/* ═════════════════════════════════════════════════════════
   MojaBiblia — site-wide layout
   topbar · subbar · verse of day · menu drawer · footer
   ═════════════════════════════════════════════════════════ */

/* Page-loader — slim gold sweep at the very top while a navigation is in flight */
.page-loader {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease-out, visibility 0.18s;
}
.page-loader.is-active {
    opacity: 1;
    visibility: visible;
}
.page-loader-bar {
    position: absolute;
    top: 0;
    left: -35%;
    height: 100%;
    width: 35%;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--gold, #C8A24E) 35%,
        var(--gold-bright, #D9B870) 65%,
        transparent 100%);
    box-shadow: 0 0 8px rgba(200, 162, 78, 0.5);
}
.page-loader.is-active .page-loader-bar {
    animation: page-loader-sweep 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes page-loader-sweep {
    0%   { left: -35%; }
    100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .page-loader.is-active .page-loader-bar { animation: none; left: 0; width: 100%; }
}

:root {
    --navy-deep: #171B27;
    --navy: #252B3D;
    --navy-line: #363D52;
    --gold: #C8A24E;
    --gold-bright: #D9B870;
    --gold-soft: #BFA058;
    --cream-frame: #E8DEC2;
    --cream-bar: #F4ECD3;
    --cream-col: #FAF3DD;
    --cream-card: #FFF8E6;
    --cream-row: #FFF8E6;
    --paper: #FFFFFF;
    --ink: #1B2A4E;
    --ink-muted: #4A536B;
    --ink-soft: #6E7693;
    --rule: rgba(200, 162, 78, 0.40);
    --rule-soft: rgba(200, 162, 78, 0.20);
    --star: #F5C443;
}

[data-theme="dark"] {
    --cream-frame: #0A0B0E;
    --cream-bar: #252830;
    --cream-col: #16181C;
    --cream-card: #2A2C34;
    --cream-row: #2A2C34;
    --paper: #1C1E24;
    --ink: #F8EFD9;
    --ink-muted: #DCD3BB;
    --ink-soft: #ABA48E;
    --gold: #ECCB85;
    --gold-bright: #F8DEA5;
    --gold-soft: #E8CD8C;
    --rule: rgba(240, 210, 140, 0.50);
    --rule-soft: rgba(240, 210, 140, 0.22);
}
/* Subbar gets its own near-black tint in dark mode (was the same dark navy
   in light mode, would clash with the rest of the dark palette). */
[data-theme="dark"] .subbar {
    background: #1B1F2C;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}
/* Header now uses the dark palette like everything else — no more forced
   white background — and we swap the bookmark icon + hamburger to the
   ink colour so they stay readable on the dark frame. */
[data-theme="dark"] .brand-back,
[data-theme="dark"] .hamburger { color: var(--ink); }

/* Logo switcher — light variant only in light mode, dark variant only in dark. */
.brand .logo-dark { display: none !important; }
[data-theme="dark"] .brand .logo-light { display: none !important; }
[data-theme="dark"] .brand .logo-dark { display: block !important; }

[data-theme="dark"] .col-title,
[data-theme="dark"] .card h3 { color: var(--gold-bright); }
[data-theme="dark"] .card a:hover {
    color: var(--gold-bright);
    text-decoration-color: var(--gold);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; touch-action: manipulation; }
body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--cream-frame);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    line-height: 1.4;
}
.topbar, .subbar, .columns, .page-footer, .verse-of-day, .page-main, .plan-day {
    max-width: 1100px;
    margin-inline: auto;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

/* ============ TOP BAR ============ */
.topbar {
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    position: relative;
}
.brand-back {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 22px;
    color: var(--navy);
    background: var(--paper);
    transition: color 0.15s;
}
.brand-back:hover { color: var(--gold-soft); }
.brand-back .brand-icon { width: 26px; height: 26px; display: block; }
.brand {
    flex: 0 0 auto;
    background: var(--paper);
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.brand .brand-logo-link {
    display: inline-flex; align-items: center; text-decoration: none; line-height: 0;
}
.brand .logo-mark {
    display: block; height: auto; width: auto; max-height: 36px; max-width: 100%; min-width: 0;
}
.topbar-right {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 22px;
    background: var(--paper);
}
.hamburger {
    background: none; border: 0; cursor: pointer; color: var(--navy);
    padding: 8px; display: inline-flex; align-items: center;
}
.hamburger svg { width: 26px; height: 26px; display: block; }

/* ============ SUB BAR ============ */
.subbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: var(--navy);
    border-bottom: 1px solid var(--navy-line);
}
.subbar form {
    display: flex; align-items: center; justify-content: flex-start;
    flex: 1 1 180px; max-width: 360px; min-width: 0;
    padding: 7px 22px; gap: 12px;
}
.subbar input {
    border: 0; background: transparent; font-size: 17px; color: #FFFFFF;
    outline: none; text-align: left; flex: 1; width: auto; min-width: 0;
    padding: 6px 0; font-family: inherit;
}
.subbar input::placeholder { color: rgba(255, 255, 255, 0.65); }
.subbar .search-icon { color: #FFFFFF; width: 20px; height: 20px; flex: 0 0 auto; }
.subbar-nav {
    display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
    padding: 8px 16px 8px 0;
    margin-left: auto;
}
.subbar-nav a {
    display: inline-flex; align-items: center; padding: 5px 13px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px; color: #FFFFFF; font-size: 11px; font-weight: 600;
    letter-spacing: 0.7px; text-decoration: none; background: transparent;
    white-space: nowrap; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.subbar-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.9);
}
/* Active link — zlatý border + zlatý text, vizuálne odlíši od hover stavu */
.subbar-nav a.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--gold-bright);
    color: var(--gold-bright);
}

.subbar-more {
    display: none; position: relative; flex: 0 0 auto; padding: 8px 16px 8px 0;
}
.subbar-more summary {
    list-style: none; cursor: pointer; display: inline-flex;
    align-items: center; gap: 6px; padding: 5px 12px 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 999px;
    color: #FFFFFF; font-size: 11px; font-weight: 600; letter-spacing: 0.7px;
    white-space: nowrap; user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.subbar-more summary::-webkit-details-marker { display: none; }
.subbar-more summary::marker { content: ""; }
.subbar-more summary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.9);
}
.subbar-more summary .caret { width: 12px; height: 12px; transition: transform 0.2s ease; }
.subbar-more[open] summary .caret { transform: rotate(180deg); }
.subbar-more-list {
    position: absolute; top: calc(100% - 2px); right: 16px; min-width: 200px;
    margin: 0; padding: 6px 0; list-style: none;
    background: #2F3548; border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); z-index: 60;
}
.subbar-more-list a {
    display: block; padding: 9px 18px; color: #FFFFFF; font-size: 12px;
    font-weight: 600; letter-spacing: 0.7px; text-decoration: none;
    white-space: nowrap; transition: background 0.15s ease, color 0.15s ease;
}
.subbar-more-list a:hover { background: rgba(255, 255, 255, 0.12); }
.subbar-more-list a.active { color: var(--gold-bright); }
@media (max-width: 640px) {
    .subbar-nav { display: none; }
    .subbar-more { display: block; }
    /* Reading-mode má len 3 krátke buttony (PLÁNY / MOJE / SUMÁR) — zmestia
       sa vedľa seba aj na bežnom mobile, takže ich nezbaľujeme do MENU
       hamburgera. Stiahneme padding/gap, aby to vyšlo aj v portrait móde
       na užšie telefóny (~360px); ak by aj tak nestačilo, `flex-wrap` z
       parent .subbar-nav povolí zalomenie. */
    .subbar-nav.subbar-nav--reading {
        display: flex;
        gap: 5px;
        padding-right: 12px;
    }
    .subbar-nav.subbar-nav--reading a {
        padding: 5px 10px;
        font-size: 11px;
        letter-spacing: 0.6px;
    }
    .subbar-more.subbar-more--reading { display: none; }
}
/* Veľmi úzke mobily (<340px) — ak by sa 3 buttony aj po stiahnutí paddingov
   nezmestili na jeden riadok, povolíme zalomenie a stredíme, aby subbar
   nepretekol mimo viewport. */
@media (max-width: 339px) {
    .subbar-nav.subbar-nav--reading {
        margin-left: 0;
        justify-content: center;
        width: 100%;
        padding: 6px 12px 8px;
    }
}

/* ============ VERSE OF THE DAY ============ */
.verse-of-day {
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 22px clamp(20px, 5vw, 60px) 28px;
}
.vod-summary {
    list-style: none; cursor: pointer; display: flex;
    align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px;
}
.vod-summary::-webkit-details-marker { display: none; }
.vod-summary::marker { content: ""; }
.verse-of-day:not([open]) .vod-summary { margin-bottom: 0; }
.verse-of-day:not([open]) { padding-bottom: 18px; }
.vod-meta {
    display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0;
}
.vod-chevron {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: 1px solid var(--rule); border-radius: 8px;
    color: var(--ink-muted); transition: color 0.15s, border-color 0.15s, background 0.15s;
    background: transparent;
}
.vod-summary:hover .vod-chevron {
    color: var(--navy); border-color: var(--gold); background: var(--cream-row);
}
.vod-chevron svg { width: 16px; height: 16px; transition: transform 0.25s ease; }
.verse-of-day[open] .vod-chevron svg { transform: rotate(180deg); }
[data-theme="dark"] .vod-summary:hover .vod-chevron { color: var(--gold-bright); }
.vod-title {
    font-family: "Cormorant Garamond", serif;
    font-size: calc(28px * var(--fz, 1.1));
    font-weight: 700; color: var(--navy); margin: 0; letter-spacing: 0.4px;
}
.vod-date {
    font-size: calc(13px * var(--fz, 1.1));
    color: var(--ink-muted); margin: 0; letter-spacing: 0.2px;
}
.vod-content {
    position: relative; padding-left: 78px; max-width: 760px; margin-inline: auto;
}
.vod-quote-mark {
    position: absolute; left: 0; top: -18px;
    font-family: "Cormorant Garamond", serif;
    font-size: 130px; line-height: 0.85;
    color: var(--gold); font-weight: 700; user-select: none;
}
.vod-text {
    font-family: "Merriweather", Georgia, serif;
    font-size: calc(18px * var(--fz, 1.1));
    line-height: 1.7; color: var(--ink); margin: 0 0 6px;
    text-align: justify; hyphens: auto; -webkit-hyphens: auto;
}
.vod-text sup {
    color: var(--gold-soft); font-weight: 700; font-size: 0.62em;
    vertical-align: super; margin-right: 1px; margin-left: 1px;
    font-family: "Inter", sans-serif;
}
.vod-ref { text-align: right; margin: 4px 0 0; }
.vod-ref-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px 4px 12px; border: 1px solid transparent; border-radius: 999px;
    font-family: "Cormorant Garamond", serif; font-size: calc(15px * var(--fz, 1.1));
    font-weight: 600; font-style: italic; color: var(--gold-soft);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.vod-ref-link:hover {
    color: var(--navy); border-color: var(--gold); background: var(--cream-row);
}
.vod-ref-arrow { width: 14px; height: 14px; flex: 0 0 auto; transition: transform 0.15s; }
.vod-ref-link:hover .vod-ref-arrow { transform: translateX(2px); }
[data-theme="dark"] .vod-ref-link:hover { color: var(--gold-bright); }
[data-theme="dark"] .vod-title { color: var(--gold-bright); }
@media (max-width: 640px) {
    .verse-of-day { padding: 16px 14px 20px; }
    .vod-content { padding-left: 50px; }
    .vod-quote-mark { font-size: 90px; top: -10px; }
    .vod-text { font-size: calc(15px * var(--fz, 1.1)); line-height: 1.6; }
    .vod-title { font-size: calc(22px * var(--fz, 1.1)); }
    .vod-date { font-size: calc(12px * var(--fz, 1.1)); }
    .vod-ref { font-size: calc(13px * var(--fz, 1.1)); }
}

/* ============ MENU DRAWER ============ */
.menu {
    position: absolute; top: calc(100% + 4px); right: 12px;
    background: var(--navy); border: 1px solid var(--gold-soft);
    box-shadow: 0 8px 24px rgba(15, 27, 54, 0.35); border-radius: 6px;
    padding: 8px 0; min-width: 220px; display: none; z-index: 50;
}
.menu.open { display: block; }
.menu a {
    display: block; padding: 10px 18px; font-size: 15px; color: #F2E7CE;
}
.menu a:hover { background: #2F3548; color: var(--gold-bright); }
.menu hr { border: 0; border-top: 1px solid var(--navy-line); margin: 6px 0; }
.menu-theme-toggle {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 10px 18px; background: none; border: 0; cursor: pointer;
    color: #F2E7CE; font-size: 15px; font-family: inherit; text-align: left;
}
.menu-theme-toggle:hover { background: #2F3548; color: var(--gold-bright); }
.menu-theme-toggle svg { width: 18px; height: 18px; flex: 0 0 auto; }
.menu-theme-toggle .icon-sun,
.menu-theme-toggle .label-light { display: none; }
[data-theme="dark"] .menu-theme-toggle .icon-moon,
[data-theme="dark"] .menu-theme-toggle .label-dark { display: none; }
[data-theme="dark"] .menu-theme-toggle .icon-sun,
[data-theme="dark"] .menu-theme-toggle .label-light { display: inline-block; }

.menu-fontsize {
    display: flex; align-items: center; gap: 8px; padding: 8px 18px; color: #F2E7CE;
}
.menu-fontsize .font-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.menu-fontsize .fz-spacer { flex: 1 1 auto; }
.menu-fontsize .fz-btn {
    width: 32px; height: 28px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px; color: #F2E7CE; font-size: 18px; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    font-family: inherit; line-height: 1;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.menu-fontsize .fz-btn:hover {
    background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.55); color: var(--gold-bright);
}
.menu-fontsize .fz-btn:active { transform: translateY(1px); }
.menu-fontsize .fz-btn svg { width: 14px; height: 14px; }

/* ============ DEFAULT CONTENT WRAPPER (legacy pages) ============ */
.page-main.legacy-page {
    background: var(--paper);
    padding: 28px clamp(16px, 4vw, 48px) 40px;
    min-height: 50vh;
}

@media (max-width: 640px) {
    .page-main.legacy-page {
        padding: 18px 14px 28px;
    }
}

/* ============ FOOTER ============ */
.page-footer {
    background: var(--paper); border-top: 1px solid var(--rule);
    padding: 28px 32px 36px; color: var(--ink-muted);
    font-size: calc(14px * var(--fz, 1.1)); line-height: 1.7;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 12px 32px rgba(15, 27, 54, 0.18);
}
[data-theme="dark"] .page-footer {
    box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 12px 32px rgba(0, 0, 0, 0.5);
}
.page-footer p { margin: 0 0 14px; }
.page-footer p:last-child { margin-bottom: 0; }

/* ============ MOBILE — common ============ */
@media (max-width: 640px) {
    .brand { padding: 8px 10px; gap: 8px; }
    .brand-back { padding: 0 10px; }
    .brand-back .brand-icon { width: 22px; height: 22px; }
    .brand .logo-mark { max-height: 30px; }
    .topbar-right { padding: 0 10px; }
    .hamburger svg { width: 22px; height: 22px; }
    .subbar form { padding: 8px 12px; gap: 8px; }
    .subbar input { font-size: 14px; }
    .subbar .search-icon { width: 18px; height: 18px; }
    .subbar-more { padding: 6px 12px 6px 0; }
    .subbar-more-list { right: 12px; }
    .page-footer { padding: 20px 16px 24px; font-size: calc(13px * var(--fz, 1.1)); line-height: 1.6; }
    .page-footer p { margin-bottom: 12px; }
}
