/* ─── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --navy:       #3a6878;
    --navy-light: #72abbf;
    --gold:       #72abbf;
    --cream:      #f2f2f2;
    --off-white:  #e8eef0;
    --rule:       #ccdde3;
    --text:       #2a2a2a;
    --text-muted: #5a7a85;
    --link:       #3a6878;

    --font-serif: 'Merriweather', Georgia, serif;
    --font-sans:  'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;

    --max-width: 1100px;
    --reading-width: 680px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background-color: var(--cream);
    line-height: 1.7;
}

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

a:hover {
    color: var(--gold);
}

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
    background-color: #3a6878;
    border-bottom: 3px solid #72abbf;
    padding: 1.1rem 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 0;
}

.site-logo {
    font-family: var(--font-serif);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
}

.site-logo svg {
    display: block;
}

.site-logo:hover {
    color: var(--gold);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-nav a {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.15s;
}

.site-nav a:hover {
    color: var(--gold);
}

.nav-auth-btn {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.15s, border-color 0.15s;
}

.nav-auth-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ─── Main Content ───────────────────────────────────────────────────────────── */
.site-main {
    min-height: calc(100vh - 140px);
    padding: 3rem 0 4rem;
}

/* ─── Page Headings ──────────────────────────────────────────────────────────── */
.page-title {
    font-family: var(--font-serif);
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.page-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.section-rule {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 1.5rem 0 2rem;
}

/* ─── Home Cards ─────────────────────────────────────────────────────────────── */
.home-hero {
    margin-bottom: 2.5rem;
}

.home-cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 900px) {
    .home-cards {
        flex-direction: row;
        align-items: stretch;
    }
}

.home-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    padding: 2.5rem 2rem;
    background: #fff;
    border: 1px solid var(--rule);
    border-top: 4px solid var(--navy-light);
    color: var(--navy);
    transition: border-top-color 0.15s, background 0.15s, transform 0.15s;
    min-height: 200px;
}

.home-card:hover {
    background: var(--off-white);
    border-top-color: var(--navy);
    color: var(--navy);
    transform: translateY(-2px);
}

.home-card__icon {
    font-size: 2rem;
    color: var(--navy-light);
    line-height: 1;
}

.home-card__label {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.3;
}

.home-card__sub {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.home-card__progress-bar {
    width: 80%;
    height: 5px;
    background: var(--rule);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.home-card__progress-fill {
    height: 100%;
    background: var(--navy-light);
    border-radius: 3px;
    transition: width 0.4s ease;
    min-width: 2px;
}

/* ─── Book Grid ──────────────────────────────────────────────────────────────── */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.book-card {
    display: block;
    background: #fff;
    border: 1px solid var(--rule);
    border-left: 3px solid var(--navy);
    padding: 0.75rem 1rem;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: var(--navy);
    transition: border-left-color 0.15s, background 0.15s;
}

.book-card:hover {
    border-left-color: var(--gold);
    background: var(--off-white);
    color: var(--navy);
}

/* ─── Chapter Grid ───────────────────────────────────────────────────────────── */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.chapter-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--rule);
    padding: 0.65rem 0.5rem;
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--navy);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.chapter-card:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

/* ─── Verse Reading ──────────────────────────────────────────────────────────── */
.reading-header {
    margin-bottom: 2rem;
}

.reading-header .breadcrumb {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.reading-header .breadcrumb a {
    color: var(--text-muted);
}

.reading-header .breadcrumb a:hover {
    color: var(--gold);
}

.reading-header .breadcrumb span {
    margin: 0 0.4rem;
}

.verse-list {
    max-width: var(--reading-width);
    list-style: none;
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text);
}

.verse-item {
    display: inline;
}

.verse-number {
    display: inline;
    font-size: 0.65rem;
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--gold);
    vertical-align: super;
    margin-right: 0.15em;
}

.verse-text {
    display: inline;
}

/* ─── Pagination ─────────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}

.btn-pagination {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    background: var(--navy);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: background 0.15s;
}

.btn-pagination:hover {
    background: var(--gold);
    color: #fff;
}

/* ─── Back Link ──────────────────────────────────────────────────────────────── */
.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.back-link:hover {
    color: var(--gold);
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
    background-color: #3a6878;
    border-top: 3px solid #72abbf;
    padding: 1.5rem 0;
    text-align: center;
}

.site-footer p {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.04em;
}

/* ─── Auth Forms ─────────────────────────────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

.auth-card {
    background: #fff;
    border: 1px solid var(--rule);
    border-top: 4px solid var(--navy-light);
    padding: 2.5rem 2.5rem 2rem;
    width: 100%;
    max-width: 460px;
}

.auth-form {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-label {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.auth-form input {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--cream);
    border: 1px solid var(--rule);
    padding: 0.6rem 0.85rem;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}

.auth-form input:focus {
    border-color: var(--navy-light);
    background: #fff;
}

.form-group--error input {
    border-color: #b94a48;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.form-error {
    font-size: 0.78rem;
    color: #b94a48;
}

.btn-submit {
    margin-top: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--navy);
    color: #fff;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-submit:hover {
    background: var(--navy-light);
}

.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--navy);
    font-weight: 600;
}

.auth-switch a:hover {
    color: var(--gold);
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
.mobile-nav {
    display: none;
    position: relative;
}

.mobile-nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    color: #ffffff;
}

.mobile-nav-menu {
    display: none;
    position: absolute;
    top: calc(100% + 1rem);
    right: 0;
    background: #3a6878;
    border: 1px solid #72abbf;
    border-radius: 6px;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    min-width: 160px;
    z-index: 100;
}

.mobile-nav-menu.open {
    display: block;
}

.mobile-nav-menu li a,
.mobile-nav-logout {
    display: block;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.15s;
}

.mobile-nav button:hover,
.mobile-nav-menu li a:hover,
.mobile-nav-logout:hover {
    color: var(--gold);
}

.mobile-nav-logout {
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

@media (max-width: 768px) {
    .site-nav {
        display: none;
    }

    .mobile-nav {
        display: flex;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .page-title {
        font-size: 1.5rem;
    }
}
