﻿/* ============================================================
   OpenMathBook · Public home — Variant A (Academic Minimal)
   Quiet beige bg, deep navy ink, restrained accents.
   Scoped to .ob-home; loaded via @section HeadMeta with
   Url.Content() for tilde resolution. Does not touch
   _PublicLayout or any other public page.
   ============================================================ */

/* ── Reset (light, scoped) ─────────────────────────────────── */
.ob-home, .ob-home *, .ob-home *::before, .ob-home *::after {
    box-sizing: border-box;
}

.ob-home {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

    .ob-home h1, .ob-home h2, .ob-home h3, .ob-home h4, .ob-home p, .ob-home ul, .ob-home ol {
        margin: 0;
        padding: 0;
    }

    .ob-home ul, .ob-home ol {
        list-style: none;
    }

    .ob-home a {
        color: inherit;
        text-decoration: none;
    }

    .ob-home button {
        font: inherit;
        cursor: pointer;
        border: 0;
        background: none;
        color: inherit;
    }

    .ob-home img, .ob-home svg {
        display: block;
        max-width: 100%;
    }

/* ── Tokens (Variant A) ────────────────────────────────────── */
.ob-home {
    --radius: 4px;
    --radius-lg: 8px;
    /* Inter for body, Fraunces only for numerals (Why / exam num). */
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Heebo", sans-serif;
    --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Heebo", sans-serif;
    --font-numeral: "Fraunces", "Georgia", serif;
    /* Quiet warm beige page bg, slightly cooler card panel */
    --bg: oklch(0.98 0.010 85); /* page */
    --bg-2: oklch(0.96 0.014 85); /* tinted strip (Why) */
    --bg-card: #ffffff; /* cards */

    --ink: oklch(0.18 0.040 250); /* deep navy */
    --ink-2: oklch(0.40 0.025 250); /* secondary */
    --ink-3: oklch(0.58 0.018 250); /* muted */

    --line: oklch(0.90 0.014 85); /* warm hairline */
    --line-2: oklch(0.84 0.018 85);
    --accent: oklch(0.32 0.08 250); /* restrained navy */
    --accent-deep: oklch(0.22 0.06 250);
    --accent-tint: oklch(0.94 0.018 250);
    --accent-ink: #ffffff;
    --shadow-sm: 0 1px 0 rgba(20, 30, 50, .04);
    --shadow: 0 1px 2px rgba(20, 30, 50, .03), 0 4px 12px rgba(20, 30, 50, .04);
    --shadow-lg: 0 2px 8px rgba(20, 30, 50, .04), 0 16px 40px rgba(20, 30, 50, .06);
    --pad-y: 96px;
    --pad-x: clamp(24px, 5vw, 72px);
    --gap: 20px;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
}

    /* per-language font swap */
    .ob-home[data-lang="he"] {
        --font: "Heebo", "Inter", -apple-system, sans-serif;
    }

    .ob-home[data-lang="ar"] {
        --font: "Cairo", "Heebo", "Inter", -apple-system, sans-serif;
    }

/* ════════════════════════════════════════════════════════════
   HERO  — quiet, no gradient
   ════════════════════════════════════════════════════════════ */
.ob-hero {
    padding: var(--pad-y) var(--pad-x) calc(var(--pad-y) * 0.75);
    background: var(--bg);
    color: var(--ink);
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.ob-hero__inner {
    max-width: 800px;
    margin: 0 auto;
}

.ob-hero__eyebrow {
    display: inline-block;
    margin-bottom: 28px;
    padding: 0;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    background: transparent;
    border-radius: 0;
}

.ob-hero__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--ink);
    text-wrap: balance;
}

.ob-hero__sub {
    margin: 22px auto 0;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.6;
    color: var(--ink-2);
    max-width: 600px;
    text-wrap: pretty;
}

.ob-hero__cta {
    margin-top: 26px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Buttons ────────────────────────────────────────────────── */
.ob-btn {
    display: inline-grid;
    grid-auto-flow: column;
    place-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 15px;
    transition: background .15s, color .15s, border-color .15s;
    border: 1px solid transparent;
}

.ob-btn--lg {
    height: 52px;
    padding: 0 28px;
    font-size: 16px;
}

.ob-btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

    .ob-btn--primary:hover {
        background: var(--accent-deep);
        border-color: var(--accent-deep);
    }

.ob-btn--ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line-2);
}

    .ob-btn--ghost:hover {
        border-color: var(--ink);
    }

/* ════════════════════════════════════════════════════════════
   SEARCH — flat, no shadow
   ════════════════════════════════════════════════════════════ */
.ob-search {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 28px auto 0;
}

.ob-search__field {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 0 6px 0 20px;
    background: var(--bg-card);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    color: var(--ink);
}

    .ob-search__field:focus-within {
        border-color: var(--ink);
    }

.ob-search__icon {
    color: var(--ink-3);
    flex: none;
}

.ob-search__field input {
    flex: 1;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
}

    .ob-search__field input::placeholder {
        color: var(--ink-3);
    }

.ob-search__btn {
    height: 44px;
    padding: 0 22px;
    border-radius: calc(var(--radius) - 1px);
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 500;
    font-size: 14px;
}

    .ob-search__btn:hover {
        background: var(--accent-deep);
    }

.ob-search__results {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    inset-inline-end: 0;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 40;
    max-height: 360px;
    overflow: auto;
    text-align: start;
}

    .ob-search__results[hidden] {
        display: none;
    }

.ob-search__result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 4px;
    color: var(--ink);
    font-size: 15px;
}

    .ob-search__result.is-active,
    .ob-search__result:hover {
        background: var(--bg-2);
    }

.ob-search__type {
    display: inline-grid;
    place-items: center;
    min-width: 70px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: transparent;
    color: var(--ink-3);
    border: 1px solid var(--line-2);
    border-radius: 3px;
    text-transform: uppercase;
}

.ob-search__type--page {
    color: oklch(0.42 0.05 60);
    border-color: oklch(0.85 0.03 60);
}

.ob-search__type--exam {
    color: oklch(0.42 0.06 130);
    border-color: oklch(0.85 0.03 130);
}

.ob-search__label {
    flex: 1;
    font-weight: 500;
}

.ob-search__arrow {
    color: var(--ink-3);
}

/* ════════════════════════════════════════════════════════════
   SECTION CHROME
   ════════════════════════════════════════════════════════════ */
.ob-pathways,
.ob-concepts,
.ob-pages,
.ob-exams,
.ob-bottomcta {
    padding: var(--pad-y) var(--pad-x);
    max-width: 1240px;
    margin: 0 auto;
}

.ob-section__head {
    margin-bottom: 40px;
    max-width: 720px;
}

    .ob-section__head h2 {
        font-family: var(--font-display);
        font-size: clamp(26px, 3vw, 36px);
        font-weight: 700;
        letter-spacing: -0.02em;
        line-height: 1.15;
        color: var(--ink);
    }

    .ob-section__head p {
        margin-top: 10px;
        color: var(--ink-2);
        font-size: 16px;
        line-height: 1.55;
    }

/* ════════════════════════════════════════════════════════════
   PATHWAYS — 4 entry cards, quiet
   ════════════════════════════════════════════════════════════ */
.ob-pathways__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
}

.ob-path {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 28px 24px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: border-color .15s;
    text-align: start;
}

    .ob-path:hover {
        border-color: var(--ink);
    }

.ob-path__icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--accent);
    margin-bottom: 8px;
}

.ob-path h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.ob-path p {
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.55;
    flex: 1;
}

/* ════════════════════════════════════════════════════════════
   CONCEPTS (chip grid)
   ════════════════════════════════════════════════════════════ */
.ob-concepts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ob-concept {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .12s;
}

    .ob-concept:hover {
        border-color: var(--ink);
    }

.ob-concept__title {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
}

.ob-concept__tag {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.ob-concept__arrow {
    color: var(--ink-3);
    flex: none;
}

.ob-concept:hover .ob-concept__arrow {
    color: var(--ink);
}

/* ════════════════════════════════════════════════════════════
   FEATURED PAGES
   ════════════════════════════════════════════════════════════ */
.ob-pages__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

.ob-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px 24px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: border-color .15s;
}

    .ob-page:hover {
        border-color: var(--ink);
    }

.ob-page__tag {
    align-self: flex-start;
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: transparent;
    color: var(--ink-3);
    border-radius: 0;
}

.ob-page h3 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--ink);
    text-wrap: balance;
}

.ob-page p {
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.55;
    flex: 1;
}

.ob-page__more {
    color: var(--accent);
    font-weight: 500;
    font-size: 13.5px;
}

/* ════════════════════════════════════════════════════════════
   EXAMS
   ════════════════════════════════════════════════════════════ */
.ob-exams__list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}

.ob-exam {
    display: grid;
    grid-template-columns: 56px 1fr auto auto;
    gap: 18px;
    align-items: center;
    padding: 22px 4px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    transition: padding-inline-start .15s, padding-inline-end .15s, background .12s;
}

    .ob-exam:hover {
        background: var(--bg-2);
        padding-inline-start: 16px;
        padding-inline-end: 16px;
    }

.ob-exam__num {
    font-family: var(--font-numeral);
    font-size: 24px;
    font-weight: 500;
    color: var(--ink-3);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.ob-exam__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ob-exam__title {
    font-weight: 600;
    font-size: 16px;
    color: var(--ink);
}

.ob-exam__desc {
    font-size: 14px;
    color: var(--ink-2);
}

.ob-exam__tag {
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: transparent;
    color: var(--ink-3);
    border: 0;
    border-radius: 0;
    white-space: nowrap;
}

.ob-exam__arrow {
    color: var(--ink-3);
}

.ob-exam:hover .ob-exam__arrow {
    color: var(--ink);
}

/* ════════════════════════════════════════════════════════════
   WHY STRIP — tinted bg, numbered items
   ════════════════════════════════════════════════════════════ */
.ob-why {
    background: var(--bg-2);
    padding: var(--pad-y) var(--pad-x);
    border-block: 1px solid var(--line);
}

    .ob-why .ob-section__head,
    .ob-why__grid {
        max-width: 1240px;
        margin-inline: auto;
    }

.ob-why__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
}

.ob-why__num {
    font-family: var(--font-numeral);
    font-size: 22px;
    font-weight: 500;
    color: var(--ink-3);
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}

.ob-why__item h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink);
}

.ob-why__item p {
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.55;
}

/* ════════════════════════════════════════════════════════════
   BOTTOM CTA  — quiet, no gradient banner
   ════════════════════════════════════════════════════════════ */
.ob-bottomcta {
    text-align: center;
    border-top: 1px solid var(--line);
}

.ob-bottomcta__inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    background: transparent;
    color: var(--ink);
    border-radius: 0;
}

.ob-bottomcta h2 {
    font-family: var(--font-display);
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.ob-bottomcta p {
    margin-top: 12px;
    font-size: 16px;
    color: var(--ink-2);
    opacity: 1;
}

.ob-bottomcta .ob-btn {
    margin-top: 24px;
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

    .ob-bottomcta .ob-btn:hover {
        background: var(--accent-deep);
        border-color: var(--accent-deep);
    }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
    .ob-pathways__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ob-concepts__grid,
    .ob-pages__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ob-why__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .ob-home {
        --pad-y: 56px;
    }

    .ob-pathways__grid,
    .ob-concepts__grid,
    .ob-pages__grid,
    .ob-why__grid {
        grid-template-columns: 1fr;
    }

    .ob-exam {
        grid-template-columns: 40px 1fr auto;
    }

    .ob-exam__tag {
        display: none;
    }

    .ob-search__field {
        height: 52px;
    }

        .ob-search__field input {
            font-size: 16px;
        }
}

/* ════════════════════════════════════════════════════════════
   RTL fixups
   ════════════════════════════════════════════════════════════ */
.ob-home[dir="rtl"] .ob-search__icon,
.ob-home[dir="rtl"] .ob-search__arrow,
.ob-home[dir="rtl"] .ob-concept__arrow,
.ob-home[dir="rtl"] .ob-exam__arrow {
    transform: scaleX(-1);
}
