/* =========================================================
   CROWNED & COVERED — BIBLE STUDY STYLESHEET
   File: study.css
   Purpose: Minimal, devotional-style Bible study pages
   ========================================================= */


/* ---------- Fonts ---------- */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600&display=swap");


/* ---------- Brand Palette ---------- */

:root {
    --ivory: #f8f3ea;
    --cream: #fffaf3;
    --paper: #fdfaf6;
    --gold: #d8a545;
    --gold-dark: #a97822;
    --gold-soft: #ead6aa;
    --charcoal: #3b332d;
    --muted: #766b63;
    --border: #ded3c4;
    --white: #ffffff;

    --serif: "Cormorant Garamond", Georgia, serif;
    --sans: "Inter", Arial, sans-serif;

    --reading-width: 760px;
    --wide-width: 1120px;
    --radius: 18px;
}


/* ---------- Reset ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--ivory);
    color: var(--charcoal);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: var(--gold-dark);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

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

button,
input,
textarea,
select {
    font: inherit;
}


/* ---------- Accessibility ---------- */

.skip-link {
    position: absolute;
    top: -48px;
    left: 16px;
    z-index: 999;
    padding: 10px 14px;
    background: var(--charcoal);
    color: var(--white);
    border-radius: 8px;
    text-decoration: none;
}

.skip-link:focus {
    top: 16px;
}

:focus-visible {
    outline: 3px solid rgba(216, 165, 69, 0.45);
    outline-offset: 3px;
}


/* ---------- Site Header ---------- */

.study-site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(248, 243, 234, 0.96);
}

.study-site-header__inner {
    width: min(calc(100% - 32px), var(--wide-width));
    margin: 0 auto;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.study-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--charcoal);
    text-decoration: none;
}

.study-brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.study-brand__text {
    font-family: var(--serif);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.study-home-link {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.study-home-link:hover,
.study-home-link:focus-visible {
    color: var(--gold-dark);
}


/* ---------- Page Wrapper ---------- */

.study-page {
    width: 100%;
}

.study-shell {
    width: min(calc(100% - 32px), var(--wide-width));
    margin: 0 auto;
}


/* ---------- Top Navigation ---------- */

.study-nav {
    width: min(calc(100% - 32px), var(--wide-width));
    margin: 28px auto 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    color: var(--muted);
    font-size: 0.9rem;
}

.study-nav a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.study-nav a:hover,
.study-nav a:focus-visible {
    color: var(--gold-dark);
}

.study-nav__center {
    text-align: center;
}

.study-nav__next {
    text-align: right;
}


/* ---------- Study Hero ---------- */

.study-hero {
    width: min(calc(100% - 32px), var(--wide-width));
    margin: 42px auto 68px;
    display: grid;
    grid-template-columns: minmax(280px, 430px) minmax(0, 1fr);
    gap: clamp(36px, 6vw, 80px);
    align-items: center;
}

.study-hero__image {
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.study-hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.study-hero__content {
    max-width: 640px;
}

.study-kicker {
    margin: 0 0 14px;
    color: var(--gold-dark);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.study-title {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(3.4rem, 7vw, 6.3rem);
    font-weight: 600;
    line-height: 0.92;
    letter-spacing: -0.035em;
}

.study-subtitle {
    margin: 24px 0 0;
    color: var(--muted);
    font-family: var(--serif);
    font-size: clamp(1.45rem, 2.5vw, 2.05rem);
    font-weight: 500;
    line-height: 1.25;
}

.study-intro {
    margin: 24px 0 0;
    max-width: 56ch;
    color: var(--muted);
    font-size: 1.04rem;
}


/* ---------- Study Details ---------- */

.study-meta {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 28px;
}

.study-meta__item {
    min-width: 0;
}

.study-meta__label {
    display: block;
    margin-bottom: 4px;
    color: var(--gold-dark);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.study-meta__value {
    color: var(--charcoal);
    font-family: var(--serif);
    font-size: 1.2rem;
    line-height: 1.3;
}


/* ---------- Main Reading Column ---------- */

.study-content {
    width: min(calc(100% - 32px), var(--reading-width));
    margin: 0 auto;
    padding-bottom: 90px;
}

.study-section {
    margin: 0 0 68px;
    scroll-margin-top: 24px;
}

.study-section + .study-section {
    padding-top: 8px;
}

.study-section h2 {
    margin: 0 0 22px;
    font-family: var(--serif);
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.study-section h3 {
    margin: 38px 0 14px;
    color: var(--gold-dark);
    font-family: var(--serif);
    font-size: clamp(1.55rem, 3vw, 2.05rem);
    font-weight: 600;
    line-height: 1.2;
}

.study-section p {
    margin: 0 0 1.25rem;
}

.study-section p:last-child {
    margin-bottom: 0;
}

.study-section ul,
.study-section ol {
    margin: 18px 0 24px;
    padding-left: 1.35rem;
}

.study-section li {
    margin-bottom: 0.75rem;
    padding-left: 0.25rem;
}

.study-section strong {
    font-weight: 700;
}

.study-section em {
    font-family: var(--serif);
    font-size: 1.06rem;
}


/* ---------- Section Divider ---------- */

.study-divider {
    width: 72px;
    height: 1px;
    margin: 68px auto;
    border: 0;
    background: var(--gold-soft);
}


/* ---------- Scripture Block ---------- */

.scripture-block {
    margin: 32px 0;
    padding: 28px 30px;
    background: var(--paper);
    border-left: 4px solid var(--gold);
    border-radius: 0 14px 14px 0;
}

.scripture-block p {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.25rem, 2.6vw, 1.65rem);
    line-height: 1.55;
}

.scripture-block cite {
    display: block;
    margin-top: 14px;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 0.84rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}


/* ---------- Key Truth ---------- */

.key-truth {
    margin: 34px 0;
    padding: 26px 28px;
    border: 1px solid var(--gold-soft);
    border-radius: var(--radius);
    background: transparent;
}

.key-truth__label {
    display: block;
    margin-bottom: 8px;
    color: var(--gold-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.key-truth p {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.35rem, 3vw, 1.9rem);
    line-height: 1.4;
}


/* ---------- Reflection Questions ---------- */

.reflection-list {
    list-style: none;
    margin: 26px 0 0;
    padding: 0;
    counter-reset: reflection;
}

.reflection-list li {
    position: relative;
    margin: 0;
    padding: 24px 0 24px 52px;
    border-top: 1px solid var(--border);
    counter-increment: reflection;
}

.reflection-list li:last-child {
    border-bottom: 1px solid var(--border);
}

.reflection-list li::before {
    content: counter(reflection, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 23px;
    color: var(--gold-dark);
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 600;
}


/* ---------- Prayer Section ---------- */

.prayer-section {
    margin-top: 72px;
    padding: clamp(30px, 6vw, 48px);
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.prayer-section h2 {
    margin-bottom: 18px;
}

.prayer-section p {
    font-family: var(--serif);
    font-size: clamp(1.2rem, 2.4vw, 1.5rem);
    line-height: 1.65;
}


/* ---------- Journal Prompt ---------- */

.journal-prompt {
    margin: 34px 0;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.journal-prompt__label {
    display: block;
    margin-bottom: 10px;
    color: var(--gold-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.journal-prompt p {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.35rem;
    line-height: 1.45;
}


/* ---------- Identity Declaration ---------- */

.identity-declaration {
    margin: 30px 0 0;
    padding: 28px 30px;
    background: var(--paper);
    border: 1px solid var(--gold-soft);
    border-radius: var(--radius);
}

.identity-declaration p {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.25rem, 2.8vw, 1.75rem);
    line-height: 1.55;
}


/* ---------- Discernment Corner ---------- */

.discernment-table-wrapper {
    width: 100%;
    margin-top: 2rem;
    overflow-x: auto;
}

.discernment-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.discernment-table th,
.discernment-table td {
    text-align: left !important;
    vertical-align: top;
}

.discernment-table th {
    padding: 0 1.75rem 1.35rem 0;
    font-weight: 700;
    line-height: 1.45;
}

.discernment-table td {
    padding: 0.9rem 1.75rem 0.9rem 0;
    line-height: 1.75;
}

/* Extra breathing room between each discernment row */
.discernment-table tbody tr + tr td {
    padding-top: 1.65rem;
}

.discernment-table th:first-child,
.discernment-table td:first-child {
    width: 38%;
    padding-right: 2.75rem;
}

.discernment-table th:last-child,
.discernment-table td:last-child {
    width: 62%;
    padding-right: 0;
}


/* ---------- Resource Links ---------- */

.resource-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
    margin-top: 2rem;
    text-align: center;
}

.resource-links a,
.resource-links .text-link {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    color: var(--gold-dark);
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1.65;
    font-weight: 600;
}


/* ---------- Bottom Navigation ---------- */

.study-nav--bottom {
    margin-top: 0;
    margin-bottom: 64px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}


/* ---------- Footer ---------- */

.study-footer {
    border-top: 1px solid var(--border);
    background: var(--cream);
}

.study-footer__inner {
    width: min(calc(100% - 32px), var(--wide-width));
    margin: 0 auto;
    padding: 34px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.study-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.study-footer a {
    color: var(--gold-dark);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}


/* ---------- Utility Classes ---------- */

.text-center {
    text-align: center;
}

.muted {
    color: var(--muted);
}

.gold {
    color: var(--gold-dark);
}

.max-reading-width {
    width: min(100%, var(--reading-width));
    margin-inline: auto;
}


/* ---------- Tablet ---------- */

@media (max-width: 860px) {
    .study-hero {
        grid-template-columns: 1fr;
        max-width: 680px;
        margin-top: 34px;
        gap: 38px;
    }

    .study-hero__image {
        width: min(100%, 520px);
        margin: 0 auto;
    }

    .study-hero__content {
        max-width: none;
        text-align: center;
    }

    .study-intro {
        margin-left: auto;
        margin-right: auto;
    }

    .study-meta {
        text-align: left;
    }

    .study-title {
        font-size: clamp(3.7rem, 11vw, 5.6rem);
    }
}


/* ---------- Mobile ---------- */

@media (max-width: 620px) {
    body {
        font-size: 0.98rem;
    }

    .study-site-header__inner {
        min-height: 68px;
    }

    .study-brand__text {
        font-size: 1.2rem;
    }

    .study-brand img {
        width: 40px;
        height: 40px;
    }

    .study-home-link {
        font-size: 0.82rem;
    }

    .study-nav {
        grid-template-columns: 1fr 1fr;
        margin-top: 22px;
        row-gap: 10px;
    }

    .study-nav__center {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .study-nav__previous {
        grid-column: 1;
        grid-row: 2;
    }

    .study-nav__next {
        grid-column: 2;
        grid-row: 2;
    }

    .study-hero {
        margin-bottom: 54px;
    }

    .study-title {
        font-size: clamp(3.25rem, 16vw, 4.6rem);
    }

    .study-subtitle {
        font-size: 1.45rem;
    }

    .study-meta {
        grid-template-columns: 1fr;
    }

    .study-content {
        padding-bottom: 70px;
    }

    .study-section {
        margin-bottom: 56px;
    }

    .study-section h2 {
        font-size: clamp(2.05rem, 10vw, 2.9rem);
    }

    .scripture-block,
    .key-truth,
    .identity-declaration {
        padding: 22px 20px;
    }

    .prayer-section {
        padding: 28px 22px;
    }

    .study-footer__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Mobile Discernment Corner */
    .discernment-table,
    .discernment-table thead,
    .discernment-table tbody,
    .discernment-table tr,
    .discernment-table th,
    .discernment-table td {
        display: block;
        width: 100%;
    }

    .discernment-table thead {
        display: none;
    }

    .discernment-table tbody tr {
        margin-bottom: 1.6rem;
        padding: 0 0 1.6rem;
        border-bottom: 1px solid rgba(59, 51, 45, 0.16);
    }

    .discernment-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .discernment-table td,
    .discernment-table tbody tr + tr td {
        width: 100%;
        padding: 0;
    }

    .discernment-table td:first-child {
        margin-bottom: 0.75rem;
        padding-right: 0;
        font-weight: 700;
        color: var(--charcoal);
    }

    .discernment-table td:first-child::before {
        content: "Common Saying";
        display: block;
        margin-bottom: 0.35rem;
        color: var(--gold-dark);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

    .discernment-table td:last-child::before {
        content: "What Scripture Teaches";
        display: block;
        margin-bottom: 0.35rem;
        color: var(--gold-dark);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

    .resource-links {
        gap: 16px;
        padding: 0 1rem;
    }

    .resource-links a,
    .resource-links .text-link {
        width: 100%;
    }
}
