/* Vinoweb — docs projet */
:root {
  --bg: #faf7f1;
  --paper: #ffffff;
  --ink: #2b2118;
  --muted: #7a6a5c;
  --wine: #6e2233;
  --wine-deep: #4c1622;
  --gold: #b08d57;
  --line: #e6ddd0;
  --ok: #2e6b4f;
  --ok-bg: #e4f0e9;
  --mid: #8a6d1f;
  --mid-bg: #f6eed3;
  --bad: #9c3332;
  --bad-bg: #f7e2e1;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header / nav ---------- */
.topbar {
  background: var(--wine-deep);
  color: #f4ead9;
  padding: 0.65rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(40, 10, 18, 0.25);
}
.topbar .brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.topbar .brand em { color: var(--gold); font-style: normal; }
.topbar .brand img.logo { height: 54px; width: auto; display: block; margin: -4px 0; }
.topbar nav { display: flex; gap: 0.2rem; flex-wrap: wrap; }
.topbar nav a {
  color: #e8d9c4;
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.92rem;
}
.topbar nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.topbar nav a.active { background: var(--wine); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--wine-deep) 0%, var(--wine) 70%, #843043 100%);
  color: #f6efe4;
  padding: 3.2rem 1.2rem 3rem;
  text-align: center;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  margin: 0 0 0.6rem;
  color: #fff;
}
.hero p.lead {
  max-width: 46rem;
  margin: 0 auto;
  font-size: 1.08rem;
  color: #eaddca;
}
.hero .tag {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
  color: #e3cfa8;
}

/* ---------- Layout ---------- */
main.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2.2rem 1.2rem 4rem;
}
.doc-header {
  border-bottom: 3px solid var(--wine);
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
}
.doc-header h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin: 0.2rem 0 0.4rem;
  color: var(--wine-deep);
}
.doc-header .meta { color: var(--muted); font-size: 0.92rem; }
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
}

h2 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--wine-deep);
  font-size: 1.55rem;
  margin: 2.6rem 0 0.8rem;
  padding-top: 0.4rem;
}
h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--wine);
  font-size: 1.18rem;
  margin: 1.8rem 0 0.5rem;
}
h4 { margin: 1.2rem 0 0.4rem; font-size: 1rem; }
p { margin: 0.6rem 0 0.9rem; }
a { color: var(--wine); }
strong { color: var(--wine-deep); }
ul, ol { padding-left: 1.3rem; }
li { margin: 0.3rem 0; }
hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }

blockquote {
  margin: 1.4rem 0;
  padding: 0.9rem 1.2rem;
  border-left: 4px solid var(--gold);
  background: var(--paper);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--serif);
  font-size: 1.08rem;
  color: var(--wine-deep);
}

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin: 1.2rem 0;
  box-shadow: 0 1px 4px rgba(60, 35, 20, 0.05);
}
.card h3 { margin-top: 0.2rem; }
.card.reco { border: 2px solid var(--gold); position: relative; }
.card.reco::before {
  content: "★ Recommandé";
  position: absolute;
  top: -0.8rem;
  right: 1rem;
  background: var(--gold);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
}
.card.warn { border-left: 5px solid var(--bad); }
.card.note { border-left: 5px solid var(--gold); }

.grid {
  display: grid;
  gap: 1rem;
  margin: 1.2rem 0;
}
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid .card { margin: 0; }

/* Index page doc cards */
.doc-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px solid var(--wine);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 4px rgba(60, 35, 20, 0.06);
}
.doc-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(60, 35, 20, 0.12); }
.doc-card .num {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
}
.doc-card h3 { margin: 0.4rem 0 0.4rem; }
.doc-card p { color: var(--muted); font-size: 0.93rem; margin-bottom: 0; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; margin: 1.2rem 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { padding: 0.6rem 0.8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th {
  background: var(--wine-deep);
  color: #f2e7d5;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
tbody tr:nth-child(even) { background: #fbf8f2; }
tbody tr:last-child td { border-bottom: none; }
td.rowhead, th.rowhead { font-weight: 600; color: var(--wine-deep); white-space: nowrap; }

/* Badges */
.b { display: inline-block; padding: 0.08rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.b.ok { background: var(--ok-bg); color: var(--ok); }
.b.mid { background: var(--mid-bg); color: var(--mid); }
.b.bad { background: var(--bad-bg); color: var(--bad); }

.pill {
  display: inline-block;
  background: var(--wine);
  color: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.7rem;
  letter-spacing: 0.03em;
}
.pill.gold { background: var(--gold); }
.pill.grey { background: #9b8b7a; }

/* ---------- Step flow (parcours) ---------- */
.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  margin: 1.2rem 0;
  counter-reset: step;
}
.flow .step {
  flex: 1 1 130px;
  min-width: 125px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.8rem 0.8rem;
  font-size: 0.85rem;
  position: relative;
  counter-increment: step;
}
.flow .step::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--wine);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 0.4rem;
}
.flow .step strong { display: block; margin-bottom: 0.15rem; }
.flow .step .sub { color: var(--muted); font-size: 0.8rem; }
.flow.gold .step::before { background: var(--gold); }

/* ---------- Timeline (roadmap / séquencement) ---------- */
.timeline { position: relative; margin: 1.6rem 0 1.6rem 0.4rem; padding-left: 1.6rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 3px;
  background: linear-gradient(var(--gold), var(--wine));
  border-radius: 2px;
}
.tl-item { position: relative; margin-bottom: 1.6rem; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 0.35rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--paper);
  border: 4px solid var(--wine);
}
.tl-item.gold::before { border-color: var(--gold); }
.tl-item h3 { margin: 0 0 0.2rem; }
.tl-item .when { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); font-weight: 700; }

/* ---------- Spectrum (buy ↔ build) ---------- */
.spectrum { margin: 1.6rem 0; }
.spectrum .bar {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3f7ab5, #b08d57, #6e2233);
  margin: 0.4rem 0 0.9rem;
}
.spectrum .ends { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.spectrum .ends .left { color: #3f6ea5; }
.spectrum .ends .right { color: var(--wine); }
.spectrum .items { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.spectrum .items span {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  white-space: nowrap;
}
.spectrum .items span.hl { border-color: var(--gold); background: #fdf6ea; font-weight: 600; }

/* ---------- MoSCoW ---------- */
.moscow { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.moscow .box { border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--paper); border: 1px solid var(--line); border-top: 5px solid; font-size: 0.92rem; }
.moscow .box h4 { margin: 0 0 0.5rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; }
.moscow .must { border-top-color: var(--wine); }
.moscow .should { border-top-color: var(--gold); }
.moscow .could { border-top-color: #7d9c6b; }
.moscow .wont { border-top-color: #9b8b7a; }
.moscow ul { margin: 0; padding-left: 1.1rem; }
.moscow li { margin: 0.25rem 0; }

/* ---------- Big numbers / stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat .n { font-family: var(--serif); font-size: 1.7rem; color: var(--wine); line-height: 1.2; }
.stat .l { font-size: 0.8rem; color: var(--muted); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.6rem 1rem 2.2rem;
}
footer a { color: var(--muted); }

.next-prev { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; flex-wrap: wrap; }
.next-prev a {
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 1.1rem;
  color: var(--wine-deep);
  font-weight: 600;
  font-size: 0.92rem;
}
.next-prev a:hover { border-color: var(--gold); }

@media print {
  .topbar, .next-prev, footer { display: none; }
  body { background: #fff; font-size: 12px; }
  .card, .table-scroll { box-shadow: none; break-inside: avoid; }
  h2 { break-after: avoid; }
}
