/* Compte à rebours Noël — feuille de style unique, sans police externe. */
:root {
  --bg: #f7f1e6;
  --bg-dots: rgba(18, 53, 43, .07);
  --paper: #fffaf1;
  --ink: #17332b;
  --muted: #5a6b63;
  --red: #b0263a;
  --red-ink: #ffffff;
  --green: #1f5a46;
  --gold: #b8862a;
  --line: rgba(23, 51, 43, .18);
  --door: #1f5a46;
  --door-ink: #fffaf1;
  --snow: rgba(255, 255, 255, .9);
  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 24px -14px rgba(23, 51, 43, .55);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1a1d;
    --bg-dots: rgba(255, 236, 200, .05);
    --paper: #132629;
    --ink: #f3eadb;
    --muted: #a9b5ae;
    --red: #e0566a;
    --red-ink: #1a0b0e;
    --green: #7cc3a3;
    --gold: #e2b75c;
    --line: rgba(243, 234, 219, .16);
    --door: #8f1f30;
    --door-ink: #fff3e2;
    --snow: rgba(255, 255, 255, .75);
    --shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 12px 28px -16px rgba(0, 0, 0, .9);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dots) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  min-height: 100vh;
}
a { color: var(--red); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; font-weight: 700; }
h2 { font-size: clamp(1.45rem, 4.5vw, 1.9rem); margin: 0 0 .75rem; }
h3 { font-size: 1.15rem; margin: 0 0 .35rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 10; }

.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 16px; }

/* En-tête : guirlande de fanions */
.top { position: relative; padding-top: 18px; }
.top::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 14px;
  background:
    linear-gradient(135deg, var(--red) 25%, transparent 25%) 0 0 / 28px 14px repeat-x,
    linear-gradient(225deg, var(--red) 25%, transparent 25%) 0 0 / 28px 14px repeat-x,
    linear-gradient(135deg, var(--green) 25%, transparent 25%) 14px 0 / 28px 14px repeat-x,
    linear-gradient(225deg, var(--green) 25%, transparent 25%) 14px 0 / 28px 14px repeat-x;
  opacity: .9;
}
.nav { display: flex; flex-wrap: wrap; gap: .35rem .5rem; align-items: center; justify-content: space-between; padding: .6rem 0; }
.brand { font-family: var(--serif); font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.brand span { color: var(--red); }
.nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; }
.nav li a {
  display: inline-block; padding: .3rem .7rem; border-radius: 999px; font-size: .92rem;
  color: var(--ink); text-decoration: none; border: 1px solid var(--line);
}
.nav li a[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Héros */
.hero { text-align: center; padding: 1.75rem 0 1rem; }
.eyebrow {
  display: inline-block; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin: 0 0 .5rem;
}
.hero h1 { font-size: clamp(2rem, 8.5vw, 3.4rem); margin: 0 0 .9rem; letter-spacing: -.01em; }
.hero h1 em { font-style: italic; color: var(--red); }
.answer { font-family: var(--serif); font-size: clamp(1.3rem, 5vw, 1.75rem); margin: 0 0 .3rem; min-height: 2.6em; display: flex; align-items: center; justify-content: center; }
.answer strong { color: var(--red); white-space: nowrap; }
.when { color: var(--muted); margin: 0 0 1.4rem; min-height: 1.6em; }

/* Portes de calendrier de l'Avent */
.doors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.4rem, 2vw, .9rem); margin: 0 auto; max-width: 36rem; }
.door {
  position: relative; background: var(--door); color: var(--door-ink);
  border-radius: 10px; padding: clamp(.7rem, 3vw, 1.1rem) .25rem .6rem;
  box-shadow: var(--shadow); text-align: center; min-height: 6.4rem;
}
.door::before { /* perforations de la porte */
  content: ""; position: absolute; inset: 5px; border: 1.5px dashed rgba(255,255,255,.35); border-radius: 7px; pointer-events: none;
}
.door::after { /* petit bouton de porte */
  content: ""; position: absolute; right: 10px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--gold);
}
.door:nth-child(even) { background: var(--red); color: var(--red-ink); }
.door:nth-child(even)::before { border-color: rgba(255,255,255,.4); }
@media (prefers-color-scheme: dark) { .door:nth-child(even) { background: #1d5a47; color: #f3eadb; } }
.num {
  display: block; font: 700 clamp(2rem, 10vw, 3.6rem)/1 var(--sans);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.unit { display: block; font-size: clamp(.7rem, 2.6vw, .85rem); text-transform: uppercase; letter-spacing: .1em; margin-top: .4rem; opacity: .9; }
.no-js-note { color: var(--muted); font-size: .95rem; }
.js .no-js-note { display: none; }
.today-msg { display: none; font-family: var(--serif); font-size: 1.25rem; }
.is-today .today-msg { display: block; }
.is-today .doors { opacity: .45; }

.actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin: 1.4rem 0 .4rem; }
.btn {
  font: 600 1rem var(--sans); cursor: pointer; border-radius: 999px; padding: .65rem 1.2rem;
  border: 2px solid var(--ink); background: var(--ink); color: var(--bg); min-height: 44px;
}
.btn.ghost { background: transparent; color: var(--ink); }
.btn[hidden] { display: none; }
.status { min-height: 1.5em; margin: 0; color: var(--green); font-size: .95rem; text-align: center; }

/* Cartes */
section { margin: 2.2rem 0; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; box-shadow: 0 12px 30px -24px rgba(0,0,0,.5); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .8rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; position: relative; overflow: hidden; }
.stat b { display: block; font: 700 2.2rem/1.1 var(--sans); font-variant-numeric: tabular-nums; color: var(--red); min-height: 1.1em; }
.stat span { display: block; font-weight: 600; }
.stat small { display: block; color: var(--muted); font-size: .88rem; margin-top: .2rem; }

/* Check-list J-30, J-15... */
.steps { list-style: none; margin: 0; padding: 0; border-left: 2px dashed var(--line); }
.steps li { position: relative; padding: .2rem 0 1.1rem 1.3rem; }
.steps li::before {
  content: ""; position: absolute; left: -8px; top: .45rem; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--green);
}
.steps .tag { display: inline-block; font: 700 .85rem var(--sans); background: var(--green); color: var(--bg); border-radius: 6px; padding: .05rem .45rem; margin-right: .35rem; }
.steps p { margin: .25rem 0 0; color: var(--muted); }
.steps li.is-past { opacity: .55; }
.steps li.is-next::before { background: var(--red); border-color: var(--red); }
.steps li.is-next .tag { background: var(--red); color: var(--red-ink); }
.steps li.is-next h3::after { content: " — prochaine étape"; font: 600 .8rem var(--sans); color: var(--red); }

/* Idées cadeaux */
.gifts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .8rem; margin: 0; padding: 0; list-style: none; }
.gifts a { display: block; height: 100%; padding: 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; }
.gifts a:hover { border-color: var(--red); }
.gifts strong { display: block; color: var(--red); }
.gifts small { color: var(--muted); }
.disclosure { font-size: .85rem; color: var(--muted); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: .8rem 0; }
.faq summary { cursor: pointer; font-weight: 650; list-style-position: outside; }
.faq details p { margin: .5rem 0 0; color: var(--muted); }

/* Emplacements publicitaires : hauteur réservée => pas de décalage de mise en page */
.ad-slot {
  min-height: 280px; margin: 2rem 0; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); border-radius: 10px; position: relative; overflow: hidden;
}
.ad-slot::before { content: "Publicité"; position: absolute; top: 4px; left: 8px; font-size: .7rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
@media (min-width: 768px) { .ad-slot { min-height: 250px; } }

.prose p, .prose li { max-width: 40rem; }
.prose h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); margin: 1.5rem 0 1rem; }
.prose h2 { margin-top: 1.8rem; }

footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: .92rem; }
footer ul { list-style: none; padding: 0; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }

.snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.snow[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print { .ad-slot, .snow, .actions, .nav ul { display: none !important; } }
