/* TableParfaite — design system
   Charte : bleu nuit #1B1F3B, jaune #FFD43B, blanc cassé #FAF9F6, anthracite #2C2C2C.
   Polices système uniquement : aucune requête vers un tiers (RGPD), aucun build. */

:root {
  --navy: #1B1F3B;
  --navy-soft: #2A3055;
  --yellow: #FFD43B;
  --yellow-dark: #E5B800;
  --cream: #FAF9F6;
  --ink: #2C2C2C;
  --muted: #6B6F80;
  --line: #E3E1DA;
  --white: #FFFFFF;

  --success: #1B7F4B;
  --success-bg: #E7F5EC;
  --error: #B3261E;
  --error-bg: #FCEBEA;
  --info: #1F5F8B;
  --info-bg: #E8F1F8;
  --warning: #8A5A00;
  --warning-bg: #FFF6DC;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(27,31,59,.06), 0 8px 24px rgba(27,31,59,.07);
  --shadow-lg: 0 2px 6px rgba(27,31,59,.08), 0 18px 48px rgba(27,31,59,.13);

  --font-title: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --space: 1rem;
  --container: 1120px;
}

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

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

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 { font-family: var(--font-title); color: var(--navy); line-height: 1.2; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(1.85rem, 1.3rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy-soft); }

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

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

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.container--narrow { max-width: 760px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--yellow); color: var(--ink); padding: .75rem 1.25rem; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- En-tête ---------- */
.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.site-header a { color: var(--white); text-decoration: none; }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: baseline; gap: .5rem; font-family: var(--font-title); font-size: 1.35rem; font-weight: 700; }
.brand span { color: var(--yellow); }
.brand small { font-family: var(--font-ui); font-size: .68rem; color: rgba(255,255,255,.65); letter-spacing: .06em; text-transform: uppercase; }

.nav { margin-left: auto; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.nav a {
  padding: .5rem .75rem; border-radius: 999px; font-size: .93rem; font-weight: 500;
  opacity: .88;
}
.nav a:hover, .nav a:focus-visible { background: rgba(255,255,255,.12); opacity: 1; }
.nav a[aria-current="page"] { background: rgba(255,212,59,.18); color: var(--yellow); opacity: 1; }
.nav .badge-count {
  display: inline-block; min-width: 20px; padding: 0 .35rem; margin-left: .3rem;
  background: var(--yellow); color: var(--ink); border-radius: 999px;
  font-size: .72rem; font-weight: 700; text-align: center;
}

.nav-toggle {
  display: none; margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: #fff; border-radius: var(--radius-sm); padding: .5rem .7rem; font-size: 1rem; cursor: pointer;
}

/* ---------- Contenu ---------- */
main { flex: 1 0 auto; padding-block: 2rem 3.5rem; }
.page-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin-bottom: .25rem; }
.page-head .lede { color: var(--muted); margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Cartes ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card h2, .card h3 { margin-top: 0; }
.card--accent { border-left: 4px solid var(--yellow); }
.card--flat { box-shadow: none; }

.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stack > * + * { margin-top: 1rem; }
.cluster { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .7rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; min-height: 44px;
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--yellow); color: var(--ink); box-shadow: 0 2px 0 var(--yellow-dark); }
.btn--primary:hover { background: #FFDD5C; color: var(--ink); }
.btn--dark { background: var(--navy); color: var(--white); }
.btn--dark:hover { background: var(--navy-soft); color: var(--white); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--navy); }
.btn--ghost:hover { background: var(--white); }
.btn--danger { background: var(--error-bg); color: var(--error); border-color: #F3C9C6; }
.btn--sm { padding: .45rem .8rem; font-size: .85rem; min-height: 36px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 1.1rem; }
.field label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; color: var(--navy); }
.field .hint { display: block; font-size: .82rem; color: var(--muted); margin-top: .3rem; }
input[type="text"], input[type="email"], input[type="number"], input[type="search"],
input[type="datetime-local"], input[type="date"], input[type="password"], input[type="file"],
select, textarea {
  width: 100%; padding: .7rem .85rem; font: inherit; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-height: 44px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 2px solid rgba(27,31,59,.15); outline-offset: 0; }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .75rem; }
.checkbox input { width: 20px; height: 20px; margin-top: .2rem; flex: none; }
.checkbox label { font-weight: 500; margin: 0; color: var(--ink); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; margin: 0 0 1.1rem; }
legend { font-weight: 700; color: var(--navy); padding-inline: .4rem; }

/* ---------- Messages ---------- */
.alert {
  padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
  border-left: 4px solid; font-size: .95rem;
}
.alert strong { display: block; }
.alert--success { background: var(--success-bg); border-color: var(--success); color: #14603A; }
.alert--error { background: var(--error-bg); border-color: var(--error); color: #8C1D18; }
.alert--info { background: var(--info-bg); border-color: var(--info); color: #14496B; }
.alert--warning { background: var(--warning-bg); border-color: var(--warning); color: #6B4600; }

/* ---------- Badges & pastilles ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .22rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: #EFEEE9; color: var(--ink); border: 1px solid var(--line);
}
.pill--draft { background: #EFEEE9; }
.pill--planned { background: var(--info-bg); color: var(--info); border-color: #C6DCEC; }
.pill--running { background: var(--warning-bg); color: var(--warning); border-color: #F2DFA8; }
.pill--revealable { background: var(--yellow); color: var(--ink); border-color: var(--yellow-dark); }
.pill--finished { background: var(--success-bg); color: var(--success); border-color: #BFE3CD; }
.pill--archived { background: #E7E7E7; color: var(--muted); }
.pill--secret { background: var(--navy); color: var(--yellow); border-color: var(--navy); }

.badge-tile { text-align: center; padding: 1rem .75rem; }
.badge-tile .emoji { font-size: 2rem; display: block; }
.badge-tile .label { font-weight: 700; font-size: .9rem; color: var(--navy); }
.badge-tile .desc { font-size: .78rem; color: var(--muted); }

/* ---------- Podium ---------- */
.podium { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; margin-bottom: 2rem; }
.podium-step { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; text-align: center; box-shadow: var(--shadow); }
.podium-step .rank { font-family: var(--font-title); font-size: 2.4rem; color: var(--yellow-dark); line-height: 1; }
.podium-step .host { font-weight: 700; font-size: 1.1rem; color: var(--navy); }
.podium-step .score { font-size: 2rem; font-family: var(--font-title); color: var(--navy); }
.podium-step .score small { font-size: .95rem; color: var(--muted); font-family: var(--font-ui); }
.podium-step--1 { border-top: 6px solid var(--yellow); transform: translateY(-8px); }
.podium-step--2 { border-top: 6px solid #C0C0C0; }
.podium-step--3 { border-top: 6px solid #CD7F32; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--navy); font-weight: 700; white-space: nowrap; }
tbody tr:hover { background: #FBFAF7; }

/* ---------- Notation ---------- */
.criterion { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; background: var(--white); margin-bottom: 1rem; }
.criterion header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .6rem; }
.criterion .weight { font-size: .78rem; color: var(--muted); }
.criterion output { font-family: var(--font-title); font-size: 1.6rem; color: var(--navy); font-weight: 700; min-width: 2.5ch; text-align: right; }
input[type="range"] { width: 100%; height: 44px; accent-color: var(--navy); }
.scale-marks { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: -.4rem; }

/* ---------- Galerie ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.gallery figure { margin: 0; position: relative; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #EFEEE9; }
.gallery figcaption { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

/* ---------- Recettes ---------- */
.recipe-card { display: flex; flex-direction: column; height: 100%; text-decoration: none; overflow: hidden; padding: 0; }
.recipe-card .thumb { aspect-ratio: 16/10; background: linear-gradient(135deg, #EFEEE9, #E3E1DA); display: grid; place-items: center; font-size: 2.4rem; }
.recipe-card .body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.recipe-card h3 { margin: 0; font-size: 1.05rem; }
.recipe-card .meta { font-size: .8rem; color: var(--muted); margin-top: auto; }

.recipe-layout { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .recipe-layout { grid-template-columns: 320px minmax(0, 1fr); } }
.ingredient-list { list-style: none; padding: 0; margin: 0; }
.ingredient-list li { padding: .5rem 0; border-bottom: 1px dashed var(--line); display: flex; gap: .5rem; }
.ingredient-list .qty { font-weight: 700; color: var(--navy); white-space: nowrap; }
.step-list { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step-list li { counter-increment: step; position: relative; padding: 0 0 1.1rem 3rem; }
.step-list li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--navy); color: var(--yellow); display: grid; place-items: center;
  font-weight: 700; font-family: var(--font-title);
}

/* ---------- Hero public ---------- */
.hero { background: var(--navy); color: var(--white); padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero h1 { color: var(--white); }
.hero h1 em { color: var(--yellow); font-style: normal; }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,.85); max-width: 56ch; }
.hero .cluster { margin-top: 1.5rem; }
.hero-stats { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15); }
.hero-stats div { min-width: 90px; }
.hero-stats .n { font-family: var(--font-title); font-size: 1.9rem; color: var(--yellow); line-height: 1; }
.hero-stats .l { font-size: .82rem; color: rgba(255,255,255,.7); }

.steps-row { counter-reset: hstep; }
.steps-row .card { position: relative; padding-top: 2.6rem; }
.steps-row .card::before {
  counter-increment: hstep; content: counter(hstep);
  position: absolute; top: 1rem; left: 1.25rem;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--yellow); color: var(--ink);
  display: grid; place-items: center; font-weight: 700; font-family: var(--font-title);
}

/* ---------- Pied de page ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.75); padding-block: 2rem; margin-top: auto; font-size: .9rem; }
.site-footer a { color: var(--yellow); }
.site-footer .footer-inner { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between; }

/* ---------- Divers ---------- */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.secret-box {
  background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 1.5rem; text-align: center;
}
.secret-box .lock { font-size: 2.2rem; }
.secret-box h3 { color: var(--yellow); }
.secret-box p { color: rgba(255,255,255,.8); margin-bottom: 0; }

.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--yellow); }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-size: .8rem; color: var(--muted); white-space: nowrap; min-width: 7rem; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: var(--yellow);
  display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex: none; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; width: 100%; flex-direction: column; align-items: stretch;
    padding-bottom: .75rem; margin-left: 0;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .7rem .75rem; }
  .header-inner { flex-wrap: wrap; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn { flex: 1; }
}

@media print {
  .site-header, .site-footer, .btn, form { display: none !important; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
