/* ============================================================
   geekchic.fr — « Vitrine nocturne »
   Mood board valide par Antoine le 2026-10-12
   Concept : l'objet tech eclaire comme une piece de joaillerie
             dans une vitrine la nuit.
   ============================================================ */

/* ---------- RESET ANTI-DISTORSION (regle reseau obligatoire) ---------- */
/* `height: auto` est indispensable : Astro genere des attributs HTML
   width/height sur les <img>, et sans ce reset le navigateur conserve
   la hauteur native malgre max-width:100% -> etirement vertical. */
img { max-width: 100%; height: auto; display: block; }

*, *::before, *::after { box-sizing: border-box; }

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* 6 couleurs du mood board */
  --night:      #121016;  /* fond — encre violacee, pas un near-black neutre */
  --night-alt:  #1C1922;  /* fond alternatif : sections, cards, corps d'article */
  --snow:       #EDE9F2;  /* texte — blanc legerement lilas */
  --lilac:      #C8B4FF;  /* accent primaire — le « chic » */
  --aqua:       #5CE1C4;  /* accent secondaire — liens, etats actifs */
  --amber:      #E8A23D;  /* nuance chaude — RESERVEE aux contenus heritage 2008 */

  /* filet de separation */
  --rule:       #2A2633;

  /* derives d'opacite */
  --snow-95:    rgba(237, 233, 242, 0.95);
  --snow-75:    rgba(237, 233, 242, 0.75);
  --snow-55:    rgba(237, 233, 242, 0.55);
  --snow-40:    rgba(237, 233, 242, 0.40);
  --night-80:   rgba(18, 16, 22, 0.80);
  --night-65:   rgba(18, 16, 22, 0.65);
  --night-40:   rgba(18, 16, 22, 0.40);
  --lilac-20:   rgba(200, 180, 255, 0.20);
  --lilac-10:   rgba(200, 180, 255, 0.10);
  --aqua-20:    rgba(92, 225, 196, 0.20);
  --amber-15:   rgba(232, 162, 61, 0.15);

  /* 3 familles — collision verifiee a 0 usage sur les 300+ sites du reseau */
  --ff-display: 'Syne', 'Trebuchet MS', sans-serif;        /* titres */
  --ff-body:    'Chivo', system-ui, -apple-system, sans-serif; /* corps + meta */
  --ff-accent:  'Zilla Slab', Georgia, serif;              /* chiffres, chapos, citations */

  /* mesures — --measure-article >= 820px OBLIGATOIRE (regle reseau) */
  --measure-article: 860px;
  --measure-wide:    1280px;
  --measure-hero:    1440px;
  --gutter:          clamp(1rem, 4vw, 2rem);

  /* transitions */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast:  300ms;
  --dur:       500ms;
  --dur-slow:  700ms;
}

/* ---------- BASE ---------- */
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--snow);
  font-family: var(--ff-body);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem); margin-top: 2.2em; }
h3 { font-size: clamp(1.2rem, 1.08rem + 0.6vw, 1.4rem); margin-top: 1.8em; }

p { margin: 0 0 1.35em; }

a {
  color: var(--aqua);
  text-decoration-color: var(--aqua-20);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease),
              text-decoration-color var(--dur-fast) var(--ease);
}
a:hover { color: var(--lilac); text-decoration-color: var(--lilac); }

:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 3px;
  border-radius: 2px;
}

strong { font-weight: 700; color: var(--snow); }
em { font-style: italic; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

::selection { background: var(--lilac-20); color: var(--snow); }

/* ---------- LAYOUT ---------- */
.container { width: 100%; max-width: var(--measure-wide); margin-inline: auto; padding-inline: var(--gutter); }
.container--article { max-width: var(--measure-article); }
.container--hero    { max-width: var(--measure-hero); }

.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section--alt { background: var(--night-alt); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--lilac); color: var(--night);
  padding: 0.7em 1.2em; font-weight: 700; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- WRAPPERS ANTI-DISTORSION (regle reseau obligatoire) ----------
   JAMAIS d'object-fit sur un <img> isole : sans conteneur a hauteur
   resolue, le navigateur ignore height:100% et la regle est
   silencieusement sans effet. Toujours <div class="img-x"><img></div>. */
.img-hero     { aspect-ratio: 16/9; overflow: hidden; }
.img-card     { aspect-ratio: 3/2;  overflow: hidden; }
.img-body     { aspect-ratio: 3/2;  overflow: hidden; }
.img-portrait { aspect-ratio: 1/1;  overflow: hidden; border-radius: 50%; }

.img-hero img,
.img-card img,
.img-body img,
.img-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* ---------- HERO + LA SIGNATURE UNIQUE : LE FILET LUMINEUX ----------
   L'audace du site, et la seule. Un seul par page. */
.hero { position: relative; background: var(--night-alt); overflow: hidden; }
.hero__media { position: relative; }
.hero__media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--night) 2%, var(--night-65) 38%, transparent 78%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  max-width: var(--measure-wide);
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 4rem) var(--gutter) clamp(2.5rem, 5vw, 4rem);
}
.hero--overlay .hero__inner { margin-top: -14vw; }

.hero__title { margin-bottom: 0.5em; }

/* le neon de vitrine */
.hero__rule {
  width: clamp(120px, 22vw, 240px);
  height: 2px;
  border: 0;
  margin: 0 0 1.4rem;
  background: linear-gradient(90deg, var(--lilac), var(--aqua));
  box-shadow: 0 0 12px var(--lilac-20), 0 0 28px var(--aqua-20);
}

.hero__standfirst {
  font-family: var(--ff-accent);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--snow-75);
  max-width: 62ch;
  margin: 0;
}

/* ---------- HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--night-80);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  max-width: var(--measure-wide); margin-inline: auto;
  padding: 0.85rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.site-logo {
  font-family: var(--ff-display);
  font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em;
  color: var(--snow); text-decoration: none; white-space: nowrap;
}
.site-logo:hover { color: var(--lilac); }
.site-logo b { color: var(--lilac); font-weight: 800; }

.site-nav ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  color: var(--snow-75); text-decoration: none;
  font-size: 0.95rem; font-weight: 500;
  padding-block: 0.3em;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--snow); border-bottom-color: var(--lilac); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule);
  color: var(--snow); font: inherit; padding: 0.45em 0.7em; cursor: pointer; border-radius: 3px;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; inset-inline: 0; top: 100%;
    background: var(--night); border-bottom: 1px solid var(--rule);
    display: none; padding: 0.5rem var(--gutter) 1.2rem;
  }
  .site-nav[data-open="true"] { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li + li { border-top: 1px solid var(--rule); }
  .site-nav a { display: block; padding: 0.85em 0; border-bottom: 0; }
}

/* ---------- CARDS — pas d'ombre portee, un filet. Registre magazine. ---------- */
.card-grid {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  list-style: none; margin: 0; padding: 0;
}

.card { display: flex; flex-direction: column; border-top: 1px solid var(--rule); padding-top: 1rem; }
.card__media { margin-bottom: 0.9rem; }
.card__meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem 0.9rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}
.card__cat {
  font-family: var(--ff-accent);
  color: var(--lilac); font-weight: 600;
  text-decoration: none;
}
.card__cat:hover { color: var(--aqua); }
/* Date visible sur chaque card — regle reseau absolue */
.card__date { font-family: var(--ff-accent); color: var(--snow-40); }

.card__title { font-size: 1.15rem; line-height: 1.25; margin: 0 0 0.45em; }
.card__title a { color: var(--snow); text-decoration: none; }
.card__title a:hover { color: var(--lilac); }
.card__summary { font-size: 0.95rem; color: var(--snow-55); margin: 0; }
.card--heritage .card__cat { color: var(--amber); }

/* ---------- ARTICLE ---------- */
.article-head { padding-block: clamp(2rem, 4vw, 3rem) 0; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1rem;
  font-size: 0.85rem; color: var(--snow-40);
  font-family: var(--ff-accent);
  margin-bottom: 1.2rem;
}
.article-meta a { color: var(--lilac); text-decoration: none; }

/* chapo */
.article-summary {
  font-family: var(--ff-accent);
  font-style: italic;
  font-size: clamp(1.08rem, 1rem + 0.4vw, 1.22rem);
  line-height: 1.65;
  color: var(--snow-75);
  margin: 0 0 2.5rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--lilac);
}

.article-body { background: var(--night-alt); }
.article-body > * { max-width: var(--measure-article); margin-inline: auto; }

.article-body h2 { position: relative; padding-top: 0.4em; }
.article-body h2::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 2.2rem; height: 2px; background: var(--lilac-20);
}

/* lettrine — categorie Culture UNIQUEMENT */
.article-body--culture > p:first-of-type::first-letter {
  font-family: var(--ff-display);
  float: left;
  font-size: 3.4em;
  line-height: 0.82;
  font-weight: 800;
  margin: 0.08em 0.1em 0 0;
  color: var(--lilac);
}

/* pull quote */
.pull-quote {
  font-family: var(--ff-accent);
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem);
  line-height: 1.5;
  color: var(--snow);
  margin: 2.5rem auto;
  padding-left: 1.3rem;
  border-left: 3px solid var(--aqua);
}
.pull-quote cite { display: block; font-size: 0.8em; font-style: normal; color: var(--snow-40); margin-top: 0.6em; }

/* ---------- FIGURES ET LEGENDES ----------
   figcaption explicitement stylise : sans cela les legendes sont
   invisibles (dette constatee sur plusieurs sites du reseau). */
figure { margin: 2.5rem auto; }
figcaption {
  font-family: var(--ff-accent);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--snow-40);
  margin-top: 0.7rem;
  padding-left: 0.8rem;
  border-left: 2px solid var(--rule);
}

/* ---------- TABLEAUX ----------
   Plusieurs sites du reseau n'avaient AUCUN style de tableau :
   les tableaux Markdown y etaient illisibles. Prevu ici d'emblee. */
.article-body table,
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem auto;
  font-size: 0.93rem;
}
th, td { padding: 0.7em 0.9em; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th {
  font-family: var(--ff-accent);
  font-weight: 700;
  color: var(--lilac);
  border-bottom: 2px solid var(--lilac-20);
  background: var(--lilac-10);
}
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.table-scroll { overflow-x: auto; margin: 2rem auto; }

/* ---------- LISTES ----------
   Idem : puce par defaut du navigateur insuffisante, stylisee ici. */
.article-body ul,
.article-body ol { padding-left: 1.3rem; margin: 0 auto 1.5em; }
.article-body ul { list-style: none; padding-left: 0; }
.article-body ul li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.6em;
}
.article-body ul li::before {
  content: '';
  position: absolute; left: 0; top: 0.62em;
  width: 6px; height: 6px;
  background: var(--aqua);
  transform: rotate(45deg);
}
.article-body ol { list-style: decimal; }
.article-body ol li { margin-bottom: 0.6em; padding-left: 0.3rem; }
.article-body ol li::marker { font-family: var(--ff-accent); color: var(--lilac); font-weight: 700; }

blockquote {
  margin: 2rem auto;
  padding-left: 1.2rem;
  border-left: 3px solid var(--lilac);
  color: var(--snow-75);
  font-style: italic;
}

code {
  font-family: ui-monospace, 'Cascadia Code', Menlo, monospace;
  font-size: 0.9em;
  background: var(--lilac-10);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--lilac);
}
pre { overflow-x: auto; padding: 1.1rem; border: 1px solid var(--rule); border-radius: 4px; }
pre code { background: none; padding: 0; color: inherit; }

/* ---------- SOMMAIRE (classe exigee par le hook check_sommaire) ---------- */
.article-sommaire {
  background: var(--night);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.2rem 1.4rem;
  margin: 0 auto 2.5rem;
  font-size: 0.93rem;
}
.article-sommaire > p {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 0.7em;
  color: var(--snow);
}
.article-sommaire ul { list-style: none; margin: 0; padding: 0; }
.article-sommaire li { margin-bottom: 0.45em; padding-left: 0.9rem; position: relative; }
.article-sommaire li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 5px; height: 1px; background: var(--lilac); }
.article-sommaire a { color: var(--snow-75); text-decoration: none; }
.article-sommaire a:hover { color: var(--aqua); }

/* Le sommaire est volontairement EN LIGNE dans le flux de l'article, pas en
   colonne laterale : la mise en page du site est a une seule colonne. Pas de
   position:sticky ici — sans grille a deux colonnes, sticky n'aurait aucun
   effet visuel et simulerait une fonctionnalite inexistante. */
/* .toc accompagne .article-sommaire sur le meme element : les deux noms sont
   attendus par des controles distincts du reseau. */
.toc { display: block; }

.article-sommaire .toc-title {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 0.7em;
  color: var(--snow);
}
.article-sommaire ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.article-sommaire ol li {
  counter-increment: toc;
  margin-bottom: 0.45em;
  padding-left: 1.6rem;
  position: relative;
}
.article-sommaire ol li::before {
  content: counter(toc);
  position: absolute;
  left: 0;
  font-family: var(--ff-accent);
  font-size: 0.85em;
  color: var(--lilac);
}

/* ---------- FAQ accordeon (toggle +, sans icone externe) ---------- */
.faq { border-top: 1px solid var(--rule); }
.faq__item { border-bottom: 1px solid var(--rule); }
.faq__q {
  width: 100%;
  background: none; border: 0;
  color: var(--snow);
  font-family: var(--ff-display);
  font-size: 1.02rem; font-weight: 600; text-align: left;
  padding: 1.15em 2.4em 1.15em 0;
  cursor: pointer; position: relative;
}
.faq__q::after {
  content: '+';
  position: absolute; right: 0.2em; top: 50%; transform: translateY(-50%);
  font-family: var(--ff-accent);
  font-size: 1.4em; color: var(--lilac);
  transition: transform var(--dur-fast) var(--ease);
}
.faq__q[aria-expanded="true"]::after { transform: translateY(-50%) rotate(45deg); }
.faq__a { display: none; padding-bottom: 1.3em; color: var(--snow-75); }
.faq__a > :last-child { margin-bottom: 0; }
.faq__item[data-open="true"] .faq__a { display: block; }

/* ---------- HERITAGE — l'ambre, uniquement ici ---------- */
.heritage-note {
  background: var(--amber-15);
  border-left: 3px solid var(--amber);
  padding: 1rem 1.2rem;
  margin: 2.5rem auto;
  font-size: 0.92rem;
  color: var(--snow-75);
}
.heritage-note strong { color: var(--amber); }

/* ---------- FILTRE PAR CATEGORIE (blog) ---------- */
.cat-filter { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 2.5rem; padding: 0; list-style: none; }
.cat-filter button {
  background: none;
  border: 1px solid var(--rule);
  color: var(--snow-75);
  font: inherit; font-size: 0.88rem;
  padding: 0.45em 1em;
  border-radius: 100px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.cat-filter button:hover { color: var(--snow); border-color: var(--snow-40); }
.cat-filter button[aria-pressed="true"] { color: var(--night); background: var(--lilac); border-color: var(--lilac); font-weight: 600; }

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--night-alt);
  padding-block: clamp(2.5rem, 5vw, 4rem) 2rem;
  margin-top: clamp(3rem, 7vw, 6rem);
  font-size: 0.9rem;
}
.site-footer__grid {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin-bottom: 2.5rem;
}
.site-footer h2 {
  font-size: 0.82rem; font-family: var(--ff-accent);
  font-weight: 700; color: var(--snow);
  margin: 0 0 0.9em;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.5em; }
.site-footer a { color: var(--snow-55); text-decoration: none; }
.site-footer a:hover { color: var(--lilac); }
.site-footer__base { border-top: 1px solid var(--rule); padding-top: 1.5rem; color: var(--snow-40); font-size: 0.85rem; }

/* ---------- FORMULAIRE DE CONTACT ---------- */
.form-row { margin-bottom: 1.3rem; }
.form-row label { display: block; margin-bottom: 0.4em; font-weight: 600; font-size: 0.92rem; }
.form-row input,
.form-row textarea {
  width: 100%;
  background: var(--night);
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--snow);
  font: inherit;
  padding: 0.7em 0.9em;
}
.form-row input:focus,
.form-row textarea:focus { border-color: var(--lilac); outline: none; }
.form-row textarea { min-height: 170px; resize: vertical; }

.btn {
  display: inline-block;
  background: var(--lilac);
  color: var(--night);
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 0.95rem;
  border: 0; border-radius: 3px;
  padding: 0.75em 1.6em;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--aqua); color: var(--night); }
.btn--ghost { background: none; border: 1px solid var(--lilac); color: var(--lilac); }
.btn--ghost:hover { background: var(--lilac); color: var(--night); }

.form-status { margin-top: 1rem; font-size: 0.92rem; }
.form-status[data-state="ok"]    { color: var(--aqua); }
.form-status[data-state="error"] { color: #FF8A8A; }

/* ---------- MOTION : une seule sequence orchestree, au hero ---------- */
@keyframes gc-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.hero__title,
.hero__rule,
.hero__standfirst {
  animation: gc-rise var(--dur-slow) var(--ease) backwards;
}
.hero__title      { animation-delay: 60ms; }
.hero__rule       { animation-delay: 220ms; }
.hero__standfirst { animation-delay: 340ms; }

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

/* ---------- UTILITAIRES ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.lede { font-size: 1.1rem; color: var(--snow-75); }
.text-center { text-align: center; }
