/* One Talibon: "How a request travels" (modules/how.js). Prefixed .how- (the page) and .hs- (the printed handout).
   Built for people who are not at ease with computers: big numbers, one icon and a few plain words per stop,
   and a state that is always a word and a mark, never colour alone. */

.how .pub-head { margin-bottom: 30px; }

/* ------------------------------------------------------------------ the sentence about the request being followed */
.how-now:empty { display: none; }
.how-now { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; padding: 20px 24px; margin-bottom: 36px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.how-now-main { flex: 1 1 440px; min-width: 0; }
.how-say { margin: 6px 0 0; font-size: clamp(19px, 2.1vw, 25px); line-height: 1.22; font-weight: 660; letter-spacing: -.032em; color: var(--ink); text-wrap: balance; }
.how-title { margin: 8px 0 0; font-size: 14.5px; line-height: 1.4; color: var(--muted); }
.how-asof { margin: 8px 0 0; }
.how-now-side { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.how-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.how-back:hover { text-decoration: underline; }
.how-note { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); }

/* ------------------------------------------------------------------ the chart */
.how-chart { position: relative; padding-top: 22px; }
.how-line { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 34px; }
.how-line-2 > .how-stop:first-child { grid-column-start: 2; }
.how-stop { position: relative; display: flex; min-width: 0; }
.how-stop:not(:last-child)::after { content: ""; position: absolute; left: 100%; top: 31px; width: 34px; height: 14px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 14'%3E%3Cpath d='M2 7h20' fill='none' stroke='%239fb0bf' stroke-width='2' stroke-linecap='round' stroke-dasharray='1 5'/%3E%3Cpath d='M21 2l6 5-6 5' fill='none' stroke='%239fb0bf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 30px 14px no-repeat; }
.how-stop.is-done:not(:last-child)::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 14'%3E%3Cpath d='M2 7h23' fill='none' stroke='%230e2942' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M21 2l6 5-6 5' fill='none' stroke='%230e2942' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

.how-card { flex: 1; min-width: 0; min-height: 214px; display: flex; flex-direction: column; gap: 6px; padding: 18px 16px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; transition: border-color .18s, box-shadow .18s, transform .18s, background-color .3s; }
.how-card:hover { color: var(--ink); border-color: var(--sea-300); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.how-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.how-n { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: #0b2036; color: #fff; font-size: 18px; font-weight: 700; font-feature-settings: "tnum"; transition: background-color .3s, color .3s; }
.how-ico { line-height: 0; color: var(--sea-500); }
.how-t { font-size: 18px; line-height: 1.2; font-weight: 680; letter-spacing: -.028em; text-wrap: balance; }
.how-d { font-size: 14.5px; line-height: 1.4; color: var(--ink-2); overflow-wrap: anywhere; }
.how-paper { margin-top: auto; padding-top: 10px; min-height: calc(2.7em + 10px); border-top: 1px dashed var(--line-strong); font-size: 13px; line-height: 1.35; font-style: italic; color: var(--muted); }
.how-fig { font-size: 13px; line-height: 1.35; color: var(--muted); }
.how-fig b { margin-right: 1px; font-size: 16px; font-weight: 680; color: var(--ink); }
.how-state { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; font-size: 13.5px; line-height: 1.3; color: var(--ink-2); }
.how-state svg { flex: none; }
.how-state b { font-weight: 680; }
.how-when { color: var(--muted); }

/* states: Done, Now here, In progress, Next, Not needed */
.how-stop.is-done .how-card { border-color: #bfe0cd; }
.how-stop.is-done .how-n { background: var(--ok-ink); }
.how-stop.is-done .how-state { color: var(--ok-ink); }
.how-stop.is-now .how-card { border-color: var(--gold); background: #fffdf5; box-shadow: 0 0 0 4px rgba(242, 180, 65, .26), var(--shadow-md); animation: how-pulse 2.6s ease-in-out infinite; }
.how-stop.is-now .how-n { background: var(--gold); color: #1c1400; }
.how-stop.is-now .how-state { color: var(--gold-ink); }
.how-stop.is-going .how-card { border-color: var(--sea-300); }
.how-stop.is-going .how-n { background: var(--sea-500); }
.how-stop.is-going .how-state { color: var(--sea-600); }
.how-stop.is-next .how-card, .how-stop.is-skip .how-card { background: #f8fafc; box-shadow: none; }
.how-stop.is-next .how-n, .how-stop.is-skip .how-n { background: #dfe5ec; color: #3a4a5a; }
.how-stop.is-next .how-t, .how-stop.is-skip .how-t { color: #3a4a5a; }
.how-stop.is-next .how-ico, .how-stop.is-skip .how-ico { color: #8a98a8; }
.how-stop.is-skip .how-card { border-style: dashed; border-color: var(--line-strong); }
@keyframes how-pulse { 50% { box-shadow: 0 0 0 10px rgba(242, 180, 65, .1), var(--shadow-md); } }

/* the letter that travels */
.how-token { position: absolute; left: 0; top: 0; z-index: 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(180deg, #f8c75f, #eeaa2c); color: #1c1400; box-shadow: 0 0 0 3px #fff, 0 8px 18px -6px rgba(122, 83, 0, .6); pointer-events: none; }
.how-token[hidden] { display: none; }
.how-token.is-moving { transition: transform .9s cubic-bezier(.2, .7, .2, 1); }

.how-then { display: flex; align-items: center; gap: 10px; margin: 30px 0 26px; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink-2); }
.how-then::before, .how-then::after { content: ""; flex: 1; min-width: 12px; height: 1px; background: var(--line-strong); }
.how-then svg { flex: none; color: var(--sea-500); }

.how-always { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 36px; border-radius: 18px; overflow: hidden; color: var(--deep-text); border: 1px solid var(--deep-line); background: radial-gradient(60% 190% at 86% 0%, rgba(14, 112, 150, .4), transparent 70%), #06111c; }
.how-always > div { display: flex; align-items: center; gap: 12px; padding: 20px 22px; font-size: 16px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
.how-always > div + div { border-left: 1px solid var(--deep-line); }
.how-always svg { flex: none; color: var(--aqua); }

.how-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 26px; font-size: 14px; color: var(--muted); }
.how-foot-main { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; min-width: 0; }
.how-foot .chip { min-height: 40px; gap: 8px; }
.how-hint { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; }

/* narrow: the stops stack and the arrows point down (class set from the chart's own width) */
.how-chart.is-narrow .how-line { grid-template-columns: minmax(0, 1fr); gap: 26px; }
.how-chart.is-narrow .how-line-2 > .how-stop:first-child { grid-column-start: auto; }
.how-chart.is-narrow .how-card { min-height: 0; padding: 16px 16px 14px; }
.how-chart.is-narrow .how-card:hover { transform: none; }
.how-chart.is-narrow .how-paper, .how-chart.is-narrow .how-state { margin-top: 8px; }
.how-chart.is-narrow .how-paper { min-height: 0; }
.how-chart.is-narrow .how-stop:not(:last-child)::after { left: 29px; top: 100%; width: 14px; height: 26px; background-size: 14px 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 26'%3E%3Cpath d='M7 2v16' fill='none' stroke='%239fb0bf' stroke-width='2' stroke-linecap='round' stroke-dasharray='1 5'/%3E%3Cpath d='M2 17l5 6 5-6' fill='none' stroke='%239fb0bf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.how-chart.is-narrow .how-stop.is-done:not(:last-child)::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 26'%3E%3Cpath d='M7 2v19' fill='none' stroke='%230e2942' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M2 17l5 6 5-6' fill='none' stroke='%230e2942' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.how-chart.is-narrow .how-then { margin: 26px 0; }
@media (max-width: 820px) {
  .how-now { padding: 16px 18px; margin-bottom: 30px; }
  .how-always { grid-template-columns: minmax(0, 1fr); }
  .how-always > div { padding: 16px 18px; }
  .how-always > div + div { border-left: 0; border-top: 1px solid var(--deep-line); }
}
@media (prefers-reduced-motion: reduce) {
  .how-stop.is-now .how-card { animation: none; }
  .how-token.is-moving, .how-card, .how-n { transition: none; }
}

/* ------------------------------------------------------------------ the handout: one A4 landscape sheet (277 x 190 mm inside the margins) */
.how-sheet-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.how-sheet-wrap { overflow-x: auto; padding: 4px 0 28px; }
.how-sheet-wrap .how-sheet { margin: 0 auto; box-shadow: var(--shadow-lg); }
.how-sheet { box-sizing: border-box; width: 277mm; padding: 6mm 8mm 5mm; background: #fff; color: #0b1622; font-family: var(--font-sans); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.hs-head { display: flex; align-items: center; gap: 6mm; padding-bottom: 4.5mm; border-bottom: .6mm solid #0b2036; }
.hs-titles { flex: 1; min-width: 0; }
.hs-kicker { font-size: 9.5pt; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: #5c6b7b; }
.hs-title { margin-top: 1mm; font-size: 30pt; font-weight: 700; letter-spacing: -.04em; line-height: 1.05; }
.hs-qr { display: flex; flex-direction: column; align-items: center; gap: 1mm; font-size: 8.5pt; font-weight: 600; color: #2a3949; }
.hs-qr svg { display: block; }
.hs-line { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9mm; margin-top: 7mm; }
.hs-line-2 { margin-top: 0; }
.hs-line-2 > .hs-stop:first-child { grid-column-start: 2; }
.hs-stop { position: relative; display: flex; flex-direction: column; gap: 1.2mm; min-height: 40mm; padding: 4mm 3.5mm 3.5mm; border: .35mm solid #9aa8b6; border-radius: 3.5mm; }
.hs-stop:not(:last-child)::after { content: ""; position: absolute; left: 100%; top: 6.6mm; width: 9mm; height: 3.6mm;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 14'%3E%3Cpath d='M2 7h23' fill='none' stroke='%230b2036' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M21 2l6 5-6 5' fill='none' stroke='%230b2036' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 7.7mm 3.6mm no-repeat; }
.hs-n { display: grid; place-items: center; width: 8.5mm; height: 8.5mm; margin-bottom: 1mm; border-radius: 50%; border: .5mm solid #0b2036; font-size: 12pt; font-weight: 700; }
.hs-stop b { font-size: 12.5pt; line-height: 1.15; letter-spacing: -.02em; }
.hs-d { font-size: 9.5pt; line-height: 1.3; color: #2a3949; }
.hs-stop i { margin-top: auto; padding-top: 2mm; border-top: .25mm dashed #9aa8b6; font-size: 8.5pt; line-height: 1.25; color: #5c6b7b; }
.hs-then { display: flex; align-items: center; gap: 4mm; margin: 5mm 0; font-size: 10pt; font-weight: 650; color: #2a3949; }
.hs-then::before, .hs-then::after { content: ""; flex: 1; height: .25mm; background: #9aa8b6; }
.hs-foot { display: flex; align-items: center; gap: 8mm; margin-top: 6mm; padding-top: 3.5mm; border-top: .35mm solid #c8d1dc; font-size: 10.5pt; font-weight: 650; }
.hs-tick::before { content: ""; display: inline-block; width: 2.4mm; height: 1.2mm; margin: 0 2mm .8mm 0; border-left: .5mm solid #1f6b41; border-bottom: .5mm solid #1f6b41; transform: rotate(-45deg); }
.hs-poc { margin-left: auto; font-weight: 500; color: #5c6b7b; }
#ot-print-root .how-sheet { box-shadow: none; margin: 0; }
