/*
Theme Name: Gaboriaud 2026
Theme URI: https://gaboriaud.net
Author: Romain Gaboriaud (avec Claude Code)
Author URI: https://gaboriaud.net
Description: Thème éditorial sur mesure pour gaboriaud.net. Magazine minimal, papier/encre, Anton + Inter auto-hébergées. Server-rendered, sans page builder.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gaboriaud-2026
*/

/* ============================================================
   DESIGN SYSTEM - tokens (source : maquettes V5)
   ============================================================ */
:root {
  /* Papier */
  --paper:       #f5f4f0;
  --paper-pure:  #ffffff;
  --paper-warm:  #efede8;

  /* Encres */
  --ink:         #0a0a0a;
  --ink-2:       #1f1f1f;
  --ink-3:       #5a5a5a;
  --ink-4:       #8a8a8a;

  /* Lignes */
  --line:        #d8d6d0;
  --line-2:      #c4c1b9;

  /* Familles */
  --display:     "Anton", "Impact", "Arial Narrow Bold", sans-serif;
  --sans:        "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Layout */
  --gutter:      clamp(1.5rem, 3.5vw, 3rem);
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
  --sec-pad:     clamp(4rem, 9vw, 7rem);
  --header-h:    72px;
  --hero-top:    8rem; /* écart menu -> titre, harmonisé sur toutes les pages */
}

/* ============================================================
   RESET / BASE
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* Accessibilité : lien d'évitement */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { left: 1rem; top: 1rem; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ============================================================
   HEADER - mix-blend-mode au-dessus du hero, opaque au scroll.
   La fusion est portée directement par .header (sinon le texte
   ne se mélange plus avec la page). Le sous-menu (.statut-flyout)
   est un élément FIXE hors du header, donc opaque et lisible.
   ============================================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  mix-blend-mode: difference;
  pointer-events: none;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), padding 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.header > * { pointer-events: auto; }

.header.scrolled {
  mix-blend-mode: normal;
  background: rgba(245, 244, 240, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.header.scrolled .brand { color: var(--ink); }
.header.scrolled .brand-logo { filter: none; }
.header.scrolled .nav a { color: var(--ink-2); }
.header.scrolled .nav a:hover,
.header.scrolled .nav a.active { color: var(--ink); }

/* « Statuts » = bouton déclencheur (non cliquable vers une page) */
.nav button.has-sub {
  font-family: var(--sans);
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  color: #fff; font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0.85; transition: opacity 0.25s;
}
.nav button.has-sub:hover,
.nav button.has-sub.active,
.nav button.has-sub[aria-expanded="true"] { opacity: 1; }
.header.scrolled .nav button.has-sub { color: var(--ink-2); }
.header.scrolled .nav button.has-sub:hover,
.header.scrolled .nav button.has-sub.active { color: var(--ink); }

/* Item avec sous-menu + chevron */
.nav a.has-sub,
.nav button.has-sub { display: inline-flex; align-items: center; gap: 0.4rem; }
.nav-caret { font-size: 0.62rem; opacity: 0.65; transition: transform 0.2s var(--ease); }
.nav .has-sub[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

/* Parent « Statuts » dans le menu mobile : libellé non cliquable */
.mobile-parent { cursor: default; }

/* Panneau déroulant Statuts : élément fixe hors header (positionné par JS) */
.statut-flyout {
  position: fixed;
  top: 64px;
  left: 0;
  min-width: 240px;
  background: var(--paper-pure);
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 44px -22px rgba(10, 10, 10, 0.35);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  pointer-events: none;
  z-index: 101; /* au-dessus du header (100) : sinon le fond opaque du header au scroll recouvre le haut du panneau */
}
.statut-flyout.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.statut-flyout a {
  display: block;
  padding: 0.85rem 1.1rem;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
}
.statut-flyout a:last-child { border-bottom: none; }
.statut-flyout a:hover,
.statut-flyout a:focus-visible {
  background: var(--paper-warm);
  color: var(--ink);
  padding-left: 1.35rem;
}

/* ============================================================
   MENU BURGER (mobile)
   ============================================================ */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.burger span { display: block; width: 26px; height: 2px; background: #fff; transition: background 0.3s var(--ease); }
.header.scrolled .burger span { background: var(--ink); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem var(--gutter) 3rem;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-1.5%);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}
body.menu-open { overflow: hidden; }
body.menu-open .mobile-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-close {
  position: absolute;
  top: 1.5rem;
  right: var(--gutter);
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  font-family: var(--display);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.mobile-nav { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-nav > li > a {
  font-family: var(--display);
  font-size: clamp(2.2rem, 11vw, 3.5rem);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.35rem 0;
}
.mobile-nav .m-num { font-family: var(--sans); font-size: 0.8rem; font-weight: 500; color: var(--ink-4); letter-spacing: 0.04em; }
.mobile-sub { list-style: none; margin: 0.25rem 0 0.85rem 2.4rem; display: flex; flex-direction: column; gap: 0.1rem; }
.mobile-sub a {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: none;
  padding: 0.3rem 0;
  display: block;
}
.mobile-sub a:hover { color: var(--ink); }

@media (max-width: 720px) { .burger { display: flex; } }
@media (min-width: 721px) { .mobile-menu { display: none; } }

.brand {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.brand-logo {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
  filter: invert(1);
}

.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.25s;
  opacity: 0.85;
}
.nav a:hover, .nav a.active { opacity: 1; }
.nav-num {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  margin-right: 0.5rem;
  opacity: 0.5;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   PRIMITIVES partagées
   ============================================================ */
.marker {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.marker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--ink);
  flex-shrink: 0;
}
.marker .sep { color: var(--ink-4); margin: 0 0.4rem; }

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 7.5vw, 7.5rem);
  line-height: 0.88;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-transform: uppercase;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 3rem var(--gutter) 2rem;
  border-top: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-3);
}
.footer .f-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer .f-links a {
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.2s;
}
.footer .f-links a:hover { color: var(--ink); }
.footer .f-copy { font-size: 0.72rem; letter-spacing: 0.04em; }

/* ============================================================
   SCROLL PAR PALIERS (sections) — pages avec la classe html.snap
   « proximity » : doux, ne piège pas les sections plus hautes que
   l'écran. (La page Contact surcharge en « mandatory » via contact.css.)
   ============================================================ */
html.snap {
  scroll-snap-type: y proximity;
  scroll-padding-top: 5rem;
}
html.snap .hero,
html.snap .section,
html.snap .fonctions-section,
html.snap .timeline-section,
html.snap .legal,
html.snap .footer {
  scroll-snap-align: start;
}
@media (prefers-reduced-motion: reduce) {
  html.snap { scroll-snap-type: none; }
}

/* ============================================================
   RESPONSIVE (global)
   ============================================================ */
@media (max-width: 720px) {
  .nav { display: none; }
  .footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
