/* ===== Fotos rotativas en la línea de tiempo (crossfade) ===== */
.timeline-photo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
}

.timeline-photo-img.is-active { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .timeline-photo-img { transition: none; }
}

/* ===== Tarjeta de evento clickable ===== */
.event-clickable {
    cursor: pointer;
    outline: none;
}

.event-clickable:focus-visible {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.45);
    border-radius: 12px;
}

.event-more {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 700;
    transition: gap 0.2s ease;
}

.event-more svg { width: 16px; height: 16px; }
.event-clickable:hover .event-more { gap: 10px; }

/* ===== Modal de detalle ===== */
.event-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.event-modal.hidden { display: none; }

.event-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.event-modal-panel {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow: hidden auto;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    animation: eventModalIn 0.3s ease;
}

@keyframes eventModalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.event-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: background 0.2s ease, transform 0.2s ease;
}

.event-modal-close:hover { background: #fff; transform: scale(1.05); }
.event-modal-close svg { width: 20px; height: 20px; }

.event-modal-hero {
    position: relative;
    height: 280px;
}

.event-modal-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-modal-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.15) 55%, transparent);
}

.event-modal-hero-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px;
}

.event-modal-badge {
    display: inline-flex;
    border-radius: 999px;
    background: #dc2626;
    padding: 7px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
}

.event-modal-badge.is-dark { background: #0a0a0f; }

.event-modal-title {
    margin-top: 14px;
    color: #fff;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.event-modal-body { padding: 28px; }

.event-modal-desc {
    color: #4b5563;
    font-size: 0.975rem;
    line-height: 1.7;
}

.event-modal-desc p + p { margin-top: 14px; }

.event-modal-highlights {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.event-detail {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
}

.event-detail svg {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex-shrink: 0;
    color: #dc2626;
}

.event-modal-section {
    margin: 28px 0 14px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0a0a0f;
}

.event-modal-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.event-gallery-item {
    margin: 0;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
}

.event-gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.event-gallery-item:hover img { transform: scale(1.06); }

.event-modal-cta {
    margin-top: 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.event-cta-primary,
.event-cta-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.event-cta-primary {
    background: #dc2626;
    color: #fff;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.25);
}

.event-cta-primary:hover { background: #b91c1c; transform: translateY(-1px); }

.event-cta-ghost {
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #111827;
}

.event-cta-ghost:hover { background: #f3f4f6; }

@media (max-width: 480px) {
    .event-modal-hero { height: 220px; }
    .event-modal-hero-copy,
    .event-modal-body { padding: 20px; }
    .event-modal-cta a { flex: 1 1 auto; }

    .events-hero-copy {
        max-width: calc(100vw - 64px);
    }

    .timeline-shell,
    .timeline-card {
        width: calc(100vw - 72px);
        max-width: calc(100vw - 72px);
    }

    .timeline-media {
        width: calc(100vw - 72px);
        max-width: calc(100vw - 72px);
        box-sizing: border-box;
    }

    .timeline-title {
        font-size: 1.25rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }
}
