/* Study session page: small interactions (October 2026).
 * Loaded after bible_study.css by session_detail.html; the behaviour is in
 * static/js/bible_study/session_interactions.js. */

/* ---- Note buttons ----
 * base.min.css paints every button[type="submit"] navy, which outranked .study-note-action:
 * Helpful, Save and Delete were navy blocks beside white Share and Edit buttons.
 * One white style here, then brand colours for a mark that is on. */
.study-shell .study-note-action[type] {
    background: var(--study-surface, #ffffff);
    color: var(--study-text-muted);
    border: 1px solid var(--study-line);
    box-shadow: none;
    transform: none;
}

@media (hover: hover) {
    .study-shell .study-note-action[type]:not(.is-active):not(.is-saved):not(.is-flagged):hover {
        background: var(--study-navy-soft);
        border-color: var(--brand-navy);
        color: var(--brand-navy);
        box-shadow: none;
        transform: none;
    }
    .study-shell .study-note-action.is-danger[type]:hover {
        background: var(--study-danger-soft);
        border-color: var(--study-danger-line);
        color: var(--study-danger-ink);
    }
}

.study-shell .study-note-action.is-active {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: #ffffff;
}

.study-shell .study-note-action.is-saved {
    background: var(--study-ember-soft);
    border-color: var(--brand-orange);
    color: var(--study-ember-ink);
}

.study-shell .study-note-action.is-flagged {
    background: var(--study-danger-soft);
    border-color: var(--study-danger-line);
    color: var(--study-danger-ink);
}

.study-shell .study-note-action.is-danger {
    color: var(--study-danger-ink);
}

.study-shell .study-note-action.is-busy {
    opacity: 0.6;
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    .study-shell .study-note-action.just-changed .material-icons {
        animation: study-note-pop 0.3s ease;
    }
}

@keyframes study-note-pop {
    50% { transform: scale(1.25); }
}

/* On tablets and desktop a verse's notes slide in over it. bible_study.css gives the slide
 * 1.2 seconds, so a reader waited over a second for a note to open. session_detail.js already
 * times its own steps for 0.2 seconds (DRAWER_TRANSITION_MS). */
@media (min-width: 768px) {
    .study-verse-line .study-verse-notes {
        transition-duration: 200ms;
    }
}

/* A deleted note is hidden while its Undo bar is open, and so is its verse's count. */
.study-note-item.is-removed,
.study-verse-note-count[hidden] {
    display: none !important;
}

/* "Note saved." beside the note, after the page comes back to it. A div: the site styles
 * every <p> as serif reading text. */
.study-note-saved {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: var(--study-navy-soft);
    color: var(--brand-navy);
    font: 600 0.85rem/1.2 var(--font-sans, 'Inter', sans-serif);
}

.study-note-saved .material-icons {
    font-size: 1rem;
}

/* ---- Application: "Saved" on the button for a moment ---- */
.study-application-card .study-cta.is-saved,
.study-application-card .study-cta.is-saved:hover {
    background: var(--study-gold-soft);
    color: var(--brand-navy);
    transform: none;
}

/* ---- Paging opens at the top of the passage, clear of the screen edge ---- */
#passage-title {
    scroll-margin-top: 2.5rem;
}

/* ---- Complete Session (or Keep reading) ----
 * Phones and tablets: after the study guide, at the end of the session.
 * Desktop: in the passage column, straight under the passage. The guide column spans both
 * rows, and the second row takes its extra height, so the button never waits for it. */
.study-session-layout > .study-session-finish {
    order: 3;
    align-self: stretch;
    margin-top: 1.5rem;
}

@media (min-width: 1024px) {
    .study-session-layout {
        grid-template-rows: auto 1fr;
    }
    .study-session-layout > .study-column:first-child {
        grid-column: 1;
        grid-row: 1;
    }
    .study-session-layout > .study-column:nth-child(2) {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
    .study-session-layout > .study-session-finish {
        grid-column: 1;
        grid-row: 2;
        align-self: start;
        margin-top: 0;
    }
}

/* ---- Long commentary: a preview that eases open ---- */
.study-commentary-full.is-clamped {
    position: relative;
    overflow: hidden;
    max-height: 15rem;
}

.study-commentary-full.is-clamped::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4.5rem;
    background: linear-gradient(rgba(255, 255, 255, 0), #ffffff 85%);
    pointer-events: none;
}

.study-commentary-full.is-moving {
    overflow: hidden;
    transition: max-height 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
    .study-commentary-full.is-moving {
        transition: none;
    }
}

.study-shell .study-clamp-toggle[type] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: -0.5rem 0 1rem;
    padding: 0 0.25rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    box-shadow: none;
    color: var(--brand-navy);
    font: 700 0.875rem/1.2 var(--font-sans, 'Inter', sans-serif);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transform: none;
}

.study-shell .study-clamp-toggle[hidden] {
    display: none;
}

/* Matthew Henry's openers: no browser triangle; "Read Matthew Henry" is the cue. */
.study-commentary-summary {
    list-style: none;
}

.study-commentary-summary::-webkit-details-marker {
    display: none;
}
