/* =============================================
   fundacioncyd_new — Nuevos estilos de portada
   ============================================= */

/* --- FIX: Header en home — forzar fondo blanco, logo y nav oscuros --- */
.home .header,
.home .header:hover {
    background: #fff !important;
    border-bottom: 1px solid #E4E4E4 !important;
}
.home .header .logo-text,
.home .header:hover .logo-text {
    fill: #262F3D !important;
}
.home .header .nav-menu a,
.home .header:hover a:not(.btn-cta-news) {
    color: #262F3D !important;
}
.home .header .btn-cta-news,
.home .header:hover .btn-cta-news {
    color: #fff !important;
    background-color: #E0241B !important;
}
.home .header svg:not(.icon-red),
.home .header:hover svg:not(.icon-red) {
    fill: #262F3D !important;
}

/* --- FIX: brand-tagline oculto (era invisible sobre fondo oscuro, ahora se ve) --- */
.brand-tagline {
    display: none !important;
}

/* --- FIX: nav — font más pequeño para evitar wrapping, negrita --- */
.nav-menu ul a {
    font-size: 0.82rem;
    font-weight: 600 !important;
}
.nav-menu ul li {
    margin-right: 14px !important;
}

/* --- Header CTA + lupa --- */
.header-inner {
    align-items: center;
}
/* Lupa en rojo — todas las páginas */
.header .btn-search svg,
.header .btn-search svg path {
    fill: #E0241B !important;
}
.btn-cta-news {
    display: inline-block;
    align-self: center;
    background-color: #E0241B;
    color: #fff !important;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 3px;
    text-decoration: none !important;
    margin-right: 10px;
    white-space: nowrap;
    line-height: 1.2;
    height: auto;
    transition: background-color 0.2s ease;
}
.btn-cta-news:hover {
    background-color: #b81c14;
    color: #fff !important;
    text-decoration: none !important;
}

/* --- Hero Slideshow --- */
.hero-slider-wrapper {
    position: relative;
    overflow: hidden;
}
.hero-slider .owl-stage-outer,
.hero-slider .owl-stage,
.hero-slider .owl-item {
    height: 100%;
}
.hero-slide {
    position: relative;
    min-height: 460px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
}
@media (max-width: 575.98px) {
    .hero-slide {
        min-height: 300px;
    }
}
.hero-slide-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 30, 60, 0.5);
    z-index: 1;
}
.hero-slide-content {
    position: relative;
    z-index: 2;
    padding: 50px 0;
    width: 100%;
}
.hero-slide-title {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.25;
    max-width: 580px;
    margin-bottom: 10px;
}
@media (max-width: 767.98px) {
    .hero-slide-title {
        font-size: 1.25rem;
    }
}
.hero-slide-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 6px;
}
.text-accent {
    color: #E0241B;
}

/* Owl nav arrows */
.hero-slider .owl-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    padding: 0 12px;
    box-sizing: border-box;
    margin: 0;
}
.hero-slider .owl-nav button {
    pointer-events: all;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
}
.hero-nav-btn {
    background: rgba(255,255,255,0.85) !important;
    border: none;
    border-radius: 50%;
    width: 42px !important;
    height: 42px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a2647;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0;
}
.hero-nav-btn:hover {
    background: #fff !important;
}
/* Flechas blancas en slides oscuros */
.hero-slider-wrapper.hero-arrows-light .hero-nav-btn {
    background: rgba(255,255,255,0.2) !important;
    color: #fff;
}
.hero-slider-wrapper.hero-arrows-light .hero-nav-btn:hover {
    background: rgba(255,255,255,0.4) !important;
}
/* Flechas azul marino en slides claros */
.hero-slider-wrapper.hero-arrows-dark .hero-nav-btn {
    background: rgba(255,255,255,0.85) !important;
    color: #1a2647;
}
.hero-slider-wrapper.hero-arrows-dark .hero-nav-btn:hover {
    background: #fff !important;
}
/* Dots — subidos para quedar por encima del solapamiento de los cuadrados */
.hero-slider .owl-dots {
    position: absolute;
    bottom: 90px;
    width: 100%;
    text-align: center;
    margin: 0;
}
.hero-slider .owl-dot span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    border: 2px solid rgba(255,255,255,0.7);
    margin: 0 4px;
    display: inline-block;
    transition: background 0.2s;
}
.hero-slider .owl-dot.active span,
.hero-slider .owl-dot:hover span {
    background: #E0241B;
    border-color: #E0241B;
}

/* --- Stats Strip — solapado sobre el hero (mitad dentro, mitad fuera) --- */
.stats-strip {
    padding: 0 0 40px;
    background: transparent;
    border-bottom: none;
    margin-top: -90px;
    position: relative;
    z-index: 20;
}
.stats-strip .container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    flex-wrap: wrap;
}
.stats-strip .row {
    display: contents;
}
.stats-strip [class*="col-"] {
    width: auto !important;
    flex: 0 0 auto !important;
    max-width: none !important;
    padding: 0 !important;
    display: flex;
    align-items: stretch;
}
.stat-card {
    border: 2px solid #E0241B;
    border-radius: 4px;
    padding: 20px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 210px;
    height: 100%;
    box-sizing: border-box;
    background: #fff !important;
}
.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: #E0241B;
    line-height: 1;
    margin-bottom: 8px;
}
.stat-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #E0241B;
    line-height: 1.35;
}

/* --- Secciones de contenido: contenedor más estrecho para más margen lateral --- */
.section-noticias .container,
.section-publicaciones .container,
.section-proyectos .container,
.section-videoteca .container,
.stats-strip .container {
    max-width: 960px !important;
}

/* --- Content cards (Noticias + Publicaciones) --- */
.section-noticias,
.section-publicaciones,
.section-videoteca {
    background: #fff;
}
.section-noticias h2,
.section-publicaciones h2,
.section-proyectos h2 {
    color: #E0241B;
    font-weight: 700;
}
.section-noticias .push-bottom-xs,
.section-publicaciones .push-bottom-xs,
.section-proyectos .push-bottom-xs {
    border-bottom: 2px solid #E0241B;
    padding-bottom: 14px;
    margin-bottom: 24px !important;
}
/* Videoteca: título con línea roja debajo, sin recuadro alrededor */
.section-videoteca {
    padding: 24px 0 0;
}
.section-videoteca h2 {
    color: #E0241B;
    font-weight: 700;
    border-bottom: 2px solid #E0241B;
    padding-bottom: 14px;
    margin: 0 0 20px;
    text-transform: uppercase;
}
/* Videoteca: wrapper flex que coloca las flechas a los lados del grid */
.vid-grid-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}
.vid-grid-nav .vid-grid {
    flex: 1;
    min-width: 0;
}
.vid-arrow-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    line-height: 0;
    transition: opacity 0.2s;
    margin-bottom: 20px;
}
.vid-arrow-btn:hover {
    opacity: 0.65;
}
.vid-arrow-btn:disabled {
    opacity: 0.25;
    cursor: default;
}
.content-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.2s;
}
.content-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.content-card-image-link {
    display: block;
}
.content-card-image {
    overflow: hidden;
    height: 175px;
    background: #f0f0f0;
}
.content-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.content-card:hover .content-card-image img {
    transform: scale(1.04);
}
.content-card-image-placeholder {
    width: 100%;
    height: 100%;
    background: #e8e8e8;
}
.content-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.content-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}
.content-card-title a {
    color: #1a2647;
    text-decoration: none;
}
.content-card-title a:hover {
    color: #E0241B;
}
.content-card-excerpt {
    font-size: 0.83rem;
    color: #555;
    flex: 1;
    margin-bottom: 12px;
    line-height: 1.5;
}
.content-card-excerpt p {
    margin: 0;
}

/* --- Sección Proyectos --- */
.section-proyectos {
    background: #fff;
    padding-top: 20px;
    padding-bottom: 40px;
}
.proyecto-block {
    display: flex;
    flex-direction: column;
    padding: 40px 28px;
    min-height: 240px;
    color: #fff !important;
    text-decoration: none !important;
    transition: filter 0.2s ease;
    border: 2px solid #E0241B;
    width: 100%;
    box-sizing: border-box;
}
.proyecto-block:hover {
    filter: brightness(0.88);
    text-decoration: none !important;
    color: #fff !important;
}
.proyecto-block--navy {
    background-color: #1a2647;
}
.proyecto-block--red {
    background-color: #E0241B;
}
.proyecto-block-title {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.proyecto-block-desc {
    color: rgba(255,255,255,0.9);
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0;
}

/* --- Tarjetas de Publicaciones: miniatura + isotipo --- */
.pub-card .content-card-image-link {
    display: none; /* ocultar el link de imagen estándar */
}
.pub-card-media {
    position: relative;
    height: 175px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    padding: 14px 18px;
    overflow: hidden;
    flex-shrink: 0;
}
.pub-card-thumb {
    display: block;
    height: 140px;
    text-decoration: none !important;
}
.pub-card-thumb img {
    width: auto;
    height: auto;
    max-width: 130px;
    max-height: 140px;
    object-fit: contain;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.18);
    display: block;
}
.pub-card-thumb-placeholder {
    width: 90px;
    height: 140px;
    background: #d8d8d8;
    border: 1px solid #ccc;
}
.pub-card-isotip {
    position: absolute;
    top: 10px;
    right: 12px;
    line-height: 0;
}
.pub-card-isotip img {
    width: 36px;
    height: 36px;
    display: block;
}

/* ================================================
   PÁGINA VIDEOTECA
   ================================================ */

/* Hero: foto de evento */
.vid-hero-wrap {
    position: relative;
    background: #111;
}
.vid-hero-slide {
    height: 400px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    /* gradiente en la parte baja para contrastar con las tarjetas */
    position: relative;
}
.vid-hero-slide::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.45));
    pointer-events: none;
}
@media (max-width: 575.98px) {
    .vid-hero-slide { height: 220px; }
}

/* Grid de tarjetas — solapado sobre el hero
   Las tarjetas suben 120px dentro del hero (sólo el thumbnail queda solapado) */
.vid-grid-section {
    background: transparent;
    padding: 0 0 0px;
    margin-top: -100px;
    position: relative;
    z-index: 20;
}
.vid-grid-section .container {
    max-width: 1160px !important;
}

/* Tarjeta de vídeo */
.vid-card {
    background: #fff;
    border: 2px solid #E0241B;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 12px rgba(0,0,0,0.22);
}
.vid-card__thumb {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    /* gris medio: visible como placeholder si el thumbnail carga tarde o falla */
    background: #888;
    overflow: hidden;
    text-decoration: none !important;
}
.vid-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}
.vid-card:hover .vid-card__img { opacity: 0.85; }
/* Icono play siempre visible (encima del thumbnail) */
.vid-card__play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.08);
    transition: background 0.2s;
}
.vid-card:hover .vid-card__play-btn { background: rgba(0,0,0,0.25); }
.vid-card__play-btn svg {
    filter: drop-shadow(0 1px 6px rgba(0,0,0,0.5));
    opacity: 0.85;
}
.vid-card:hover .vid-card__play-btn svg { opacity: 1; }
.vid-card__duration {
    position: absolute;
    bottom: 5px;
    right: 7px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.72);
    padding: 1px 5px;
    border-radius: 2px;
    letter-spacing: 0.03em;
    line-height: 1.6;
    z-index: 2;
}
.vid-card__body {
    padding: 10px 12px 14px;
    flex: 1;
    background: #fff;
}
.vid-card__title {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1a1a1a;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vid-card:hover .vid-card__title { color: #E0241B; }

/* ================================================
   POPUP MAKER — Corrección de posicionamiento
   WP Rocket excluye site.css de Popup Maker del CSS
   combinado, dejando el overlay sin position:fixed.
   Estas reglas restauran el comportamiento correcto.
   ================================================ */
.pum-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    z-index: 1999999999 !important;
    overflow: auto;
    background: rgba(0,0,0,0.5);
}
.pum-container {
    position: absolute;
    z-index: 1999999999;
    box-sizing: border-box;
}
.pum-content {
    position: relative;
    z-index: 1;
}

/* ================================================
   PÁGINA RANKING CYD
   ================================================ */

/* --- Hero --- */
.ranking-hero {
    position: relative;
    background: #fff;
    padding: 56px 0 48px;
    overflow: hidden;
}
.ranking-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center right;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
}
.ranking-hero__inner {
    position: relative;
    z-index: 1;
}
.ranking-hero__title {
    color: #E0241B;
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 4px;
    display: block;
    text-transform: uppercase;
}
.ranking-hero__title::after {
    content: '';
    display: block;
    width: 100%;
    border-bottom: 3px solid #E0241B;
    margin-top: 8px;
    margin-bottom: 20px;
}
.ranking-hero__subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1a2647;
    max-width: 520px;
    margin-bottom: 28px;
}
.ranking-hero__personas {
    display: block;
    max-height: 280px;
    width: auto;
    margin: 0 auto;
}
@media (max-width: 767.98px) {
    .ranking-hero__personas {
        display: none;
    }
    .ranking-hero {
        padding: 36px 0 32px;
    }
}

/* --- Secciones de contenido --- */
.ranking-body {
    padding: 40px 0 48px;
}
.ranking-intro {
    margin-bottom: 36px;
    font-size: 0.96rem;
    line-height: 1.7;
    color: #333;
}
.ranking-section-title {
    color: #E0241B;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 16px;
    margin-top: 0;
}
.ranking-indicadores {
    margin-bottom: 36px;
}
.ranking-indicadores h2 {
    color: #E0241B;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 16px;
    margin-top: 0;
}
.ranking-indicadores p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 12px;
}
.ranking-indicadores strong {
    font-weight: 700;
}

/* --- Stats strip (reutiliza .stat-card existente) --- */
.ranking-stats {
    margin-bottom: 36px;
}
.ranking-stats .row {
    margin-left: 0;
    margin-right: 0;
}
.ranking-stats [class*="col-"] {
    padding-left: 3px !important;
    padding-right: 3px !important;
}
.ranking-stats [class*="col-"]:first-child {
    padding-left: 0 !important;
}
.ranking-stats [class*="col-"]:last-child {
    padding-right: 0 !important;
}
.ranking-stats .stat-card {
    width: 100%;
    border-radius: 0;
    padding: 22px 16px;
}

/* --- Callout box --- */
.ranking-callout {
    border: 2px solid #202945;
    border-radius: 4px;
    padding: 32px 36px;
    margin-bottom: 40px;
}
.ranking-callout .ranking-section-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
}
.ranking-callout p {
    font-size: 0.93rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 12px;
}
.ranking-callout p:last-child {
    margin-bottom: 0;
}

/* ================================================
   PÁGINAS DE LISTADO DE PUBLICACIONES
   ================================================ */

.publications-title-row {
    border-bottom: 2px solid #E0241B;
    padding-bottom: 14px;
    margin-bottom: 24px !important;
}

.page-title-publications {
    color: #E0241B;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0;
    margin-top: 50px;
    font-size: 30px;
}

.publications-category-desc {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.publication-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.09);
    padding: 20px 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
}

.publication-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* ================================================
   SUBHEADER GLOBAL — reemplaza franja azul marino
   por cabecera roja sobre fondo blanco (estilo publicaciones)
   ================================================ */
.subheader-big,
.subheader-small {
    background-color: #fff !important;
    color: #1a2647 !important;
    padding: 40px 0 0 !important;
    border-bottom: none !important;
}

.subheader-big h1,
.subheader-big h2,
.subheader-big h3,
.subheader-small h1,
.subheader-small h2,
.subheader-small h3 {
    color: #E0241B !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    margin-bottom: 0;
    display: block;
    padding-bottom: 10px;
    border-bottom: 3px solid #E0241B;
}

.subheader-big a,
.subheader-small a {
    color: #1a2647 !important;
}

/* ================================================
   PAGINACIÓN — restaurar caja del número activo
   (main.css solo aplica block/height a los <a>,
   pero WordPress genera el activo como <span>)
   ================================================ */
.page-numbers li .current,
.pagination li .current {
    display: block;
    height: 48px;
    width: 48px;
    line-height: 48px;
    text-align: center;
    font-size: 13px;
    font-weight: normal;
    border: 1px solid #E0241B;
}
