/* =====================================================================
   CALENDARIO DE EVENTOS — Iglesia Lugar Más Alto
   Usa los mismos colores del sitio: negro #030303, blanco y grises.
   ===================================================================== */

/* Superficie de cristal (igual que .glass-card, pero sin brincar al pasar el mouse) */
.cal-surface {
    background: rgba(10, 10, 10, 0.8);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------- Controles del mes ---------- */
.cal-nav-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background .25s, color .25s, border-color .25s;
}
.cal-nav-btn:hover { background: #fff; color: #000; border-color: #fff; }

.cal-today-btn {
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    color: #e2e8f0;
    transition: background .25s, color .25s;
}
.cal-today-btn:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

/* ---------- Cuadrícula ---------- */
.cal-weekdays,
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.cal-weekday {
    text-align: center;
    padding-bottom: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .15em;
    color: #94a3b8;
}
.cal-weekday .cal-wd-long { display: none; }

.cal-day {
    position: relative;
    min-width: 0;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 2px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.025);
    color: #e2e8f0;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}
.cal-day:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.12); }

.cal-day.is-past { color: #94a3b8; }
.cal-day.is-outside { background: transparent; color: #64748b; }
.cal-day.is-outside .cal-chips { opacity: .4; }

.cal-day-num {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.cal-day.is-today .cal-day-num { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.75); color: #fff; }

/* Día seleccionado: se invierte a blanco, como los botones principales del sitio */
.cal-day.is-selected,
.cal-day.is-selected:hover { background: #fff; border-color: #fff; color: #000; }
.cal-day.is-selected.is-today .cal-day-num { box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.6); color: #000; }

/* Indicadores de eventos: puntos en celular, etiquetas en pantallas grandes */
.cal-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}
.cal-chip {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.4);
    font-size: 0;
    overflow: hidden;
}
.cal-chip.is-especial { background: #fff; }
.cal-day.is-selected .cal-chip { background: rgba(0, 0, 0, 0.3); }
.cal-day.is-selected .cal-chip.is-especial { background: #000; }
.cal-chip-more { display: none; }

@media (min-width: 768px) {
    .cal-weekdays,
    .cal-grid { gap: 8px; }

    .cal-weekday { text-align: left; padding-left: 10px; }
    .cal-weekday .cal-wd-short { display: none; }
    .cal-weekday .cal-wd-long { display: inline; }

    .cal-day {
        aspect-ratio: auto;
        min-height: 112px;
        align-items: stretch;
        padding: 8px;
        gap: 6px;
        border-radius: 16px;
    }
    .cal-day-num { width: 30px; height: 30px; font-size: 15px; }

    .cal-chips { flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; gap: 4px; }
    .cal-chip {
        width: auto;
        height: auto;
        padding: 3px 7px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.08);
        color: #cbd5e1;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.3;
        text-align: left;
    }
    .cal-chip-text {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        overflow-wrap: anywhere;
    }
    .cal-chip.is-especial { background: #fff; color: #000; }
    .cal-day.is-selected .cal-chip { background: rgba(0, 0, 0, 0.07); color: rgba(0, 0, 0, 0.75); }
    .cal-day.is-selected .cal-chip.is-especial { background: #000; color: #fff; }

    .cal-chip-more {
        display: block;
        padding-left: 7px;
        font-size: 11px;
        font-weight: 600;
        color: #94a3b8;
        text-align: left;
    }
    .cal-day.is-selected .cal-chip-more { color: rgba(0, 0, 0, 0.55); }
}

/* Leyenda */
.cal-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.25);
}
.cal-legend-dot.is-especial { background: #fff; }

/* ---------- Panel del día y próximos eventos ---------- */
.cal-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    transition: background .25s, color .25s, border-color .25s;
}
.cal-action:hover { background: #fff; color: #000; border-color: #fff; }
.cal-action.is-primary { background: #fff; color: #000; border-color: #fff; }
.cal-action.is-primary:hover { background: #e2e8f0; }

/* Tarjeta "Próxima reunión" (días sin reuniones): resalta para llevar al siguiente evento */
.cal-next-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin-top: 16px;
    padding: 16px;
    text-align: left;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.22);
    transition: background .25s, border-color .25s;
}
.cal-next-card:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.4); }
.cal-next-icono {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fff;
    color: #000;
}
.cal-next-flecha { flex-shrink: 0; color: #94a3b8; transition: transform .25s, color .25s; }
.cal-next-card:hover .cal-next-flecha { color: #fff; transform: translateX(3px); }

.cal-upcoming-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cal-upcoming-row:first-child { border-top: 0; padding-top: 0; }
.cal-upcoming-row:last-child { padding-bottom: 0; }

.cal-date-block {
    width: 56px;
    flex-shrink: 0;
    padding: 10px 0;
    text-align: center;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    transition: background .25s, border-color .25s;
}
.cal-upcoming-row:hover .cal-date-block { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); }

/* Foco visible para teclado */
.cal-day:focus-visible,
.cal-nav-btn:focus-visible,
.cal-today-btn:focus-visible,
.cal-action:focus-visible,
.cal-next-card:focus-visible,
.cal-upcoming-row:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* Transición al cambiar de mes */
.cal-animate { animation: cal-in .45s var(--ease, ease-out); }
@keyframes cal-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .cal-animate { animation: none; }
}