/*
    urhema.components.css — cross-screen component primitives (Phase 0)

    The shell (urhema.shell.css) is deliberately scoped to reset + header + footer
    + verse popover. But several primitives recur on every content screen — cards,
    chips/badges, progress meters — and the prototype leans on `.ub-card`
    especially. Those don't belong in the shell (not shell chrome) and they don't
    belong in any one page's file (used everywhere), so they live here: loaded once
    in Master, after the shell, available to Today, Library, Lesson, Profile, etc.

    Everything reads --ub-* tokens; nothing defines a colour of its own.
*/

/* ---- Card: the universal surface panel ------------------------------- */

.ub-card {
    background: var(--ub-paper-raised);
    border: var(--ub-rule);
    border-radius: var(--ub-radius-md);
    box-shadow: var(--ub-shadow-soft);
}

/* Opt-in hover lift for cards that are themselves links/actions. Plain
   content cards don't get this — only ones you can click. */
.ub-card--interactive {
    transition: border-color var(--ub-duration-fast) var(--ub-ease),
                box-shadow var(--ub-duration-fast) var(--ub-ease),
                transform var(--ub-duration-fast) var(--ub-ease);
}
.ub-card--interactive:hover {
    border-color: var(--ub-accent-500);
    box-shadow: var(--ub-shadow-float);
}

/* ---- Chip / badge ---------------------------------------------------- */

.ub-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--ub-space-1);
    padding: 0.2rem 0.6rem;
    font-family: var(--ub-font-ui);
    font-size: var(--ub-text-xs);
    font-weight: 600;
    line-height: 1.4;
    color: var(--ub-ink-muted);
    background: var(--ub-paper-sunken);
    border: var(--ub-rule);
    border-radius: var(--ub-radius-pill);
    white-space: nowrap;
}
.ub-chip--accent {
    color: var(--ub-accent-700);
    background: var(--ub-accent-100);
    border-color: transparent;
}

/* ---- Meter: a labelled progress bar --------------------------------- */

.ub-meter {
    height: 6px;
    background: var(--ub-paper-sunken);
    border: var(--ub-rule);
    border-radius: var(--ub-radius-pill);
    overflow: hidden;
}
.ub-meter__fill {
    height: 100%;
    background: var(--ub-accent-500);
    border-radius: inherit;
}

/* ---- Situational Passages (12.9) — "A verse for right now" ------------ */
/* Renders on Today's aside and the Lectio side-panel; shared, not page-scoped. */

.ub-situational {
    padding: var(--ub-space-5);
}

.ub-situational__prompt {
    margin: 0 0 var(--ub-space-3);
    font-size: var(--ub-text-sm);
    color: var(--ub-ink-muted);
}

.ub-situational__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ub-space-2);
}

/* Quiet pills, not solid CTAs — this is a gentle optional prompt, not a primary action;
   same restraint .ub-button--quiet already applies elsewhere in this codebase. */
.ub-situational__chip {
    display: inline-flex;
    align-items: center;
    padding: var(--ub-space-2) var(--ub-space-4);
    border-radius: var(--ub-radius-pill);
    border: 1px solid var(--ub-line);
    background: var(--ub-paper-sunken);
    color: var(--ub-ink);
    font-family: var(--ub-font-ui);
    font-size: var(--ub-text-sm);
    text-decoration: none;
    min-height: 2.25rem; /* comfortable tap target */
    transition: border-color 0.15s ease, background 0.15s ease;
}

    .ub-situational__chip:hover,
    .ub-situational__chip:focus-visible {
        border-color: var(--ub-accent-500);
        background: var(--ub-paper-raised);
    }

/* ---- Resolved state ---- */

.ub-situational__back {
    display: inline-block;
    margin-bottom: var(--ub-space-4);
    font-size: var(--ub-text-xs);
    color: var(--ub-ink-muted);
    text-decoration: none;
}

    .ub-situational__back:hover {
        color: var(--ub-ink);
        text-decoration: underline;
    }

.ub-situational__framing {
    margin: 0 0 var(--ub-space-4);
    font-size: var(--ub-text-sm);
    color: var(--ub-ink-muted);
    line-height: var(--ub-leading-body);
}

.ub-situational__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--ub-space-5);
}

/* Left-border-accent treatment, matching the Verse of the Day block's own visual language
   ("a verse worth carrying") rather than inventing a new card style for essentially the
   same kind of content. */
.ub-situational__passage {
    padding-left: var(--ub-space-4);
    border-left: 2px solid var(--ub-accent-500);
}

.ub-situational__passage-text {
    margin: 0 0 var(--ub-space-2);
    font-family: var(--ub-font-heading);
    font-style: italic;
    font-size: var(--ub-text-md);
    line-height: var(--ub-leading-reading);
    color: var(--ub-ink);
}

.ub-situational__passage-ref a {
    font-size: var(--ub-text-xs);
    font-weight: 700;
    color: var(--ub-accent-500);
    text-decoration: none;
}

    .ub-situational__passage-ref a:hover {
        text-decoration: underline;
    }

.ub-situational__passage-gloss {
    margin: var(--ub-space-2) 0 0;
    font-size: var(--ub-text-xs);
    color: var(--ub-ink-muted);
}
.ub-situational__dots {
    display: flex;
    gap: var(--ub-space-2);
    margin-top: var(--ub-space-5);
    padding-top: var(--ub-space-4);
    border-top: 1px solid var(--ub-line);
}

.ub-situational__dots {
    display: flex;
    gap: var(--ub-space-2);
    margin-top: var(--ub-space-5);
    padding-top: var(--ub-space-4);
    border-top: 1px solid var(--ub-line);
}

.ub-situational__dot {
    /* FIXED — my mistake in the original delivery. <a> is display: inline by default, and
       width/height/border-radius are silently ignored on inline elements -- without this,
       the dots almost certainly weren't rendering as sized circles at all, producing an
       uneven, jagged row instead of a clean line. Got this right on .ub-situational__chip
       (inline-flex) but missed it here. */
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--ub-line);
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
    vertical-align: middle; /* keeps the row's baseline from drifting between dots */
}

    .ub-situational__dot:hover {
        background: var(--ub-ink-muted);
    }

    .ub-situational__dot.is-current {
        background: var(--ub-accent-500);
        transform: scale(1.3);
    }

/* ---- Obedience Loop (lesson commit panel, follow-up prompt, report form) ----
   Quiet by design — see docs/gamification-philosophy.md. No colour coding by outcome, no
   lateness cues: every status button looks the same; only the current one is marked. */

.ob-panel {
    padding: var(--ub-space-5);
    margin-bottom: var(--ub-space-4);
}

.ob-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ub-space-3);
}

.ob-panel__title {
    margin: 0 0 var(--ub-space-2);
    font-size: var(--ub-text-md);
    color: var(--ub-ink);
}

.ob-intro,
.ob-status {
    margin: 0 0 var(--ub-space-3);
    font-size: var(--ub-text-sm);
    color: var(--ub-ink-muted);
    line-height: var(--ub-leading-body);
}

.ob-status {
    font-weight: 600;
}

.ob-flash {
    margin: 0 0 var(--ub-space-3);
    padding: var(--ub-space-2) var(--ub-space-3);
    font-size: var(--ub-text-sm);
    color: var(--ub-ink);
    background: var(--ub-paper-sunken);
    border-radius: var(--ub-radius-sm);
}

.ob-label {
    display: block;
    margin-bottom: var(--ub-space-2);
    font-size: var(--ub-text-sm);
    color: var(--ub-ink);
}

.ob-optional {
    color: var(--ub-ink-soft);
}

.ob-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: var(--ub-space-3);
    font: inherit;
    font-size: var(--ub-text-base);
    line-height: var(--ub-leading-body);
    color: var(--ub-ink);
    background: var(--ub-paper-sunken);
    border: var(--ub-rule);
    border-radius: var(--ub-radius-sm);
    resize: vertical;
}

.ob-textarea:focus-visible {
    outline: 2px solid var(--ub-accent-500);
    outline-offset: 1px;
}

.ob-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ub-space-2);
    margin-top: var(--ub-space-3);
}

.ob-btn {
    padding: var(--ub-space-2) var(--ub-space-3);
    font: inherit;
    font-size: var(--ub-text-sm);
    color: var(--ub-ink);
    background: var(--ub-paper-raised);
    border: var(--ub-rule);
    border-radius: var(--ub-radius-pill);
    cursor: pointer;
}

.ob-btn:hover {
    border-color: var(--ub-accent-500);
}

.ob-btn:focus-visible {
    outline: 2px solid var(--ub-accent-500);
    outline-offset: 2px;
}

.ob-btn.is-current {
    border-color: var(--ub-accent-500);
    background: var(--ub-accent-100);
}

.ob-btn--primary {
    color: var(--ub-accent-contrast);
    background: var(--ub-accent-700);
    border-color: var(--ub-accent-700);
}

.ob-link {
    padding: 0;
    font: inherit;
    font-size: var(--ub-text-sm);
    color: var(--ub-ink-muted);
    background: none;
    border: 0;
    text-decoration: underline;
    cursor: pointer;
}

.ob-form--remove {
    margin-top: var(--ub-space-2);
}

.ob-quote,
.ob-reflection {
    margin: 0 0 var(--ub-space-3);
    font-size: var(--ub-text-base);
    line-height: var(--ub-leading-reading);
    color: var(--ub-ink);
}

.ob-quote > :first-child,
.ob-reflection > :first-child {
    margin-top: 0;
}

.ob-quote > :last-child,
.ob-reflection > :last-child {
    margin-bottom: 0;
}

.ob-reflection {
    padding-left: var(--ub-space-3);
    border-left: 2px solid var(--ub-rule-strong, currentColor);
    color: var(--ub-ink-muted);
}

.ob-report-disclosure {
    margin-top: var(--ub-space-3);
    font-size: var(--ub-text-sm);
    color: var(--ub-ink-muted);
}

.ob-report-disclosure > summary {
    cursor: pointer;
}

.ob-report {
    margin-top: var(--ub-space-3);
}
