:root {
    color-scheme: light dark;
    --font-body: "Crimson Pro", "Georgia", serif;
    --font-display: "Newsreader", "Georgia", serif;
    --font-ui: "Newsreader", "Georgia", serif;
    --bg: #f8f3ea;
    --bg-accent: #f3e8da;
    --surface: #f6f0e6;
    --surface-elevated: #fbf6ee;
    --surface-highlight: #fffaf2;
    --text: #2b2520;
    --muted: #6e6155;
    --border: #d4c6b2;
    --accent: #8b4c2a;
    --accent-strong: #6a361e;
    --ornament: rgba(106, 54, 30, 0.08);
    --shadow: 0 20px 45px rgba(56, 36, 22, 0.1);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #1a1512;
    --bg-accent: #241d18;
    --surface: #201a15;
    --surface-elevated: #2a221c;
    --surface-highlight: #2f261f;
    --text: #f2e9dc;
    --muted: #c7b7a5;
    --border: #3a2d24;
    --accent: #d5a679;
    --accent-strong: #f0c694;
    --ornament: rgba(240, 198, 148, 0.12);
    --shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    line-height: 1.75;
    background:
        radial-gradient(circle at top, var(--bg-accent), var(--bg)),
        linear-gradient(120deg, transparent 0%, var(--ornament) 48%, transparent 100%);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: var(--accent);
}

.page {
    max-width: 920px;
    margin: 0 auto;
    padding: 56px 24px 72px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.site-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.brand {
    max-width: 680px;
}

.site-eyebrow {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 10px;
}

.site-title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 3.4vw, 3.3rem);
    font-weight: 600;
    margin: 0 0 10px;
}

.site-tagline {
    margin: 0;
    font-size: 1.05rem;
    color: var(--muted);
}

.site-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 18px;
}

.site-nav {
    display: flex;
    gap: 18px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site-nav a {
    position: relative;
    padding-bottom: 4px;
}

.site-nav a[aria-current="page"] {
    color: var(--accent);
}

.site-nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: currentColor;
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    color: var(--text);
    font-family: var(--font-ui);
    padding: 8px 14px;
    border-radius: 999px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
    cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.entry-card,
.about-card {
    background:
        linear-gradient(180deg, var(--surface-highlight), var(--surface));
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.entry-header,
.about-header {
    text-align: center;
    margin-bottom: 26px;
}

.entry-date {
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.74rem;
    margin: 0 0 12px;
    color: var(--muted);
}

.entry-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 2.8vw, 2.7rem);
    margin: 0;
}

.about-title {
    font-size: clamp(1.6rem, 2.3vw, 2.1rem);
}

.entry-section,
.about-section {
    margin-top: 28px;
}

.about-section {
    margin-top: 22px;
}

.entry-section--scripture {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px 24px 20px;
    position: relative;
    overflow: hidden;
}

.entry-section--scripture::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 12% 12%, var(--ornament), transparent 55%);
    opacity: 0.8;
    pointer-events: none;
}

.entry-section--scripture > * {
    position: relative;
    z-index: 1;
}

.verse-columns {
    display: flex;
    gap: 0;
    margin-bottom: 8px;
}

.verse-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Divider logic for desktop */
.verse-block:first-child {
    border-right: 1px solid var(--border);
    padding-right: 32px;
}

.verse-block:last-child {
    padding-left: 32px;
}

/* If ESV is hidden, remove border/padding from KJV so it centers/fills */
.verse-block:last-child.hidden {
    display: none;
}

.verse-block.hidden + .verse-block,
.verse-block:has(+ .verse-block.hidden),
.verse-block:first-child:last-child {
    border-right: none;
    padding-right: 0;
}

.version-label {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 500;
    opacity: 0.8;
}

.entry-section-title {
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
    margin: 0 0 12px;
    color: var(--accent);
}

.about-section .entry-section-title {
    margin-bottom: 2px;
}

.about-section .entry-text {
    white-space: normal;
    margin: 0;
}

.about-section .entry-text + .entry-text {
    margin-top: 18px;
}

.about-section ul.entry-text {
    margin-top: 14px;
    padding-left: 22px;
    display: grid;
    gap: 6px;
}

.about-section ul.entry-text li {
    margin: 0;
    line-height: 1.6;
}

.about-link {
    font-weight: 600;
    color: var(--accent-strong);
    padding: 0 3px;
    border-radius: 6px;
    border-bottom: 1px solid var(--accent);
    box-shadow: inset 0 -0.5em 0 var(--ornament);
    transition: color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.about-link:hover,
.about-link:focus-visible {
    color: var(--accent);
    border-bottom-color: var(--accent-strong);
    box-shadow: inset 0 -0.6em 0 var(--ornament);
}

.entry-text {
    margin: 0;
    font-size: 1.08rem;
    white-space: pre-line;
    color: var(--text);
}

.entry-verse-ref {
    margin: 8px 0 0;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-strong);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.entry-verse-ref::before {
    content: "";
    width: 22px;
    height: 1px;
    background: currentColor;
    opacity: 0.6;
}

.entry-poem .entry-text {
    font-style: italic;
    color: var(--muted);
    line-height: 1.6;
    white-space: normal;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.entry-poem .poem-line {
    display: block;
    padding-left: 1.25rem;
    text-indent: -1.25rem;
}

.entry-poem .poem-line--blank {
    min-height: 1.6em;
}

.entry-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.entry-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 20px;
}

.date-picker-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}

.date-picker-label {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.current-date-display {
    font-family: var(--font-ui);
    font-size: 0.92rem;
    color: var(--muted);
    text-align: center;
    border-bottom: 1px dashed var(--border);
    padding: 4px 8px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.current-date-display:hover,
.current-date-display:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
}

.nav-date-input {
    position: absolute;
    inset: -6px;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.nav-button {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    padding: 10px 16px;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.nav-button:hover,
.nav-button:focus-visible {
    border-color: var(--accent);
    color: var(--accent-strong);
}

input[type="date"] {
    font-family: var(--font-ui);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.site-footer {
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--muted);
}

.footer-legal a {
    font-weight: 600;
    color: var(--accent-strong);
    padding: 0 3px;
    border-radius: 6px;
    border-bottom: 1px solid var(--accent);
    box-shadow: inset 0 -0.5em 0 var(--ornament);
    transition: color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
    color: var(--accent);
    border-bottom-color: var(--accent-strong);
    box-shadow: inset 0 -0.6em 0 var(--ornament);
}

/* CTA Button */
.about-cta {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.cta-button {
    display: inline-block;
    border: 1px solid var(--accent);
    background: var(--surface-elevated);
    color: var(--accent-strong);
    padding: 14px 28px;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.cta-button:hover,
.cta-button:focus-visible {
    background: var(--accent);
    color: var(--surface-highlight);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 76, 42, 0.15);
}

@media (max-width: 900px) {
    .page {
        padding: 44px 20px 60px;
    }

    .verse-columns {
        flex-direction: column;
        gap: 24px;
    }

    .verse-block:first-child {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px dashed var(--border);
        padding-bottom: 24px;
    }

    .verse-block:last-child {
        padding-left: 0;
    }

    .entry-section--scripture {
        padding: 20px 20px 18px;
    }

    .site-actions {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 600px) {
    .page {
        padding: 32px 16px 48px;
        gap: 32px;
    }

    .site-actions {
        width: 100%;
    }

    .site-nav {
        justify-content: center;
    }

    .entry-card,
    .about-card {
        padding: 28px 22px;
    }

    .entry-section--scripture {
        padding: 18px 18px 16px;
    }

    .entry-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .current-date-display {
        order: -1;
    }
}
