/* ═══════════════════════════════════════════════════════════════════════
   Bible Race — Global front-end stylesheet
   Palette adapted from MCMIS Back Office design system
════════════════════════════════════════════════════════════════════════ */

/* ── Global scale ────────────────────────────────────────────────────── */
html { zoom: 0.68; }

/* ── Brand colour tokens ─────────────────────────────────────────────── */
:root {
    --br-navy:       #0f1f3d;
    --br-navy-light: #1a2f58;
    --br-accent:     #2563eb;
    --br-accent-lt:  #3b82f6;
    --br-gold:       #c8972a;
    --br-surface:    #f4f6fb;
    --br-hero-grad:  linear-gradient(135deg, #0f1f3d 0%, #1a2f58 100%);
}

/* ── Body & font ─────────────────────────────────────────────────────── */
body {
    font-family: 'Inter', sans-serif;
}

/* ── Navbar ──────────────────────────────────────────────────────────── */
.navbar.bg-dark {
    background-color: var(--br-navy) !important;
    border-bottom: 3px solid var(--br-gold) !important;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
footer.bg-dark {
    background-color: var(--br-navy) !important;
    border-top: 3px solid var(--br-gold) !important;
}

/* ── Override Bootstrap primary colour ───────────────────────────────── */
.text-primary            { color: var(--br-accent) !important; }
.border-primary          { border-color: var(--br-accent) !important; }
a.text-primary:hover     { color: var(--br-navy-light) !important; }

.btn-primary {
    background-color: var(--br-accent);
    border-color:     var(--br-accent);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--br-navy);
    border-color:     var(--br-navy);
}
.btn-outline-primary {
    color:        var(--br-accent);
    border-color: var(--br-accent);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--br-accent);
    border-color:     var(--br-accent);
    color: #fff;
}

/* ── Form focus ring ─────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--br-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* ── Card / surface defaults ─────────────────────────────────────────── */
.card {
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(15, 31, 61, .10);
}

/* ═══════════════════════════════════════════════════════════════════════
   Primary navigation — utility bar + sticky mega-menu header
   Palette matches the TEITI reference site's navy/gold treatment.
   All directional spacing uses logical properties so [dir="rtl"] mirrors
   automatically — do not add left/right/margin-left/padding-right here.
════════════════════════════════════════════════════════════════════════ */
:root {
    --br-nav-navy:    #1B2F52;
    --br-gold-border: #C6A24C;
    --br-nav-blue:    #1C6BB0;
    --br-nav-blue-lt: #2E8BD6;
    --br-nav-ink:     #16263C;
    --br-nav-border:  #E3EAF2;
    --br-nav-on-dark: #C7D6E8;
    --br-util-bar:    #0A1A33;
    --br-max-w:       1320px;
}

/* ── Utility bar ─────────────────────────────────────────────────────── */
.br-utility-bar {
    background: var(--br-util-bar);
    border-block-end: 1px solid #1C3358;
    font-family: 'IBM Plex Mono', monospace;
}
.br-utility-inner {
    max-width: var(--br-max-w);
    margin-inline: auto;
    padding-inline: 32px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.br-utility-title {
    font-family: 'Libre Franklin', sans-serif;
    font-size: .85rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
    padding: 5px 14px;
    border-radius: 4px;
    background: rgba(198, 162, 76, .16);
    border-inline-start: 3px solid var(--br-gold-border);
}
.br-utility-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-inline-start: auto;
}
.br-util-links {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 11px;
    font-weight: 500;
    color: #7FD8DF;
}
.br-util-links a { color: #7FD8DF; transition: color .15s; white-space: nowrap; text-decoration: none; }
.br-util-links a:hover { color: #fff; text-decoration: none; }

/* Inline language list — all 8 shown directly in the utility bar, no dropdown */
.br-lang-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 14px;
}
.br-lang-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 2px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--br-nav-on-dark);
    font-family: 'IBM Plex Mono', monospace;
    white-space: nowrap;
    text-decoration: none;
    transition: color .15s;
}
.br-lang-item:hover { color: #fff; }
.br-lang-item.active { color: #fff; font-weight: 700; }
.br-lang-item .fi { width: 1.1em; border-radius: 2px; flex-shrink: 0; }

/* ── Main header ─────────────────────────────────────────────────────── */
.br-header {
    background: var(--br-nav-navy);
    border-block-end: 4px solid var(--br-gold-border);
    position: sticky;
    inset-block-start: 0;
    z-index: 1020;
    box-shadow: 0 2px 10px rgba(8,21,43,.2);
}
.br-header-inner {
    max-width: var(--br-max-w);
    margin-inline: auto;
    padding: 10px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
/* CMS-style horizontal nav with dropdowns */
.br-nav { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; font-family: 'Libre Franklin', sans-serif; }
.br-nav-item { position: relative; }
.br-nav-item.br-nav-push { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.br-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--br-nav-on-dark);
    border-radius: 6px;
    white-space: nowrap;
    text-decoration: none;
    transition: color .15s, background .15s;
    cursor: pointer;
}
.br-nav-link:hover,
.br-nav-link.active { color: #fff; }
.br-nav-link.active { font-weight: 700; background: rgba(255,255,255,.12); }
.br-caret { font-size: 9px; opacity: .6; }

.br-has-dropdown:hover .br-dropdown,
.br-has-dropdown:focus-within .br-dropdown { display: block; }
.br-dropdown {
    display: none;
    position: absolute;
    inset-block-start: 100%;
    inset-inline-start: 0;
    min-width: 230px;
    background: #fff;
    border: 1px solid var(--br-nav-border);
    border-block-start: 3px solid var(--br-nav-blue);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 18px 40px rgba(16,38,60,.14);
    padding: 8px;
    z-index: 1030;
}
.br-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 13px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--br-nav-ink);
    font-family: 'Libre Franklin', sans-serif;
    transition: background .12s, color .12s;
}
.br-dropdown-item:hover { background: #F1F6FB; color: var(--br-nav-blue); }
.br-dropdown-divider { border-block-start: 1px solid var(--br-nav-border); margin: 6px 4px; }
.br-dropdown-header {
    padding: 8px 13px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #8a97a8;
}

/* Wide 2-column dropdown — for menus with many children (e.g. Admin) */
.br-dropdown--wide {
    min-width: 480px;
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 0 4px;
    max-height: 70vh;
    overflow-y: auto;
}
.br-has-dropdown:hover .br-dropdown--wide,
.br-has-dropdown:focus-within .br-dropdown--wide { display: grid; }
.br-dropdown--wide .br-dropdown-header,
.br-dropdown--wide .br-dropdown-divider { grid-column: 1 / -1; }

/* Sign-in / register buttons in the push group */
.br-nav-cta {
    background: var(--br-nav-blue);
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}
.br-nav-cta:hover { background: var(--br-nav-blue-lt); color: #fff !important; }

/* Mobile hamburger */
.br-close-nav { display: none; }
.br-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.br-hamburger span {
    display: block; width: 24px; height: 2px;
    background: var(--br-nav-on-dark); border-radius: 2px;
}

/* ── Main content container — same max-width/padding as the header, so a
   sidebar column added here lines up with the header's right-aligned
   account area above it ─────────────────────────────────────────────── */
.br-main-container {
    max-width: var(--br-max-w);
    margin-inline: auto;
    padding-inline: 32px;
    width: 100%;
}

/* ── Content row — page content + side action rail as sibling columns,
   7:1, so the rail sits directly below the header's account dropdown
   instead of floating over the page ─────────────────────────────────── */
.br-content-row {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}
.br-content-main { flex: 7; min-width: 0; }

.br-side-actions {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    background: var(--br-nav-navy);
    border: 1px solid var(--br-gold-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(8,21,43,.15);
    overflow: hidden;
    align-self: flex-start;
}
.br-side-action {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 16px;
    font-family: 'Libre Franklin', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--br-nav-on-dark);
    text-decoration: none;
    border-block-end: 1px solid rgba(255,255,255,.08);
    transition: background .15s, color .15s;
}
.br-side-action:last-child { border-block-end: none; }
.br-side-action:hover { background: rgba(255,255,255,.08); color: #fff; }
.br-side-action i { font-size: 16px; flex-shrink: 0; }

@media (max-width: 767px) {
    .br-content-row { flex-direction: column; }
    .br-side-actions { width: 100%; }
}

@media (max-width: 991px) {
    .br-nav-wrapper {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(8,21,43,.97);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 32px 32px;
        z-index: 2000;
        overflow-y: auto;
    }
    .br-nav-wrapper.open { display: flex; }
    .br-nav { flex-direction: column; align-items: flex-start; width: 100%; gap: 4px; }
    .br-nav-item { width: 100%; }
    .br-nav-item.br-nav-push { margin-inline-start: 0; flex-direction: column; align-items: flex-start; margin-block-start: 16px; width: 100%; }
    .br-nav-link { font-size: 17px; padding: 12px 14px; width: 100%; color: #fff; }
    .br-dropdown {
        position: static;
        display: none;
        border: none;
        background: rgba(255,255,255,.06);
        border-radius: 8px;
        margin: 4px 0;
        padding: 4px;
        box-shadow: none;
    }
    .br-has-dropdown.open .br-dropdown { display: block; }
    .br-dropdown--wide { min-width: unset; grid-template-columns: 1fr; max-height: none; }
    .br-has-dropdown.open .br-dropdown--wide { display: block; }
    .br-dropdown-item { color: var(--br-nav-on-dark); }
    .br-dropdown-item:hover { background: rgba(255,255,255,.1); color: #fff; }
    .br-dropdown-header { color: #7691b3; }
    .br-hamburger { display: flex; }
    .br-close-nav {
        position: absolute; inset-block-start: 20px; inset-inline-end: 24px;
        background: none; border: none;
        color: #9FC2EA; font-size: 28px; cursor: pointer;
    }
}
