/* Pagine di approfondimento della pipeline (pipeline/*.html).
   Si appoggia ai token di brand.css; qui solo i componenti specifici. */

.site-header { padding-block: 14px; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-header img { height: 28px; width: auto; translate: 0 2px; }
.site-header nav { display: flex; align-items: center; gap: 20px; }
.back { color: var(--ink-2); text-decoration: none; font-size: 15px; white-space: nowrap; display: inline-block; padding-block: 10px; }
.back:hover { color: var(--ink); }
@media (max-width: 520px) { .site-header .btn { display: none; } }

/* ---------- navigazione tra i passaggi ---------- */
.steps-nav { border-bottom: 1px solid var(--line); background: var(--surface); }
.steps-nav ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.steps-nav li { position: relative; }
.steps-nav a, .steps-nav span { display: flex; align-items: center; gap: 10px; padding: 16px 12px 16px 0; font-size: 15px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.steps-nav i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.steps-nav a { color: var(--ink-2); }
.steps-nav a:hover { color: var(--ink); }
.steps-nav a:hover i { border-color: var(--brand); }
.steps-nav [aria-current="page"] { color: var(--ink); font-weight: 600; }
.steps-nav [aria-current="page"] i { background: var(--brand); border-color: var(--brand); }
.steps-nav [aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 12px; bottom: -1px; height: 2px; background: var(--brand); }
@media (max-width: 760px) {
  .steps-nav .wrap { overflow-x: auto; scrollbar-width: none; }
  .steps-nav .wrap::-webkit-scrollbar { display: none; }
  .steps-nav ol { display: flex; gap: 20px; width: max-content; }
}

/* ---------- apertura ---------- */
.p-hero { padding-block: clamp(40px, 6vw, 80px) clamp(48px, 7vw, 88px); }
.p-hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.p-hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.4rem); line-height: 1; letter-spacing: -0.035em; font-weight: 600; margin: 14px 0 20px; }
.p-hero .lead { font-size: clamp(1.08rem, 1.5vw, 1.25rem); color: var(--ink-2); margin: 0; max-width: 42ch; }
.photo { margin: 0; }
.photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-card); background: var(--band); }
.photo figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
.photo figcaption a { color: var(--muted); }
@media (max-width: 900px) { .p-hero .wrap { grid-template-columns: minmax(0, 1fr); } }

/* ---------- sezioni ---------- */
.p-section { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.p-section.band { background: var(--band); border-top: 0; }
.p-head { max-width: 64ch; margin-bottom: clamp(28px, 4vw, 44px); }
.p-head h2 { font-size: clamp(1.7rem, 2.8vw, 2.25rem); line-height: 1.14; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 12px; }
.p-head p { margin: 0; color: var(--ink-2); font-size: 1.05rem; }

/* in breve: tre fatti */
.brief { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.brief li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; }
.brief b { display: block; font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.brief span { color: var(--ink-2); font-size: 15px; }
.brief .display-num { display: block; font-size: 2.4rem; color: var(--brand-ink); margin-bottom: 8px; }
@media (max-width: 860px) { .brief { grid-template-columns: minmax(0, 1fr); } }

/* flusso orizzontale a blocchi */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 28px; counter-reset: flow; }
.flow li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; }
.flow li + li::before { content: ""; position: absolute; left: -22px; top: 50%; width: 16px; height: 1px; background: var(--line-strong); }
.flow li + li::after { content: ""; position: absolute; left: -10px; top: calc(50% - 4px); border: 4px solid transparent; border-left: 5px solid var(--line-strong); }
.flow b { display: block; font-size: 15.5px; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.flow span { display: block; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.flow code { font-family: var(--mono); font-size: 12.5px; color: var(--brand-ink); }
.flow li.hl { background: var(--brand-tint); border-color: #d6e8dc; }
@media (max-width: 960px) {
  .flow { grid-auto-flow: row; grid-auto-columns: auto; gap: 22px; }
  .flow li + li::before { left: 28px; top: -17px; width: 1px; height: 12px; }
  .flow li + li::after { left: 24px; top: -8px; border: 4px solid transparent; border-top: 5px solid var(--line-strong); }
}

/* figure e screenshot */
.shot { margin: 0; }
.shot .frame img { width: 100%; }
.shot figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); max-width: 72ch; }
.zoom { display: block; line-height: 0; cursor: zoom-in; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.split.wide-left { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
@media (max-width: 900px) { .split, .split.wide-left { grid-template-columns: minmax(0, 1fr); } }

/* elenco numerato accanto a uno screenshot */
.notes { list-style: none; margin: 0; padding: 0; counter-reset: note; display: grid; gap: 4px; }
.notes li { counter-increment: note; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 14px 0; }
.notes li + li { border-top: 1px solid var(--line); }
.notes li::before { content: counter(note); width: 26px; height: 26px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-ink); font: 500 13px/26px var(--mono); text-align: center; }
.notes.cols { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; margin-top: 28px; }
.notes.cols li { border-top: 1px solid var(--line); }
.shot.full { max-width: 1040px; }
.notes b { display: block; font-weight: 600; margin-bottom: 2px; }
.notes span { color: var(--ink-2); font-size: 15px; }

/* tabelle */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 15px; }
.table-wrap th { text-align: left; font: 500 12px/1.3 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 14px 20px; border-bottom: 1px solid var(--line); }
.table-wrap td { padding: 14px 20px; vertical-align: top; color: var(--ink-2); }
.table-wrap tr + tr td { border-top: 1px solid var(--line); }
.table-wrap td:first-child { color: var(--ink); font-weight: 500; }
.table-wrap code { font-family: var(--mono); font-size: 13px; color: var(--brand-ink); white-space: nowrap; }
.table-wrap .num { font-family: var(--sans); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--ink); }

/* codice */
.code { margin: 0; background: #14201A; color: #DDE7E0; border-radius: var(--r-card); padding: 20px 22px; overflow-x: auto; font: 13.5px/1.65 var(--mono); tab-size: 4; }
.code .k { color: #8FD6AE; }
.code .s { color: #E6C98F; }
.code .c { color: #8A9B91; font-style: italic; }
.code .n { color: #9CC7F0; }
.code-cap { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

/* riquadro nota */
.callout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 24px; color: var(--ink-2); font-size: 15px; }
.callout strong { color: var(--ink); }
.callout.tint { background: var(--brand-tint); border-color: #d6e8dc; }

/* etichetta mono piccola sopra blocchi di schema */
.label { display: block; font: 500 12px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

/* ---------- chiusura: passaggio precedente e successivo ---------- */
.pager { border-top: 1px solid var(--line); padding-block: 40px 56px; }
.pager .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.pager a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px 24px; text-decoration: none; color: var(--ink); transition: border-color 160ms var(--ease-out), transform 120ms var(--ease-out); }
.pager a:hover { border-color: var(--line-strong); }
.pager a:active { transform: scale(0.99); }
.pager small { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.pager b { font-size: 1.25rem; font-weight: 600; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 640px) { .pager .wrap { grid-template-columns: minmax(0, 1fr); } .pager .next { grid-column: 1; } }

.site-footer { border-top: 1px solid var(--line); padding-block: 28px 36px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer a { color: var(--ink-2); display: inline-block; padding-block: 10px; margin-block: -10px; }

/* ---------- lettura a slide verticali (classe aggiunta da pipeline.js) ---------- */
html.p-slides { scroll-snap-type: y mandatory; }
.p-slides .site-header { scroll-snap-align: start; }
/* prima slide: header + passaggi + apertura, alti insieme una schermata */
.p-slides .p-hero { min-height: calc(100vh - var(--top-h, 140px)); display: flex; align-items: center; padding-block: 32px; }
.p-slides .p-section { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-block: 64px; scroll-snap-align: start; }
/* ultima slide: l'ultima sezione con sotto i passaggi vicini e il footer */
.p-slides main > .p-section:last-child { min-height: calc(100vh - var(--end-h, 240px)); padding-bottom: 32px; }
.p-slides .pager { border-top: 0; padding-block: 8px 48px; }
.p-slides .pager.band { background: var(--band); }
.p-slides .site-footer { scroll-snap-align: end; }

.slide-dots { position: fixed; right: clamp(12px, 1.4vw, 24px); top: 50%; transform: translateY(-50%); z-index: 20; }
.slide-dots ol { list-style: none; margin: 0; padding: 8px 6px; display: grid; gap: 2px; background: rgba(251, 251, 250, 0.86); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 999px; }
.slide-dots a { position: relative; display: grid; place-items: center; width: 22px; height: 30px; border-radius: 999px; }
.slide-dots i { display: block; width: 8px; height: 8px; border-radius: 4px; background: var(--line-strong); transition: height 260ms var(--ease-out), background-color 160ms var(--ease-out); }
.slide-dots a:hover i { background: var(--ink-2); }
.slide-dots a[aria-current="true"] i { height: 22px; background: var(--brand); }
.slide-dots .lbl {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translate(4px, -50%);
  white-space: nowrap; background: var(--ink); color: #fff; font-size: 13px; line-height: 1; padding: 7px 10px; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.slide-dots a:hover .lbl, .slide-dots a:focus-visible .lbl { opacity: 1; transform: translate(0, -50%); }
