/* The Masoretes — shared design system: blue, white, faint gold, and soft rose-magenta */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,700;1,400&family=Noto+Sans+Hebrew:wght@400;500;600&display=swap');

:root {
    --sidebar-width: 270px;

    /* Blues */
    --blue-primary: #1E3A5F;
    --blue-bright: #0284C8;
    --blue-soft: #38BDF8;
    --blue-border: #BAE6FD;
    --blue-pale: #E0F2FE;
    --blue-mist: #F0F9FF;
    --blue-ghost: #F8FAFC;

    /* Golds */
    --gold: #D4AF37;
    --gold-dark: #B8860B;
    --gold-deep: #C5A028;
    --gold-light: #F9F1D8;
    --gold-pale: #FEF3C7;
    --gold-wash: rgba(212, 175, 55, 0.08);

    /* Rose-magenta accents (kept very light) */
    --magenta: #C4719A;
    --magenta-soft: #E4A8C4;
    --magenta-pale: #FCE7F3;
    --magenta-light: #FDF2F8;
    --magenta-border: #F5D5E8;
    --magenta-wash: rgba(196, 113, 154, 0.06);
    --magenta-glow: rgba(196, 113, 154, 0.11);

    /* Neutrals */
    --ink: #1E293B;
    --slate: #334155;
    --muted: #475569;
    --subtle: #64748B;
    --cloud: #94A3B8;

    /* Theme-able surfaces (light default) */
    --bg-body: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-soft: var(--blue-mist);
    --bg-mute: var(--blue-ghost);
    --text-main: var(--ink);
    --text-head: var(--blue-primary);
    --text-muted: var(--subtle);
    --border-color: var(--blue-border);
    --shadow-color: rgba(30, 58, 95, 0.1);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 250ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Radii */
    --radius-sm: 0.45rem;
    --radius-md: 0.65rem;
    --radius-lg: 0.85rem;
    --radius-xl: 1rem;
}

/* Base */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

*, *::before, *::after {
    font-family: 'Lora', Georgia, 'Times New Roman', serif !important;
}

/* Preserve Font Awesome icon glyphs; the universal Lora rule would otherwise override the icon font on ::before. */
.fas, .far, .fal, .fab,
.fa-solid, .fa-regular, .fa-light, .fa-brands,
.fas::before, .far::before, .fal::before, .fab::before,
.fa-solid::before, .fa-regular::before, .fa-light::before, .fa-brands::before,
.fa-solid::after, .fa-regular::after, .fa-brands::after {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}

.hebrew, .hebrew * {
    font-family: 'Noto Sans Hebrew', 'Times New Roman', serif !important;
}

/* SVG graphics preserve their own coordinate-system text sizing so diagrams don't break */
svg, svg * {
    font-size: unset;
    line-height: initial;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    color: var(--text-head);
    line-height: 1.3;
    margin-bottom: 0.75rem;
    font-weight: bold !important;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

::selection {
    background: var(--magenta-pale);
    color: var(--blue-primary);
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.7;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--blue-primary);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 100;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0 0 var(--radius-sm) 0;
    transition: top var(--transition-fast);
}
.skip-link:focus { top: 0; }

/* Layout */
.site-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.site-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 1.1rem 0.9rem 1.5rem;
    z-index: 40;
}

.site-main { min-width: 0; }

/* Sidebar brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-bottom: 0.9rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    text-decoration: none;
}

.sidebar-brand img,
.sidebar-brand-mark {
    width: 2.65rem;
    height: 2.65rem;
    object-fit: contain;
    border-radius: 0.4rem;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(30, 58, 95, 0.1);
    background: #FFFBF5;
    /* No rose/magenta tint on the brand mark */
    filter: none;
    opacity: 1;
}
.hub-page .hub-hero-title-with-mark {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1.25;
}
.hub-page .hub-title-mark {
    width: 2.75rem;
    height: 2.75rem;
    object-fit: contain;
    border-radius: 0.45rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.1);
    background: #FFFBF5;
    filter: none;
    opacity: 1;
}
@media (min-width: 768px) {
    .hub-page .hub-title-mark {
        width: 3.25rem;
        height: 3.25rem;
    }
}
.hub-page .hub-hero-title-text {
    min-width: 0;
}
.sidebar-brand-text { font-weight: 700; font-size: 1rem; color: var(--text-head); line-height: 1.2; }
.sidebar-badge {
    display: inline-block;
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    line-height: 1.3;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--gold-pale);
    color: var(--gold-dark);
    border: 1px solid var(--gold);
    margin-top: 4px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    min-width: 0;
}

/* Sidebar sections */
.sidebar-label {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-head);
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    border: 1px solid transparent;
}
.sidebar-link:hover {
    background: var(--gold-wash);
    color: var(--gold-deep);
}
.sidebar-link.active {
    background: var(--gold-light);
    color: var(--gold-dark);
    border-color: var(--gold);
    font-weight: 600;
}
.sidebar-link i { width: 14px; text-align: center; font-size: 0.75rem; opacity: 0.75; }
.sidebar-sublink { padding-left: 1.5rem; font-size: 0.8125rem; color: var(--muted); }
.sidebar-sublink.featured { color: var(--gold-deep); font-weight: 600; }
.sidebar-section { margin-bottom: 1.1rem; }

/* Sidebar filters */
.sidebar-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.sidebar-filters .filter-pill {
    font-size: 0.75rem;
    padding: 3px 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-head);
    border-radius: 9999px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.sidebar-filters .filter-pill.active,
.sidebar-filters .filter-pill:hover {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
}

/* Standalone filter pill (used on search page category filters) */
.filter-pill {
    font-size: 0.75rem;
    padding: 3px 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-head);
    border-radius: 9999px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.filter-pill.active,
.filter-pill:hover {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
}

.sidebar-footer {
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--blue-pale);
    font-size: 0.75rem;
    color: var(--cloud);
}
.sidebar-footer a { color: var(--subtle); }
.sidebar-footer a:hover { color: var(--gold-deep); }

.theme-toggle {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-mute);
    color: var(--text-head);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.theme-toggle:hover { background: var(--gold-wash); border-color: var(--gold); }

/* Unified article typography (replaces Tailwind hex utilities) */
.eyebrow {
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    font-weight: 600;
    color: var(--gold-dark);
    text-transform: uppercase;
}
.page-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-head);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-top: 0.5rem;
}
@media (min-width: 768px) {
    .page-title { font-size: 3rem; }
}
.lede {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.625;
    color: var(--muted);
    max-width: 48rem;
}
.section-title {
    position: relative;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-head);
    margin-bottom: 1.25rem;
    margin-top: 0;
    line-height: 1.4;
    padding-left: 0.8rem;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.12em;
    bottom: 0.12em;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--gold) 0%, var(--magenta-soft) 100%);
    opacity: 0.72;
}
.text-body {
    color: var(--slate);
    font-size: 1rem;
    line-height: 1.625;
}
.text-body-sm {
    font-size: 0.875rem;
    color: var(--muted);
}
.confessional-banner {
    background: linear-gradient(135deg, var(--gold-pale) 0%, var(--magenta-pale) 100%);
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-top: 1rem;
    max-width: 48rem;
    box-shadow: inset 0 0 0 1px var(--magenta-wash);
}
.confessional-banner p {
    font-size: 0.75rem;
    color: var(--text-head);
    font-style: italic;
    line-height: 1.625;
    margin: 0;
}
.figure-caption {
    font-size: 0.6875rem;
    color: var(--subtle);
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--blue-pale);
    background: var(--bg-mute);
}
.pull-quote {
    margin: 1.5rem 0;
    padding: 0.75rem 1rem 0.75rem 1.25rem;
    border-left: 4px solid var(--gold);
    background: linear-gradient(90deg, var(--magenta-light) 0%, var(--blue-mist) 42%);
    border-radius: 0 0.25rem 0.25rem 0;
    font-style: italic;
    color: var(--muted);
    font-size: 0.875rem;
}
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}
.card-subtitle {
    font-weight: 700;
    color: var(--text-head);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}
.sidebar-current {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-head);
    padding: 0 0.5rem;
}
.fact-callout-title {
    font-weight: 600;
    color: var(--text-head);
}
.section-title-lg {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-head);
    margin-bottom: 1.5rem;
    margin-top: 0;
}

/* Theme-aware utilities (replace Tailwind arbitrary hex) */
.ui-head { color: var(--text-head); }
.ui-muted { color: var(--muted); }
.ui-subtle { color: var(--subtle); }
.ui-gold { color: var(--gold-dark); }
.ui-magenta { color: var(--magenta); }
.ui-bg-soft { background: var(--blue-mist); }
.ui-bg-mute { background: var(--bg-mute); }
.ui-bg-gold-pale { background: var(--gold-pale); }
.ui-bg-primary { background: var(--blue-primary); color: #fff; }
.ui-bg-primary:hover { background: var(--gold-deep); }
.ui-border { border-color: var(--border-color); }
.ui-border-pale { border-color: var(--blue-pale); }
.ui-border-gold { border-color: var(--gold); }
.ui-border-top { border-top: 2px solid var(--border-color); }
.ui-footer-bar {
    border-top: 2px solid var(--border-color);
    padding: 2rem 0;
    background: var(--blue-mist);
    margin-top: 2rem;
}
.ui-footer-text {
    font-size: 0.75rem;
    color: var(--text-head);
    text-align: center;
}

/* Presentation slide deck */
.deck-frame {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(30, 58, 95, 0.18);
    overflow: hidden;
}
.deck-slide {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #0f172a;
    display: block;
}
.deck-page .thumb {
    width: 88px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid transparent;
    opacity: 0.7;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.deck-page .thumb:hover,
.deck-page .thumb.active {
    opacity: 1;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}
.deck-page .thumb-strip {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    overflow-x: auto;
    background: #111827;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) #1e293b;
}
.deck-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(186, 230, 253, 0.35);
    color: #e2e8f0;
    transition: all 0.15s ease;
}
.deck-btn:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.25);
    border-color: var(--gold);
    color: #fff;
}
.deck-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--blue-primary);
    color: #fff;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition-fast);
}
.download-btn:hover { background: var(--gold-deep); }
.deck-fullscreen:fullscreen { background: #0f172a; padding: 0; }
.deck-fullscreen:fullscreen .deck-frame { border-radius: 0; border: none; }
.deck-fullscreen:fullscreen .deck-toolbar { border-radius: 0; }
.deck-fullscreen:fullscreen .thumb-strip { background: #0f172a; }

/* Main areas */
.site-main-header {
    padding: 1.5rem 1.5rem 1.25rem;
    border-bottom: 1px solid var(--magenta-border);
    background: linear-gradient(180deg, var(--magenta-wash) 0%, transparent 72%);
}
.site-main-body { padding: 1.5rem 1.5rem 2rem; }

/* Article rhythm — generous spacing between headings, subheadings, and paragraphs */
.note-page .site-main-body section,
.note-page .site-main-body section.mb-8 {
    margin-bottom: 3rem;
}
.note-page .site-main-body section:last-child {
    margin-bottom: 0;
}

.note-page .site-main-header .page-title {
    margin-bottom: 0.75rem;
}
.note-page .site-main-header .lede {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.note-page .site-main-header .hub-confessional {
    margin-top: 1.25rem;
}

.note-page .site-main-body .section-title,
.note-page .site-main-body section > h2 {
    font-weight: 700 !important;
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.note-page .site-main-body section h3 {
    font-weight: 700 !important;
    font-size: 1rem;
    margin-top: 1.75rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}
.note-page .site-main-body section > h3:first-child {
    margin-top: 0;
}

.note-page .site-main-body h4,
.note-page .site-main-body .fact-callout-title {
    font-weight: 700 !important;
}

.note-page .site-main-body p {
    margin-top: 0;
    margin-bottom: 0;
}
.note-page .site-main-body p + p,
.note-page .site-main-body section p + p,
.note-page .site-main-body article p + p {
    margin-top: 1.375rem;
}
.note-page .site-main-body p.text-body.mt-3,
.note-page .site-main-body p.text-body.mt-4,
.note-page .site-main-body p.mt-3,
.note-page .site-main-body p.mt-4 {
    margin-top: 1.375rem !important;
}

.note-page .site-main-body .section-title + p,
.note-page .site-main-body h2 + p,
.note-page .site-main-body h3 + p {
    margin-top: 0;
}

.note-page .site-main-body p + blockquote,
.note-page .site-main-body p + .pull-quote,
.note-page .site-main-body blockquote + p,
.note-page .site-main-body .pull-quote + p {
    margin-top: 1.5rem;
}
.note-page .site-main-body .pull-quote,
.note-page .site-main-body blockquote.pull-quote {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.note-page .site-main-body p + figure,
.note-page .site-main-body p + .ornate-card,
.note-page .site-main-body figure + p,
.note-page .site-main-body .ornate-card + p,
.note-page .site-main-body .fact-strip + figure,
.note-page .site-main-body figure + section {
    margin-top: 1.5rem;
}

.note-page .site-main-body .fact-strip {
    margin-bottom: 2rem;
}
.note-page .site-main-body figure.ornate-card,
.note-page .site-main-body figure.illus-card {
    margin-bottom: 2rem;
}

/* Hero crops tuned to keep a subject's face in frame */
figure.hero-figure-face img {
    object-position: center 22%;
}

figure.hero-figure-face.hero-figure-face-left img {
    object-position: 30% 20%;
}

figure.hero-figure-face.hero-figure-face-left-far img {
    object-position: 20% 22%;
}

figure.hero-figure-full img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center center;
}

.note-page .site-main-body article.space-y-10 > * + * {
    margin-top: 2.5rem;
}
.note-page .site-main-body article.space-y-6 > * + * {
    margin-top: 1.75rem;
}
.note-page .site-main-body article.space-y-4 > * + * {
    margin-top: 1.375rem;
}
.site-main-footer {
    border-top: 1px solid var(--magenta-border);
    padding: 0.65rem 1.5rem;
    background: linear-gradient(180deg, var(--bg-mute) 0%, var(--magenta-light) 100%);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Hub tabs */
.hub-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}
.hub-tab {
    font-size: 0.875rem;
    padding: 0.4rem 0.85rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
    font-weight: 500;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.hub-tab:hover { color: var(--text-head); }
.hub-tab.active {
    color: var(--gold-dark);
    border-bottom-color: var(--gold);
    font-weight: 600;
    background: linear-gradient(to top, var(--magenta-wash), transparent);
}

.hub-panel { display: none; }
.hub-panel.active { display: block; }

/* Tables */
.notes-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.notes-table th {
    text-align: left;
    font-size: 0.75rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-mute);
    font-weight: 700;
}
.notes-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--blue-pale);
    vertical-align: top;
}
.notes-table tr:hover td { background: linear-gradient(90deg, var(--magenta-wash) 0%, var(--gold-wash) 100%); }
.notes-table .read-link { color: var(--gold-deep); font-size: 0.875rem; white-space: nowrap; text-decoration: none; font-weight: 600; }
.notes-table .read-link:hover { color: var(--text-head); text-decoration: underline; }

/* Buttons and links */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: var(--blue-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--blue-primary);
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.btn-primary:hover { background: var(--gold-deep); border-color: var(--gold-deep); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    color: var(--text-head);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.btn-secondary:hover { background: var(--gold-light); border-color: var(--gold); }

.content-link {
    color: var(--text-head);
    text-decoration: none;
    border-bottom: 1px dotted var(--border-color);
    transition: color var(--transition-fast), border-bottom-style var(--transition-fast);
}
.content-link:hover {
    color: var(--gold-deep);
    border-bottom-style: solid;
    border-bottom-color: var(--magenta-soft);
}

/* Cards */
.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}
.module-card:hover {
    border-color: var(--gold);
    box-shadow: 0 6px 16px -4px var(--shadow-color), 0 0 0 1px var(--magenta-glow);
    transform: translateY(-2px);
}
.module-card.active {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-wash);
}
/* Fixed-ratio thumb frame so portrait/landscape assets fill evenly */
.module-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-mute);
    overflow: hidden;
    flex: 0 0 auto;
    /* Intrinsic image size must not drive flex item height */
    min-height: 0;
}
.module-card-tags {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    display: flex;
    gap: 0.125rem;
    z-index: 1;
}
.module-card .thumb {
    /* Pull out of flow so portrait JPGs cannot stretch the frame */
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}
/* SVG thumbs: cover the frame instead of letterboxing to intrinsic size */
.module-card .thumb[src$=".svg"],
.module-card .thumb[src*=".svg?"] {
    object-fit: cover;
    background: var(--bg-mute);
}
.module-card:hover .thumb {
    transform: scale(1.04);
}
.module-card .card-body {
    padding: 0.55rem 0.65rem 0.6rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.module-card .card-title {
    font-size: 0.9375rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 2.5em; /* two lines → even card rows */
}
.module-card .card-blurb {
    font-size: 0.875rem;
    line-height: 1.35;
    margin-top: 0.25rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 2.7em;
}
.module-card .card-foot {
    margin-top: auto;
    padding-top: 0.3rem;
    font-size: 0.75rem;
}

.tag {
    font-size: 0.75rem !important;
    letter-spacing: 0.03em;
    padding: 2px 9px;
    border-radius: 9999px;
    background: var(--blue-mist);
    color: var(--blue-bright);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}
.tag:hover {
    background: var(--gold-pale);
    border-color: var(--gold);
    color: var(--gold-dark);
}

.fact-box {
    background: linear-gradient(135deg, var(--blue-mist) 0%, var(--magenta-light) 100%);
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    min-width: 0;
    align-self: start;
}
.fact-box:hover {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--magenta-pale) 100%);
    border-color: var(--magenta-border);
    box-shadow: inset 0 0 0 1px var(--magenta-wash);
}

/* Discretionary hover links for people & places in fact-boxes and info-cards */
.fact-box .hover-entity-link,
.info-card .hover-entity-link {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
    border-bottom: 1px dotted transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    cursor: pointer;
}
.fact-box:hover .hover-entity-link,
.info-card:hover .hover-entity-link,
.fact-box .hover-entity-link:hover,
.info-card .hover-entity-link:hover,
.fact-box .hover-entity-link:focus-visible,
.info-card .hover-entity-link:focus-visible {
    color: var(--gold-dark);
    border-bottom-color: var(--gold);
    outline: none;
}
.fact-box.has-entity-link:hover .hover-entity-link::after,
.info-card.has-entity-link:hover .hover-entity-link::after {
    content: ' \2197';
    font-size: 0.72em;
    opacity: 0.85;
}

.fact-box.compact {
    padding: 0.65rem 0.85rem;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.fact-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: stretch;
}
@media (min-width: 720px) {
    .fact-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
.fact-strip > * { min-width: 0; }
.fact-strip .fact-box {
    height: 100%;
}

/* Info-card grids used in place of crude SVG maps on several NT pages */
.info-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: stretch;
}
.info-card-grid .info-card {
    align-self: stretch;
    height: 100%;
}
.info-card-grid.info-card-grid--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 768px) {
    .info-card-grid.info-card-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.65rem 0.75rem;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.05);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    display: grid;
    grid-template-columns: 1.65rem 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 0.65rem;
    row-gap: 0.12rem;
    align-items: start;
}
.info-card:hover {
    border-color: var(--magenta-border);
    box-shadow: 0 6px 16px rgba(30, 58, 95, 0.08), 0 0 0 1px var(--magenta-wash);
}
.info-card .info-card-icon {
    width: 1.65rem;
    height: 1.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--gold-pale) 0%, var(--magenta-pale) 100%);
    color: var(--gold-dark);
    font-size: 0.75rem;
    margin-bottom: 0;
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: start;
}
.info-card .info-card-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-head);
    margin-bottom: 0;
    grid-column: 2;
    grid-row: 1;
}
.info-card .info-card-body {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--muted);
    grid-column: 2;
    grid-row: 2;
}
.info-card .info-card-note {
    font-size: 0.7rem;
    color: var(--subtle);
    margin-top: 0;
    font-style: italic;
    grid-column: 2;
    grid-row: 3;
}

/* Compact summary grids inside article sections */
.site-main-body .grid[class*="grid-cols"] {
    align-items: start;
    gap: 0.5rem;
}
.site-main-body .grid[class*="grid-cols"] > .ornate-card,
.site-main-body .grid[class*="grid-cols"] > .fact-box,
.site-main-body .grid[class*="grid-cols"] > figure.illus-card {
    align-self: start;
}
.note-page .site-main-body .grid[class*="grid-cols"] > figure.illus-card {
    margin-bottom: 0;
}
.site-main-body .grid[class*="grid-cols"] > .text-body {
    align-self: start;
}
.site-main-body .grid[class*="grid-cols"] > p.text-body.drop-cap {
    align-self: start;
    margin-top: 0;
}
.site-main-body .grid[class*="grid-cols"] > .ornate-card.p-4,
.site-main-body .grid[class*="grid-cols"] > .ornate-card.p-5 {
    padding: 0.65rem 0.75rem;
}
.site-main-body .grid[class*="grid-cols"] > .ornate-card .ui-head.text-sm,
.site-main-body .grid[class*="grid-cols"] > .ornate-card .font-semibold.text-sm {
    font-size: 0.8125rem;
}
.site-main-body .grid[class*="grid-cols"] > .ornate-card .text-xs {
    font-size: 0.7rem;
    line-height: 1.4;
    margin-top: 0.25rem;
}

.ornate-card:has(.info-card-grid) {
    padding: 1rem !important;
}
.ornate-card:has(.info-card-grid) .text-xs.font-semibold.ui-gold {
    margin-bottom: 0.5rem !important;
}
.ornate-card:has(.info-card-grid) .text-\[11px\].ui-subtle {
    margin-top: 0.5rem !important;
}
.info-card-grid--dense {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 0.5rem;
    align-items: start;
}
.info-card--dense {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.65rem 0.75rem;
}
.info-card--dense .info-card-icon {
    width: 1.65rem;
    height: 1.65rem;
    font-size: 0.75rem;
    margin-bottom: 0;
    flex-shrink: 0;
}
.info-card--dense .info-card-title {
    font-size: 0.875rem;
    margin-bottom: 0.15rem;
}
.info-card--dense .info-card-body {
    font-size: 0.75rem;
    line-height: 1.4;
}

.ornate-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 14px var(--shadow-color);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    min-width: 0;
}
.ornate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--magenta-soft) 22%, var(--gold) 50%, var(--magenta-soft) 78%, transparent);
    opacity: 0.5;
    pointer-events: none;
}
.ornate-card:hover {
    border-color: var(--magenta-border);
    box-shadow: 0 6px 18px rgba(30, 58, 95, 0.1), 0 0 0 1px var(--magenta-wash);
}

/* Detail pane */
.detail-pane {
    background: var(--bg-card);
    border: 1px solid var(--gold-light);
    box-shadow: 0 4px 14px var(--shadow-color);
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-lg);
}

/* Masoretes / mini-timeline cards */
.masoretes-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.masoretes-card:hover { border-color: var(--gold); }

.mini-timeline .event {
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1.3;
    background: var(--bg-card);
}
.mini-timeline .event .event-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.25;
}
.mini-timeline .event:hover { background: var(--gold-pale); border-color: var(--gold); }
.mini-timeline .event.active { background: var(--gold-light); border-color: var(--gold); }

/* Hub grid scrollbar */
.hub-grid {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-mute);
}

/* Nav scrolled (reserved for future sticky nav) */
.nav-scrolled {
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 var(--blue-pale);
}

/* Copyable Hebrew */
.copyable {
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    border: 1px solid transparent;
}
.copyable:hover { background: var(--gold-pale); border-color: var(--gold); }

/* Scholarly text */
.scholarly { font-size: 1rem; line-height: 1.7; }

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--gold);
    background: var(--blue-mist);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
}

/* Subtle divider */
.subtle-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), var(--blue-border), var(--gold), transparent);
}

/* Section headers */
.section-header {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    color: var(--text-head);
    position: relative;
    display: inline-block;
    font-weight: 700;
}
.section-header::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold-pale), var(--gold), var(--blue-border), transparent);
}

/* Heading serif (hub headings) */
.heading-serif {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    color: var(--text-head);
    font-weight: 700;
}

/* Bibliography entry */
.sources-jump ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sources-footer-links a {
    white-space: nowrap;
}

.bib-entry {
    border-left: 3px solid var(--gold);
    padding-left: 1rem;
    margin-bottom: 0.75rem;
    transition: background var(--transition-fast);
}
.bib-entry:hover {
    background: linear-gradient(90deg, var(--magenta-wash) 0%, var(--gold-wash) 100%);
}

/* Drop cap */
.drop-cap::first-letter {
    float: left;
    font-size: 3.5rem;
    line-height: 0.75;
    margin: 0.1em 0.15em 0 0;
    color: var(--text-head);
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-weight: 700;
}

/* Region cards used on diaspora hub and related pages */
.region-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}
.region-card:hover {
    border-color: var(--gold);
    box-shadow: 0 8px 20px rgba(30, 58, 95, 0.14);
}

/* Related Notes: even modular card grid */
.related-notes-section {
    margin-bottom: 2rem;
}
.related-notes-section > .section-title,
.related-notes-section > .section-title-lg {
    margin-bottom: 0.85rem;
}
.related-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.75rem, 1fr));
    gap: 0.55rem;
    align-items: stretch;
}
.related-notes-grid--roomy {
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.65rem;
}
.related-note-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.75rem 0.85rem;
    min-height: 4.5rem;
    height: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    box-sizing: border-box;
}
.related-note-card:hover {
    background: var(--gold-pale);
    border-color: var(--gold);
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.1);
    transform: translateY(-1px);
}
.related-note-card:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
.related-note-card > i,
.related-note-card-icon {
    flex-shrink: 0;
    width: 1.55rem;
    height: 1.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: var(--gold-pale);
    color: var(--gold-deep);
    font-size: 0.65rem;
}
.related-note-card:hover > i,
.related-note-card:hover .related-note-card-icon {
    background: var(--bg-card);
}
.related-note-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-head);
    display: block;
}
.related-note-card-desc {
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--muted);
    display: block;
    margin: 0;
}
.related-notes-kicker {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin: 0 0 0.65rem;
}
/* When Related Notes sit inside an ornate shell, keep padding even */
.ornate-card.related-notes-shell {
    padding: 1.5rem 1.5rem 1.35rem;
}
.ornate-card.related-notes-shell > .section-title-lg,
.ornate-card.related-notes-shell > .section-title {
    margin-bottom: 0.85rem;
}
@media (min-width: 640px) {
    .related-notes-grid {
        grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
    }
    .related-notes-grid--roomy {
        grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    }
}
@media (max-width: 480px) {
    .related-notes-grid,
    .related-notes-grid--roomy {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }
    .related-note-card {
        min-height: 4rem;
        padding: 0.65rem 0.7rem;
    }
}

/* Featured image + caption (used on survival pages) */
.featured-img {
    border: 3px solid var(--border-color);
    box-shadow: 4px 6px 12px rgba(30, 58, 95, 0.15);
}
.featured-img + .figure-caption,
.featured-img .figure-caption {
    font-style: italic;
    color: var(--text-head);
    font-size: 0.875rem;
    text-align: center;
    margin-top: 6px;
}

/* Illustrated card + caption (Golden Age Spain) */
.illus-card {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 4px 14px var(--shadow-color);
}
.illus-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.illus-caption {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0.6rem 0.85rem;
    border-top: 1px solid var(--blue-pale);
    background: var(--bg-mute);
}

/* Timeline item (Golden Age Spain) */
.timeline-item {
    border-left: 2px solid var(--gold);
    padding-left: 1rem;
    margin-bottom: 0.85rem;
}
.site-main-body .grid .timeline-item {
    margin-bottom: 0.5rem;
}

/* Niqqud table (Nakdanim page) */
.niqqud-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.niqqud-table th {
    text-align: left;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-mute);
}
.niqqud-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--blue-pale);
    vertical-align: middle;
}
.niqqud-table tr:hover td { background: var(--blue-mist); }

/* Page body defaults — Lora everywhere, consistent size */
.note-page,
.hub-page {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.7;
}

.note-page {
    background-image:
        radial-gradient(ellipse 90% 55% at 100% 0%, var(--magenta-wash), transparent 58%),
        radial-gradient(ellipse 70% 45% at 0% 100%, var(--magenta-wash), transparent 52%),
        linear-gradient(rgba(2, 132, 199, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(2, 132, 199, 0.03) 1px, transparent 1px);
    background-size: auto, auto, 18px 18px, 18px 18px;
}

.hub-page {
    background-image:
        radial-gradient(ellipse 85% 50% at 100% 0%, var(--magenta-wash), transparent 55%),
        radial-gradient(ellipse 65% 40% at 0% 100%, var(--magenta-wash), transparent 50%),
        linear-gradient(rgba(2, 132, 199, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(2, 132, 199, 0.025) 1px, transparent 1px);
    background-size: auto, auto, 20px 20px, 20px 20px;
}

/* Hub hero: balanced two-column top + full-width lower band */
.hub-page .site-main-header {
    padding: 1.15rem 1.5rem 0.85rem;
}

/* Pull Explore Modules up: tighter hero chrome, larger module stage */
.hub-page .site-main-body {
    padding: 0.85rem 1.5rem 2rem;
}

.hub-page .hub-tabs {
    margin-bottom: 0.9rem;
    padding: 0.15rem 0 0;
    gap: 0.35rem;
    border-bottom-width: 1px;
}

.hub-page .hub-tab {
    font-size: 0.9375rem;
    padding: 0.55rem 1.05rem;
    letter-spacing: 0.02em;
}

.hub-page .hub-tab.active {
    font-weight: 700;
}

.hub-page .explore-modules-heading {
    margin-bottom: 0.55rem;
}

.hub-page #modules-grid.hub-grid {
    max-height: none;
    overflow: visible;
}

.hub-page #detail-pane.detail-pane {
    max-height: min(420px, 55vh);
    min-height: 220px;
}

/* Compact the band above Explore so modules sit higher in the viewport */
.hub-page .site-main-header .hub-hero-lower {
    gap: 0.65rem;
    padding-top: 0.15rem;
}

.hub-page .site-main-header .hub-hero-actions-foot {
    margin-top: 0.35rem;
    font-size: 0.6875rem;
}

.hub-page .hub-journal-banner {
    padding: 0.6rem 0.95rem;
    gap: 0.55rem 1rem;
}

.hub-page .hub-journal-banner-desc {
    display: none;
}

.hub-page .hub-journal-banner-title {
    font-size: 0.9rem;
}

.hub-page .hub-journal-banner-cta {
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
}

.hub-page .site-main-header .hub-hero-quicklinks-label {
    margin-bottom: 0.35rem;
}

.hub-page .site-main-header .hub-hero-quicklinks-grid {
    gap: 0.4rem;
}

.hub-page .site-main-header .hub-quicklink {
    min-height: 0;
    padding: 0.45rem 0.55rem;
    align-items: center;
}

.hub-page .site-main-header .hub-quicklink-desc {
    display: none;
}

.hub-page .site-main-header .hub-quicklink > i {
    margin-top: 0;
}


.hub-page .site-main-header .hub-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem 2.25rem;
    width: 100%;
    max-width: none;
    align-items: start;
}

.hub-page .site-main-header .hub-hero-title {
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.hub-page .site-main-header .hero-intro {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--muted);
    margin-top: 0;
    margin-bottom: 0.45rem;
    max-width: 40rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Our conviction — click popup (not hover) */
.site-main-header .hub-confessional {
    width: 100%;
    max-width: 40rem;
    margin-top: 0.65rem;
}

.site-main-header .hub-confessional-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    font-family: inherit;
    color: var(--text-head);
    background: var(--gold-pale);
    border: 1px solid var(--gold);
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    user-select: none;
}

.site-main-header .hub-confessional-tab:hover,
.site-main-header .hub-confessional-tab:focus-visible {
    background: var(--gold-light);
    border-color: var(--gold-deep);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.1);
}

.site-main-header .hub-confessional-tab:active {
    transform: translateY(1px);
}

.site-main-header .hub-confessional-tab i:first-child {
    color: var(--gold-deep);
    font-size: 0.625rem;
}

.hub-confessional-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.hub-confessional-modal[hidden] {
    display: none !important;
}

.hub-confessional-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
    border: 0;
    cursor: pointer;
}

.hub-confessional-dialog {
    position: relative;
    z-index: 1;
    width: min(32rem, 100%);
    max-height: min(80vh, 28rem);
    overflow: auto;
    padding: 0;
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg, 0.85rem);
    background: var(--bg-card, #fff);
    background-image: linear-gradient(180deg, var(--gold-pale) 0%, var(--bg-card, #fff) 42%);
    box-shadow: 0 18px 48px rgba(30, 58, 95, 0.22), 0 0 0 1px var(--magenta-glow, rgba(196,113,154,0.11));
    animation: hubConfessionalIn 0.2s ease;
}

@keyframes hubConfessionalIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.hub-confessional-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem 0.65rem;
    border-bottom: 1px solid var(--gold);
}

.hub-confessional-dialog-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-head);
    letter-spacing: 0.02em;
}

.hub-confessional-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-card, #fff);
    color: var(--text-head);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.hub-confessional-close:hover {
    background: var(--gold-pale);
    border-color: var(--gold);
}

.hub-confessional-close-label { line-height: 1; }

.hub-confessional-dialog-body {
    padding: 1rem 1.15rem 1.25rem;
}

.hub-confessional-dialog-body p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-head);
}

body.hub-confessional-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .hub-confessional-dialog { animation: none; }
}

.hub-page .site-main-header .hub-hero-download {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
}

.hub-page .site-main-header .hub-hero-eyebrow-wrap {
    margin-bottom: 0.4rem;
}

.hub-page .site-main-header .hub-hero-eyebrow {
    margin-bottom: 0;
}

.hub-page .site-main-header .hub-hero-actions {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--blue-pale);
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 0 0 auto;
}

.hub-page .site-main-header .hub-hero-actions-lead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
    margin: 0;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.hub-page .site-main-header .hub-hero-actions-link {
    color: var(--text-head);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.hub-page .site-main-header .hub-hero-actions-link:hover {
    color: var(--gold-deep);
    text-decoration: underline;
}

.hub-page .site-main-header .hub-hero-actions-dot {
    color: var(--gold);
    opacity: 0.85;
}

.hub-page .site-main-header .hub-hero-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.hub-page .site-main-header .hub-hero-actions-buttons .btn-secondary,
.hub-page .site-main-header .hub-hero-actions-buttons .btn-primary {
    font-size: 0.8125rem;
}

.hub-page .site-main-header .hub-hero-actions-foot {
    margin: 0.85rem 0 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--muted);
    text-align: center;
}

/* Full-width band under text + figure */
.hub-page .site-main-header .hub-hero-lower {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-width: 0;
}

.hub-page .site-main-header .hub-hero-quicklinks {
    margin-top: 0;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hub-page .site-main-header .hub-hero-quicklinks-daily {
    font-weight: 400;
    opacity: 0.72;
    font-size: 0.85em;
    letter-spacing: 0.02em;
}
.hub-page .site-main-header .hub-hero-quicklinks-label {
    margin: 0 0 0.55rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.hub-page .site-main-header .hub-hero-quicklinks-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    flex: 0 0 auto;
    align-content: start;
}

.hub-page .site-main-header .hub-quicklink {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.55rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 3.4rem;
}

.hub-page .site-main-header .hub-quicklink:hover {
    background: var(--gold-pale);
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.08);
}

.hub-page .site-main-header .hub-quicklink > i {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: var(--gold-pale);
    color: var(--gold-deep);
    font-size: 0.5625rem;
    margin-top: 0.1rem;
}

.hub-page .site-main-header .hub-quicklink-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.hub-page .site-main-header .hub-quicklink-title {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-head);
}

.hub-page .site-main-header .hub-quicklink-desc {
    font-size: 0.625rem;
    line-height: 1.35;
    color: var(--muted);
}

.hub-page .site-main-header .hub-hero-text-col {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.hub-page .site-main-header .hub-hero-copy {
    margin-top: 0.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.hub-page .site-main-header .hub-hero-figure-col {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
}

.hub-hero-figure {
    margin: 0;
    width: 100%;
    max-width: 22rem;
}

.hub-hero-figure picture {
    display: block;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 28px rgba(30, 58, 95, 0.14);
    background: var(--bg-card);
}

.hub-hero-figure img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    min-height: 12rem;
    max-height: 18rem;
    object-fit: cover;
    object-position: 24% 40%;
}

.hub-hero-figure-caption {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-deep);
    font-weight: 600;
}

/* Tablet+: text left, art right — graphic TOP flush with History badge */
@media (min-width: 900px) {
    .hub-page .site-main-header .hub-hero-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(15rem, 0.95fr);
        column-gap: 1.1rem;
        row-gap: 1.75rem;
        align-items: start;
    }

    .hub-page .site-main-header .hub-hero-text-col {
        grid-column: 1;
        grid-row: 1;
        padding-top: 0;
        margin-top: 0;
    }

    .hub-page .site-main-header .hub-hero-eyebrow-wrap {
        margin-top: 0;
        padding-top: 0;
    }

    .hub-page .site-main-header .hub-hero-figure-col {
        grid-column: 2;
        grid-row: 1;
        /* Top-align with the History of Bible Transmission badge */
        align-self: start;
        position: relative;
        min-height: 0;
        height: auto;
        margin-top: 0;
        padding-top: 0;
        display: block;
    }

    .hub-page .site-main-header .hub-hero-lower {
        grid-column: 1 / -1;
        grid-row: 2;
        padding-top: 0.35rem;
        border-top: 1px solid var(--blue-pale);
    }

    /* Fill from badge top → bottom of action tiles (height set in JS) */
    .hub-hero-figure {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
        display: block;
    }

    .hub-hero-figure picture {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 0;
        border-radius: 0.75rem;
    }

    .hub-hero-figure img {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: none;
        aspect-ratio: auto;
        object-fit: cover;
        /* Level the painted top edge with the History badge */
        object-position: 28% 0%;
    }

    /* Caption overlays the frame so the graphic bottom stays flush with actions */
    .hub-hero-figure-caption {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0.55rem;
        margin: 0;
        z-index: 1;
        color: #fff;
        text-shadow: 0 1px 2px rgba(15, 23, 42, 0.75), 0 0 10px rgba(15, 23, 42, 0.45);
        pointer-events: none;
    }

    .hub-page .site-main-header .hub-hero-quicklinks-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.4rem;
    }

    /* Keep popular entry points compact so Explore Modules sits higher */
    .hub-page .site-main-header .hub-quicklink {
        min-height: 0;
        padding: 0.45rem 0.6rem;
        align-items: center;
    }

    .hub-page .site-main-header .hub-quicklink-title {
        font-size: 0.75rem;
    }

    .hub-page .site-main-header .hub-quicklink-desc {
        display: none;
    }

    .hub-page .site-main-header .hub-hero-actions-foot {
        text-align: left;
    }
}

/* Wide main area: keep art subordinate to text column height */
@media (min-width: 1200px) {
    .hub-page .site-main-header .hub-hero-grid {
        grid-template-columns: minmax(0, 1.1fr) minmax(16rem, 0.9fr);
        column-gap: 1.25rem;
    }

    /* 8 popular entry points → two even rows of four */
    .hub-page .site-main-header .hub-hero-quicklinks-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Mid desktop: still prefer 4 columns for an 8-tile set */
@media (min-width: 900px) and (max-width: 1199.98px) {
    .hub-page .site-main-header .hub-hero-quicklinks-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 768px) and (max-width: 899.98px) {
    .hub-page .site-main-header .hub-hero-quicklinks-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hub-hero-figure {
        max-width: none;
        margin-inline: 0;
        width: 100%;
    }
}

/* Hebrew text */
.hebrew {
    font-family: 'Noto Sans Hebrew', 'Times New Roman', serif;
    direction: rtl;
}

/* Back-to-top button */
.back-to-top {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blue-primary);
    color: #fff;
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--transition-smooth), transform var(--transition-smooth), background var(--transition-fast);
    z-index: 50;
    pointer-events: none;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.back-to-top:hover { background: var(--gold-deep); }

/* Mobile sidebar */
.sidebar-toggle, .sidebar-overlay { display: none; }

@media (max-width: 1024px) {
    .site-layout { grid-template-columns: 1fr; }
    .site-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform var(--transition-smooth);
        box-shadow: 4px 0 24px rgba(30, 58, 95, 0.14);
        width: var(--sidebar-width);
    }
    .site-sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 35; }
    .sidebar-toggle {
        display: flex;
        position: fixed;
        bottom: 1.1rem;
        left: 1.1rem;
        z-index: 60;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--blue-primary);
        color: #fff;
        border: 1px solid var(--gold);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(30, 58, 95, 0.2);
        transition: background var(--transition-fast);
    }
    .sidebar-toggle:hover { background: var(--gold-deep); }
    .back-to-top { bottom: 1.1rem; right: 1.1rem; }
}


/* Greek Bible / article utilities */
.nt-timeline {
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid var(--gold);
}
.nt-timeline .event {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.75rem;
}
.nt-timeline .event::before {
    content: '';
    position: absolute;
    left: -0.35rem;
    top: 0.35rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--bg-card);
}

.manuscript-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.manuscript-card:hover {
    border-color: var(--gold);
    box-shadow: 0 6px 16px -4px var(--shadow-color);
}

.stat-card {
    background: var(--bg-mute);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.75rem;
    text-align: center;
}
.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-head);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.confessional-box {
    background: var(--gold-pale);
    border: 1px solid var(--gold);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    color: var(--text-head);
    font-style: italic;
}

/* =========================================================
   Dark mode
   ========================================================= */
html[data-theme="dark"] {
    color-scheme: dark;

    --blue-primary: #93C5FD;
    --blue-bright: #38BDF8;
    --blue-soft: #7DD3FC;
    --blue-border: #1E3A5F;
    --blue-pale: #172554;
    --blue-mist: #0F172A;
    --blue-ghost: #0B1220;

    --gold: #E8C76B;
    --gold-dark: #F0D78A;
    --gold-deep: #E8C76B;
    --gold-light: rgba(212, 175, 55, 0.15);
    --gold-pale: rgba(212, 175, 55, 0.12);
    --gold-wash: rgba(212, 175, 55, 0.08);

    --magenta: #E8A8C8;
    --magenta-soft: #D487B0;
    --magenta-pale: rgba(196, 113, 154, 0.14);
    --magenta-light: rgba(196, 113, 154, 0.09);
    --magenta-border: rgba(196, 113, 154, 0.32);
    --magenta-wash: rgba(196, 113, 154, 0.07);
    --magenta-glow: rgba(196, 113, 154, 0.14);

    --ink: #E2E8F0;
    --slate: #CBD5E1;
    --muted: #94A3B8;
    --subtle: #94A3B8;
    --cloud: #64748B;

    --bg-body: #0B1220;
    --bg-card: #0F172A;
    --bg-soft: #172554;
    --bg-mute: #0F172A;
    --text-main: #E2E8F0;
    --text-head: #93C5FD;
    --text-muted: #94A3B8;
    --border-color: #1E3A5F;
    --shadow-color: rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        color-scheme: dark;

        --blue-primary: #93C5FD;
        --blue-bright: #38BDF8;
        --blue-soft: #7DD3FC;
        --blue-border: #1E3A5F;
        --blue-pale: #172554;
        --blue-mist: #0F172A;
        --blue-ghost: #0B1220;

        --gold: #E8C76B;
        --gold-dark: #F0D78A;
        --gold-deep: #E8C76B;
        --gold-light: rgba(212, 175, 55, 0.15);
        --gold-pale: rgba(212, 175, 55, 0.12);
        --gold-wash: rgba(212, 175, 55, 0.08);

        --magenta: #E8A8C8;
        --magenta-soft: #D487B0;
        --magenta-pale: rgba(196, 113, 154, 0.14);
        --magenta-light: rgba(196, 113, 154, 0.09);
        --magenta-border: rgba(196, 113, 154, 0.32);
        --magenta-wash: rgba(196, 113, 154, 0.07);
        --magenta-glow: rgba(196, 113, 154, 0.14);

        --ink: #E2E8F0;
        --slate: #CBD5E1;
        --muted: #94A3B8;
        --subtle: #94A3B8;
        --cloud: #64748B;

        --bg-body: #0B1220;
        --bg-card: #0F172A;
        --bg-soft: #172554;
        --bg-mute: #0F172A;
        --text-main: #E2E8F0;
        --text-head: #93C5FD;
        --text-muted: #94A3B8;
        --border-color: #1E3A5F;
        --shadow-color: rgba(0, 0, 0, 0.35);
    }
}

/* Explicit dark-mode tweaks for elements not yet using variables */
html[data-theme="dark"] .site-sidebar,
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .site-sidebar { border-right-color: var(--border-color); }
}

html[data-theme="dark"] img,
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) img { opacity: 0.92; }
}

/* Tailwind arbitrary-color overrides for dark mode */
html[data-theme="dark"] [class*="text-[#1E3A5F]"],
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) [class*="text-[#1E3A5F]"] { color: var(--text-head) !important; }
}

html[data-theme="dark"] [class*="text-[#334155]"],
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) [class*="text-[#334155]"] { color: var(--text-main) !important; }
}

html[data-theme="dark"] [class*="text-[#475569]"],
html[data-theme="dark"] [class*="text-[#64748B]"],
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) [class*="text-[#475569]"],
    html:not([data-theme="light"]) [class*="text-[#64748B]"] { color: var(--text-muted) !important; }
}

html[data-theme="dark"] [class*="bg-[#F0F9FF]"],
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) [class*="bg-[#F0F9FF]"] { background-color: var(--bg-soft) !important; }
}

html[data-theme="dark"] [class*="bg-[#FEF3C7]"],
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) [class*="bg-[#FEF3C7]"] { background-color: var(--gold-pale) !important; }
}

html[data-theme="dark"] [class*="border-[#BAE6FD]"],
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) [class*="border-[#BAE6FD]"] { border-color: var(--border-color) !important; }
}

html[data-theme="dark"] [class*="border-[#D4AF37]"],
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) [class*="border-[#D4AF37]"] { border-color: var(--gold) !important; }
}

html[data-theme="dark"] [class*="text-[#B8860B]"],
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) [class*="text-[#B8860B]"] { color: var(--gold-dark) !important; }
}

html[data-theme="dark"] [class*="bg-[#1E3A5F]"],
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) [class*="bg-[#1E3A5F]"] { background-color: #172554 !important; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .module-card:hover, .region-card:hover { transform: none; }
    .module-card:hover .thumb { transform: none; }
    .site-sidebar { transition: none; }
    .back-to-top { transition: none; }
}

/* =========================================================
   Scholarship map
   ========================================================= */
.map-page .site-main-body.max-w-6xl {
    max-width: 72rem;
}

.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.map-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.map-filter-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.map-filter-btn:hover,
.map-filter-btn.map-filter-active {
    border-color: var(--gold);
    background: var(--gold-wash);
    color: var(--text-head);
}

.map-toolbar-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: start;
}

.map-main-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.scholarship-map-canvas {
    min-height: 460px;
    height: min(62vh, 620px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    background: var(--blue-ghost);
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.08);
}

/* Full individual menu below the map — never clipped by map overflow */
.map-individual-card {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    box-shadow: 0 8px 22px rgba(30, 58, 95, 0.1);
}
.map-individual-card.is-open {
    display: block;
}

.map-city-panel {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: var(--bg-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: min(62vh, 620px);
}

.map-city-panel-header {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-dark);
    font-weight: 600;
}

#map-city-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    overflow-y: auto;
}

.map-index-section {
    list-style: none;
    margin: 0;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-card);
}

.map-index-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem 0.4rem;
    margin: 0.15rem 0 0.2rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-card) 70%, transparent);
}

.map-index-heading-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-dark);
}

.map-index-heading-count {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--blue-mist, rgba(2, 132, 200, 0.08));
    border-radius: 9999px;
    padding: 0.1rem 0.45rem;
    min-width: 1.4rem;
    text-align: center;
}

.map-index-section + li .map-city-item {
    margin-top: 0.1rem;
}

/* Space before the People block when it follows Cities */
.map-index-section:not(:first-child) {
    margin-top: 0.55rem;
    padding-top: 0.15rem;
}

.map-index-empty {
    list-style: none;
    padding: 1rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.map-city-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 0.75rem;
    padding: 0.55rem 0.6rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.map-city-item:hover,
.map-city-item.is-active {
    background: var(--blue-mist);
    border-color: var(--border-color);
}

.map-city-item-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    flex-shrink: 0;
}

.map-city-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.map-city-item-label {
    font-size: 0.85rem;
    color: var(--text-head);
    font-weight: 600;
}

.map-city-item-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.scholarship-map-marker-wrap {
    background: transparent;
    border: none;
}

.scholarship-map-marker-person {
    border-radius: 2px;
    transform: rotate(45deg);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25);
}
.map-city-item-dot.is-person {
    border-radius: 2px;
    transform: rotate(45deg);
}
.map-legend-swatch-person {
    border-radius: 2px;
    transform: rotate(45deg);
}
.scholarship-map-popup-place {
    font-size: 0.75rem;
    color: var(--ui-subtle, #64748b);
    margin: 0.15rem 0 0.4rem;
}
.scholarship-map-popup-place i {
    margin-right: 0.25rem;
    opacity: 0.8;
}
.scholarship-map-marker {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 9999px;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.35);
}

.scholarship-map-popup-pane .leaflet-popup-content-wrapper {
    border-radius: 0.85rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 24px rgba(30, 58, 95, 0.16);
}

/* Person popups: roomy but kept inside the map by framing + max bounds */
.scholarship-map-popup-pane--person .leaflet-popup-content-wrapper {
    max-width: min(340px, 48vw) !important;
    box-sizing: border-box;
    overflow: visible;
}
.scholarship-map-popup-pane--person .leaflet-popup-content {
    margin: 0 !important;
    width: auto !important;
    max-height: none !important;
    overflow: visible !important;
}
.scholarship-map-popup--person {
    display: flex;
    flex-direction: column;
    max-height: min(360px, 60vh);
}
.scholarship-map-popup-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}
.scholarship-map-popup-footer {
    flex: 0 0 auto;
    padding-top: 0.4rem;
}
.scholarship-map-popup-pane .leaflet-popup-content {
    margin: 0.7rem 0.8rem;
}

.scholarship-map-popup {
    font-family: Lora, Georgia, serif;
}

.scholarship-map-popup--person {
    max-width: 100%;
}

.scholarship-map-popup-eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-dark);
    margin-bottom: 0.25rem;
}

.scholarship-map-popup--person .scholarship-map-popup-eyebrow {
    font-size: 0.65rem;
    margin-bottom: 0.2rem;
}

.scholarship-map-popup-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-head);
    margin: 0 0 0.35rem;
    line-height: 1.25;
}

.scholarship-map-popup--person .scholarship-map-popup-title {
    font-size: 1rem;
    margin: 0 0 0.3rem;
    line-height: 1.25;
}

.scholarship-map-popup-blurb {
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-muted);
    margin: 0 0 0.6rem;
}

.scholarship-map-popup--person .scholarship-map-popup-blurb {
    font-size: 0.8rem;
    line-height: 1.45;
    margin: 0.3rem 0 0.5rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
}

.scholarship-map-popup-link {
    font-size: 0.75rem;
    color: var(--blue-bright);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.15rem;
}

.scholarship-map-popup--person .scholarship-map-popup-link {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.scholarship-map-popup-link:hover {
    text-decoration: underline;
}

.scholarship-map-popup--person .scholarship-map-popup-place {
    font-size: 0.78rem;
    margin: 0.15rem 0 0.25rem;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-top: 0.75rem;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.map-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 9999px;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(30, 58, 95, 0.2);
}

.map-context-link {
    border-left: 4px solid var(--gold);
}

.map-load-error {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-city-panel {
        max-height: 240px;
    }

    .scholarship-map-canvas {
        min-height: 360px;
        height: 50vh;
    }
}



/* =========================================================
   Journal (WordPress) entry points
   ========================================================= */
.sidebar-link.journal-nav-link {
    /* plain menu entry — matches other sidebar links */
    font-weight: 400;
    margin-top: 0;
    box-shadow: none;
    background: transparent;
    border: 1px solid transparent;
}
.sidebar-link.journal-nav-link:hover {
    background: var(--gold-wash);
    border-color: transparent;
    color: var(--gold-deep);
}
.sidebar-link.journal-nav-link i {
    color: inherit;
    opacity: 0.75;
}
.sidebar-link.journal-nav-link.active,
a.sidebar-link.journal-nav-link[aria-current="page"] {
    background: var(--gold-light);
    color: var(--gold-dark);
    border-color: var(--gold);
    font-weight: 600;
}

.journal-footer-link {
    color: var(--gold-deep) !important;
    font-weight: 600;
    border-bottom-color: var(--gold) !important;
}
.journal-footer-link:hover {
    color: var(--text-head) !important;
}

.hub-journal-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1.5rem;
    margin: 0;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gold);
    background:
        linear-gradient(135deg, var(--gold-wash) 0%, transparent 45%),
        linear-gradient(225deg, var(--magenta-wash) 0%, var(--blue-mist) 70%);
    box-shadow: 0 2px 10px var(--shadow-color);
}
.hub-journal-banner-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: min(100%, 16rem);
}
.hub-journal-banner-kicker {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--gold-deep);
}
.hub-journal-banner-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-head);
    line-height: 1.3;
}
.hub-journal-banner-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 36rem;
}
.hub-journal-banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.05rem;
    border-radius: 999px;
    background: var(--blue-primary);
    color: #fff !important;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none !important;
    border: 1px solid var(--blue-primary);
    white-space: nowrap;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.hub-journal-banner-cta:hover {
    background: var(--gold-deep);
    border-color: var(--gold-deep);
    transform: translateY(-1px);
}
.hub-journal-banner-cta i {
    color: var(--gold-pale);
}

.hub-page .site-main-header .hub-quicklink.hub-quicklink-journal {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--gold-pale) 0%, var(--bg-card) 55%);
}
.hub-page .site-main-header .hub-quicklink.hub-quicklink-journal > i {
    color: var(--gold-deep);
    background: var(--gold-wash);
}
.btn-primary.journal-cta {
    background: linear-gradient(135deg, var(--blue-primary) 0%, #2a5080 100%);
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold-wash), 0 2px 8px var(--shadow-color);
}
.btn-primary.journal-cta:hover {
    background: var(--gold-deep);
    border-color: var(--gold-deep);
}

/* =========================================================
   Print styles
   ========================================================= */
@media print {
    .site-sidebar, .sidebar-toggle, .back-to-top, .hub-tabs, .theme-toggle, .skip-link { display: none !important; }
    .site-layout { grid-template-columns: 1fr; }
    body { background: #fff !important; color: #000 !important; }
    a { text-decoration: underline; color: #000 !important; }
    .detail-pane, .module-card, .ornate-card, .fact-box, .region-card { box-shadow: none !important; border: 1px solid #ccc !important; }
    img { opacity: 1 !important; }
}

.scholarship-map-popup-travels {
    margin: 0.35rem 0 0.45rem;
    padding: 0.45rem 0.55rem;
    background: rgba(124, 58, 237, 0.06);
    border-radius: 0.5rem;
    font-size: 0.75rem;
}
.scholarship-map-popup-travels-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7C3AED;
    margin-bottom: 0.2rem;
    font-size: 0.62rem;
}
.scholarship-map-popup-path {
    line-height: 1.4;
    color: var(--text-muted);
    max-height: 4.5rem;
    overflow-y: auto;
    word-break: break-word;
}
.scholarship-map-popup-path-count {
    opacity: 0.75;
    white-space: nowrap;
}
.scholarship-map-popup-path-sep {
    color: #7C3AED;
    opacity: 0.75;
    padding: 0 0.12rem;
    white-space: nowrap;
}
.scholarship-map-popup-travels ol {
    margin: 0;
    padding-left: 1.1rem;
}
.scholarship-map-popup-travels li {
    margin: 0.1rem 0;
}
.scholarship-map-popup-travel-years {
    opacity: 0.75;
}


/* Full Preservation Timeline: keep the whole graphic inside the module / detail pane */
.detail-pane .timeline-detail-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
.detail-pane .timeline-detail-graphic,
.detail-pane .detail-timeline-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: min(260px, 40vh);
    object-fit: contain;
    object-position: center;
    background: var(--bg-mute);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-sizing: border-box;
}
.detail-pane .detail-timeline-picture {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
/* Card thumb: 16:9 frame already; cover the illustrated scene without overflow */
.module-card[data-id="timeline"] .module-card-thumb {
    aspect-ratio: 16 / 9;
}
.module-card[data-id="timeline"] .thumb {
    object-fit: cover;
    object-position: center center;
}

.detail-pane .timeline-detail-links a.content-link {
    font-weight: 600;
}
.detail-pane .timeline-detail-links > div {
    line-height: 1.45;
}


/* Note-page figures: properly proportioned 16:9 illustrations */
.note-page figure.ornate-card .article-figure-picture,
.note-page figure.ornate-card picture.article-figure-picture {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-mute);
    overflow: hidden;
}
.note-page figure.ornate-card .article-figure-img,
.note-page figure.ornate-card img.article-figure-img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center center;
    max-height: none;
}
/* Fallback for plain figure imgs marked 16:9 */
.note-page figure.ornate-card img.w-full.article-figure-img {
    max-height: none;
}
.module-card[data-id="bible-atlantic-colonies"] .thumb,
.module-card[data-id="hampton-court-av"] .thumb {
    object-fit: cover;
    object-position: center center;
}
.detail-pane img.detail-atlantic-img,
.detail-pane img.detail-hampton-img {
    object-fit: cover !important;
    object-position: center center !important;
    max-height: min(280px, 40vh) !important;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-mute);
}

.module-card[data-id="hampton-court-av"] .thumb {
    object-fit: contain;
    object-position: center center;
    background: var(--bg-mute);
}

/* On-page contents index (Hampton Court and similar notes) */
.article-contents-index {
    background: linear-gradient(180deg, var(--gold-wash) 0%, var(--bg-card) 55%);
}
.article-contents-list {
    margin: 0;
    padding-left: 1.15rem;
}
.article-contents-list li {
    margin: 0.15rem 0;
}
.article-contents-list a.content-link {
    font-weight: 600;
}

/* Modular "On this page" panel (Hampton Court and reusable) */
.on-page-panel {
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg, 0.75rem);
    background:
        linear-gradient(135deg, var(--gold-wash) 0%, transparent 42%),
        var(--bg-card);
    box-shadow: 0 2px 12px var(--shadow-color);
    padding: 1rem 1.1rem 1.15rem;
}
.on-page-panel-kicker {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin-bottom: 0.75rem;
}
.on-page-panel-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}
@media (min-width: 768px) {
    .on-page-panel-grid {
        grid-template-columns: 1.15fr 1fr;
        gap: 1rem;
        align-items: start;
    }
}
.on-page-module {
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
    background: var(--bg-card);
    padding: 0.85rem 0.95rem 1rem;
    box-shadow: 0 1px 4px rgba(30, 58, 95, 0.06);
}
.on-page-module-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--blue-pale);
}
.on-page-module-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: var(--gold-pale);
    color: var(--gold-deep);
    font-size: 0.7rem;
    flex-shrink: 0;
}
.on-page-module-title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-head);
}
.on-page-toc {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-head);
}
.on-page-toc li { margin: 0.28rem 0; }
.on-page-toc a {
    color: var(--text-head);
    text-decoration: none;
    border-bottom: 1px dotted var(--border-color);
    font-weight: 600;
}
.on-page-toc a:hover {
    color: var(--gold-deep);
    border-bottom-color: var(--gold);
}
.on-page-related-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}
.on-page-related-card {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.45rem;
    background: var(--bg-mute);
    text-decoration: none;
    color: var(--text-head);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.on-page-related-card i {
    color: var(--gold-deep);
    font-size: 0.65rem;
    width: 0.9rem;
    text-align: center;
    flex-shrink: 0;
}
.on-page-related-card:hover {
    background: var(--gold-pale);
    border-color: var(--gold);
    box-shadow: 0 1px 4px rgba(30, 58, 95, 0.08);
}


/* Preservation note: PPTX cover thumb + full-slide gallery tiles */
.pptx-download-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
@media (min-width: 768px) {
    .pptx-download-panel {
        grid-template-columns: minmax(240px, 42%) 1fr;
        align-items: stretch;
    }
}
.pptx-thumb-link {
    position: relative;
    display: block;
    background: var(--bg-mute, #0f172a);
    overflow: hidden;
}
.pptx-thumb-img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center center;
}
.pptx-thumb-badge {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    background: rgba(15, 23, 42, 0.88);
    color: #f8fafc;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.6rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(212, 175, 55, 0.45);
}
.pptx-thumb-badge i { color: #d4af37; margin-right: 0.3rem; }
.pptx-download-copy { display: flex; flex-direction: column; justify-content: center; }

.slide-gallery-frame {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0b1220;
    overflow: hidden;
}
.slide-gallery-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    background: #0b1220;
}
.module-card[data-id="preservation-holy-bible"] .thumb {
    object-fit: cover;
    object-position: center center;
}


/* ============================================================
   Hub modular redesign (2026-07-21)
   Less listy hero · image-forward Start Here · full module gallery
   ============================================================ */

/* --- Hero action modules (replace dotted text nav) --- */
.hub-page .site-main-header .hub-hero-actions {
    margin-top: 0.85rem;
    padding-top: 0;
    border-top: none;
    display: block;
}

.hub-page .hub-hero-action-modules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

@media (min-width: 560px) {
    .hub-page .hub-hero-action-modules {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .hub-page .hub-hero-action-modules {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: 34rem;
    }
}

.hub-page .hub-action-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    text-decoration: none;
    color: inherit;
    min-height: 4.25rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

.hub-page .hub-action-tile:hover {
    border-color: var(--gold);
    box-shadow: 0 6px 16px -6px var(--shadow-color);
    transform: translateY(-1px);
    text-decoration: none;
}

.hub-page .hub-action-tile > i {
    color: var(--gold);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.hub-page .hub-action-tile-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--head);
    line-height: 1.2;
}

.hub-page .hub-action-tile-meta {
    font-size: 0.6875rem;
    color: var(--muted);
    line-height: 1.25;
}

.hub-page .hub-action-tile-primary {
    border-color: rgba(212, 175, 55, 0.45);
    background: linear-gradient(160deg, var(--gold-wash), var(--bg-card) 70%);
}

.hub-page .hub-action-tile-journal {
    border-color: rgba(2, 132, 200, 0.28);
}

/* Hide legacy list lead if present */
.hub-page .site-main-header .hub-hero-actions-lead,
.hub-page .site-main-header .hub-hero-actions-buttons {
    display: none;
}

/* --- Spotlight modular strip (Start here) --- */
.hub-page .hub-spotlight {
    width: 100%;
}

.hub-page .hub-spotlight-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.65rem;
}

.hub-page .hub-spotlight-title {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--gold);
}

.hub-page .hub-spotlight-sub {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted);
}

.hub-page .hub-hero-quicklinks-daily-host {
    color: var(--subtle, var(--muted));
}

.hub-page .hub-spotlight-grid,
.hub-page .site-main-header .hub-hero-quicklinks-grid.hub-spotlight-grid,
.hub-page .site-main-header .hub-spotlight-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem !important;
}

@media (min-width: 720px) {
    .hub-page .hub-spotlight-grid,
    .hub-page .site-main-header .hub-spotlight-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem !important;
    }
}

@media (min-width: 1100px) {
    .hub-page .hub-spotlight-grid,
    .hub-page .site-main-header .hub-spotlight-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.65rem !important;
    }
}

.hub-page .hub-spot-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 0.85rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.hub-page .hub-spot-card:hover {
    border-color: var(--gold);
    box-shadow: 0 10px 22px -10px var(--shadow-color), 0 0 0 1px var(--magenta-glow);
    transform: translateY(-2px);
    text-decoration: none;
}

.hub-page .hub-spot-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-mute);
    overflow: hidden;
}

.hub-page .hub-spot-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.hub-page .hub-spot-card:hover .hub-spot-media img {
    transform: scale(1.05);
}

.hub-page .hub-spot-media-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(2, 132, 200, 0.18), rgba(212, 175, 55, 0.12));
}

.hub-page .hub-spot-media-icon i {
    font-size: 1.55rem;
    color: var(--gold);
}

.hub-page .hub-spot-meta {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    padding: 0.45rem 0.55rem 0.55rem;
    min-height: 3.2rem;
}

.hub-page .hub-spot-kicker {
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: #0284C8;
}

.hub-page .hub-spot-title {
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--head);
}

.hub-page .hub-spot-desc {
    font-size: 0.72rem;
    line-height: 1.3;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hub-page .hub-spot-card-journal .hub-spot-media-icon {
    background: linear-gradient(145deg, rgba(2, 132, 200, 0.28), rgba(15, 23, 42, 0.06));
}

/* Compact lower band */
.hub-page .site-main-header .hub-hero-lower {
    gap: 0.75rem;
    padding-top: 0.35rem;
}

/* --- Full-width module gallery --- */
.hub-page .hub-explore-stage {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.hub-page .explore-modules-lead {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.35;
    max-width: 36rem;
}

.hub-page #modules-grid.hub-modules-gallery,
.hub-page #modules-grid.hub-grid.hub-modules-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 0.25rem;
}

@media (min-width: 640px) {
    .hub-page #modules-grid.hub-modules-gallery {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.55rem;
    }
}

@media (min-width: 900px) {
    .hub-page #modules-grid.hub-modules-gallery {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.6rem;
    }
}

@media (min-width: 1100px) {
    .hub-page #modules-grid.hub-modules-gallery {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0.65rem;
    }
}

@media (min-width: 1400px) {
    .hub-page #modules-grid.hub-modules-gallery {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 0.65rem;
    }
}

/* Thumbnail-first module cards on hub (~33% smaller again) */
.hub-page .module-card {
    border-radius: 0.65rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.hub-page .module-card-thumb {
    aspect-ratio: 16 / 9;
}

.hub-page .module-card .card-body {
    padding: 0.4rem 0.45rem 0.45rem;
}

.hub-page .module-card .card-title {
    font-size: 0.75rem;
    line-height: 1.22;
    min-height: 2.35em;
    -webkit-line-clamp: 2;
}

.hub-page .module-card .card-blurb {
    font-size: 0.68rem;
    line-height: 1.25;
    margin-top: 0.15rem;
    min-height: 0;
    -webkit-line-clamp: 1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hub-page .module-card .card-foot {
    margin-top: 0.25rem;
    padding-top: 0.2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hub-page .module-card .card-open-label {
    color: #0284C8;
}

.hub-page .module-card:hover .card-open-label {
    color: var(--gold);
}

/* Detail stage under the gallery */
.hub-page .hub-detail-stage {
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
}

.hub-page .hub-detail-pane.detail-pane,
.hub-page #detail-pane.hub-detail-pane {
    min-height: 240px;
    max-height: min(480px, 58vh);
}

/* When a module is selected, gently scroll detail into view is handled by JS if needed */

/* Tighter hero copy so gallery rises earlier */
.hub-page .site-main-header .hero-intro {
    -webkit-line-clamp: 2;
    max-width: 38rem;
}

.hub-page .site-main-header .hub-hero-download {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

@media (max-width: 639px) {
    .hub-page .hub-spot-desc {
        display: none;
    }
    .hub-page .hub-spot-meta {
        min-height: 2.6rem;
        padding: 0.45rem 0.55rem 0.55rem;
    }
    .hub-page .module-card .card-blurb {
        display: none;
    }
    .hub-page .module-card .card-title {
        min-height: 0;
        font-size: 0.875rem;
    }
}


/* Force hub thumbs visible even if Tailwind preflight sets img{height:auto} */
.hub-page .module-card .thumb,
.hub-page .hub-spot-media img {
    max-width: none !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
}
.hub-page .module-card-thumb,
.hub-page .hub-spot-media {
    position: relative !important;
    overflow: hidden !important;
    background: var(--bg-mute);
    min-height: 3.5rem;
}
.hub-page .module-card-thumb {
    aspect-ratio: 16 / 9 !important;
}
.hub-page .hub-spot-media {
    aspect-ratio: 16 / 9 !important;
    max-height: 7.5rem;
}
.hub-page .hub-spot-meta {
    min-height: 2.6rem !important;
    padding: 0.35rem 0.45rem 0.4rem !important;
}
.hub-page .hub-spot-title {
    font-size: 0.72rem !important;
}
.hub-page .hub-spot-desc {
    font-size: 0.65rem !important;
}
.hub-page .hub-spot-card {
    border-radius: 0.65rem;
}
.hub-page .module-card .tag {
    font-size: 0.6rem !important;
    padding: 1px 6px !important;
}



/* Hero graphic: top edge locked to History of Bible Transmission badge */
@media (min-width: 900px) {
    .hub-page .site-main-header .hub-hero-text-col,
    .hub-page .site-main-header .hub-hero-figure-col {
        align-self: start;
    }
    .hub-page .site-main-header .hub-hero-figure-col {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    .hub-page .site-main-header .hub-hero-eyebrow-wrap {
        margin-top: 0 !important;
    }
    .hub-page .hub-hero-figure {
        top: 0 !important;
    }
}


/* Brand mark: no rose/magenta wash on top-left logo box */
.sidebar-brand,
.site-sidebar .sidebar-brand {
    background: transparent !important;
    background-image: none !important;
    border-bottom-color: var(--border-color) !important;
    box-shadow: none;
}
.sidebar-brand img,
.sidebar-brand-mark,
.hub-page .hub-title-mark {
    filter: none !important;
}
html[data-theme="dark"] .sidebar-brand img,
html[data-theme="dark"] .sidebar-brand-mark,
html[data-theme="dark"] .hub-page .hub-title-mark {
    opacity: 1 !important;
    filter: none !important;
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .sidebar-brand img,
    html:not([data-theme="light"]) .sidebar-brand-mark,
    html:not([data-theme="light"]) .hub-page .hub-title-mark {
        opacity: 1 !important;
        filter: none !important;
    }
}


/* ---- Site-wide second PPTX CTA (Preservation of the Holy Bible) ---- */
/* Sidebar PPTX + Journal: same look as ordinary menu entries */
.site-sidebar .sidebar-nav a.sidebar-pptx-link,
.site-sidebar .sidebar-nav a.sidebar-pptx-masoretes,
.site-sidebar .sidebar-nav a.sidebar-pptx-jesus,
.site-sidebar .sidebar-nav a.journal-nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.45rem 0.6rem !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: inherit !important;
    letter-spacing: normal !important;
    color: var(--text-head) !important;
    text-decoration: none !important;
    background: transparent !important;
    background-image: none !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    transform: none !important;
}
.site-sidebar .sidebar-nav a.sidebar-pptx-link:hover,
.site-sidebar .sidebar-nav a.sidebar-pptx-masoretes:hover,
.site-sidebar .sidebar-nav a.sidebar-pptx-jesus:hover,
.site-sidebar .sidebar-nav a.journal-nav-link:hover {
    background: var(--gold-wash) !important;
    background-image: none !important;
    color: var(--gold-deep) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
.site-sidebar .sidebar-nav a.sidebar-pptx-link i,
.site-sidebar .sidebar-nav a.sidebar-pptx-masoretes i,
.site-sidebar .sidebar-nav a.sidebar-pptx-jesus i,
.site-sidebar .sidebar-nav a.journal-nav-link i {
    width: 14px !important;
    text-align: center !important;
    font-size: 0.75rem !important;
    opacity: 0.75 !important;
    color: inherit !important;
}

.site-pptx-cta {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 55;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    max-width: min(22rem, calc(100vw - 2rem));
    padding: 0.7rem 0.95rem;
    border-radius: 0.85rem;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 55%, #16324f 100%);
    border: 1px solid rgba(212, 175, 55, 0.65);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(212, 175, 55, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.site-pptx-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.34), 0 0 0 1px rgba(212, 175, 55, 0.35);
    color: #fff;
    text-decoration: none;
}
.site-pptx-cta > i {
    font-size: 1.35rem;
    color: #f0c14b;
    flex-shrink: 0;
}
.site-pptx-cta-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.site-pptx-cta-label {
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.2;
}
.site-pptx-cta-sub {
    font-size: 0.65rem;
    opacity: 0.88;
    line-height: 1.25;
}
.footer-pptx-link i {
    color: var(--gold);
    margin-right: 0.2rem;
}
@media (max-width: 640px) {
    .site-pptx-cta {
        right: 0.65rem;
        bottom: 0.65rem;
        padding: 0.6rem 0.75rem;
    }
    .site-pptx-cta-sub {
        display: none;
    }
}
/* Keep clear of mobile sidebar toggle (bottom-left) */
@media (max-width: 1024px) {
    .site-pptx-cta {
        bottom: 4.25rem;
    }
}


/* Masoretes first PPTX pill — solid gold border */
.hub-page .hub-hero-download.hub-pptx-masoretes,
.hub-page a.hub-pptx-masoretes {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35);
}
.hub-page .hub-hero-download.hub-pptx-masoretes:hover,
.hub-page a.hub-pptx-masoretes:hover {
    border-color: var(--gold-deep, var(--gold)) !important;
    background: var(--gold-pale);
}


/* Two stacked PPTX CTAs (Masoretes + Bible Since Jesus) */
.site-pptx-cta-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 55;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    max-width: min(44rem, calc(100vw - 2rem));
}
.site-pptx-cta-stack .site-pptx-cta {
    position: static;
    right: auto;
    bottom: auto;
    max-width: none;
    width: 100%;
}

.site-pptx-cta-masoretes {
    border-color: rgba(212, 175, 55, 0.85) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(212, 175, 55, 0.35);
}
@media (max-width: 640px) {
    .site-pptx-cta-stack {
        right: 0.65rem;
        bottom: 0.65rem;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .hub-page .hub-hero-cta-row {
        gap: 0.45rem;
    }
    .hub-page .hub-hero-cta-row .hub-hero-download {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
    }
}
@media (max-width: 1024px) {
    .site-pptx-cta-stack {
        bottom: 4.25rem;
    }
}


/* Hub: conviction + PPTX pills in one horizontal row */
.hub-page .hub-hero-cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.65rem;
    margin-top: 0.65rem;
    max-width: 100%;
}
.hub-page .hub-hero-cta-row .hub-confessional {
    width: auto;
    max-width: none;
    margin-top: 0;
}
.hub-page .hub-hero-cta-row .hub-hero-download {
    margin-top: 0;
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
}
/* Floating PPTX stack not needed on hub hero */
.hub-page .site-pptx-cta-stack {
    display: none !important;
}


/* Bring hub hero graphic closer to the copy */
@media (min-width: 900px) {
    .hub-page .site-main-header .hub-hero-grid {
        column-gap: 1rem !important;
        grid-template-columns: minmax(0, 1.05fr) minmax(15rem, 0.95fr) !important;
    }
    .hub-page .site-main-header .hub-hero-figure-col {
        justify-content: flex-start !important;
        padding-left: 0;
        margin-left: 0;
    }
    .hub-page .hub-hero-figure {
        max-width: none !important;
        width: 100% !important;
        margin-inline: 0 !important;
    }
}
@media (min-width: 1100px) {
    .hub-page .site-main-header .hub-hero-grid {
        column-gap: 1.15rem !important;
        grid-template-columns: minmax(0, 1.08fr) minmax(16rem, 0.92fr) !important;
    }
}


/* level-with-history-badge: graphic top flush with History of Bible Transmission tab */
@media (min-width: 900px) {
    .hub-page .site-main-header .hub-hero-text-col,
    .hub-page .site-main-header .hub-hero-figure-col {
        align-self: start;
    }
    .hub-page .site-main-header .hub-hero-eyebrow-wrap {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    .hub-page .site-main-header .hub-hero-figure-col {
        margin-top: 0; /* JS may set exact offset to match badge */
        padding-top: 0 !important;
    }
    .hub-page .hub-hero-figure {
        top: 0 !important;
        margin-top: 0 !important;
    }
    .hub-page .hub-hero-figure img {
        object-position: 28% 0% !important;
    }
}


/* PPTX links sit at bottom of the primary sidebar menu (no extra spacing) */
.site-sidebar .sidebar-nav > .sidebar-pptx-link,
.site-sidebar .sidebar-nav > a.sidebar-pptx-masoretes,
.site-sidebar .sidebar-nav > a.sidebar-pptx-jesus {
    margin-top: 0;
}


/* PPTX floating/hero labels: normal weight */
.hub-page .hub-hero-cta-row .hub-hero-download,
.hub-page .hub-hero-cta-row .hub-hero-download span,
.site-pptx-cta-label {
    font-weight: 400 !important;
}



