/* CX Eventos - estilos del front.
   Heredan el aire del plugin anterior, pero con variables para que cada
   web pueda cambiar colores sin tocar este archivo. */

.cxev-wrap {
    --cxev-columnas: 3;
    --cxev-hueco: 24px;
    --cxev-radio: 12px;
    --cxev-fondo: #ffffff;
    --cxev-texto: #2b2b2b;
    --cxev-suave: #5c5c5c;
    --cxev-linea: #e7e7e7;
    --cxev-acento: #ea5535;
    --cxev-acento-oscuro: #c8401f;
    --cxev-acento-texto: #ffffff;
    --cxev-alto-img: 300px;

    width: 100%;
    margin: 24px 0;
}

/* ---------- Filtros ---------- */

.cxev-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.cxev-filtro {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--cxev-linea);
    background: var(--cxev-fondo);
    color: var(--cxev-suave);
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.2;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.cxev-filtro:hover {
    border-color: var(--cxev-acento);
    color: var(--cxev-texto);
}

.cxev-filtro.is-activo {
    background: var(--cxev-acento);
    border-color: var(--cxev-acento);
    color: var(--cxev-acento-texto);
}

/* Meses sin eventos.
   Van con !important a proposito: estos botones viven dentro del tema de
   cada web, y casi todos los temas estilan <button> con mano dura. Sin esto
   un mes vacio puede acabar pintado igual que uno activo. */
.cxev-wrap .cxev-filtros .cxev-filtro--vacio,
.cxev-wrap .cxev-filtros .cxev-filtro--vacio:hover,
.cxev-wrap .cxev-filtros .cxev-filtro--vacio:focus,
.cxev-wrap .cxev-filtros .cxev-filtro--vacio:active,
.cxev-wrap .cxev-filtros .cxev-filtro[disabled] {
    opacity: .3 !important;
    filter: grayscale(1);
    background: transparent !important;
    background-image: none !important;
    border: 1px dashed var(--cxev-linea) !important;
    color: var(--cxev-suave) !important;
    box-shadow: none !important;
    text-decoration: none !important;
    transform: none !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    user-select: none;
    -webkit-user-select: none;
}

/* Y que nunca se pueda quedar marcado como activo. */
.cxev-wrap .cxev-filtros .cxev-filtro--vacio.is-activo {
    background: transparent !important;
    color: var(--cxev-suave) !important;
}

/* ---------- Cuadricula ---------- */

.cxev-grid {
    display: grid;
    grid-template-columns: repeat(var(--cxev-columnas), minmax(0, 1fr));
    gap: var(--cxev-hueco);
    align-items: stretch;
}

.cxev-grid.cxev-fila {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.cxev-grid.cxev-fila .cxev-card {
    flex: 1 1 280px;
    max-width: 400px;
}

/* ---------- Tarjeta ---------- */

.cxev-card {
    display: flex;
    flex-direction: column;
    background: var(--cxev-fondo);
    border: 1px solid var(--cxev-linea);
    border-radius: var(--cxev-radio);
    overflow: hidden;
    transition: transform .22s ease, box-shadow .22s ease;
}

.cxev-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .10);
}

.cxev-card[hidden] {
    display: none;
}

.cxev-card--destacado {
    border-color: var(--cxev-acento);
}

.cxev-card--terminado {
    opacity: .72;
}

.cxev-card__img {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #f1f1f1;
    overflow: hidden;
}

.cxev-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.cxev-card:hover .cxev-card__img img {
    transform: scale(1.04);
}

.cxev-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 4px;
}

.cxev-card__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    flex-grow: 1;
}

.cxev-card__titulo {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.35;
    color: var(--cxev-texto);
}

.cxev-card__titulo a {
    color: inherit;
    text-decoration: none;
}

.cxev-card__titulo a:hover {
    text-decoration: underline;
}

.cxev-card__fecha {
    margin: 0;
    font-size: .9rem;
    font-weight: 600;
    color: var(--cxev-acento);
}

.cxev-card__fecha--libre {
    font-weight: 500;
    font-style: italic;
    color: var(--cxev-suave);
}

.cxev-card__hora {
    font-weight: 400;
    color: var(--cxev-suave);
}

.cxev-card__lugar {
    margin: -4px 0 0;
    font-size: .87rem;
    color: var(--cxev-suave);
}

.cxev-card__lugar[hidden] {
    display: none;
}

.cxev-card__texto {
    font-size: .94rem;
    line-height: 1.65;
    color: var(--cxev-suave);
    flex-grow: 1;
}

.cxev-card__texto p {
    margin: 0 0 10px;
}

.cxev-card__texto p:last-child {
    margin-bottom: 0;
}

.cxev-card__texto ul,
.cxev-card__texto ol {
    margin: 0 0 10px;
    padding-left: 20px;
}

.cxev-card__boton {
    display: inline-block;
    margin-top: auto;
    padding: 12px 22px;
    background: var(--cxev-acento);
    color: var(--cxev-acento-texto);
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: .93rem;
    transition: opacity .2s ease;
}

.cxev-card__boton:hover {
    background: var(--cxev-acento-oscuro);
    color: var(--cxev-acento-texto);
}

.cxev-card__extras {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--cxev-linea);
}

.cxev-card__extra {
    padding: 5px 11px;
    background: #f4f4f4;
    color: var(--cxev-suave);
    border-radius: 4px;
    font-size: .8rem;
    text-decoration: none;
}

.cxev-card__extra:hover {
    background: #ebebeb;
    color: var(--cxev-texto);
}

/* ---------- Adaptable ---------- */

@media (max-width: 900px) {
    .cxev-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .cxev-grid {
        grid-template-columns: 1fr;
    }

    .cxev-grid.cxev-fila .cxev-card {
        max-width: 100%;
    }

    .cxev-card__body {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cxev-card,
    .cxev-card__img img {
        transition: none;
    }

    .cxev-card:hover {
        transform: none;
    }

    .cxev-card:hover .cxev-card__img img {
        transform: none;
    }
}
