/* ============================================================
   mega-annuaire.com — Design system "Velours Cosmopolite"
   ============================================================ */

/* Reset anti-distorsion — obligatoire */
img { max-width: 100%; height: auto; display: block; }

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..700;1,9..144,400..600&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* Couleurs — palette "Velours Cosmopolite" */
  --nuit: #171226;         /* bleu-nuit profond, quasi-noir */
  --grenat: #8C2F4A;       /* grenat velours (chaleur, romance) */
  --or-rose: #D9A566;      /* or rosé, chaleureux */
  --turquoise: #2E7C77;    /* turquoise sourd (voyage, ailleurs) */
  --creme: #FBF6EF;        /* fond clair chaud */
  --ivoire: #FFFDFA;
  --encre: #1D1826;

  /* Derives opacite */
  --encre-85: rgba(29, 24, 38, 0.85);
  --encre-65: rgba(29, 24, 38, 0.65);
  --encre-45: rgba(29, 24, 38, 0.45);
  --encre-20: rgba(29, 24, 38, 0.2);
  --encre-10: rgba(29, 24, 38, 0.1);
  --encre-06: rgba(29, 24, 38, 0.06);
  --ivoire-95: rgba(255, 253, 250, 0.95);
  --ivoire-75: rgba(255, 253, 250, 0.75);
  --ivoire-40: rgba(255, 253, 250, 0.4);
  --grenat-15: rgba(140, 47, 74, 0.15);
  --grenat-08: rgba(140, 47, 74, 0.08);
  --or-30: rgba(217, 165, 102, 0.35);
  --or-12: rgba(217, 165, 102, 0.14);
  --turquoise-12: rgba(46, 124, 119, 0.12);

  /* Semantique */
  --bg: var(--creme);
  --bg-alt: var(--ivoire);
  --bg-dark: var(--nuit);
  --text: var(--encre);
  --text-light: var(--encre-65);
  --primary: var(--grenat);
  --accent: var(--or-rose);
  --accent-2: var(--turquoise);

  /* Polices */
  --ff-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ff-body: 'Manrope', system-ui, -apple-system, sans-serif;
  --ff-quote: 'Fraunces', Georgia, serif;

  /* Mesures */
  --measure-article: 760px;
  --measure-wide: 1240px;
  --measure-hero: 1400px;
  --gutter: clamp(1rem, 4vw, 2.2rem);

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 280ms;
  --dur: 480ms;
  --dur-slow: 680ms;

  /* Rayons */
  --radius: 6px;
  --radius-sm: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  color: var(--grenat);
  line-height: 1.14;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 500; }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }

p { margin: 0 0 1.25em; }
a { color: var(--grenat); text-decoration: underline; text-decoration-color: var(--grenat-15); text-underline-offset: 3px; transition: text-decoration-color var(--dur-fast) var(--ease); }
a:hover { text-decoration-color: var(--grenat); }

.container { max-width: var(--measure-wide); margin: 0 auto; padding: 0 var(--gutter); }
.container--article { max-width: var(--measure-article); margin: 0 auto; padding: 0 var(--gutter); }

/* ============ Signature : constellation SVG divider ============ */
.sprig-divider {
  display: flex; align-items: center; justify-content: center;
  margin: 2.6rem 0;
  color: var(--or-rose);
}
.sprig-divider svg { width: 64px; height: 20px; }

/* Filet or sous H2 */
.article-body h2 {
  position: relative;
  padding-bottom: 0.55em;
  margin-top: 2.4em;
}
.article-body h2::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 48px; height: 2px;
  background: var(--or-rose);
  border-radius: 2px;
}

/* Kickers */
.kicker {
  font-family: var(--ff-body);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--turquoise);
}

/* Lettrine */
.article-body > p:first-of-type::first-letter {
  font-family: var(--ff-display);
  font-size: 3.7em;
  float: left;
  line-height: 0.82;
  padding: 0.06em 0.1em 0 0;
  color: var(--grenat);
}

/* Pull quotes */
.pull-quote {
  font-family: var(--ff-quote);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.42;
  border-left: 2px solid var(--or-rose);
  padding: 0.2em 0 0.2em 1.3em;
  margin: 2.2em 0;
  color: var(--encre-85);
}

/* Encadre "bon a savoir" */
.saviez-vous {
  background: var(--turquoise-12);
  border-left: 3px solid var(--turquoise);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.4rem;
  margin: 1.8rem 0;
  font-size: 0.98rem;
}
.saviez-vous strong { color: var(--grenat); }

/* Tableaux */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  font-size: 0.95rem;
}
.article-body th, .article-body td {
  padding: 0.7em 0.9em;
  border-bottom: 1px solid var(--encre-10);
  text-align: left;
}
.article-body th {
  font-family: var(--ff-body);
  font-weight: 700;
  color: var(--grenat);
  background: var(--grenat-08);
}

/* Listes */
.article-body ul, .article-body ol { padding-left: 1.4rem; }
.article-body li { margin-bottom: 0.5em; }

/* Sommaire / TOC */
.toc {
  background: var(--bg-alt); border: 1px solid var(--or-30); border-radius: var(--radius);
  padding: 1.1rem 1.5rem;
  margin-bottom: 2.2rem;
}
.toc summary { cursor: pointer; font-family: var(--ff-body); font-weight: 700; color: var(--grenat); }
.toc ul { margin: 0.9rem 0 0; padding-left: 1.3rem; }
.toc a { text-decoration: none; }

/* FAQ accordeon */
.faq { margin: 2.6rem 0; }
.faq-item {
  border-bottom: 1px solid var(--encre-10);
}
.faq-item summary,
.faq-item__question {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 0;
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--encre);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item__icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--or-12);
  color: var(--grenat);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform var(--dur-fast) var(--ease);
}
.faq-item.open .faq-item__icon,
.faq-item[open] .faq-item__icon { transform: rotate(45deg); }
.faq-item__answer {
  padding: 0 0 1.25rem;
  color: var(--text-light);
}

/* ============ Wrappers anti-distorsion — OBLIGATOIRES ============ */
.img-hero     { aspect-ratio: 16/9; overflow: hidden; position: relative; }
.img-card     { aspect-ratio: 3/2;  overflow: hidden; position: relative; }
.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;
}

/* Cards */
.card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--encre-06);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px var(--encre-10); }
.card .img-card { border-radius: 0; }
.card__body { padding: 1.25rem 1.35rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card__kicker { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--turquoise); margin-bottom: 0.45em; }
.card__title { font-family: var(--ff-display); font-size: 1.25rem; font-weight: 600; margin: 0 0 0.5em; color: var(--encre); }
.card__date { font-size: 0.82rem; color: var(--text-light); margin-top: auto; padding-top: 0.6em; }
.card a { text-decoration: none; color: inherit; }

/* Grille */
.grid { display: grid; gap: 1.7rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

/* Hero */
.hero { position: relative; color: var(--ivoire); overflow: hidden; }
.hero h1 { color: var(--ivoire); }
.hero-home { min-height: 86vh; display: flex; align-items: flex-end; }
.hero-home__img { position: absolute; inset: 0; }
.hero-home__img img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hero-home__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(23,18,38,0.25) 0%, rgba(23,18,38,0.88) 100%);
}
.hero-home__content { position: relative; z-index: 1; padding: 4rem var(--gutter) 3.6rem; max-width: var(--measure-hero); margin: 0 auto; width: 100%; }
.hero-compact { min-height: 44vh; display: flex; align-items: flex-end; }
.hero-compact .hero-home__content { padding: 3rem var(--gutter) 2.6rem; }

/* Header / Footer */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ivoire-95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--or-30);
  transition: box-shadow var(--dur) var(--ease);
}
.site-header.scrolled { box-shadow: 0 2px 18px var(--encre-10); }
.site-footer { background: var(--nuit); color: var(--ivoire-75); padding: 3.6rem 0 2rem; }
.site-footer a { color: var(--ivoire-95); text-decoration: none; }
.site-footer a:hover { color: var(--or-rose); }

/* Reveal animations — progressive enhancement */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto !important; }
}

/* Body article images + figcaption */
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 1.7rem 0 0; }
.article-body figure { margin: 1.7rem 0 1.8rem; }
.article-body figure img { margin: 0; }
.article-body figcaption {
  font-size: 0.9rem; color: var(--text-light); font-family: var(--ff-quote); font-style: italic;
  margin-top: 0.6em; padding-top: 0.5em; border-top: 1px solid var(--or-30);
}

.article-media { margin: 2.1rem 0; }
.article-media .img-body { border-radius: var(--radius); }
.article-media figcaption { margin-top: 0.6rem; margin-bottom: 0; border-top: 1px solid var(--or-30); padding-top: 0.5em; }

/* Sites externes recommandés (annuaire) */
.external-sites-section { margin: 2.6rem 0; }
.external-sites { margin: 1rem 0 0; display: flex; flex-direction: column; gap: 1rem; }
.external-site {
  display: block;
  background: var(--bg-alt);
  border: 1px solid var(--or-30);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.external-site:hover { border-color: var(--grenat); transform: translateX(4px); }
.external-site__name { font-family: var(--ff-display); font-weight: 600; font-size: 1.1rem; color: var(--grenat); display: block; margin-bottom: 0.3em; }
.external-site__desc { font-size: 0.94rem; color: var(--text-light); margin: 0; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.85em 1.7em;
  border-radius: 999px;
  font-family: var(--ff-body); font-weight: 600; font-size: 0.95rem;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.btn--primary { background: var(--or-rose); color: var(--nuit); }
.btn--primary:hover { background: var(--grenat); color: var(--ivoire); transform: translateY(-2px); }
.btn--ghost { border: 1.5px solid var(--ivoire-75); color: var(--ivoire); }
.btn--ghost:hover { background: rgba(255,255,255,0.1); }
