/* ============================================================
   Cyber Guide: sidebar + article layout for the guide pages.
   Uses the tokens from assets/sw.css (honey and sage, light + dark) and the shared chrome.css.
   Every class here starts with cg-. No scripts needed.
   ============================================================ */

.cg-main { padding: 28px 0 56px; }
.cg-layout { display: block; }

/* ---------------- sidebar (wide screens) ---------------- */
.cg-side { display: none; }

@media (min-width: 960px) {
    .cg-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 12px; }
    .cg-side {
        display: block; position: sticky; top: 92px;
        max-height: calc(100vh - 112px); overflow-y: auto;
        padding: 20px 18px; background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
        box-shadow: var(--shadow-sm);
    }
    .cg-mobile { display: none; }
}

.cg-side-title {
    display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
    letter-spacing: -0.02em; color: var(--text); text-decoration: none; padding: 4px 0 8px;
}
.cg-side-title:hover { color: var(--accent); }
.cg-side-title[aria-current="page"] { color: var(--accent); }
.cg-side-h {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-dim); margin: 18px 0 6px;
}
.cg-side-list { list-style: none; margin: 0; padding: 0; }
.cg-side-list a {
    display: block; padding: 6px 10px; margin: 0 -10px; border-radius: 8px;
    font-size: 0.95rem; line-height: 1.35; color: var(--text-muted); text-decoration: none;
}
.cg-side-list a:hover { background: var(--bg3); color: var(--text); }
.cg-side-list a[aria-current="page"] {
    background: var(--bg3); color: var(--accent); font-weight: 700;
    box-shadow: inset 3px 0 0 var(--accent-fill);
}

/* ---------------- sidebar (phones and tablets): closed disclosure ---------------- */
.cg-mobile {
    margin: 0 0 28px; background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
}
.cg-mobile > summary {
    cursor: pointer; padding: 14px 16px; font-weight: 700; color: var(--text); list-style: none;
    display: flex; align-items: center; justify-content: space-between; border-radius: 14px;
}
.cg-mobile > summary::-webkit-details-marker { display: none; }
.cg-mobile > summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--accent); }
.cg-mobile[open] > summary::after { content: "\2212"; }
.cg-mobile nav { padding: 0 16px 16px; }
.cg-mobile .cg-side-list a { padding: 10px; }

/* ---------------- article ---------------- */
.cg-article { max-width: 60ch; min-width: 0; color: var(--text-muted); font-size: 1.04rem; line-height: 1.72; }
.cg-article p, .cg-article ul, .cg-article ol { margin: 0 0 16px; }
.cg-article strong { color: var(--text); font-weight: 600; }
.cg-article a { color: var(--accent); text-underline-offset: 3px; }
.cg-article a:hover { color: var(--accent-hover); }
.cg-article ul { padding-left: 1.3em; }
.cg-article ul li { margin-bottom: 8px; }

.cg-eyebrow {
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--accent); margin: 0 0 10px;
}
.cg-title {
    font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08;
    font-size: clamp(2rem, 6vw, 3.1rem); color: var(--text); margin: 0 0 18px;
}
.cg-answer {
    font-size: 1.15rem; line-height: 1.6; color: var(--text); font-weight: 500;
    padding: 16px 18px; background: var(--bg3); border-radius: 14px; margin-bottom: 12px !important;
}
.cg-meta { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 8px !important; }

.cg-article h2 {
    font-family: var(--font-display); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15;
    font-size: clamp(1.4rem, 3.4vw, 1.85rem); color: var(--text); margin: 44px 0 14px; scroll-margin-top: 96px;
}
.cg-article h3 {
    font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
    font-size: 1.2rem; color: var(--text); margin: 30px 0 10px; scroll-margin-top: 96px;
}

/* Numbered steps with clear numbers */
.cg-steps { list-style: none; padding: 0; counter-reset: step; }
.cg-steps li {
    counter-increment: step; position: relative; padding: 4px 0 4px 46px; margin-bottom: 10px; min-height: 34px;
}
.cg-steps li::before {
    content: counter(step); position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent-fill); color: var(--on-accent); font-weight: 700; font-size: 0.95rem;
    display: flex; align-items: center; justify-content: center;
}

/* Callouts and flags */
.cg-callout {
    background: var(--info-bg); color: var(--info-fg); border-radius: 12px; padding: 12px 16px; margin: 0 0 18px;
}
.cg-callout p { margin: 0; }
.cg-callout strong { color: inherit; }
.cg-callout-warn { background: var(--warn-bg); color: var(--warn-fg); }
.cg-flag {
    display: inline-block; font-size: 0.78rem; font-weight: 700; line-height: 1.3; padding: 2px 8px; border-radius: 999px;
    background: var(--warn-bg); color: var(--warn-fg); vertical-align: 1px; margin-left: 4px;
}

/* Index cards */
.cg-cards { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 0 0 16px; }
.cg-card {
    position: relative; background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.cg-card:hover { border-color: var(--border-hover); }
.cg-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.cg-card h3 a { text-decoration: none; color: var(--text); }
.cg-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.cg-card h3 a:focus-visible { outline: none; }
.cg-card:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.cg-card p { margin: 0; font-size: 0.97rem; }

.cg-sources { padding-left: 1.3em; }
.cg-sources a { overflow-wrap: anywhere; }

@media (max-width: 480px) {
    .cg-steps li { padding-left: 42px; }
    .cg-main { padding-top: 18px; }
}

/* ============================================================
   Added 13 Nov 2026: catch-all hub, level labels, figures
   ============================================================ */

/* Nested guides in the sidebar */
.cg-side-sub { list-style: none; margin: 0 0 4px 6px; padding: 0 0 0 10px; border-left: 2px solid var(--border); }
.cg-side-sub a { font-size: 0.9rem; padding: 5px 10px; }

/* Level label: always carries words, never colour alone */
.cg-level {
    display: inline-block; font-size: 0.78rem; font-weight: 700; line-height: 1.3; letter-spacing: 0.02em;
    padding: 2px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-fg);
    border: 1px solid currentColor; margin: 0;
}
.cg-level-further { background: var(--info-bg); color: var(--info-fg); }
.cg-level-row { margin: 0 0 14px !important; }
.cg-card .cg-level { margin-bottom: 8px; }

/* Hub banner: flat, static illustration; colours come from the site tokens */
.cg-banner { margin: 0 0 22px; }
.cg-banner svg { display: block; width: 100%; height: auto; max-height: 180px; border-radius: 16px; }
.cg-b-bg { fill: var(--bg3); }
.cg-b-a { fill: var(--accent-fill); }
.cg-b-a2 { fill: var(--accent2); }
.cg-b-card { fill: var(--bg2); stroke: var(--text); stroke-width: 4; stroke-linejoin: round; }
.cg-b-line { fill: none; stroke: var(--text); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.cg-b-lineA { fill: none; stroke: var(--accent-fill); stroke-width: 9; stroke-linecap: round; }
.cg-b-on { fill: var(--on-accent); }
.cg-b-tick { fill: none; stroke: var(--on-accent); stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.cg-b-tick2 { fill: none; stroke: var(--on-honey, #29261D); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.cg-b-dot { fill: var(--bg2); }

/* Figures: work for inline SVG, HTML mock-ups and <img> screenshots */
.cg-figure { margin: 22px 0 26px; padding: 0; background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.cg-figure > .cg-fig-body { padding: 16px; }
.cg-figure img, .cg-figure svg { display: block; max-width: 100%; height: auto; }
.cg-figure > img { width: 100%; }
.cg-figure figcaption { padding: 12px 16px; font-size: 0.92rem; line-height: 1.55; color: var(--text-muted); background: var(--bg3); border-top: 1px solid var(--border); }
.cg-figure figcaption strong { color: var(--text); }
.cg-legend { list-style: none; counter-reset: pin; padding: 0 !important; margin: 14px 0 22px; }
.cg-legend li { counter-increment: pin; position: relative; padding: 2px 0 2px 38px; margin-bottom: 10px; min-height: 28px; }
.cg-legend li::before, .cg-pin {
    content: counter(pin); width: 26px; height: 26px; border-radius: 50%; background: var(--bad); color: #fff;
    font-weight: 700; font-size: 0.85rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
    flex: none;
}
.cg-legend li::before { position: absolute; left: 0; top: 2px; }
.cg-pin { content: none; margin-right: 8px; vertical-align: middle; }

/* Mock email (fictional). Uses site tokens so it follows light and dark mode */
.cg-mail { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 0.95rem; line-height: 1.5; overflow: hidden; }
.cg-mail-head { padding: 12px 14px; background: var(--bg3); border-bottom: 1px solid var(--border); }
.cg-mail-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 4px !important; overflow-wrap: anywhere; }
.cg-mail-row:last-child { margin-bottom: 0 !important; }
.cg-mail-k { color: var(--text-dim); font-size: 0.82rem; min-width: 3.4em; }
.cg-mail-subject { font-weight: 700; color: var(--text); }
.cg-mail-body { padding: 14px; }
.cg-mail-body p { margin: 0 0 10px !important; overflow-wrap: anywhere; }
.cg-mail-btn { display: inline-block; background: var(--accent-fill); color: var(--on-accent); font-weight: 700; padding: 8px 14px; border-radius: 8px; }
.cg-mail-file { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 6px 10px; margin-top: 4px; overflow-wrap: anywhere; }
.cg-mail-foot { color: var(--text-dim); font-size: 0.82rem; }

/* Compare panels (two boxes with an arrow between) */
.cg-compare { display: grid; gap: 10px; grid-template-columns: 1fr; align-items: stretch; }
.cg-panel { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); padding: 12px 14px; overflow-wrap: anywhere; }
.cg-panel-h { margin: 0 0 6px !important; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.cg-fake-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.cg-statusbar { font-family: ui-monospace, Consolas, monospace; font-size: 0.88rem; background: var(--bg3); border-radius: 6px; padding: 6px 8px; color: var(--text); }
.cg-arrow { text-align: center; color: var(--accent); font-size: 1.4rem; line-height: 1; font-weight: 700; }
@media (min-width: 640px) {
    .cg-compare { grid-template-columns: 1fr auto 1fr; }
    .cg-arrow { align-self: center; }
}

/* Side-by-side cards inside a figure (passwords, hashing) */
.cg-duo { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .cg-duo { grid-template-columns: 1fr 1fr; } }
.cg-duo-cell { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); padding: 12px 14px; }
.cg-duo-title { margin: 0 0 8px !important; font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--text); }
.cg-duo-cell p { margin: 0 0 6px !important; font-size: 0.93rem; }
.cg-code { display: block; font-family: ui-monospace, Consolas, monospace; font-size: 1rem; font-weight: 700; color: var(--text); background: var(--bg3); border-radius: 6px; padding: 8px 10px; margin: 0 0 8px; overflow-wrap: anywhere; }
.cg-fact-yes, .cg-fact-no { display: block; font-size: 0.9rem; margin: 0 0 4px; }
.cg-fact-yes::before { content: "Good: "; font-weight: 700; color: var(--ok-fg); }
.cg-fact-no::before { content: "Weak: "; font-weight: 700; color: var(--bad-fg); }

/* Three-step strip */
.cg-strip { list-style: none; counter-reset: s; display: grid; gap: 10px; grid-template-columns: 1fr; padding: 0 !important; margin: 0 !important; }
@media (min-width: 640px) { .cg-strip { grid-template-columns: repeat(3, 1fr); } }
.cg-strip li { counter-increment: s; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); padding: 12px 14px 12px 14px; margin: 0 !important; }
.cg-strip li::before { content: "Step " counter(s); display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.cg-strip strong { display: block; }

/* Hash diagram */
.cg-flow { display: grid; gap: 6px; justify-items: stretch; }
.cg-flow-box { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); padding: 8px 10px; font-size: 0.9rem; overflow-wrap: anywhere; }
.cg-flow-box .cg-code { margin: 4px 0 0; font-size: 0.9rem; }
.cg-flow-arrow { text-align: center; color: var(--accent); font-weight: 700; line-height: 1; font-size: 1.2rem; }
.cg-flow-salt { border-style: dashed; }
.cg-arrow::before { content: "\2193"; }
@media (min-width: 640px) { .cg-arrow::before { content: "\2192"; } }

/* ============================================================
   Added 23 Nov 2026: sidebar categories, drawn phone illustrations
   ============================================================ */

/* Category sub-headings in the Guides list */
.cg-side-cat { font-size: 0.82rem; font-weight: 700; color: var(--text); margin: 14px 0 4px; }
.cg-side-cat + .cg-side-list { margin-bottom: 4px; }

/* Drawn phone screen (made-up content only). Uses site tokens so it follows light and dark mode */
.cg-phone { max-width: 300px; margin: 0 auto; border: 3px solid var(--text); border-radius: 26px; background: var(--bg); color: var(--text); font-size: 0.93rem; line-height: 1.45; overflow: hidden; }
.cg-phone-top { padding: 9px 14px; text-align: center; font-size: 0.8rem; font-weight: 600; color: var(--text-dim); background: var(--bg3); border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.cg-url-bar { display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: 0.82rem; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 12px; }
.cg-phone-body { display: grid; gap: 8px; padding: 14px; }
.cg-phone-body p { margin: 0 !important; }
.cg-bubble-from { font-size: 0.78rem; color: var(--text-dim); }
.cg-bubble { max-width: 92%; padding: 9px 12px; border-radius: 16px 16px 16px 4px; background: var(--bg3); color: var(--text); overflow-wrap: anywhere; }
.cg-url { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.cg-form-h { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--text); }
.cg-form-field { border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; background: var(--bg2); color: var(--text-dim); }
