/*
 * The study session page (session_detail.html), phone first.
 *
 * The page root carries .study-home as well as .ss-page, so it shares the study
 * home's design (study-home.css: brand tokens, sentence-case headings, Inter
 * copy, buttons, chips, info bubbles, the session path). This file adds what
 * only the session page needs and quiets the older session styles in
 * bible_study.css, which this page still loads for the verse, note and chat
 * markup the page scripts rely on.
 */

/* ---------- Guest preview bar (sticky, above the page root) ---------- */

/* The study shell hid sideways overflow with overflow: hidden, which also stops
   anything inside it from sticking, so the old "stays visible" banner never
   did. clip hides the same overflow without that side effect. */
.study-shell:has(> .ss-preview-bar) {
    overflow-x: clip;
    overflow-y: visible;
}

/* One slim line, so unlike the old banner it can stay in view on phones too
   (bible_study_accessibility.css sets the old one static under 768px). */
.study-shell .study-preview-banner.ss-preview-bar {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
    z-index: 55;
}

.ss-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0.5rem 1rem;
    padding: 0.375rem 0.375rem 0.375rem 1rem;
    border-radius: 999px;
    background: var(--brand-dark, #11192c);
    box-shadow: 0 10px 28px rgba(17, 25, 44, 0.22);
    color: #ffffff;
}

.ss-preview-bar__badge {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 0.375rem;
    color: var(--brand-accent, #fcd34d);
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}

.ss-preview-bar__badge .material-icons {
    font-size: 1.0625rem;
}

.ss-preview-bar__text {
    display: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Longer translations ("Kontynuuj studium za darmo") wrap to two lines rather than run off screen. */
.study-shell a.ss-preview-bar__cta {
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
    min-height: 2.5rem;
    padding: 0.375rem 0.75rem 0.375rem 1rem;
    border-radius: 1.25rem;
    background: var(--brand-accent, #fcd34d);
    color: var(--brand-dark, #11192c);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.ss-preview-bar__cta .material-icons {
    font-size: 1.125rem;
    transition: transform 0.2s ease;
}

.study-shell a.ss-preview-bar__cta:hover {
    box-shadow: 0 6px 18px rgba(252, 211, 77, 0.35);
}

.ss-preview-bar__cta:hover .material-icons {
    transform: translateX(2px);
}

.ss-preview-bar__cta:active {
    transform: scale(0.97);
}

@media (min-width: 768px) {
    .ss-preview-bar {
        margin: 0 0 1.25rem;
        padding-left: 1.25rem;
    }

    .ss-preview-bar__badge {
        display: none;
    }

    .ss-preview-bar__text {
        display: block;
    }
}

/* ---------- Header: where the reader is ---------- */

.ss-page .ss-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.25rem 1.125rem;
    border-radius: 1.5rem;
    background: linear-gradient(160deg, var(--sh-ink) 0%, var(--sh-navy-dark) 45%, var(--sh-navy) 74%, rgba(250, 131, 52, 0.85) 125%);
    box-shadow: 0 18px 40px rgba(17, 25, 44, 0.22);
    color: #ffffff;
}

.ss-page .ss-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: radial-gradient(55% 45% at 88% 0%, rgba(252, 211, 77, 0.2), transparent 70%);
    pointer-events: none;
}

.ss-hero__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.study-home .ss-hero__title {
    color: #ffffff;
    font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

/* The study's name sits first in the details row and leads back to the study. */
.study-home a.ss-hero__study {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 1.75rem;
    color: #ffffff;
    font-family: var(--sh-display);
    font-size: 0.9375rem;
    font-style: italic;
    font-weight: 600;
    text-decoration: none;
}

.ss-hero__study .material-icons {
    font-size: 1rem;
    font-style: normal;
    transition: transform 0.2s var(--sh-ease);
}

.study-home a.ss-hero__study:hover {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ss-hero__study:hover .material-icons {
    transform: translateX(-3px);
}

.ss-hero__path {
    margin-top: 0.25rem;
}

/* "In this session": one row of jump links that scrolls sideways on a phone. */
.ss-page .study-outline {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: 0.375rem -1.25rem 0;
    padding: 0 1.25rem 0.125rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.ss-page .study-outline::-webkit-scrollbar {
    display: none;
}

.ss-page .study-outline-label {
    flex: none;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
}

.ss-page .study-outline-list {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.375rem;
}

.ss-page .study-outline-list a {
    /* 44px: a comfortable tap. It was 40px. */
    min-height: 2.75rem;
    padding: 0.375rem 0.75rem;
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.8125rem;
}

.ss-page .study-outline-count {
    color: var(--sh-ink);
}

@media (min-width: 900px) {
    .ss-page .ss-hero {
        padding: 2rem 2.25rem 1.5rem;
    }

    .ss-page .study-outline {
        flex-wrap: wrap;
        margin: 0.5rem 0 0;
        padding: 0;
        overflow: visible;
    }
}

/* ---------- Panes ---------- */

.ss-page .study-session-layout {
    gap: 1.25rem;
}

.ss-page .study-pane {
    min-height: 0;
    padding: 1.25rem 1rem;
    border-color: var(--sh-line);
    border-radius: var(--sh-radius);
    box-shadow: var(--sh-shadow);
}

@media (min-width: 768px) {
    .ss-page .study-pane {
        padding: 1.75rem;
    }
}

.ss-page .study-pane h2 {
    margin-bottom: 1rem;
    color: var(--sh-navy);
    font-size: 1.375rem;
    line-height: 1.2;
}

.study-home .ss-section-title {
    margin: 0;
    color: var(--sh-navy);
    font-size: 1.375rem;
}

/* The small labels in the study guide stay small capitals in Inter, not tiny Playfair. */
.ss-page .study-pane :is(h3, h4).uppercase {
    margin-bottom: 0.75rem;
    color: var(--sh-muted);
    font-family: var(--sh-sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ss-page .study-pane h3.text-brand-orange {
    color: var(--sh-ember-ink) !important;
}

/* Scripture, teaching and notes keep the reading serif. */
.ss-page p.font-serif {
    font-family: var(--sh-display);
}

/* ---------- Passage ---------- */

.ss-passage-head {
    display: grid;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.study-home .ss-passage-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.125rem 0.5rem;
    color: var(--sh-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

/* The dot ends a line rather than starting the next one when the line wraps. */
.ss-passage-meta > span:not(:last-child)::after {
    content: "·";
    margin-left: 0.5rem;
    color: var(--sh-muted);
}

.ss-passage-meta__ref {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--sh-navy);
}

.ss-passage-meta__ref .material-icons {
    font-size: 1rem;
}

.ss-page .ss-notes-toolbar {
    display: grid;
    gap: 0.625rem;
    justify-content: stretch;
    margin-bottom: 1rem;
}

/* How to add a note: a light line with a navy accent, not a box. */
.study-home .ss-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.125rem 0 0.125rem 0.625rem;
    border-left: 3px solid var(--sh-navy);
    color: var(--sh-navy);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .study-home .ss-hint {
        font-size: 0.875rem;
    }
}

.ss-hint .material-icons {
    flex: none;
    font-size: 1.125rem;
    transform-origin: 50% 80%;
    animation: ss-tap 1.6s ease-in-out 0.6s 3;
}

.ss-notes-view {
    margin: 0.5rem 0 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--sh-line);
}

/* "Show notes from (i)" on one line; the (i) sits beside the words it explains. */
.ss-notes-view__head {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    margin-bottom: 0.5rem;
}

.study-home .ss-notes-view__label {
    margin: 0;
    color: var(--sh-ink);
    font-size: 0.875rem;
    font-weight: 600;
}

/* The (i) keeps its full tap area without making the line taller. */
.ss-notes-view__head .sh-tip {
    margin: -0.5rem 0;
}

/* Switching views: a small spinner beside the heading while the notes load. */
.ss-notes-view__head .sh-spin {
    width: 1rem;
    height: 1rem;
    margin-left: 0.25rem;
    color: var(--sh-navy);
}

.ss-page .study-notes-filter {
    width: 100%;
}

/* Phones: the four views in an even 2x2 grid, styled like the study home's tabs. */
.ss-page .study-segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* stretch: a label that wraps to two lines keeps its row neighbour the same height. */
    align-items: stretch;
    gap: 0.25rem;
    width: 100%;
    max-width: 100%;
    padding: 0.25rem;
    border: 0;
    border-radius: 1rem;
    background: var(--sh-navy-tint);
}

.ss-page .study-segment {
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.ss-page .study-segment span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    min-height: 2.75rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.75rem;
    color: var(--sh-navy);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ss-page .study-segment:not(.is-disabled):hover span {
    background: rgba(255, 255, 255, 0.6);
}

.ss-page .study-segment input:checked + span {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(17, 25, 44, 0.12);
    color: var(--sh-ink);
}

.ss-page .study-segment input:focus-visible + span {
    outline: 3px solid var(--sh-navy);
    outline-offset: 2px;
}

@media (min-width: 640px) {
    .ss-page .study-segmented {
        display: inline-grid;
        grid-template-columns: none;
        grid-auto-flow: column;
        width: auto;
        border-radius: 999px;
    }

    .ss-page .study-segment span {
        min-height: 2.5rem;
        padding: 0.5rem 1rem;
        border-radius: 999px;
        white-space: nowrap;
    }
}

.ss-page .study-notes-scope-help {
    margin-top: 0.5rem;
    color: var(--sh-muted);
    font-size: 0.8125rem;
    transition: opacity 0.2s ease;
}

.ss-notes-view.is-busy .study-notes-scope-help {
    opacity: 0.5;
}

/* Scripture on the page itself, not in a grey box. */
.ss-page .study-passage {
    margin-bottom: 1rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.ss-page .study-passage-grid {
    gap: 0;
}

.ss-page .study-verse-row {
    padding-bottom: 0;
    border-bottom: 0;
}

.ss-page .study-verse-line {
    margin-bottom: 0.125rem;
    padding: 0.5rem 0.5rem;
    border-radius: 0.875rem;
}

.ss-page .study-verse-line .study-verse {
    color: var(--sh-ink);
    font-size: 1.1875rem;
    line-height: 1.75;
}

.ss-page .verse-num-text {
    color: var(--sh-gold-ink);
    font-size: 0.8125rem;
    font-weight: 700;
}

.ss-page .study-verse-line.is-selected {
    border-color: var(--sh-navy);
    background: var(--sh-navy-tint);
    box-shadow: 0 0 0 3px rgba(43, 58, 127, 0.1);
}

/* Saved notes were marked in stock green; gold ink keeps the page in its palette. */
.ss-page #study-passage-grid[data-notes-scope="saved"] .study-verse-line.has-note {
    box-shadow: inset 4px 0 0 var(--sh-gold-ink);
}

/* A quiet icon, not a white tile beside every verse. */
.ss-page .study-verse-copy {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.ss-page .study-verse-copy:hover {
    background: var(--sh-navy-tint);
}

/* Phones have no hover, so the copy button stays visible there, quietly. */
@media (hover: none) {
    .ss-page .study-verse-copy {
        opacity: 0.6 !important;
    }
}

.ss-page .study-pagination {
    margin: 1rem 0;
    padding: 0.75rem 0;
}

/* ---------- Finish: complete the session, keep reading, or join ---------- */

.ss-page .ss-finish {
    display: grid;
}

.ss-complete {
    display: grid;
    gap: 0.625rem;
    justify-items: center;
    padding: 1.25rem;
    border: 1px solid var(--sh-line);
    border-radius: var(--sh-radius);
    background: #ffffff;
    box-shadow: var(--sh-shadow);
    text-align: center;
}

.study-home .ss-finish__btn {
    width: 100%;
}

.study-home .ss-finish__where {
    color: var(--sh-gold-ink);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.study-home .ss-finish__next {
    color: var(--sh-muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

.ss-join {
    display: grid;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem;
    border-radius: 1.5rem;
    background: linear-gradient(160deg, var(--sh-ink) 0%, var(--sh-navy-dark) 50%, var(--sh-navy) 85%, rgba(250, 131, 52, 0.8) 135%);
    box-shadow: 0 18px 40px rgba(17, 25, 44, 0.22);
    color: #ffffff;
}

.study-home .ss-join__title {
    color: #ffffff;
    font-size: 1.25rem;
    line-height: 1.2;
}

.ss-join .sh-benefits {
    display: grid;
    gap: 0.375rem;
    margin: 0;
}

.study-home .ss-join .sh-btn--lg {
    width: 100%;
}

.study-home .ss-join .ss-finish__next {
    color: rgba(255, 255, 255, 0.8);
}

@keyframes ss-tap {
    0%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(2px) scale(0.92); }
}

@media (prefers-reduced-motion: reduce) {
    .ss-hint .material-icons {
        animation: none;
    }
}

/* ---- Buttons at the site's scale (November 24, 2026) ----
   .study-cta is 17.6px bold with 0.85rem / 2rem padding (about 54px tall) in
   bible_study.css, a size up from the verse page, the dashboard and the other
   study pages, where a button is Inter 14px semibold, 44px tall with 10px
   corners. The "Save" / "Saved" button in the Application card was the most
   visible case. Two classes on the left so this outranks the card's own rules. */
.study-home.ss-page .study-cta,
.study-home.ss-page .study-application-card .study-cta {
    min-height: 2.75rem;
    padding: 0.5rem 1.25rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    gap: 0.5rem;
}

.study-home.ss-page .study-cta .material-icons { font-size: 1.125rem; }
