/* ==========================================================================
   Diputación de Guadalajara – Estilos corporativos para STEC frontend
   ========================================================================== */

/*
 * COLOR BASE POR DEFECTO: morado corporativo #5B325F
 *
 * Sobreescribe los colores rojos de STEC (#ea4335, #f15e6e, #ff5f5f)
 * por el morado institucional en todos los controles de interfaz.
 *
 * No afecta a los colores individuales de cada evento (vienen del
 * color asignado al calendario del evento via inline styles).
 *
 * MAPA DE COLORES POR CALENDARIO:
 *   - Home / Diputación / Carreras populares: #5B325F (morado, base)
 *   - Natación:           #2559DB (azul)
 *   - Trail:              #CE1627 (rojo)
 *   - MTB:                #E5E000 (amarillo)
 *   - Mus:                #DB8925 (naranja)
 *   - Carreras infantiles:#82B440 (verde)
 *   - Pádel:             #43BAC0 (turquesa)
 */

/* ---------- Variables raíz: sobreescritura global ---------- */
/* html:root tiene especificidad (0,1,1) > :root (0,1,0) de STEC inline */
html:root {
    /* Botones generales */
    --stec-ec-button-bg: #5B325F;
    --stec-ec-button-bg-hover: #7A4580;
    --stec-ec-button-color: #fff;
    --stec-ec-button-color-hover: #fff;

    /* Menú superior (navegación, selector de vista, "Hoy") */
    --stec-top-menu-bg-active-primary: #5B325F;
    --stec-top-menu-bg-active-secondary: #4A2750;
    --stec-top-menu-color-active: #fff;

    /* Link hover */
    --stec-a-hover-color: #7A4580;

    /* Celda activa / seleccionada (mes/semana) */
    --stec-mw-cell-bg-active: #5B325F;
    --stec-mw-cell-color-active: #fff;

    /* Hover de celdas */
    --stec-mw-cell-bg-hover: rgba(91, 50, 95, 0.10);

    /* Indicador "Hoy" en leyenda de días */
    --stec-mw-legend-today-bg: #5B325F;
    --stec-mw-legend-today-color: #fff;

    /* Celda de hoy */
    --stec-mw-cell-today-bg: #5B325F;
    --stec-mw-cell-today-color: #fff;
}

/* Botones en frontend (no admin/dashboard) */
body:not(.wp-admin) .stec-button:hover {
    background-color: #7A4580;
    color: #fff;
}

/* Botón de cerrar modal */
body:not(.wp-admin) .stec-modal-close:hover {
    background-color: #5B325F;
}

/* Flechas del carrusel de medios */
body:not(.wp-admin) .stec-media-carousel-main .swiper-button-next:hover,
body:not(.wp-admin) .stec-media-carousel-main .swiper-button-prev:hover {
    background-color: #5B325F;
}

/* Selector de cantidad (qty) hover */
body:not(.wp-admin) .stec-qty-selector i:hover {
    color: #5B325F;
}

/* Indicador "Hoy" en leyenda de días de la semana.
   STEC Settings puede inyectar un color con !important; lo contrarrestamos. */
.stec-calendar-week-day-label.stec-calendar-week-day-label-today::after {
    background-color: #5B325F !important;
}
.stec-calendar-week-day-label.stec-calendar-week-day-label-today {
    color: #fff !important;
}

/* ---------- LEYENDA DE COLORES ---------- */

.cdgec-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 12px 0 0;
    padding: 10px 16px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.cdgec-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cdgec-legend-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.cdgec-legend-label {
    color: #333;
}

/* ---------- DIFERENCIACIÓN POR CALENDARIO ---------- */

/*
 * El script frontend.js detecta el atributo filter__calendar de cada
 * instancia en window.stecInstances y añade la clase
 * .cdgec-cal-{term_id} al contenedor .stec-instance correspondiente.
 *
 * A continuación se definen variables CSS específicas por calendario.
 * Si el shortcode filtra por un solo calendario, los controles de esa
 * instancia usarán su color propio.
 */

/* --- Natación: #2559DB (azul) --- */
.cdgec-cal-natacion {
    --stec-ec-button-bg: #2559DB;
    --stec-ec-button-bg-hover: #3A6EE8;
    --stec-top-menu-bg-active-primary: #2559DB;
    --stec-top-menu-bg-active-secondary: #1D4AB8;
    --stec-a-hover-color: #3A6EE8;
    --stec-mw-cell-bg-active: #2559DB;
    --stec-mw-cell-bg-hover: rgba(37, 89, 219, 0.10);
    --stec-mw-legend-today-bg: #2559DB;
    --stec-mw-cell-today-bg: #2559DB;
}
.cdgec-cal-natacion .stec-calendar-week-day-label.stec-calendar-week-day-label-today::after {
    background-color: #2559DB !important;
}

/* --- Trail: #CE1627 (rojo) --- */
.cdgec-cal-trail {
    --stec-ec-button-bg: #CE1627;
    --stec-ec-button-bg-hover: #E02D3D;
    --stec-top-menu-bg-active-primary: #CE1627;
    --stec-top-menu-bg-active-secondary: #A81220;
    --stec-a-hover-color: #E02D3D;
    --stec-mw-cell-bg-active: #CE1627;
    --stec-mw-cell-bg-hover: rgba(206, 22, 39, 0.10);
    --stec-mw-legend-today-bg: #CE1627;
    --stec-mw-cell-today-bg: #CE1627;
}
.cdgec-cal-trail .stec-calendar-week-day-label.stec-calendar-week-day-label-today::after {
    background-color: #CE1627 !important;
}

/* --- MTB: #E5E000 (amarillo) --- */
.cdgec-cal-mtb {
    --stec-ec-button-bg: #C8C300;
    --stec-ec-button-bg-hover: #E5E000;
    --stec-ec-button-color: #333333;
    --stec-ec-button-color-hover: #333333;
    --stec-top-menu-bg-active-primary: #C8C300;
    --stec-top-menu-bg-active-secondary: #ADA800;
    --stec-top-menu-color-active: #333333;
    --stec-a-hover-color: #C8C300;
    --stec-mw-cell-bg-active: #C8C300;
    --stec-mw-cell-color-active: #333333;
    --stec-mw-cell-bg-hover: rgba(229, 224, 0, 0.12);
    --stec-mw-legend-today-bg: #C8C300;
    --stec-mw-legend-today-color: #333333;
    --stec-mw-cell-today-bg: #C8C300;
    --stec-mw-cell-today-color: #333333;
    --stec-layout-month-week-active-cell-txtcolor: #333333;
}

/* MTB: botones con texto oscuro para legibilidad */
.cdgec-cal-mtb .stec-button:hover {
    color: #333333;
}
.cdgec-cal-mtb .stec-top-menu-button.active,
.cdgec-cal-mtb .stec-top-menu-button:hover {
    color: #333333;
}
.cdgec-cal-mtb .stec-top-scroll-menu .stec-top-scroll-menu-control {
    color: #333333;
}
.cdgec-cal-mtb .stec-top-scroll-menu .stec-top-scroll-menu-control.active,
.cdgec-cal-mtb .stec-top-scroll-menu .stec-top-scroll-menu-control:hover {
    color: #333333;
}
.cdgec-cal-mtb .stec-top-layout-dropdown-menu .stec-top-layout-dropdown-menu-list-item {
    color: #333333;
}
.cdgec-cal-mtb .stec-top-layout-dropdown-menu .stec-top-layout-dropdown-menu-list-item.active,
.cdgec-cal-mtb .stec-top-layout-dropdown-menu .stec-top-layout-dropdown-menu-list-item:hover {
    color: #333333;
}
.cdgec-cal-mtb .stec-top-scroll-menu .stec-top-scroll-menu-dropdown-list .stec-top-scroll-menu-dropdown-option {
    color: #333333;
}
.cdgec-cal-mtb .stec-top-scroll-menu .stec-top-scroll-menu-dropdown-list .stec-top-scroll-menu-dropdown-option.active,
.cdgec-cal-mtb .stec-top-scroll-menu .stec-top-scroll-menu-dropdown-list .stec-top-scroll-menu-dropdown-option:hover {
    color: #333333;
}
.cdgec-cal-mtb .stec-top-filter .stec-top-filter-selector {
    color: #333333;
}
.cdgec-cal-mtb .stec-top-filter-item {
    color: #333333;
}
.cdgec-cal-mtb .stec-top-datepicker-dropdown-menu .stec-top-menu-datepicker-mobile .stec-top-menu-button {
    color: #333333;
}
.cdgec-cal-mtb .stec-modal-close:hover {
    background-color: #C8C300;
    color: #333333;
}
.cdgec-cal-mtb .stec-calendar-week-day-label.stec-calendar-week-day-label-today::after {
    background-color: #C8C300 !important;
}
.cdgec-cal-mtb .stec-calendar-week-day-label.stec-calendar-week-day-label-today {
    color: #333333 !important;
}

/* --- Mus: #DB8925 (naranja) --- */
.cdgec-cal-mus {
    --stec-ec-button-bg: #DB8925;
    --stec-ec-button-bg-hover: #E9A04A;
    --stec-top-menu-bg-active-primary: #DB8925;
    --stec-top-menu-bg-active-secondary: #BE761E;
    --stec-a-hover-color: #E9A04A;
    --stec-mw-cell-bg-active: #DB8925;
    --stec-mw-cell-bg-hover: rgba(219, 137, 37, 0.10);
    --stec-mw-legend-today-bg: #DB8925;
    --stec-mw-cell-today-bg: #DB8925;
}
.cdgec-cal-mus .stec-calendar-week-day-label.stec-calendar-week-day-label-today::after {
    background-color: #DB8925 !important;
}

/* --- Carreras infantiles: #82B440 (verde) --- */
.cdgec-cal-infantiles {
    --stec-ec-button-bg: #82B440;
    --stec-ec-button-bg-hover: #96C85A;
    --stec-top-menu-bg-active-primary: #82B440;
    --stec-top-menu-bg-active-secondary: #6E9935;
    --stec-a-hover-color: #96C85A;
    --stec-mw-cell-bg-active: #82B440;
    --stec-mw-cell-bg-hover: rgba(130, 180, 64, 0.10);
    --stec-mw-legend-today-bg: #82B440;
    --stec-mw-cell-today-bg: #82B440;
}
.cdgec-cal-infantiles .stec-calendar-week-day-label.stec-calendar-week-day-label-today::after {
    background-color: #82B440 !important;
}

/* --- Pádel: #43BAC0 (turquesa) --- */
.cdgec-cal-padel {
    --stec-ec-button-bg: #43BAC0;
    --stec-ec-button-bg-hover: #5DCDD2;
    --stec-top-menu-bg-active-primary: #43BAC0;
    --stec-top-menu-bg-active-secondary: #379EA3;
    --stec-a-hover-color: #5DCDD2;
    --stec-mw-cell-bg-active: #43BAC0;
    --stec-mw-cell-bg-hover: rgba(67, 186, 192, 0.10);
    --stec-mw-legend-today-bg: #43BAC0;
    --stec-mw-cell-today-bg: #43BAC0;
}
.cdgec-cal-padel .stec-calendar-week-day-label.stec-calendar-week-day-label-today::after {
    background-color: #43BAC0 !important;
}

/* --- Carreras populares / Home / Diputación: #5B325F (morado, ya es el base) --- */
.cdgec-cal-diputacion {
    --stec-ec-button-bg: #5B325F;
    --stec-ec-button-bg-hover: #7A4580;
    --stec-top-menu-bg-active-primary: #5B325F;
    --stec-top-menu-bg-active-secondary: #4A2750;
    --stec-a-hover-color: #7A4580;
    --stec-mw-cell-bg-active: #5B325F;
    --stec-mw-cell-bg-hover: rgba(91, 50, 95, 0.10);
    --stec-mw-legend-today-bg: #5B325F;
    --stec-mw-cell-today-bg: #5B325F;
}
.cdgec-cal-diputacion .stec-calendar-week-day-label.stec-calendar-week-day-label-today::after {
    background-color: #5B325F !important;
}
