.upeu-events-widget,
.upeu-events-widget * {
    box-sizing: border-box;
}

.upeu-events-widget {
    width: 100%;
}

.upeu-events-filters {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 70px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.upeu-events-filter {
    appearance: none;
    border: 0;
    margin: 0;
    min-height: 50px;
    padding: 0 28px;
    border-radius: 28px;
    background: #0c4c86;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 0 0 auto;
    font: inherit;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: transform .18s ease, opacity .18s ease, background-color .18s ease;
}

.upeu-events-filter:hover,
.upeu-events-filter:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.upeu-events-filter.is-active {
    background: #f7a900;
}

.upeu-events-filter .upeu-event-svg {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.upeu-events-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 32px;
}

.upeu-event-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 520px;
    height: auto;
    min-width: 0;
    overflow: visible;
    border: 1px solid #cfe5f8;
    border-radius: 34px;
    background: #f6f7f9;
    text-decoration: none !important;
    color: inherit;
    box-shadow: 0 12px 28px rgba(18, 62, 99, .10);
    transition: transform .2s ease, box-shadow .2s ease;
}

.upeu-event-card[href]:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(18, 62, 99, .15);
}

.upeu-event-card[hidden] {
    display: none !important;
}

.upeu-event-image-wrap {
    position: relative;
    width: 100%;
    height: 330px;
    flex: 0 0 auto;
    overflow: visible;
    border-radius: 34px 34px 0 0;
    background: #e9eef3;
}

.upeu-event-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    border-radius: 33px 33px 0 0;
}

/* v1.2: por defecto la imagen conserva su proporcion original y se muestra completa. */
.upeu-events-widget.upeu-image-mode-natural .upeu-event-card:not(.is-image-only) .upeu-event-image-wrap {
    height: auto;
    overflow: visible;
}

.upeu-events-widget.upeu-image-mode-natural .upeu-event-card:not(.is-image-only) .upeu-event-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center center;
}

.upeu-events-widget.upeu-image-mode-contain .upeu-event-image {
    object-fit: contain;
}

.upeu-events-widget.upeu-image-mode-cover .upeu-event-image {
    object-fit: cover;
}

/* Una tarjeta que solo contiene fotografia no debe reservar alto extra.
   Cuando el titulo y el resto de datos estan ocultos, la tarjeta se ajusta solo a la imagen. */
.upeu-events-widget.upeu-image-mode-natural .upeu-event-card.is-image-only {
    min-height: 0 !important;
    height: auto !important;
}

.upeu-events-widget.upeu-image-mode-natural .upeu-event-card.is-image-only .upeu-event-image-wrap {
    height: auto;
    flex: 0 0 auto;
}

.upeu-events-widget.upeu-image-mode-natural .upeu-event-card.is-image-only .upeu-event-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
}

.upeu-event-card.is-image-only .upeu-event-image-wrap {
    height: auto;
    flex: 0 0 auto;
}

.upeu-event-card.has-no-image .upeu-event-body {
    padding-top: 54px;
}

.upeu-event-card.is-image-only .upeu-event-image-wrap,
.upeu-event-card.is-image-only .upeu-event-image {
    border-radius: 34px;
}

.upeu-event-card.is-image-only {
    min-height: 0 !important;
}

.upeu-event-card.has-no-image .upeu-event-body {
    border-radius: 34px;
}

.upeu-event-status {
    position: absolute;
    z-index: 6;
    top: -22px;
    right: 20px;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 15px;
    background: #e8eef6;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 5px 16px rgba(0,0,0,.06);
}

.upeu-event-card > .upeu-event-status {
    top: -22px;
}

.upeu-event-status .upeu-event-svg {
    width: 18px;
    height: 18px;
}

.upeu-event-status.status-proximamente {
    background: #fff3d6;
    color: #d97706;
}

.upeu-event-status.status-en_curso {
    background: #dcfce7;
    color: #15803d;
}

.upeu-event-status.status-finalizado {
    background: #e8eef6;
    color: #475569;
}

.upeu-event-status.status-cancelado {
    background: #fde8e7;
    color: #dc2626;
}

.upeu-event-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 28px 20px;
    text-align: center;
    border-radius: 0 0 34px 34px;
    background: #f6f7f9;
}

.upeu-event-datebox {
    width: min(100%, 300px);
    min-height: 74px;
    margin: 0 auto 16px;
    padding: 8px 10px;
    border-radius: 22px;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    background: #f7fbff;
    box-shadow: 0 15px 30px rgba(27, 60, 89, .12);
}

.upeu-event-day {
    min-height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #064b86;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    padding: 0 10px;
}

.upeu-event-datecopy {
    min-width: 0;
    text-align: center;
}

.upeu-event-month {
    color: #71829a;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1.1;
    text-transform: uppercase;
}

.upeu-event-dateline {
    margin-top: 4px;
    color: #073b70;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.15;
}

.upeu-event-title {
    margin: 0 0 6px;
    color: #073b70;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.08;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.upeu-event-subtitle {
    color: #111;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.upeu-event-meta {
    width: 100%;
    margin-top: 10px;
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    color: #4a4a4a;
    font-size: 13px;
    line-height: 1.25;
}

.upeu-event-meta-item {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.upeu-event-meta-item .upeu-event-svg {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
}

.upeu-events-empty {
    padding: 24px;
    border: 1px dashed #c9d3dd;
    border-radius: 12px;
    text-align: center;
    color: #5d6670;
}

@media (max-width: 1024px) {
    .upeu-events-filters {
        margin-bottom: 48px;
    }
    .upeu-event-body {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 767px) {
    .upeu-events-grid {
        grid-template-columns: 1fr;
    }
    .upeu-events-filters {
        gap: 10px;
        margin-bottom: 34px;
    }
    .upeu-events-filter {
        min-height: 44px;
        padding-left: 18px;
        padding-right: 18px;
        gap: 9px;
    }
    .upeu-events-filter .upeu-event-svg {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }
    .upeu-event-card {
        min-height: 460px;
        height: auto;
        border-radius: 26px;
    }
    .upeu-events-widget:not(.upeu-image-mode-natural) .upeu-event-image-wrap {
        height: 285px;
    }
    .upeu-event-body {
        padding: 14px 18px 18px;
    }
    .upeu-event-datebox {
        width: min(100%, 285px);
        min-height: 68px;
        grid-template-columns: 56px minmax(0, 1fr);
        margin-bottom: 14px;
        border-radius: 19px;
    }
    .upeu-event-day {
        min-height: 50px;
        border-radius: 14px;
        font-size: 18px;
    }
    .upeu-event-month,
    .upeu-event-dateline {
        font-size: 14px;
    }
    .upeu-event-title {
        font-size: 20px;
    }
    .upeu-event-subtitle {
        font-size: 15px;
    }
    .upeu-event-status {
        top: -20px;
        right: 16px;
        min-height: 40px;
        padding: 0 16px;
        font-size: 14px;
    }
    .upeu-event-meta {
        gap: 10px 16px;
        font-size: 13px;
    }
}

/* ==========================================================
   Carrusel UPeU Eventos v1.5.0
   ========================================================== */
.upeu-events-carousel {
    position: relative;
    width: 100%;
}

.upeu-events-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-top: 30px;
    margin-top: -30px;
}

.upeu-carousel-enabled .upeu-events-grid {
    --upeu-slides-per-view: 2;
    --upeu-carousel-gap: 28px;
    display: flex;
    grid-template-columns: none !important;
    flex-wrap: nowrap;
    align-items: flex-start;
    width: 100%;
    gap: var(--upeu-carousel-gap);
    transform: translate3d(0, 0, 0);
    transition-property: transform;
    transition-duration: var(--upeu-carousel-duration, 650ms);
    transition-timing-function: cubic-bezier(.22,.61,.36,1);
    will-change: transform;
}

.upeu-carousel-enabled .upeu-event-card {
    flex: 0 0 var(--upeu-card-width, calc(50% - 14px));
    width: var(--upeu-card-width, calc(50% - 14px));
    max-width: var(--upeu-card-width, calc(50% - 14px));
    transition:
        transform var(--upeu-carousel-duration, 650ms) cubic-bezier(.22,.61,.36,1),
        opacity var(--upeu-carousel-duration, 650ms) cubic-bezier(.22,.61,.36,1),
        box-shadow .25s ease;
}

.upeu-carousel-clone {
    pointer-events: none;
}

/* Animaciones elegantes */
.upeu-carousel-animation-soft .upeu-event-card {
    opacity: .88;
}

.upeu-carousel-animation-soft .upeu-event-card.is-carousel-visible {
    opacity: 1;
}

.upeu-carousel-animation-zoom .upeu-event-card {
    opacity: .76;
    transform: scale(.965);
}

.upeu-carousel-animation-zoom .upeu-event-card.is-carousel-visible {
    opacity: 1;
    transform: scale(1);
}

.upeu-carousel-animation-lift .upeu-event-card {
    opacity: .78;
    transform: translateY(10px);
}

.upeu-carousel-animation-lift .upeu-event-card.is-carousel-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Navegacion */
.upeu-carousel-arrow {
    position: absolute;
    z-index: 12;
    top: 50%;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(0, 56, 101, .10);
    border-radius: 50%;
    background: rgba(255, 255, 255, .96);
    color: #003865;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 56, 101, .16);
    transform: translateY(-50%);
    transition: transform .22s ease, box-shadow .22s ease, background-color .22s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.upeu-carousel-arrow:hover,
.upeu-carousel-arrow:focus-visible {
    background: #fff;
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 14px 34px rgba(0, 56, 101, .22);
    outline: none;
}

.upeu-carousel-arrow svg {
    width: 23px;
    height: 23px;
}

.upeu-carousel-prev {
    left: -18px;
}

.upeu-carousel-next {
    right: -18px;
}

.upeu-carousel-arrow[hidden],
.upeu-carousel-dots[hidden] {
    display: none !important;
}

.upeu-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 18px;
    margin-top: 22px;
}

.upeu-carousel-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 56, 101, .24);
    cursor: pointer;
    transition: width .28s ease, background-color .28s ease, transform .28s ease;
}

.upeu-carousel-dot:hover,
.upeu-carousel-dot:focus-visible {
    transform: scale(1.18);
    outline: none;
}

.upeu-carousel-dot.is-active {
    width: 24px;
    background: #009fe3;
}

@media (max-width: 1024px) {
    .upeu-carousel-enabled .upeu-events-grid {
        --upeu-slides-per-view: 2;
    }

    .upeu-carousel-prev {
        left: 4px;
    }

    .upeu-carousel-next {
        right: 4px;
    }
}

@media (max-width: 767px) {
    .upeu-carousel-enabled .upeu-events-grid {
        --upeu-slides-per-view: 1;
    }

    .upeu-carousel-enabled .upeu-event-card {
        flex-basis: var(--upeu-card-width, 100%);
        width: var(--upeu-card-width, 100%);
        max-width: var(--upeu-card-width, 100%);
    }

    .upeu-carousel-arrow {
        width: 40px;
        height: 40px;
    }

    .upeu-carousel-prev {
        left: 6px;
    }

    .upeu-carousel-next {
        right: 6px;
    }

    .upeu-carousel-dots {
        margin-top: 16px;
        gap: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .upeu-carousel-enabled .upeu-events-grid,
    .upeu-carousel-enabled .upeu-event-card,
    .upeu-carousel-dot,
    .upeu-carousel-arrow {
        transition-duration: 1ms !important;
    }
}
