/* Scripturewell preview V14: Bible reference links and the "Back to ..." button. */

/* A Bible reference inside teaching text: same type as the text, underlined so it reads as a link. */
a.swv-ref {
    color: var(--crimson);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
    border-radius: 3px;
    padding: 0 1px;
    white-space: nowrap;
    cursor: pointer;
}
[data-theme='dark'] a.swv-ref { color: var(--gold-light); }
a.swv-ref:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
a.swv-ref:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; text-decoration: none; }

/* The way back: a bar above the bottom navigation on phones, at the bottom on larger screens. */
.swv-back {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 1200;
    display: flex;
    align-items: stretch;
    max-width: calc(100vw - 24px);
    border: 1px solid var(--crimson-dark, #68312f);
    border-radius: 999px;
    background: var(--crimson, #813b39);
    color: var(--on-crimson, #fff8e9);
    box-shadow: 0 6px 22px rgba(30, 20, 14, 0.28);
    overflow: hidden;
}
.swv-back[hidden] { display: none; }
.swv-back button {
    min-height: 48px;
    border: 0;
    background: transparent;
    color: inherit;
    font: 600 0.95rem/1.2 var(--sw12-ui, system-ui, sans-serif);
    cursor: pointer;
}
.swv-back-go {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px 14px 10px 20px;
}
.swv-back-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swv-back-x {
    min-width: 48px;
    padding: 0 14px;
    border-left: 1px solid rgba(255, 248, 233, 0.35) !important;
    font-size: 1.3rem !important;
    font-weight: 400 !important;
}
.swv-back button:hover { background: rgba(255, 255, 255, 0.12); }
.swv-back button:focus-visible { outline: 3px solid var(--on-crimson, #fff8e9); outline-offset: -5px; border-radius: 999px; }
@media (max-width: 800px) {
    /* Fallback; the script sets the exact height of the bottom navigation bar when it shows. */
    .swv-back { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: no-preference) {
    .swv-back:not([hidden]) { animation: swv-in 0.18s ease-out; }
    @keyframes swv-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
}
@media print { .swv-back { display: none; } }
