:root {
    --sp-primary: #601028;
    --sp-primary-soft: #7e1b3a;
    --sp-secondary: #a62346;
    --sp-bg: #f6f3ef;
    --sp-surface: #ffffff;
    --sp-text: #1f2937;
    --sp-muted: #6b7280;
    --sp-border: #e8dee2;
    --sp-shadow-sm: 0 3px 14px rgba(76, 18, 38, 0.07);
    --sp-transition: all 0.22s ease;
}

* {
    font-family:
        "Montserrat",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    background: var(--sp-bg);
}

.sp-page {
    width: min(1320px, calc(100% - 2rem));
    margin: 1.75rem auto 2.5rem;
}

.sp-hero {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: var(--sp-primary) url("/images/fondo_rojo.png") center / cover
        no-repeat;
    border: none;
    padding: 1.1rem 2rem;
    color: #fff;
    box-shadow: none;
}

.sp-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.45rem;
}

.sp-hero-escudo {
    width: 52px;
    height: auto;
    opacity: 0.92;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.sp-hero-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sp-hero-title {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sp-hero-subtitle {
    margin: 0.15rem auto 0;
    max-width: 740px;
    font-size: 0.88rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.sp-alert {
    margin: 1rem 0;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 0.8rem 0.95rem;
    font-weight: 600;
}

.sp-alert-success {
    background: #ebf9f2;
    color: #0f5132;
    border-color: #9ddfba;
}

.sp-alert-warning {
    background: #fff7df;
    color: #8a6100;
    border-color: #f1dc99;
}

.sp-alert-danger {
    background: #fdf0f2;
    color: #7a2236;
    border-color: #efc2cf;
}

.sp-alert-info {
    background: #edf6ff;
    color: #1d4f8f;
    border-color: #bfd9fb;
}

.sp-shell {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: 10px;
    box-shadow: var(--sp-shadow-sm);
    padding: 1.5rem;
}

.sp-agenda-layout {
    margin-top: 1.2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.2rem;
}

.sp-agenda-calendar-shell {
    min-width: 0;
}

.sp-agenda-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.sp-agenda-sidebar-section {
    padding: 1.2rem;
}

.sp-section-header {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #5c1e33;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(96, 16, 40, 0.15);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.sp-calendar-wrapper {
    background: rgba(96, 16, 40, 0.03);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid var(--sp-border);
}

/* Legend */
.sp-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.sp-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sp-text);
}

.sp-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

.sp-dot-ordinaria {
    background: #601028;
}

.sp-dot-extraordinaria {
    background: #a62346;
}

.sp-dot-solemne {
    background: #2c3e50;
}

.sp-dot-comision {
    background: #95a5a6;
}

/* Filters */
.sp-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sp-filter-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sp-text);
}

.sp-filter-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--sp-primary);
    cursor: pointer;
}

.sp-filter-label {
    user-select: none;
}

/* Help */
.sp-help-text {
    margin: 0 0 1rem;
    font-size: 0.88rem;
    color: var(--sp-muted);
    line-height: 1.55;
    font-weight: 500;
}

.sp-btn {
    border-radius: 10px;
    padding: 0.5rem 0.74rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--sp-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.sp-btn-primary {
    border: 1px solid #8a1f40;
    background: #8a1f40;
    color: #fff;
}

.sp-btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(166, 35, 70, 0.25);
}

/* FullCalendar theme overrides */
.fc .fc-toolbar-title {
    color: var(--sp-text);
    font-weight: 700;
    font-size: 1.15rem !important;
}

.fc .fc-button-primary {
    background-color: var(--sp-primary) !important;
    border-color: var(--sp-primary) !important;
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: 8px !important;
    transition: var(--sp-transition);
}

.fc .fc-button-primary:hover {
    background-color: #4c0c20 !important;
    border-color: #4c0c20 !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: #4c0c20 !important;
    border-color: #4c0c20 !important;
}

.fc .fc-button-primary:focus {
    box-shadow: 0 0 0 3px rgba(166, 35, 70, 0.25) !important;
}

.fc .fc-day-today {
    background-color: rgba(166, 35, 70, 0.06) !important;
}

.fc .fc-event {
    border: none !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 4px;
}

.fc .fc-event:hover {
    opacity: 0.88;
}

.fc .fc-col-header-cell-cushion {
    font-weight: 700;
    color: #5c1e33;
    text-transform: capitalize;
}

.fc .fc-daygrid-day-number {
    font-weight: 600;
    color: var(--sp-text);
}

/* Event type classes */
.fc .evt-ordinaria {
    background-color: #601028 !important;
    color: #fff !important;
}

.fc .evt-extraordinaria {
    background-color: #a62346 !important;
    color: #fff !important;
}

.fc .evt-solemne {
    background-color: #2c3e50 !important;
    color: #fff !important;
}

.fc .evt-comision {
    background-color: #95a5a6 !important;
    color: #fff !important;
}

/* Filter-based hiding via CSS classes on the calendar container */
#sp-calendar.sp-filter-hide-ordinaria .evt-ordinaria {
    display: none !important;
}

#sp-calendar.sp-filter-hide-extraordinaria .evt-extraordinaria {
    display: none !important;
}

#sp-calendar.sp-filter-hide-solemne .evt-solemne {
    display: none !important;
}

#sp-calendar.sp-filter-hide-comision .evt-comision {
    display: none !important;
}

@media (max-width: 992px) {
    .sp-agenda-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sp-page {
        width: calc(100% - 1rem);
        margin-top: 1rem;
    }

    .sp-hero {
        padding: 0.7rem 0.75rem;
    }

    .sp-hero-escudo {
        width: 36px;
    }

    .sp-hero-subtitle {
        font-size: 0.78rem;
    }

    .sp-legend {
        grid-template-columns: 1fr;
    }

    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
}
