/* ============================================
   SmartBloom AI — MathQuest guides, hubs, 404
   Shares the home page palette.
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --dark: #0f172a;
    --dark-mid: #1e293b;
    --mid: #334155;
    --muted: #64748b;
    --light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --success: #10b981;
    --radius: 14px;
    --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--dark);
    background: var(--white);
    line-height: 1.7;
    font-size: 17px;
}

a { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* ── Top bar ── */
.g-nav { background: var(--dark); }
.g-nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; min-height: 64px; flex-wrap: wrap;
}
.g-brand {
    display: flex; align-items: center; gap: 10px;
    color: var(--white); text-decoration: none; font-weight: 700;
}
.g-brand img { width: 34px; height: 34px; border-radius: 8px; }
.g-links { display: flex; gap: 18px; flex-wrap: wrap; }
.g-links a { color: rgba(255,255,255,0.78); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.g-links a:hover { color: var(--white); }

/* ── Page header ── */
.g-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, var(--dark) 100%);
    color: var(--white);
    padding: 56px 0 48px;
}
.g-label {
    display: inline-block; font-size: 0.75rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: #a5b4fc; background: rgba(99,102,241,0.18);
    padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.g-hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); line-height: 1.2; font-weight: 800; margin-bottom: 14px; }
.g-hero p { color: rgba(255,255,255,0.8); font-size: 1.1rem; max-width: 640px; }
.crumbs { font-size: 0.85rem; margin-bottom: 18px; color: rgba(255,255,255,0.6); }
.crumbs a { color: rgba(255,255,255,0.75); }

/* ── Article body ── */
main { padding: 40px 0 56px; }
main h2 { font-size: 1.5rem; line-height: 1.3; margin: 40px 0 12px; color: var(--dark); }
main h3 { font-size: 1.15rem; margin: 28px 0 8px; color: var(--dark-mid); }
main p, main li { color: var(--mid); }
main p { margin-bottom: 14px; }
main ul, main ol { margin: 0 0 16px 22px; }
main li { margin-bottom: 6px; }
.answer {
    font-size: 1.12rem; color: var(--dark); background: var(--light);
    border-left: 4px solid var(--primary); padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 24px;
}
.example {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 22px; margin: 18px 0 24px; background: var(--white);
}
.example h3 { margin-top: 0; }
.math { font-family: 'Cambria Math', 'STIX Two Math', Georgia, serif; font-size: 1.08em; white-space: nowrap; }
.steps { counter-reset: s; list-style: none; margin-left: 0; }
.steps li { counter-increment: s; padding-left: 36px; position: relative; }
.steps li::before {
    content: counter(s); position: absolute; left: 0; top: 2px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--primary); color: var(--white);
    font-size: 0.8rem; font-weight: 700; text-align: center; line-height: 24px;
}
.warn { border-left: 4px solid #f59e0b; background: #fffbeb; padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 0.97rem; }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--light); }
.table-scroll { overflow-x: auto; }

details {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 16px; margin: 10px 0;
}
details summary { cursor: pointer; font-weight: 600; color: var(--dark); }
details[open] summary { margin-bottom: 8px; }

/* ── Calls to action ── */
.cta {
    display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(6,182,212,0.08));
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: var(--radius); padding: 20px 22px; margin: 28px 0;
}
.cta img { width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0; }
.cta-text { flex: 1 1 260px; }
.cta-text strong { display: block; color: var(--dark); font-size: 1.05rem; margin-bottom: 2px; }
.cta-text span { color: var(--mid); font-size: 0.97rem; }
.cta-big { flex-direction: column; text-align: center; padding: 32px 22px; }
.cta-big .cta-text { flex: none; }
.cta-big strong { font-size: 1.35rem; }
.btn-play {
    display: inline-block; background: var(--primary); color: var(--white);
    text-decoration: none; font-weight: 700; padding: 12px 22px;
    border-radius: 999px; white-space: nowrap; transition: background 0.2s ease;
}
.btn-play:hover { background: var(--primary-dark); }

/* ── Hubs & landing ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 18px 0 28px; }
.card {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; background: var(--white); text-decoration: none; display: block;
}
a.card:hover { border-color: var(--primary); box-shadow: 0 8px 28px rgba(99,102,241,0.12); }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; color: var(--dark); }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.guide-list { list-style: none; margin: 8px 0 24px; padding: 0; }
.guide-list li { border-bottom: 1px solid var(--border); padding: 12px 0; margin: 0; }
.guide-list a { font-weight: 600; text-decoration: none; }
.guide-list a:hover { text-decoration: underline; }
.guide-list .tag { display: inline-block; font-size: 0.75rem; color: var(--muted); margin-left: 8px; }
.empty-note { color: var(--muted); font-style: italic; }
.related { border-top: 1px solid var(--border); margin-top: 40px; padding-top: 8px; }

/* ── Footer ── */
.g-footer { background: var(--dark); color: rgba(255,255,255,0.6); padding: 28px 0; font-size: 0.9rem; }
.g-footer a { color: rgba(255,255,255,0.8); text-decoration: none; margin-right: 16px; }
.g-footer a:hover { color: var(--white); }
.g-footer p { margin-top: 10px; }

@media (max-width: 560px) {
    body { font-size: 16px; }
    .g-hero { padding: 40px 0 36px; }
    .cta { padding: 18px; }
    .btn-play { width: 100%; text-align: center; }
}
