/* ==========================================================
   EVENT CARDS HIERARCHY
   ========================================================== */
.card {
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}

.card h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}

.card .year {
    font-size: 13px;
    margin-top: 6px;
    font-weight: 600;
}

.label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    margin-top: 10px;
}

/* Base Importance Formats: Major (Gold) */
.major .card {
    background: #fffdf6;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-left: 6px solid #D4AF37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.06);
}

.major .card h2 {
    color: #685216;
}

.major .card .year {
    color: #b79528;
}

.major-label {
    color: #b79528;
}

.major .card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 14px 28px rgba(212, 175, 55, 0.16);
}

/* Base Importance Formats: Minor (Blue/Grey) */
.minor .card {
    background: white;
    border: 1px solid rgba(91, 125, 189, 0.15);
    border-left: 4px solid #5B7DBD;
    box-shadow: 0 4px 12px rgba(90, 70, 50, 0.03);
}

.minor .card h2 {
    color: #334155;
}

.minor .card .year {
    color: #64748b;
}

.minor-label {
    color: #5B7DBD;
}

.minor .card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 14px 28px rgba(90, 70, 50, 0.1);
}

/* Active Selection Cards Engine Styles */
.event.active.major .card {
    border: 2px solid #D4AF37;
    border-left: 6px solid #D4AF37;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

.event.active.minor .card {
    border: 2px solid #5B7DBD;
    border-left: 4px solid #5B7DBD;
    box-shadow: 0 0 0 4px rgba(91, 125, 189, 0.2);
}

/* ==========================================================
   ATMOSPHERIC TESTAMENT COLOR THEMING (All Devices & Panels)
   ========================================================= */

/* --- 1. OLD TESTAMENT ERA (Amber Parchment Theme) --- */

/* The Card Item on the Timeline */
.event.testament-ot .card {
    background: #fdfaf2 !important;
}

/* Card Heading (Title) */
.event.testament-ot .card h2,
.event.major.testament-ot .card h2,
.event.minor.testament-ot .card h2 {
    color: #78350f !important;
}

/* Card Year Label */
.event.testament-ot .card .year,
.event.major.testament-ot .card .year,
.event.minor.testament-ot .card .year {
    color: #d97706 !important;
}

/* Card Hover Interactions */
.event.testament-ot .card:hover,
.event.major.testament-ot .card:hover,
.event.minor.testament-ot .card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 14px 28px rgba(180, 83, 9, 0.15) !important;
}

/* The Expanded Side Detail Panels & Mobile Modals */
.detail.testament-ot,
.modal.testament-ot #modalBody,
#modalBody.testament-ot {
    border-top: 6px solid #b45309 !important;
    background-color: #fdfaf2 !important;
}

.detail.testament-ot h2,
.modal.testament-ot h2,
#modalBody.testament-ot h2 {
    color: #78350f !important;
}


/* --- 2. NEW TESTAMENT ERA (Gospel Crimson Theme) --- */

/* The Card Item on the Timeline */
.event.testament-nt .card,
.event.major.testament-nt .card,
.event.minor.testament-nt .card {
    background: #fef2f2 !important;
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
    border-left: 6px solid #dc2626 !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.05) !important;
}

/* Card Heading (Title) */
.event.testament-nt .card h2,
.event.major.testament-nt .card h2,
.event.minor.testament-nt .card h2 {
    color: #991b1b !important;
}

/* Card Year Label */
.event.testament-nt .card .year,
.event.major.testament-nt .card .year,
.event.minor.testament-nt .card .year {
    color: #ef4444 !important;
}

/* Card Hover Interactions */
.event.testament-nt .card:hover,
.event.major.testament-nt .card:hover,
.event.minor.testament-nt .card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 14px 28px rgba(220, 38, 38, 0.15) !important;
}

/* The Expanded Side Detail Panels & Mobile Modals */
.detail.testament-nt,
.modal.testament-nt #modalBody,
#modalBody.testament-nt {
    border-top: 6px solid #dc2626 !important;
    background-color: #fef2f2 !important;
}

.detail.testament-nt h2,
.modal.testament-nt h2,
#modalBody.testament-nt h2 {
    color: #991b1b !important;
}

/* ==========================================================
   DESKTOP DETAIL CARD PANELS
   ========================================================== */
.jesus-icon {
    color: #c62828 !important;
}

.detail {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(90, 70, 50, 0.12);
    border: 1px solid rgba(210, 184, 148, 0.2);
    position: sticky;
    top: 40px;
    height: max-content;
    max-height: calc(100vh - 80px);
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    transform: translateY(10px);
}

.detail.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.detail::after {
    content: "";
    position: absolute;
    top: var(--arrowY, 40px);
    width: 0;
    height: 0;
    border-style: solid;
    transition: top 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.left-detail::after {
    right: -12px;
    border-width: 12px 0 12px 12px;
    border-color: transparent transparent transparent white;
    filter: drop-shadow(4px 2px 2px rgba(90, 70, 50, 0.04));
}

.right-detail::after {
    left: -12px;
    border-width: 12px 12px 12px 0;
    border-color: transparent white transparent transparent;
    filter: drop-shadow(-4px 2px 2px rgba(90, 70, 50, 0.04));
}

/* Layout Content Typographies */
.detail h2,
.modal-content h2 {
    color: #5a4632;
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 4px;
}

.detail .year,
.modal-content .year {
    display: inline-block;
    font-size: 13px;
    color: #b08b57;
    background: #fbf7f0;
    padding: 3px 10px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #ebdcc5;
    font-weight: 600;
}

.detail h3,
.modal-content h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #8c765c;
    margin-top: 20px;
    margin-bottom: 6px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail h3:not(:first-of-type),
.modal-content h3:not(:first-of-type) {
    border-top: 1px solid rgba(210, 184, 148, 0.25);
    padding-top: 16px;
    margin-top: 22px;
}

.detail p,
.modal-content p,
.detail .inline-list,
.modal-content .inline-list {
    font-size: 14.5px;
    line-height: 1.6;
    color: #574c3f;
    margin: 0;
}

.detail h3 i,
.modal-content h3 i {
    margin-right: 6px;
    color: #b08b57;
    opacity: 0.85;
    font-size: 14px;
}

/* ==========================================================
   COLLAPSIBLE DISCLOSURE COMPONENT (JESUS SECTION)
   ========================================================== */
.collapsible-jesus-container {
    margin: 1.5rem 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    overflow: hidden;
    transition: border-color 0.25s ease;
}

.collapsible-jesus-container.is-open {
    border-color: #cbd5e1;
}

.jesus-toggle-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.jesus-toggle-btn:hover {
    background-color: #f1f5f9;
}

.jesus-toggle-btn span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jesus-icon {
    color: #a855f7;
}

.toggle-arrow {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.25s ease;
}

.jesus-content-wrapper {
    height: 0;
    overflow: hidden;
    transition: height 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.jesus-content-inner {
    padding: 0 16px 16px 16px;
    color: #334155;
    line-height: 1.6;
}

.jesus-content-inner p {
    margin: 0;
}

/* ==========================================================
   MOBILE RESPONSIVE MODAL OVERLAY
   ========================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(62, 50, 37, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    padding: 30px 24px 24px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f3eae0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5a4632;
    font-size: 16px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #ebdcc5;
}

/* Laptop specific visibility tweaks */
@media (max-width: 1400px) {
    #leftDetail {
        display: none !important;
        /* Hide left detail panel on laptops */
    }

    /* Make sure the right sidebar can scroll internally if content is long */
    .right-detail {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
}

.swipe-hint {
    display: none;
    /* Hidden by default on desktop */
}

/* Modal Content Transition Animations */
#modalBody {
    transition: opacity 0.15s ease-in-out;
}

#modalBody.fade-out {
    opacity: 0;
}

/* Mobile specific visibility tweaks */
@media (max-width: 992px) {
    .swipe-hint {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-top: 30px;
        font-size: 0.85rem;
        color: #8c765c;
        opacity: 0.7;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .swipe-hint i {
        animation: nudge 1.5s infinite;
    }
}

@keyframes nudge {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(3px);
    }
}