/* Cinecyclop — articles techniques et checklists.
   Reprend la palette de la landing : fond sable, encre chaude, accent orange. */

:root {
  --bg: #f5f3ed;
  --surface: #fffdfa;
  --ink: #17120c;
  --muted: #62584b;
  --line: #ded5c7;
  --accent: #d87900;
  --ok: #2f7d55;
  --radius: 6px;
  --max: 1060px;
  font-family: "Barlow", Verdana, Geneva, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent) 58%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.shell { width: min(var(--max), calc(100vw - 40px)); margin: 0 auto; }

header, footer { padding: 24px 0; }
header .shell, footer .shell {
  display: flex; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; align-items: center;
}
.brand { font-weight: 800; text-decoration: none; }
nav.top {
  display: flex; flex-wrap: wrap; gap: 14px;
  color: var(--muted); font-size: .95rem; font-weight: 600;
}
nav.top a[aria-current="page"] { color: var(--accent); }

main { padding: clamp(40px, 7vw, 78px) 0 clamp(48px, 8vw, 92px); }

.kicker { margin: 0 0 14px; color: #9a5d00; font-weight: 700; }
h1 {
  margin: 0; max-width: 900px;
  font-size: clamp(2.1rem, 4.4vw, 3.7rem);
  line-height: 1.04; letter-spacing: 0;
}
.lede {
  margin: 24px 0 0; max-width: 780px;
  color: var(--muted); font-size: 1.14rem;
}
.meta {
  margin: 20px 0 0; color: var(--muted);
  font-size: .88rem; letter-spacing: .02em;
}
.meta .tag {
  display: inline-block; margin-right: 10px; padding: 3px 11px;
  border-radius: 999px; background: #fff0d8; color: #9a5d00;
  font-size: .74rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
}

article h2 {
  margin: clamp(42px, 6vw, 64px) 0 6px;
  font-size: clamp(1.42rem, 2.4vw, 1.95rem); line-height: 1.14;
}
article h3 { margin: 30px 0 4px; font-size: 1.1rem; }
article p, article ul, article ol { max-width: 780px; }
article ul, article ol { padding-left: 1.25em; }
article li { margin-bottom: 8px; }

.note {
  margin: 26px 0 0; padding: 20px 22px; max-width: 800px;
  border-radius: var(--radius); background: #fff8ec; color: var(--muted);
}
.note strong { color: var(--ink); }

table {
  width: 100%; max-width: 780px; margin-top: 16px;
  border-collapse: collapse; font-size: .97rem;
}
th, td {
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top;
}
th {
  font-size: .78rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted);
}

/* ---------- Checklist interactive ---------- */

.cl-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: clamp(30px, 5vw, 46px) 0 8px; padding: 14px 18px;
  border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 10px 24px rgba(89, 63, 23, .12);
}
.cl-count { font-weight: 800; font-variant-numeric: tabular-nums; }
.cl-track {
  flex: 1 1 180px; height: 7px; min-width: 120px;
  border-radius: 999px; background: #e8e0d2; overflow: hidden;
}
.cl-fill {
  display: block; height: 100%; width: 0;
  border-radius: 999px; background: var(--accent);
  transition: width 220ms ease;
}
.cl-actions { display: flex; gap: 8px; }
.cl-btn {
  min-height: 40px; padding: 8px 15px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink);
  font: inherit; font-size: .86rem; font-weight: 650; cursor: pointer;
}
.cl-btn:hover { background: #f7f2e9; }

.cl-section { margin-top: clamp(32px, 5vw, 50px); }
.cl-section > h2 { margin-top: 0; }
.cl-section > p { color: var(--muted); }

ul.cl { max-width: 820px; margin: 14px 0 0; padding: 0; list-style: none; }
ul.cl > li { margin: 0; border-bottom: 1px solid var(--line); }
ul.cl > li:first-child { border-top: 1px solid var(--line); }

ul.cl label {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 13px 6px; cursor: pointer;
}
ul.cl input[type="checkbox"] {
  flex: 0 0 auto; width: 21px; height: 21px; margin: 2px 0 0;
  accent-color: var(--accent); cursor: pointer;
}
ul.cl .cl-text { min-width: 0; }
ul.cl .cl-why {
  display: block; margin-top: 3px;
  color: var(--muted); font-size: .9rem;
}
ul.cl input:checked ~ .cl-text { color: var(--muted); text-decoration: line-through; }
ul.cl input:checked ~ .cl-text .cl-why { text-decoration: none; }

.cta {
  margin-top: clamp(50px, 8vw, 86px); padding: 30px;
  border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 14px 28px rgba(89, 63, 23, .1);
}
.cta p { margin: 0 0 16px; max-width: 640px; font-size: 1.1rem; font-weight: 600; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 4px;
  background: var(--accent); color: #fff; font-weight: 750; text-decoration: none;
}
.btn.ghost {
  margin-left: 10px; background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ---------- Index des articles ---------- */

.grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; margin-top: clamp(34px, 6vw, 58px);
}
.card {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 16px; min-height: 200px; padding: 22px;
  border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 14px 28px rgba(89, 63, 23, .1);
  text-decoration: none;
}
.card h2 { margin: 8px 0 0; font-size: 1.22rem; line-height: 1.15; }
.card p { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.card .tag {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  background: #fff0d8; color: #9a5d00; font-size: .72rem;
  font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.card .go { color: var(--accent); font-weight: 750; font-size: .92rem; }

footer { color: var(--muted); border-top: 1px solid var(--line); font-size: .95rem; }

@media (max-width: 860px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  header .shell, footer .shell { display: block; }
  nav.top { margin-top: 12px; }
  .btn.ghost { margin: 10px 0 0; display: block; text-align: center; }
  .cl-bar { gap: 10px; }
}

/* ---------- Impression : la checklist doit sortir propre sur papier ---------- */

@media print {
  :root { --bg: #fff; --surface: #fff; }
  header, footer, .cta, .cl-actions, nav.top { display: none !important; }
  body { font-size: 11pt; }
  main { padding: 0; }
  .shell { width: auto; }
  .cl-bar {
    position: static; box-shadow: none;
    border: 1px solid #000; border-radius: 0;
  }
  .cl-track, .cl-fill { display: none; }
  h1 { font-size: 20pt; }
  article h2 { margin-top: 16pt; font-size: 13pt; page-break-after: avoid; }
  .cl-section { page-break-inside: avoid; }
  ul.cl label { padding: 5pt 0; }
  ul.cl input[type="checkbox"] {
    width: 11pt; height: 11pt;
    -webkit-appearance: none; appearance: none;
    border: 1pt solid #000;
  }
  ul.cl input:checked ~ .cl-text { color: #000; text-decoration: none; }
  a { text-decoration: none; }
  .note { border: 1px solid #ccc; }
}

/* ---------- Figures : schémas techniques inline ---------- */

.fig {
  max-width: 820px;
  margin: clamp(26px, 4vw, 40px) 0 0;
  padding: 20px 20px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(89, 63, 23, .09);
}
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}
.fig--hero { margin-top: clamp(30px, 5vw, 44px); }

/* Vocabulaire commun aux schémas. Les SVG ne portent aucune couleur en dur :
   tout passe par ces règles, donc par la palette du site. */
.f-line, .f-sling, .f-beam, .f-check, .f-cross, .f-gap, .f-hatch, .f-sep, .f-axis, .f-bar-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.f-line   { stroke: var(--ink);   stroke-width: 2; }
.f-axis   { stroke: var(--line);  stroke-width: 1.5; }
.f-hatch  { stroke: var(--muted); stroke-width: 1.4; opacity: .55; }
.f-sep    { stroke: var(--line);  stroke-width: 1.5; stroke-dasharray: 4 6; }
.f-struct { fill: var(--muted);   opacity: .22; stroke: var(--muted); stroke-width: 1.5; }
.f-body   { fill: var(--ink);     opacity: .82; }
.f-clamp  { fill: var(--muted);   opacity: .6; }
.f-beam   { stroke: var(--accent); stroke-width: 1.6; opacity: .5; stroke-dasharray: 3 5; }
.f-sling  { stroke: var(--accent); stroke-width: 3.2; }
.f-node   { fill: var(--accent); }
.f-gap    { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 3; }
.f-check  { stroke: var(--ok);    stroke-width: 4; }
.f-cross  { stroke: #b23b2e;      stroke-width: 4; }

.f-ko .f-sling, .f-ko .f-node, .f-ko .f-gap { stroke: #b23b2e; }
.f-ko .f-node { fill: #b23b2e; stroke: none; }
.f-ko .f-fixture { opacity: .5; }

.f-lbl, .f-cap, .f-note, .f-verdict, .f-gap-lbl, .f-tick, .f-val {
  font-family: "Barlow", Verdana, sans-serif;
  fill: var(--ink);
}
.f-lbl     { font-size: 13px; fill: var(--muted); }
.f-cap     { font-size: 14px; font-weight: 600; }
.f-note    { font-size: 14px; fill: var(--muted); }
.f-tick    { font-size: 12px; fill: var(--muted); }
.f-val     { font-size: 14px; font-weight: 700; }
.f-gap-lbl { font-size: 12px; fill: #b23b2e; font-weight: 600; }
.f-verdict { font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.f-verdict-ok { fill: var(--ok); }
.f-verdict-ko { fill: #b23b2e; }

.f-step-box { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.f-step-box--on { fill: #fff0d8; stroke: var(--accent); }
.f-step-n { font-family: "Barlow", sans-serif; font-size: 12px; font-weight: 800; fill: var(--accent); }
.f-step-t { font-family: "Barlow", sans-serif; font-size: 13px; font-weight: 600; fill: var(--ink); }
.f-bar    { fill: var(--accent); opacity: .8; }
.f-bar--alt { fill: var(--muted); opacity: .35; }

@media print {
  .fig {
    box-shadow: none;
    border: 1px solid #bbb;
    page-break-inside: avoid;
  }
  .f-struct { opacity: .3; }
  .f-beam { opacity: .6; }
}

/* ---------- Bloc « Dans Cinecyclop » ---------- */

.applink {
  max-width: 800px;
  margin: clamp(38px, 6vw, 58px) 0 0;
  padding: 22px 24px;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(89, 63, 23, .09);
}
.applink-k {
  margin: 0;
  color: #9a5d00;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.applink-t {
  margin: 8px 0 0;
  font-size: 1.12rem;
  font-weight: 650;
  line-height: 1.3;
}
.applink p { margin: 10px 0 0; }
.applink-go { font-weight: 650; }
.applink-go a { color: var(--accent); }

@media print {
  .applink { box-shadow: none; border: 1px solid #ccc; border-left: 3px solid #888; }
}
