/* ============================================================
   CARNET DE BORD — global.css
   Socle de design : variables, reset, typographie, utilitaires
   ============================================================ */

/* ------------------------------------------------------------
   1. IMPORTS TYPOGRAPHIQUES
   - Lora : serif éditorial pour les titres (chaud, littéraire)
   - Source Sans 3 : sans-serif clair pour le corps de texte
   ------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Source+Sans+3:wght@400;500;600&display=swap');

/* ------------------------------------------------------------
   2. VARIABLES CSS
   Toute couleur, taille ou espace utilisé dans le site
   doit référencer une variable définie ici.
   ------------------------------------------------------------ */
:root {
  /* Typographie */
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Source Sans 3', system-ui, sans-serif;

  /* Tailles de police */
  --text-xs:   0.75rem;   /* 12px — métadonnées, tags */
  --text-sm:   0.875rem;  /* 14px — navigation, légendes */
  --text-base: 1rem;      /* 16px — corps de texte */
  --text-lg:   1.125rem;  /* 18px — lead paragraphe */
  --text-xl:   1.375rem;  /* 22px — titres secondaires */
  --text-2xl:  1.75rem;   /* 28px — titres de section */
  --text-3xl:  2.25rem;   /* 36px — titre hero */

  /* Hauteurs de ligne */
  --leading-tight:  1.2;
  --leading-snug:   1.4;
  --leading-normal: 1.65;
  --leading-loose:  1.8;

  /* Palette principale — tons chauds éditoriaux */
  --color-ink:       #1C1917;   /* quasi-noir chaud — texte principal */
  --color-ink-muted: #57534E;   /* gris chaud — texte secondaire */
  --color-ink-faint: #A8A29E;   /* gris clair — métadonnées */

  --color-paper:     #FAFAF8;   /* fond général — blanc légèrement chaud */
  --color-surface:   #FFFFFF;   /* surfaces de cartes */
  --color-border:    #E7E5E4;   /* séparateurs */
  --color-border-light: rgba(28, 25, 23, 0.07);

  /* Couleur d'accent — brun doré éditorial */
  --color-accent:    #8B6F47;
  --color-accent-light: #F5EFE7; /* fond teinté pour les tags */
  --color-accent-dark:  #6B5235;

  /* Espacements */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Largeur max du contenu */
  --content-width: 860px;
  --prose-width:   680px;

  /* Header */
  --header-height: 64px;

  /* Rayons de bordure */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 12px;

  /* Ombres */
  --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 4px 12px rgba(28, 25, 23, 0.08), 0 2px 4px rgba(28, 25, 23, 0.04);
}

/* ------------------------------------------------------------
   3. RESET ET BASE
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-ink);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------
   4. TYPOGRAPHIE GLOBALE
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: var(--leading-tight);
  color: var(--color-ink);
  margin: 0;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p {
  margin: 0 0 var(--space-4);
  line-height: var(--leading-loose);
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  padding-left: var(--space-6);
  margin: 0 0 var(--space-4);
}

li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-normal);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 3px solid var(--color-accent);
  background: var(--color-accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-ink-muted);
}

blockquote p:last-child {
  margin-bottom: 0;
}

code {
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  background: var(--color-border);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------
   5. LAYOUT UTILITAIRES
   ------------------------------------------------------------ */

/* Centrage du contenu principal */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Zone de lecture resserrée (articles) */
.prose {
  max-width: var(--prose-width);
  margin: 0 auto;
}

/* Séparateur de section visible */
.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

/* Tag / étiquette de catégorie */
.tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
}

/* Lien de lecture typique */
.read-more {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-accent);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.read-more:hover {
  color: var(--color-accent-dark);
  text-decoration: none;
}

/* ------------------------------------------------------------
   6. MAIN — zone principale après le header
   ------------------------------------------------------------ */
main {
  padding-top: var(--space-8);
  padding-bottom: var(--space-16);
  min-height: calc(100dvh - var(--header-height) - 80px);
}

/* ------------------------------------------------------------
   7. RESPONSIVE — points de rupture globaux
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  :root {
    --text-3xl: 1.875rem; /* 30px sur mobile */
    --text-2xl: 1.5rem;
    --space-6:  1rem;
  }

  .container {
    padding: 0 var(--space-4);
  }
}
