/*
 * afeasy signature ("the link mechanic for starters"). CSS only, works under a strict CSP without scripts.
 * Load after kit.css + themes/afeasy.css.
 * Elements: link with plan B (hero), readiness checklist (result of the real SiteInspector), ledger table.
 */

/* ---------- Hero layout ---------- */
.af-hero { padding: clamp(2rem, 5vw, 4rem) 0; border-bottom: 1px solid var(--zs-line); }
.af-hero__grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 56rem) { .af-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; } }
.af-hero h1 { font-size: clamp(2.1rem, 2.6vw + 1.2rem, 3.4rem); line-height: 1.04; }
.af-hero__lead { font-size: 1.15rem; margin: 1rem 0 1.5rem; max-width: 34rem; }

/* ---------- Link with plan B: one short link, two routes, one switched off ---------- */
.af-route { background: var(--zs-surface); border: 1px solid var(--zs-line); border-radius: var(--zs-radius); padding: 1.1rem 1.2rem 1rem; box-shadow: 0 2px 0 var(--zs-line); }
.af-route__link { display: inline-flex; align-items: center; gap: .5rem; font: 600 1rem/1.3 var(--zs-font-display); background: var(--zs-ink); color: #fff; padding: .4rem .7rem; border-radius: var(--zs-radius-sm); overflow-wrap: anywhere; }
.af-route__link small { font: 400 .78rem var(--zs-font-body); opacity: .75; }
.af-route__branches { list-style: none; margin: .2rem 0 0 1.1rem; padding: 0; }
.af-branch { position: relative; padding: .9rem 0 0 2rem; }
/* Tree connector: vertical from the link, horizontal into each branch. */
.af-branch::before { content: ""; position: absolute; left: 0; top: 0; height: 1.95rem; border-left: 2px solid var(--zs-accent); }
.af-branch::after { content: ""; position: absolute; left: 0; top: 1.95rem; width: 1.6rem; border-top: 2px solid var(--zs-accent); }
.af-branch:not(:last-child)::before { height: 100%; }
.af-branch.is-down::after { border-top: 2px dashed var(--zs-muted); }
.af-branch__card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .8rem; align-items: center; border: 2px solid var(--zs-accent); border-radius: var(--zs-radius-sm); padding: .55rem .75rem; }
.af-branch.is-down .af-branch__card { border: 2px dashed var(--zs-line); color: var(--zs-muted); }
.af-branch__shop { font-weight: 700; }
.af-branch.is-down .af-branch__shop { text-decoration: line-through; }
.af-branch__via { font-size: .85rem; color: var(--zs-muted); }
.af-branch__price { grid-row: 1 / span 2; grid-column: 2; text-align: right; font: 700 1.15rem/1.1 var(--zs-font-display); font-variant-numeric: tabular-nums; }
.af-branch__price small { display: block; font: 400 .78rem var(--zs-font-body); color: var(--zs-muted); }
.af-flag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 0 .45rem; border-radius: var(--zs-radius-sm); margin-top: .35rem; }
.af-flag.is-down { color: var(--af-down); background: #fbe4e2; }
.af-flag.is-live { color: var(--zs-accent-ink); background: var(--zs-accent); }
.af-route__note { font-size: .82rem; color: var(--zs-muted); margin: .9rem 0 0; }

/* ---------- Readiness check: URL in, checklist out ---------- */
.af-check { background: var(--zs-surface); border: 1px solid var(--zs-line); border-radius: var(--zs-radius); }
.af-check__form { display: flex; gap: .5rem; padding: 1rem; border-bottom: 1px solid var(--zs-line); flex-wrap: wrap; }
.af-check__form label { flex-basis: 100%; font-weight: 600; }
.af-check__form input { flex: 1; min-width: 0; font: inherit; padding: .6rem .7rem; min-height: 2.8rem; border: 1px solid var(--zs-ink); border-radius: var(--zs-radius-sm); }
.af-check__form input:focus-visible { outline: 3px solid var(--zs-accent); outline-offset: 1px; }
.af-checklist { list-style: none; margin: 0; padding: .4rem 1rem 1rem; }
.af-checklist li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; gap: .7rem; align-items: start; padding: .55rem 0; border-bottom: 1px solid var(--zs-line); }
.af-checklist li:last-child { border-bottom: 0; }
.af-checklist li::before { content: ""; width: 1.1rem; height: 1.1rem; margin-top: .15rem; border-radius: 50%; border: 2px solid var(--zs-muted); box-sizing: border-box; }
.af-checklist li.is-pass::before { border-color: var(--af-ok); background: var(--af-ok); }
/* Check mark drawn with borders: no data: URI, so it passes a strict img-src CSP. */
.af-checklist li { position: relative; }
.af-checklist li.is-pass::after { content: ""; position: absolute; left: .4rem; top: calc(.55rem + .33rem); width: .28rem; height: .55rem; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.af-checklist li.is-todo::before { border-color: var(--af-down); border-style: dashed; }
.af-checklist strong { display: block; }
.af-checklist span { font-size: .88rem; color: var(--zs-muted); }
.af-checklist em { font-style: normal; font-size: .8rem; font-weight: 600; white-space: nowrap; color: var(--af-ok); }
.af-checklist li.is-todo em { color: var(--af-down); }
.af-checklist li.is-unverified em { color: var(--zs-muted); font-weight: 400; }

/* ---------- Ledger: the same product across networks ---------- */
.af-ledger { width: 100%; border-collapse: collapse; background: var(--zs-surface); font-variant-numeric: tabular-nums; }
.af-ledger caption { text-align: left; padding-bottom: .5rem; }
.af-ledger caption strong { display: block; font: 700 1.15rem/1.3 var(--zs-font-display); }
.af-ledger caption span { font-size: .85rem; color: var(--zs-muted); }
.af-ledger th, .af-ledger td { padding: .55rem .7rem; border-bottom: 1px solid var(--zs-line); text-align: left; }
.af-ledger thead th { font-size: .8rem; font-weight: 600; color: var(--zs-muted); border-bottom: 3px double var(--zs-ink); white-space: nowrap; }
.af-ledger .num { text-align: right; white-space: nowrap; }
.af-ledger tbody th { font-weight: 600; }
.af-ledger tbody th small { display: none; font-weight: 400; font-size: .8rem; color: var(--zs-muted); }
.af-ledger tr.is-pick { box-shadow: inset 4px 0 0 var(--zs-accent); background: color-mix(in srgb, var(--zs-accent) 6%, var(--zs-surface)); }
.af-ledger tr.is-pick th::after { content: "gekozen"; display: inline-block; margin-left: .5rem; font-size: .72rem; font-weight: 700; color: var(--zs-accent-ink); background: var(--zs-accent); padding: 0 .4rem; border-radius: var(--zs-radius-sm); vertical-align: middle; }
.af-ledger tr.is-out td, .af-ledger tr.is-out th { color: var(--zs-muted); }
.af-ledger tfoot td { font-size: .8rem; color: var(--zs-muted); border-bottom: 0; padding-top: .7rem; }
.af-ledger-wrap { overflow-x: auto; border: 1px solid var(--zs-line); border-radius: var(--zs-radius); }
/* Phones: network and stock move under the shop name (th small), their own columns hide. */
@media (max-width: 40rem) { .af-ledger .af-hide-sm { display: none; } .af-ledger tbody th small { display: block; } .af-ledger th, .af-ledger td { padding: .5rem .45rem; } }
@media (max-width: 30rem) { .af-route__link { flex-wrap: wrap; gap: 0 .5rem; font-size: .92rem; } .af-route__link small { flex-basis: 100%; } }

/* ================= Pictograms (Terry 18-11: own pictograms) ================= */
/* Tile: icons/afeasy/sprite.svg, white glyph on cobalt. Status shapes differ (circle / open ring / diamond), so colour is never the only signal. */
.af-picto { --picto-bg: var(--zs-accent); display: inline-grid; place-items: center; flex: none; width: 3rem; height: 3rem; background: var(--picto-bg); color: #fff; border-radius: 10px; }
/* Glyph colour sits on the svg via --picto-fg, so a parent rule like `.list span { color: … }` cannot dim it. */
.af-picto svg { width: 80%; height: 80%; color: var(--picto-fg, #fff); }
.af-picto--sm { width: 2.1rem; height: 2.1rem; border-radius: 8px; }
.af-picto--lg { width: 4.25rem; height: 4.25rem; border-radius: 14px; }
.af-picto--pass { --picto-bg: var(--af-ok); }
.af-picto--todo { --picto-bg: var(--af-down); }
.af-picto--unverified { --picto-bg: var(--zs-muted); }
@media print { .af-picto { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
