/* ============================================================
   gregoirelorieux.net — format.css  v2
   Direction : Wildproject — interface effacée, typographie forte
   Polices : Cormorant Garamond (display italic) + DM Sans (corps/nav)
   ============================================================ */

/* === POLICES AUTO-HÉBERGÉES ===
   Cormorant Garamond : italic 300/400/500 + normal 400
   DM Sans            : normal 300/400/500
   Source : /site/fonts/webfonts/
   ============================================================ */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('fonts/webfonts/cormorant-garamond-latin-300-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/webfonts/cormorant-garamond-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/webfonts/cormorant-garamond-latin-500-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/webfonts/cormorant-garamond-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('fonts/webfonts/dm-sans-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/webfonts/dm-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/webfonts/dm-sans-latin-500-normal.woff2') format('woff2');
}

/* === VARIABLES === */
:root {
  --bg:         #FAFAF8;
  --text:       #111110;
  --text-muted: #76766E;
  --border:     #E2E2DC;
  --link-under: #C8C8C0;
  /* Le vert n'apparaît plus dans l'interface —
     la couleur vient de la photo et des projets */
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.8;
  margin: 0;
  padding: 0;
}

/* === TYPOGRAPHIE ===
   h1/h2 : Cormorant Garamond italic — grand, expressif, éditorial
   h3     : DM Sans majuscules espacées — sobre, structurant
   ------------------------------------------------------------ */
h1, h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--text);
  line-height: 1.1;
  margin-top: 1.2em;
  margin-bottom: 0.4em;
}

h3, h4, h5, h6 {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-style: normal;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2em;
  margin-bottom: 0.6em;
}

h1 { font-size: clamp(2rem,   5vw,   4rem);   }
h2 { font-size: clamp(1.5rem, 3.8vw, 3rem);   }
h3 { font-size: clamp(0.88rem, 1.3vw, 1rem);   } /* année / section : lisible sans dominer */
h6 { font-size: clamp(0.68rem, 1vw,   0.8rem);  color: var(--text-muted); }

figcaption {
  color: var(--text-muted);
  font-size: clamp(0.68rem, 1vw, 0.8rem);
  font-style: italic;
  text-align: center;
  margin-top: 0.5em;
}

img {
  max-width: 100%;
  height: auto;
  /* Inline par défaut — les icônes (computer.png etc.)
     restent dans le flux du texte */
}

figure img {
  display: block;
}

/* Icône computer.png — petite, alignée sur la ligne de texte */
img[src*="computer.png"] {
  display: inline;
  vertical-align: middle;
  height: 0.9em;
  width: auto;
  margin-right: 0.25em;
  margin-bottom: 0.1em;
}

/* === LIENS ===
   Soulignement discret au repos, visible au survol.
   Pas de couleur — le lien s'intègre au texte.
   ------------------------------------------------------------ */
a:link, a:visited {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--link-under);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover, a:active {
  color: var(--text);
  text-decoration-color: var(--text);
}

/* === BLOCS DE TEXTE ===
   #niceparagraph : réservé au texte d'accroche — Cormorant italic grand
   #paragraph     : corps courant en DM Sans léger
   ------------------------------------------------------------ */

#element {
  font-family: 'DM Sans', system-ui, sans-serif;
  padding: 30px;
  max-width: 880px;
  margin: 0 auto;
}

#niceparagraph {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--text);
  font-size: clamp(1rem, 1.5vw, 1.2rem);  /* corps lisible ~17-19px */
  width: 72%;
  max-width: 700px;
  margin: 0 auto 1.6em;
  padding: 0;
  border: none;
  text-align: left;
  line-height: 1.75;
}

#paragraph {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 300;
  color: var(--text);
  font-size: clamp(0.92rem, 1.35vw, 1.05rem);
  width: 78%;
  max-width: 700px;
  margin: 0 auto 1.5em;
  padding: 0;
  border: none;
  text-align: left;
  line-height: 1.85;
}

#paragraphsm {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 300;
  color: var(--text);
  font-size: clamp(0.82rem, 1.15vw, 0.95rem);
  width: 78%;
  max-width: 700px;
  margin: 0 auto 1.3em;
  padding: 0;
  border: none;
  text-align: left;
}

#narrowparagraph {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 300;
  color: var(--text);
  font-size: clamp(0.88rem, 1.3vw, 1rem);
  width: 42%;
  max-width: 500px;
  margin: 0 auto 1.5em;
  padding: 0;
  border: none;
  text-align: left;
}

#narrowparagraphc {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 300;
  color: var(--text);
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  width: 42%;
  max-width: 500px;
  margin: 0 auto 1.3em;
  padding: 0;
  border: none;
  text-align: left;
}

/* === NAVIGATION ===
   DM Sans, petites capitales espacées, couleur texte.
   Soulignement vert pour l'item actif — seul point de couleur.
   ------------------------------------------------------------ */
#primary_nav_wrap {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

#primary_nav_wrap ul {
  list-style: none;
  position: relative;
  float: right;
  margin: 0;
  padding: 0;
}

#primary_nav_wrap ul a {
  color: var(--text);
  text-decoration: none;
  line-height: 3vw;
  padding: 0 14px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(0.65rem, 0.95vw, 0.78rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
  transition: opacity 0.15s ease;
}

#primary_nav_wrap ul a:hover {
  opacity: 0.5;
  text-decoration: none;
}

#primary_nav_wrap ul li {
  display: inline-block;
  position: relative;
  float: left;
  margin: 0;
  padding: 0;
}

/* Item actif : trait vert au lieu du fond vert */
#primary_nav_wrap ul li.current-menu-item > a {
  border-bottom: 2px solid #2D5A27;
  opacity: 1;
}

#primary_nav_wrap ul li:hover { background: transparent; }

/* Sous-menus */
#primary_nav_wrap ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 0;
  min-width: 200px;
  z-index: 100;
}

#primary_nav_wrap ul ul li {
  float: none;
  width: auto;
  border-bottom: 1px solid var(--border);
}

#primary_nav_wrap ul ul li:last-child { border-bottom: none; }

#primary_nav_wrap ul ul a {
  line-height: 1.4;
  padding: 10px 16px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 300;
  font-size: clamp(0.78rem, 1.1vw, 0.88rem);
}

#primary_nav_wrap ul ul ul { top: 0; right: 100%; }
#primary_nav_wrap ul li:hover > ul { display: block; }


/* ============================================================
   RESPONSIVE — MOBILE & TABLETTE
   Breakpoint : 768px
   ============================================================ */

/* === PHOTO HOME === */
#photo-home {
  width: 78%;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

#photo-home figure {
  margin: 0;
  padding: 0;
}

#photo-home img {
  display: block;
  width: 100%;
  height: auto;
}

/* === BOUTON HAMBURGER (caché sur desktop) === */
#nav-toggle {
  display: none;
}

@media (max-width: 768px) {

  /* --- Corps --- */
  body { font-size: 18px; }

  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  h2 { font-size: clamp(1.5rem, 6vw, 2.4rem); }
  h3 { font-size: clamp(0.88rem, 3vw, 1rem); }

  /* --- Blocs de texte --- */
  #niceparagraph,
  #paragraph,
  #paragraphsm,
  #narrowparagraph,
  #narrowparagraphc,
  #element,
  .element {
    width: 92% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #page {
    padding: 0 4%;
  }

  /* --- Photo home : pleine largeur --- */
  #photo-home {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  /* --- Navigation mobile --- */
  #primary_nav_wrap {
    position: relative;
  }

  /* Bouton hamburger */
  #nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    position: absolute;
    top: 6px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 200;
  }

  #nav-toggle span,
  #nav-toggle span::before,
  #nav-toggle span::after {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  #nav-toggle span { position: relative; }
  #nav-toggle span::before,
  #nav-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
  }
  #nav-toggle span::before { top: -6px; }
  #nav-toggle span::after  { top:  6px; }

  /* Nav fermée par défaut */
  #primary_nav_wrap ul {
    display: none;
    float: none;
    width: 100%;
    background: var(--bg);
    border-top: none;
  }

  /* Nav ouverte via classe .nav-open (ajoutée par nav.js) */
  #primary_nav_wrap.nav-open ul {
    display: block;
  }

  #primary_nav_wrap ul li {
    display: block;
    float: none;
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  #primary_nav_wrap ul a {
    line-height: 1;
    padding: 14px 16px;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    display: block;
  }

  /* Sous-menus : affichés inline en retrait */
  #primary_nav_wrap ul ul {
    display: block;
    position: static;
    border: none;
    border-top: 1px solid var(--border);
    padding: 0;
    min-width: auto;
    width: 100%;
    background: color-mix(in srgb, var(--bg) 96%, #000 4%);
  }

  #primary_nav_wrap ul ul li {
    border-bottom: 1px solid var(--border);
  }

  #primary_nav_wrap ul ul a {
    padding: 12px 28px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: none;
    font-weight: 300;
  }

  /* Images générales */
  figure img { max-width: 100% !important; }

  /* Audio player */
  audio { width: 100%; }
}

@media (max-width: 480px) {
  body { font-size: 17px; }
  h1 { font-size: clamp(1.8rem, 9vw, 2.6rem); }
  h2 { font-size: clamp(1.4rem, 7vw, 2.1rem); }
  #page { padding: 0 3%; }

  #niceparagraph {
    font-size: 1.05rem !important;
    line-height: 1.7 !important;
  }
}
