/**
 * Componente Campañas - CON IMAGEN DE FONDO
 * SOLO PARA LANDING - NO APLICAR EN PÁGINA DE CAMPAÑAS
 */

/* Restringir aplicación solo a la sección de campañas de la landing */
/* NO aplicar en páginas con clase 'page-template-campaigns' o similares */
body.page-campaigns .rescop-campaigns-component,
body.page-template-campaigns .rescop-campaigns-component,
body.campaigns-page .rescop-campaigns-component {
    display: none !important;
}

/* === CONTENEDOR PRINCIPAL - CON IMAGEN DE FONDO === */
.rescop-campaigns-component {
    /* Ancho completo */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-top: 0;
    margin-bottom: 0;
    min-height: 900px; 
    background-image: url('../images/back_campanas.png');
    overflow: hidden;
    
    /* Flex container */
    display: flex;
    position: relative;
    padding: 0;
}

/* === CONTENEDOR CAMPAÑAS 1280px === */
.rescop-campaigns-landing-container {
    width: 100%;
    max-width: 1280px !important; /* CAMBIO: 1280px */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 60px 4rem 40px 4rem; /* Espaciado ajustado para 1280x800 */
    position: relative;
    z-index: 2;
}

/* === HEADER DE LA SECCIÓN === */
.rescop-campaigns-landing-header {
    position: relative;
    z-index: 3;
    /* Flex para centrar títulos */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    
    /* Espaciado calculado de Figma */
    margin-bottom: 3rem;
        width: 100%;
    }
    
/* === TÍTULO PRINCIPAL === */
.rescop-campaigns-landing-title {
    position: relative;
    z-index: 4;
    /* Medidas exactas de Figma */
    width: 100%;
    max-width: 1456px;
    
    /* Tipografía exacta */
    color: black !important;
    font-size: clamp(28px, 3.5vw, 36px) !important;
    font-family: var(--rescop-font-display, 'Anton', sans-serif) !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    text-align: center;
    margin: 0 0 1.5rem 0 !important;
    padding: 0 !important;
    word-wrap: break-word;
}

/* === SUBTÍTULO === */
.rescop-campaigns-landing-subtitle {
    position: relative;
    z-index: 4;
    /* Medidas exactas de Figma */
    width: 100%;
    max-width: 1215px;
    
    /* Tipografía exacta */
    color: rgba(0, 0, 0, 0.80) !important;
    font-size: clamp(24px, 3vw, 36px) !important;
    font-family: var(--rescop-font-primary, 'Merriweather Sans', serif) !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
    word-wrap: break-word;
}

/* === GRID DE CAMPAÑAS === */
.rescop-campaigns-landing-grid {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(1.5rem, 4vw, 3rem); /* Gap responsive */
    width: 100%;
    max-width: 1200px; /* Dentro del contenedor */
    flex-wrap: nowrap;
    position: relative;
    z-index: 3;
}

/* Ajustar cards para que quepan */
.rescop-campaign-landing-card {
    width: 100%;
    max-width: 380px; /* Ajustar para que quepan 3 en 1200px */
    flex: 0 0 calc(33.333% - 2rem);
    height: 32rem;
    
    /* Estilos */
    background: white;
    border: 1px rgba(0, 0, 0, 0.50) solid;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    
    /* Flex interno */
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 4;
}

.rescop-campaign-landing-card:hover {
    transform: translateY(-4px);
}

/* === IMAGEN DE LA CARD === */
.rescop-campaign-landing-card-image {
    /* Altura exacta de Figma */
    flex: 0 0 275px;
    width: 100%;
    overflow: hidden;
    border-radius: 6px 6px 0 0;
}

.rescop-campaign-landing-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rescop-campaign-landing-card-placeholder {
    width: 100%;
    height: 100%;
    background: #E5E5E5;
    border: 1px rgba(0, 0, 0, 0.30) solid;
    border-radius: 4px;
}

/* === CONTENIDO DE LA CARD === */
.rescop-campaign-landing-card-content {
    /* Altura controlada */
    /* flex: 0 0 285px; */
    /* height: 285px; */
    flex: 1;
    padding: 1.5rem;
    
    /* Flex para organizar contenido interno */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    /* Asegurar que no se desborde */
    overflow: hidden;
}

/* === TÍTULO DE LA CAMPAÑA === */
/* .rescop-campaign-landing-card-title {
    color: black !important;
    font-size: 24px !important;
    font-family: var(--rescop-font-display, 'Anton', sans-serif) !important;
    font-weight: 400 !important;
    line-height: 36px !important;
    text-transform: capitalize !important; /* CAMBIO: capitalize */
   /* margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    word-wrap: break-word;
    
    /* LIMITAR ALTURA */
   /* max-height: 108px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    flex: 0 0 auto;
} */

.rescop-campaign-landing-card-title {
    color: black !important;
    font-size: 24px !important;
    font-family: var(--rescop-font-display, 'Anton', sans-serif) !important;
    font-weight: 400 !important;
    line-height: 36px !important;
    text-transform: none !important;
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    word-wrap: break-word;
    
    /* LIMITAR ALTURA */
    max-height: 108px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    flex: 0 0 auto;
}

.rescop-campaign-landing-card-title a {
    color: inherit !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.rescop-campaign-landing-card-title a:hover {
    color: #BE252D !important;
}

/* === EXCERPT === */
.rescop-campaign-landing-card-excerpt {
    color: rgba(0, 0, 0, 0.80) !important;
    font-size: 18px !important;
    font-family: var(--rescop-font-primary, 'Merriweather Sans', serif) !important;
    font-weight: 400 !important;
    line-height: 24px !important; /* 24px de line-height */
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    word-wrap: break-word;
    
    /* EXACTAMENTE 3 LÍNEAS: 24px * 3 = 72px */
    height: 72px;
    max-height: 72px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    flex: 1;
}

/* === FOOTER DE LA CARD === */
.rescop-campaign-landing-card-footer {
   
    flex: 0 0 50px;
    height: 50px;

    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    
    
    padding-top: 1rem;
}

/* === BOTÓN "VER CAMPAÑA" === */
.rescop-campaign-landing-cta {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 164px;
    height: 40px;
    
    /* Color del cliente */
    background: linear-gradient(0deg, #BE252D 0%, #BE252D 100%), #ED2E38;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    z-index: 5;
}

.rescop-campaign-landing-cta span {
    color: white !important;
    font-size: 14px !important;
    font-family: var(--rescop-font-display, 'Anton', sans-serif) !important;
    font-weight: 400 !important;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

/* === RESPONSIVE === */
@media (max-width: 1680px) {
    .rescop-campaigns-landing-container {
        padding: 100px 4rem 2rem 4rem;
    }
    
    .rescop-campaigns-landing-grid {
        gap: 3rem;
    }
}

@media (max-width: 1400px) {
    .rescop-campaigns-component {
        min-height: 900px;
    }
    
    .rescop-campaigns-landing-grid {
        gap: 2rem;
    }
    
    .rescop-campaign-landing-card {
        width: 350px;
        flex: 0 0 350px;
    }
}

@media (max-width: 1200px) {
    .rescop-campaigns-landing-container {
        padding: 4rem 2rem;
}

    .rescop-campaigns-landing-grid {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2rem;
    }
    
    .rescop-campaign-landing-card {
        width: calc(50% - 1rem);
        min-width: 300px;
        flex: 0 0 auto;
    }
}

@media (max-width: 768px) {
    .rescop-campaigns-component {
        min-height: 800px;
    }
    
    .rescop-campaigns-landing-container {
        padding: 2rem 1rem;
    }
    
    .rescop-campaigns-landing-grid {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .rescop-campaign-landing-card {
        width: 100%;
        max-width: 400px;
        height: 480px;
        flex: 0 0 auto;
    }
    
    .rescop-campaign-landing-card-content {
        padding: 1rem;
    }
}

/* === ELIMINAR RESTRICCIONES DEL TEMA === */
/* Solo aplicar en front-page o páginas específicas de la landing */
body.home .entry-content .rescop-campaigns-component,
body.front-page .entry-content .rescop-campaigns-component,
body.page .entry-content .rescop-campaigns-component:not(.campaigns-index),
.wp-block-post-content .rescop-campaigns-component,
.site-main .rescop-campaigns-component {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    max-width: none !important;
}

/* NO aplicar estilos de ancho completo en la página de índice de campañas */
body.campaigns-index .rescop-campaigns-component,
body.page-campaigns .rescop-campaigns-component {
    width: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    background-image: none !important;
    min-height: auto !important;
}

