:root {
    --navy: #071a34;
    --blue: #102b4b;
    --gold: #d3b477;
    --paper: #f7f2e8;
    --ink: #182638;
    --reader-font: 21px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--navy);
    color: #ffffff;
    font-family: Arial, sans-serif;
    line-height: 1.65;
}

.site-header {
    text-align: center;
    padding: 25px 15px;
    border-bottom: 1px solid var(--gold);
}

.brand {
    color: var(--gold);
    font-size: clamp(24px, 5vw, 38px);
    font-weight: bold;
    letter-spacing: 1px;
}

.site-header p {
    margin: 5px;
}

nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 18px;
}

a {
    color: var(--gold);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.hero {
    text-align: center;
    padding: 35px 15px;
    background: linear-gradient(
        135deg,
        #102b4b,
        #071a34
    );
}

.hero-icon {
    font-size: 55px;
}

h1, h2, h3 {
    color: var(--gold);
}

h1 {
    font-size: clamp(32px, 6vw, 50px);
    margin: 0;
}

.hero p {
    font-size: 19px;
}

blockquote {
    color: var(--gold);
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 20px;
    max-width: 750px;
    margin: 20px auto;
}

blockquote small {
    display: block;
    margin-top: 10px;
    font-size: 15px;
}

main {
    max-width: 1150px;
    margin: auto;
    padding: 20px;
}

.statistics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.statistics > div {
    background: var(--blue);
    border: 1px solid #34506d;
    border-radius: 12px;
    padding: 15px 5px;
    text-align: center;
}

.statistics strong {
    display: block;
    color: var(--gold);
    font-size: 28px;
}

.statistics span {
    font-size: 14px;
}

.panel {
    background: var(--blue);
    border: 1px solid #34506d;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 15px 0;
}

.main-toolbar {
    justify-content: center;
}

button {
    background: var(--gold);
    color: var(--navy);
    border: 0;
    border-radius: 8px;
    padding: 11px 15px;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
    min-height: 44px;
    transition: filter 0.15s;
}

button:hover {
    filter: brightness(1.12);
}

button:disabled {
    opacity: 0.45;
    cursor: default;
}

button.active-tab {
    background: #ffffff;
    color: var(--navy);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid #e8ad44;
    outline-offset: 3px;
}

.selectors {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr 1fr;
    gap: 12px;
}

label {
    display: block;
    color: var(--gold);
    font-weight: bold;
}

select,
input {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 6px 0 12px;
    border: 1px solid #7890a8;
    border-radius: 8px;
    background: var(--navy);
    color: white;
    font: inherit;
    min-width: 0;
}

.reader {
    background: var(--paper);
    color: var(--ink);
    padding: clamp(16px, 4vw, 40px);
    border-radius: 14px;
    margin-bottom: 25px;
    box-shadow: 0 6px 20px #00000022;
}

.reader h2 {
    color: #765621;
    text-align: center;
    border-bottom: 1px solid #cdbb9d;
    padding-bottom: 15px;
    margin-top: 0;
}

.verse {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 5px;
    border-bottom: 1px solid #dcd4c5;
    scroll-margin-top: 20px;
}

.verse-number {
    color: #80602c;
    font-size: 16px;
    font-weight: bold;
    min-width: 25px;
    padding-top: 5px;
}

.verse-text {
    flex: 1;
    min-width: 0;
    font-family: Georgia, serif;
    font-size: var(--reader-font);
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.verse-actions {
    display: flex;
    gap: 5px;
}

.verse-actions button {
    background: transparent;
    color: #765621;
    border: 1px solid #b9a27d;
    padding: 5px 10px;
    font-size: 19px;
}

.verse-actions button.saved {
    color: #b32636;
    border-color: #b32636;
}

.highlighted {
    background: #efdfae;
    border-radius: 8px;
}

.bottom-navigation {
    justify-content: space-between;
    margin-top: 25px;
}

.result-card {
    padding: 16px;
    background: var(--navy);
    border: 1px solid #34506d;
    border-radius: 10px;
    margin: 12px 0;
}

.result-card h3 {
    color: var(--gold);
    margin-top: 0;
}

.result-card p {
    font-family: Georgia, serif;
    font-size: 19px;
    line-height: 1.8;
}

#searchCount {
    color: var(--gold);
    font-weight: bold;
}

#status,
#notice {
    text-align: center;
    color: var(--gold);
}

#notice {
    min-height: 25px;
}

#status.error {
    color: #ffb4b4;
    border-color: #b74747;
}

body.dark .reader {
    background: #0d1b2b;
    color: #e9e4d9;
}

body.dark .reader h2,
body.dark .verse-number,
body.dark .verse-actions button {
    color: var(--gold);
}

body.dark .verse-actions button.saved {
    color: #ff8795;
}

body.dark .verse {
    border-color: #304052;
}

body.dark .highlighted {
    background: #39472e;
}

.information {
    font-size: 15px;
}

footer {
    text-align: center;
    padding: 30px 15px;
    border-top: 1px solid var(--gold);
}

footer p {
    margin: 8px;
}

.footer-verse {
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 22px;
    font-style: italic;
}

@media (max-width: 700px) {

    main {
        padding: 12px;
    }

    .statistics {
        grid-template-columns: repeat(2, 1fr);
    }

    .selectors {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toolbar button {
        flex: 1 1 auto;
    }

    .verse {
        flex-wrap: wrap;
    }

    .verse-actions {
        margin-left: auto;
    }

    .panel {
        padding: 14px;
    }

    nav {
        gap: 12px;
        font-size: 14px;
    }

    .hero {
        padding: 22px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    button {
        transition: none;
    }
}