/* =========================================================
   EVENTOS — /eventos y /eventos/<congreso>
   Solo lo cargan las plantillas de eventos (bloque extra_head).
   Todas las clases empiezan por "ev-" para no afectar al resto.
   ========================================================= */

.ev-page {
    --ev-navy: #07152d;
    --ev-navy-2: #0b2847;
    --ev-gold: #d7b65d;
    --ev-green: #15966f;
    --ev-green-soft: #80c99b;
    --ev-red: #c72632;
    --ev-text: #1a2940;
    --ev-muted: #4b5668;
    --ev-line: #dce2e8;

    color: var(--ev-text);
    overflow-x: hidden;
}

.ev-page *,
.ev-page *::before,
.ev-page *::after {
    box-sizing: border-box;
}

.ev-page img {
    max-width: 100%;
}

.ev-page h1,
.ev-page h2,
.ev-page h3,
.ev-page h4,
.ev-page p {
    overflow-wrap: break-word;
}

.ev-container {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.ev-narrow {
    max-width: 860px;
}

.ev-narrow-left {
    max-width: 860px;
}

/* ---------- Cabecera ---------- */

.ev-hero {
    position: relative;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 90px 24px 70px;
    text-align: center;
    color: #fff;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(4, 18, 38, 0.97), rgba(11, 48, 82, 0.92)),
        linear-gradient(90deg, #071426, #123d63);
}

.ev-hero-image {
    min-height: 460px;
    background: var(--ev-navy);
}

.ev-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

.ev-hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(4, 18, 38, 0.72) 0%, rgba(4, 18, 38, 0.86) 70%, rgba(4, 18, 38, 0.95) 100%);
}

.ev-hero-content {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    margin: 0 auto;
}

.ev-hero h1 {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(2.1rem, 5.5vw, 4.4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.ev-hero p {
    max-width: 720px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.7;
}

.ev-label {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--ev-green-soft);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ev-back {
    display: table;
    margin: 0 auto 22px;
    padding: 8px 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    text-decoration: none;
}

.ev-back:hover,
.ev-back:focus-visible {
    color: #fff;
    border-color: var(--ev-gold);
}

/* ---------- Fecha y lugar ---------- */

.ev-facts {
    padding: 0 24px;
    background: var(--ev-navy);
    color: #fff;
    border-bottom: 1px solid rgba(215, 182, 93, 0.35);
}

.ev-facts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ev-fact {
    display: grid;
    gap: 6px;
    align-content: start;
    padding: 26px 22px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.ev-fact:first-child {
    border-left: 0;
}

.ev-fact strong {
    font-size: 1.1rem;
    line-height: 1.35;
}

.ev-fact-extra {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.92rem;
    line-height: 1.5;
}

.ev-meta-label {
    color: var(--ev-gold);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* ---------- Secciones ---------- */

.ev-section {
    padding: 90px 24px;
}

.ev-section-alt {
    background: #fff;
}

.ev-number {
    display: block;
    margin-bottom: 10px;
    color: #2d744e;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.ev-page .ev-heading {
    position: relative;
    margin: 0 0 32px;
    padding-bottom: 19px;
    color: var(--ev-navy-2);
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.ev-page .ev-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ev-gold), var(--ev-green));
}

.ev-subheading {
    margin: 56px 0 24px;
    color: var(--ev-navy-2);
    font-size: clamp(1.3rem, 2.6vw, 1.7rem);
    line-height: 1.2;
}

.ev-text {
    margin: 0 0 20px;
    color: var(--ev-muted);
    font-size: 1.05rem;
    line-height: 1.85;
}

.ev-intro {
    max-width: 860px;
}

.ev-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 20px;
    background: var(--ev-navy);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.ev-button:hover,
.ev-button:focus-visible {
    background: var(--ev-green);
}

.ev-button-gold {
    background: var(--ev-gold);
    color: var(--ev-navy);
}

.ev-button-gold:hover,
.ev-button-gold:focus-visible {
    background: #fff;
    color: var(--ev-navy);
}

/* ---------- Tarjetas de /eventos ---------- */

.ev-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
}

.ev-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ev-line);
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(8, 30, 54, 0.1);
}

.ev-card-image {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--ev-navy);
}

.ev-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ev-card:hover .ev-card-image img {
    transform: scale(1.04);
}

.ev-card-year {
    position: absolute;
    left: 18px;
    bottom: 16px;
    padding: 6px 14px;
    background: var(--ev-gold);
    color: var(--ev-navy);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    border-radius: 999px;
}

.ev-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 28px;
}

.ev-card-edition {
    color: #2d744e;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ev-card h3 {
    margin: 0;
    color: var(--ev-navy-2);
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    line-height: 1.2;
}

.ev-card h3 a {
    color: inherit;
    text-decoration: none;
}

.ev-card h3 a:hover,
.ev-card h3 a:focus-visible {
    color: var(--ev-green);
}

.ev-card p {
    margin: 0;
    color: var(--ev-muted);
    line-height: 1.7;
}

.ev-card .ev-button {
    margin-top: auto;
}

.ev-meta {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--ev-text);
    font-weight: 700;
    line-height: 1.5;
}

.ev-meta .ev-meta-label {
    display: inline-block;
    min-width: 62px;
    color: #9a7b2b;
}

/* ---------- Ejes / temas ---------- */

.ev-topics-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.ev-topics-layout.has-image {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
}

.ev-topics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ev-topics-layout.has-image .ev-topics {
    grid-template-columns: minmax(0, 1fr);
}

.ev-topic {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 24px;
    background: #f5f7fa;
    border-left: 3px solid var(--ev-gold);
    border-radius: 0 14px 14px 0;
}

.ev-topic h3 {
    margin: 0 0 8px;
    color: var(--ev-navy-2);
    font-size: 1.12rem;
    line-height: 1.3;
}

.ev-topic p {
    margin: 0;
    color: var(--ev-muted);
    line-height: 1.7;
}

.ev-topic-number {
    flex-shrink: 0;
    color: var(--ev-green);
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1.2;
}

.ev-topics-image {
    margin: 0;
}

.ev-topics-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 22px;
    box-shadow: 0 24px 55px rgba(8, 30, 54, 0.24);
}

.ev-quote {
    margin-top: 48px;
    padding: 36px clamp(22px, 4vw, 48px);
    background: var(--ev-navy);
    color: rgba(255, 255, 255, 0.82);
    border-radius: 22px;
}

.ev-quote h3 {
    margin: 0 0 16px;
    color: #fff;
    font-size: clamp(1.3rem, 2.6vw, 1.7rem);
}

.ev-quote p {
    margin: 0 0 12px;
    line-height: 1.75;
}

.ev-quote p:last-child {
    margin-bottom: 0;
}

.ev-quote-highlight {
    color: var(--ev-gold);
    font-size: clamp(1.2rem, 2.4vw, 1.5rem);
    font-weight: 800;
}

/* ---------- Ponentes ---------- */

.ev-speakers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 28px;
}

.ev-speaker {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ev-line);
    border-radius: 20px;
    box-shadow: 0 14px 36px rgba(8, 30, 54, 0.08);
}

.ev-speaker-photo {
    margin: 0;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--ev-navy);
}

.ev-speaker-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ev-speaker-body {
    padding: 22px 22px 26px;
}

.ev-speaker h3 {
    margin: 0 0 10px;
    color: var(--ev-navy-2);
    font-size: 1.25rem;
    line-height: 1.25;
}

.ev-speaker p {
    margin: 0 0 10px;
    color: var(--ev-muted);
    font-size: 0.97rem;
    line-height: 1.7;
}

.ev-speaker p:last-child {
    margin-bottom: 0;
}

/* ---------- Premios ---------- */

.ev-awards {
    background:
        radial-gradient(circle at 85% 10%, rgba(215, 182, 93, 0.10), transparent 35%),
        #f5f7fa;
}

.ev-tribute {
    margin: 40px 0 0;
    padding: clamp(28px, 5vw, 56px);
    background:
        radial-gradient(circle at 50% 0%, rgba(91, 132, 153, 0.22), transparent 45%),
        linear-gradient(180deg, #061321, #0a2b3e);
    color: rgba(248, 246, 239, 0.8);
    border: 1px solid rgba(216, 180, 91, 0.35);
    border-radius: 24px;
}

.ev-tribute .ev-label {
    color: var(--ev-gold);
}

.ev-tribute h3 {
    margin: 0 0 22px;
    color: #f8f6ef;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    line-height: 1.15;
}

.ev-tribute p {
    max-width: 860px;
    margin: 0 0 18px;
    line-height: 1.85;
}

.ev-tribute .ev-button {
    margin-top: 12px;
}

.ev-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.ev-category {
    min-width: 0;
    padding: 28px 24px;
    background: #fff;
    border-top: 3px solid var(--ev-gold);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 14px 36px rgba(8, 30, 54, 0.08);
}

.ev-category h4 {
    margin: 10px 0 12px;
    color: var(--ev-navy-2);
    font-size: 1.15rem;
    line-height: 1.3;
}

.ev-category p {
    margin: 0 0 10px;
    color: var(--ev-muted);
    line-height: 1.7;
}

.ev-awards-closing {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    align-items: center;
    margin-top: 56px;
}

.ev-awards-closing.has-image {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.ev-motto {
    padding-left: 22px;
    border-left: 3px solid var(--ev-green);
}

.ev-motto h3 {
    margin: 0 0 12px;
    color: var(--ev-navy-2);
    font-size: clamp(1.3rem, 2.6vw, 1.7rem);
}

.ev-motto p {
    margin: 0 0 4px;
    color: var(--ev-text);
    font-size: 1.1rem;
    font-weight: 700;
}

.ev-awards-image {
    margin: 0;
}

.ev-awards-image img,
.ev-gallery img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(8, 30, 54, 0.18);
}

/* ---------- Galería ---------- */

.ev-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 20px;
}

.ev-gallery figure {
    margin: 0;
}

/* ---------- Patrocinadores y colaboradores ---------- */

.ev-logos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ev-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 22px 16px;
    background: #f5f7fa;
    border: 1px solid var(--ev-line);
    border-radius: 18px;
    text-align: center;
}

.ev-logo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 130px;
}

.ev-logo-frame img {
    display: block;
    max-width: 100%;
    max-height: 130px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.ev-logo-name {
    color: var(--ev-navy-2);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.35;
}

/* ---------- Congreso anterior / siguiente ---------- */

.ev-pager {
    padding: 40px 24px 70px;
}

.ev-pager-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.ev-pager-link {
    display: grid;
    gap: 8px;
    padding: 22px 24px;
    background: var(--ev-navy);
    color: #fff;
    border-radius: 16px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.ev-pager-link:hover,
.ev-pager-link:focus-visible {
    background: var(--ev-navy-2);
}

.ev-pager-link strong {
    line-height: 1.35;
}

.ev-pager-next {
    grid-column: 2;
    text-align: right;
}

/* El CSS general pone "img { height: auto !important }" por debajo de 900 px;
   estas imágenes recortadas (object-fit: cover) necesitan ocupar su caja. */
@media (max-width: 900px) {
    .ev-page .ev-hero-bg,
    .ev-page .ev-card-image img,
    .ev-page .ev-speaker-photo img {
        height: 100% !important;
    }
}

/* ---------- Tablet ---------- */

@media (max-width: 980px) {
    .ev-cards,
    .ev-topics,
    .ev-topics-layout.has-image,
    .ev-awards-closing.has-image {
        grid-template-columns: minmax(0, 1fr);
    }

    .ev-categories {
        grid-template-columns: minmax(0, 1fr);
    }

    .ev-topics-image {
        max-width: 480px;
    }
}

/* ---------- Móvil ---------- */

@media (max-width: 640px) {
    .ev-hero {
        min-height: 280px;
        padding: 64px 18px 52px;
    }

    .ev-hero-image {
        min-height: 380px;
    }

    .ev-section {
        padding: 60px 18px;
    }

    .ev-facts {
        padding: 0 18px;
    }

    .ev-facts-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ev-fact {
        padding: 18px 0;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .ev-fact:first-child {
        border-top: 0;
    }

    .ev-card-body {
        padding: 22px 20px 24px;
    }

    .ev-topic {
        padding: 20px 18px;
        gap: 14px;
    }

    .ev-tribute {
        border-radius: 18px;
    }

    .ev-logos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .ev-logo {
        padding: 16px 10px;
    }

    .ev-logo-frame {
        height: 96px;
    }

    .ev-logo-frame img {
        max-height: 96px;
    }

    .ev-logo-name {
        font-size: 0.85rem;
    }

    .ev-pager {
        padding: 24px 18px 56px;
    }

    .ev-pager-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ev-pager-next {
        grid-column: 1;
        text-align: left;
    }
}

/* ---------- Colaboradores propios de un congreso (nov 2026) ---------- */
/* Tarjetas blancas, 4 por fila en ordenador y 2 en móvil; todos los logos con el mismo cuadro. */

.ev-colaboradores {
    background: #fff;
}

.ev-logos-colab {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ev-logos-colab .ev-logo {
    background: #fff;
    border-color: #e3e8ee;
    box-shadow: 0 10px 28px rgba(6, 23, 45, 0.08);
    overflow: hidden;
}

.ev-logos-colab .ev-logo-frame {
    height: 150px;
}

.ev-logos-colab .ev-logo-frame img {
    max-height: 150px;
    border-radius: 10px;
    /* Funde los fondos casi blancos con la tarjeta; los logos de fondo oscuro o de color no cambian. */
    mix-blend-mode: multiply;
}

/* Logo con mucho margen blanco propio: se amplía para igualar el tamaño visual (el margen es blanco sobre blanco). */
.ev-logos-colab .ev-logo-frame img.ev-logo-ampliar {
    transform: scale(1.18);
}

/* Logo con fondo casi blanco (254 en lugar de 255): se aclara un 1 % para que el fondo quede blanco puro
   y no se vea un recuadro gris; el resto del logo no cambia a simple vista. */
.ev-logos-colab .ev-logo-frame img.ev-logo-aclarar {
    filter: brightness(1.01);
}

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

    .ev-logos-colab .ev-logo-frame {
        height: 110px;
    }

    .ev-logos-colab .ev-logo-frame img {
        max-height: 110px;
        border-radius: 8px;
    }
}
