/*
 * Getting-started / beginner's guide page (/guide/). Loaded on top of
 * home.css so it inherits the .section / .section-light / .cta-band /
 * .landing-footer chrome and only adds the guide-specific surfaces
 * (header, concept cards, numbered steps, worked example, glossary).
 */

.guide-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #334155 100%);
    color: #f8fafc;
    padding: 4rem 1rem 3rem;
    text-align: left;
}
.guide-header .container { max-width: 56rem; }
.guide-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0 0 0.4rem;
}
.guide-header h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 1rem;
}
.guide-header .lead {
    font-size: 1.1rem;
    color: #cbd5e1;
    max-width: 44rem;
    margin: 0 0 1.5rem;
}
.guide-jump {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.guide-jump a {
    background: rgba(248, 250, 252, 0.08);
    border: 1px solid rgba(248, 250, 252, 0.15);
    color: #f1f5f9;
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    transition: background 120ms ease, border-color 120ms ease;
}
.guide-jump a:hover {
    background: rgba(248, 250, 252, 0.15);
    border-color: rgba(248, 250, 252, 0.3);
}

.guide-section {
    padding: 3.5rem 1rem;
}
.guide-section .container { max-width: 56rem; }
.guide-section h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 1.25rem;
}
.guide-section > .container > p,
.guide-section > .container > ul,
.guide-section > .container > ol {
    color: #334155;
    font-size: 1rem;
    line-height: 1.65;
    max-width: 44rem;
}
.guide-section ul li,
.guide-section ol li { margin-bottom: 0.5rem; }

/* Concept cards — used for the back/lay/qualifying-loss/rating/etc
 * grid. Same visual as the home-page feature-card but smaller and
 * with a slightly different typographic balance. */
.concept-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    height: 100%;
}
.concept-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    color: #0f172a;
}
.concept-card p {
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0;
}

/* Numbered step list. Uses CSS counters rather than the default <ol>
 * marker so the number sits in a coloured circle outside the text
 * column — matches the home page's old "How it works" rhythm. */
.guide-steps {
    counter-reset: gstep;
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    max-width: 44rem;
}
.guide-steps > li {
    counter-increment: gstep;
    position: relative;
    padding-left: 3.25rem;
    margin-bottom: 1.75rem;
}
.guide-steps > li::before {
    content: counter(gstep);
    position: absolute;
    left: 0;
    top: 0.05rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: #0f172a;
    color: #f8fafc;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}
.guide-steps h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    color: #0f172a;
}
.guide-steps p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}
.guide-steps a { color: #0f172a; text-decoration: underline; }

/* The "what to do first" list uses its own circles (already prefixed
 * with "1." / "2." etc. in the markup), so suppress the counter-based
 * pseudo-element on that variant. */
.guide-steps-compact > li { padding-left: 0; }
.guide-steps-compact > li::before { content: none; }

/* Worked-example block — keep the table compact and tighten the row
 * padding; the calculation is the whole point of the section. */
.worked-example {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 44rem;
}
.worked-example h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: #0f172a;
}
.worked-example h3:not(:first-child) {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}
.worked-example p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0 0 0.85rem;
}
.worked-table th {
    width: 45%;
    font-weight: 500;
    color: #475569;
}
.worked-table td { color: #0f172a; }

/* Risk-free vs variance callout — sits above the per-offer cards and
 * explains the bankroll distinction in two side-by-side panels. The
 * panels use the same green / amber palette as the badges, so the
 * connection between the callout and the per-card badges is visual,
 * not just textual. */
.risk-callout {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    margin: 1.5rem 0 1rem;
    max-width: 44rem;
}
.risk-callout > h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.35rem;
}
.risk-callout > p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0 0 1.25rem;
}
.risk-callout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.risk-callout-half {
    border-radius: 10px;
    padding: 1rem 1.1rem;
}
.risk-callout-safe {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.risk-callout-variance {
    background: rgba(245, 175, 25, 0.08);
    border: 1px solid rgba(245, 175, 25, 0.25);
}
.risk-callout-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.risk-callout-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}
.risk-callout-half p {
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0 0 0.6rem;
}
.risk-callout-half p:last-child { margin-bottom: 0; }
.risk-callout-half strong { color: #0f172a; }

/* Risk badges. Used in the callout headers and on each offer-guide
 * card so the visual link between the callout and the per-card flag
 * is unambiguous. Green = risk-free, amber = variance. Same shape as
 * .offer-guide-tag but distinct palette. */
.risk-badge {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    border: 1px solid;
    line-height: 1.2;
    white-space: nowrap;
}
.risk-badge-safe {
    color: #15803d;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.45);
}
.risk-badge-variance {
    color: #b45309;
    background: rgba(245, 175, 25, 0.12);
    border-color: rgba(245, 175, 25, 0.5);
}

/* Tag row inside offer-guide-head — was a bare .offer-guide-tag, now
 * holds both the category tag and the risk badge. Flex row so the two
 * sit side-by-side at the top of each card. */
.offer-guide-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.offer-guide-tags .offer-guide-tag { margin-bottom: 0; }

/* Per-offer stepped guide cards. Each .offer-guide is a self-contained
 * walkthrough of one offer type: tag pill, heading, value summary,
 * intro paragraph, numbered steps, and a "watch out" callout. Visually
 * heavier than concept-card because each one is a substantial read. */
.offer-guide {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.75rem;
    margin-top: 1.5rem;
    max-width: 44rem;
}
.offer-guide:first-of-type { margin-top: 0.5rem; }
.offer-guide-head { margin-bottom: 1rem; }
.offer-guide-tag {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    font-weight: 600;
    color: #b07000;
    background: rgba(245, 175, 25, 0.12);
    border: 1px solid rgba(245, 175, 25, 0.35);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}
.offer-guide-head h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.4rem;
    line-height: 1.3;
}
.offer-guide-value {
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0;
}
.offer-guide > p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1rem;
}
.offer-guide-steps {
    padding-left: 1.25rem;
    margin: 0 0 1rem;
    color: #334155;
}
.offer-guide-steps li {
    margin-bottom: 0.55rem;
    font-size: 0.95rem;
    line-height: 1.6;
}
.offer-guide-steps li:last-child { margin-bottom: 0; }
.offer-guide-steps ul {
    margin-top: 0.4rem;
    padding-left: 1.25rem;
}
.offer-guide-steps ul li { margin-bottom: 0.35rem; }
.offer-guide-steps a { color: #0f172a; text-decoration: underline; }
.offer-guide-watchout {
    background: rgba(245, 175, 25, 0.08);
    border-left: 3px solid #f5af19;
    border-radius: 6px;
    padding: 0.85rem 1rem;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.55;
    margin-top: 0.5rem;
}
.offer-guide-watchout strong { color: #0f172a; }
.offer-guide-followup {
    margin-top: 1.5rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 44rem;
    font-style: italic;
}

/* Dark-theme overrides for the offer-guide cards. */
[data-theme="dark"] .offer-guide {
    background: var(--bg-card);
    border-color: var(--border);
}
[data-theme="dark"] .offer-guide-head h3,
[data-theme="dark"] .offer-guide-watchout strong { color: var(--text); }
[data-theme="dark"] .offer-guide > p,
[data-theme="dark"] .offer-guide-value,
[data-theme="dark"] .offer-guide-steps,
[data-theme="dark"] .offer-guide-watchout,
[data-theme="dark"] .offer-guide-followup { color: var(--text-mid); }
[data-theme="dark"] .offer-guide-steps { color: var(--text-mid); }
[data-theme="dark"] .offer-guide-steps a { color: var(--text); }
[data-theme="dark"] .offer-guide-tag {
    color: #ffc14d;
    background: rgba(245, 175, 25, 0.15);
    border-color: rgba(245, 175, 25, 0.4);
}
[data-theme="dark"] .offer-guide-watchout {
    background: rgba(245, 175, 25, 0.1);
    border-left-color: #ffc14d;
}

/* Dark-theme overrides for the risk callout and badges. */
[data-theme="dark"] .risk-callout {
    background: var(--bg-card);
    border-color: var(--border);
}
[data-theme="dark"] .risk-callout > h3,
[data-theme="dark"] .risk-callout-header h4,
[data-theme="dark"] .risk-callout-half strong { color: var(--text); }
[data-theme="dark"] .risk-callout > p,
[data-theme="dark"] .risk-callout-half p { color: var(--text-mid); }
[data-theme="dark"] .risk-callout-safe {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}
[data-theme="dark"] .risk-callout-variance {
    background: rgba(245, 175, 25, 0.1);
    border-color: rgba(245, 175, 25, 0.35);
}
[data-theme="dark"] .risk-badge-safe {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
}
[data-theme="dark"] .risk-badge-variance {
    color: #ffc14d;
    background: rgba(245, 175, 25, 0.15);
    border-color: rgba(245, 175, 25, 0.55);
}

/* Glossary — definition list with the term on the left, definition
 * indented under it on small screens, or as a 2-col grid on wider
 * viewports. */
.glossary {
    margin: 0;
    max-width: 44rem;
}
.glossary dt {
    font-weight: 600;
    color: #0f172a;
    margin-top: 1rem;
}
.glossary dt:first-child { margin-top: 0; }
.glossary dd {
    margin: 0.15rem 0 0;
    color: #475569;
    line-height: 1.55;
    font-size: 0.95rem;
}

/* Dark-theme: flip the white cards / tables / worked-example onto the
 * dark page background so the guide reads cleanly in dark mode. */
[data-theme="dark"] .guide-section > .container > p,
[data-theme="dark"] .guide-section > .container > ul,
[data-theme="dark"] .guide-section > .container > ol { color: var(--text-mid); }
[data-theme="dark"] .concept-card,
[data-theme="dark"] .worked-example {
    background: var(--bg-card);
    border-color: var(--border);
}
[data-theme="dark"] .concept-card h3,
[data-theme="dark"] .worked-example h3,
[data-theme="dark"] .guide-steps h3,
[data-theme="dark"] .glossary dt { color: var(--text); }
[data-theme="dark"] .concept-card p,
[data-theme="dark"] .worked-example p,
[data-theme="dark"] .guide-steps p,
[data-theme="dark"] .glossary dd { color: var(--text-mid); }
[data-theme="dark"] .worked-example h3:not(:first-child) {
    border-top-color: var(--border);
}
[data-theme="dark"] .worked-table th { color: var(--text-mid); }
[data-theme="dark"] .worked-table td { color: var(--text); }
[data-theme="dark"] .guide-steps a { color: var(--text); }

@media (max-width: 768px) {
    .guide-header { padding: 3rem 1rem 2.5rem; }
    .guide-section { padding: 2.5rem 1rem; }
    .guide-section h2 { font-size: 1.35rem; }
    .guide-steps > li { padding-left: 2.75rem; }
    .guide-steps > li::before {
        width: 1.9rem;
        height: 1.9rem;
        font-size: 0.9rem;
    }
    .worked-example { padding: 1.1rem; }
    .worked-table th { width: 55%; }
    .offer-guide { padding: 1.25rem; }
    .offer-guide-head h3 { font-size: 1.05rem; }
    .risk-callout { padding: 1.1rem; }
    .risk-callout-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}
