/* ── Scripture reference links ─────────────────────────────────────────────── */
.jcf-scripture-refs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;              /* default; overridden by Elementor gap control */
}

.jcf-scripture-ref {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    position: relative;
    transition: opacity .15s;
}

.jcf-scripture-ref:hover,
.jcf-scripture-ref:focus {
    outline: none;
    opacity: .75;
}

/* ── Tooltip card ──────────────────────────────────────────────────────────── */
.jcf-scripture-tooltip {
    position: fixed;
    z-index: 99999;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
    padding: 16px 18px;
    max-width: 380px;
    width: max-content;
    pointer-events: auto;
    font-size: 14px;
    line-height: 1.65;
    left: -9999px;          /* hidden off-screen until positioned */
    /* clamp height so very long passages don't overflow the viewport */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile: render as a scrollable bottom sheet instead of a floating card */
@media (max-width: 600px) {
    .jcf-scripture-tooltip {
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, .18);
        padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
    }
}

.jcf-scripture-tooltip[hidden] {
    display: none;
}

/* ── Close button ──────────────────────────────────────────────────────────── */
.jcf-scripture-tooltip__close {
    position: absolute;
    top: 10px;
    right: 10px;
    appearance: none;
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: inherit;
    opacity: 0.4;
    transition: opacity 0.15s;
    border-radius: 4px;
}

.jcf-scripture-tooltip__close:hover,
.jcf-scripture-tooltip__close:focus {
    opacity: 1;
    outline: none;
}

/* Make room for the close button inside the card */
.jcf-scripture-tooltip {
    padding-top: 36px;
}

.jcf-scripture-tooltip__ref {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .55;
    margin-bottom: 8px;
}

.jcf-scripture-tooltip__text {
    margin: 0 0 10px;
    font-style: italic;
}

.jcf-scripture-tooltip__version {
    display: block;
    font-size: 11px;
    opacity: .45;
    font-style: normal;
}

.jcf-scripture-tooltip__loading {
    opacity: .55;
    font-style: italic;
}

.jcf-scripture-tooltip__error {
    color: #c00;
    font-size: 13px;
}
