/**
 * Archivo: assets/css/archive-articulo-new.css
 * Descripción: Estilos para el rediseño del Home de Artículos (Pillars Strategy)
 */

/* =========================================
   VARIABLES & GLOBAL
   ========================================= */
:root {
    --color-navy: #001344;
    --color-blue: #0033ff;
    --color-dark-blue: #050588;
    --color-white: #ffffff;
    --color-gray-bg: #F0F2F5;
    --color-text: #333333;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    --transition: all 0.3s ease;
}

body {
    background-color: var(--color-gray-bg);
}

.site-main {
    background-color: var(--color-gray-bg);
    overflow-x: clip;
    /* Prevent horizontal scroll from negative margins */
}

/* FIX: Remove top padding from #content if present globally */
#content {
    padding-top: 0 !important;
}

/* =========================================
   1. HERO SECTION
   ========================================= */
.articles-hero {
    position: relative;
    /* Navy background with blueprint image overlay */
    background-color: var(--color-navy);
    background-image:
        linear-gradient(rgba(0, 19, 68, 0.5), rgba(0, 19, 68, 0.7)),
        url('https://cdn.inspenet.com/%E2%80%94Pngtree%E2%80%94tech-blue-gradient-background_329197.webp');
    background-size: cover;
    background-position: center;
    background-blend-mode: normal;
    /* Less aggressive blending for clarity */

    /* Matches reference: large padding bot for overlap, no hard border radius on bottom yet (or simplified) */
    padding: 120px 20px 220px;
    text-align: center;
    color: var(--color-white);
}

.hero-content-wrapper {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.articles-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    /* Better readability on lighter bg */
}

.articles-hero .tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    /* More visible */
    margin-bottom: 3rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

/* Search Bar - Matches Ref: Dark input, Bright Button */
.hero-search-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.hero-search-form {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    /* Lighter/Glassier */
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    padding: 6px;
    backdrop-filter: blur(8px);
    transition: var(--transition);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.hero-search-form:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-search-form input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 25px;
    color: var(--color-white);
    font-size: 0.95rem;
    outline: none;
}

.hero-search-form input::placeholder {
    color: rgba(255, 255, 255, 0.8);
    font-style: normal;
}

.hero-search-form button {
    background-color: var(--color-blue);
    color: var(--color-white);
    border: none;
    border-radius: 40px;
    padding: 0 40px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    text-transform: capitalize;
    box-shadow: 0 4px 15px rgba(0, 51, 255, 0.3);
}

.hero-search-form button:hover {
    background-color: #1a45ff;
    box-shadow: 0 6px 20px rgba(0, 51, 255, 0.5);
    transform: translateY(-2px);
}

/* =========================================
   2. PILLARS GRID (Floating)
   ========================================= */
.pillars-container {
    max-width: 1300px;
    /* Slightly wider */
    margin: -160px auto 0;
    /* Deep negative margin for "floating" effect */
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.pillar-card {
    position: relative;
    height: 480px;
    /* Taller vertically */
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Content at bottom */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    /* Slightly softer shadow */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pillar-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.3);
}

.pillar-bg {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    opacity: 0.85;
    /* Brighter images */
    transition: transform 0.8s ease, opacity 0.5s ease;
}

.pillar-card:hover .pillar-bg {
    transform: scale(1.1);
    opacity: 0.6;
    /* Darken slightly on hover for text contrast */
}

/* Gradient Overlay: Deep black at bottom, transparent top */
.pillar-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.9) 90%);
    z-index: 1;
}

.pillar-content {
    position: relative;
    z-index: 2;
    padding: 30px 24px;
    width: 100%;
}

.pillar-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-white);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.pillar-topics {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    display: block;
    margin-bottom: 25px;
    line-height: 1.4;
    font-weight: 500;
    min-height: 40px;
}

.pillar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 15px;
}

.pillar-count {
    color: var(--color-white);
    font-weight: 700;
    font-size: 0.8rem;
    opacity: 1;
}

.pillar-arrow {
    width: 24px;
    height: 24px;
    color: var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.pillar-card:hover .pillar-arrow {
    transform: translateX(5px);
    color: #fff;
}

/* =========================================
   3. EXPLORE BY TOPIC
   ========================================= */
.explore-section {
    padding: 100px 0 80px;
    /* Top padding accounts for floating overlap area */
    text-align: center;
}

.section-title-wrapper {
    margin-bottom: 50px;
    text-align: center;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-navy);
    margin-bottom: 10px;
}

.section-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: left;
}

.explore-col h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.explore-col h3 i {
    color: var(--color-blue);
    font-style: normal;
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.topic-btn {
    display: block;
    padding: 12px 16px;
    background: var(--color-white);
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    color: #4B5563;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.topic-btn:hover {
    border-color: var(--color-blue);
    color: var(--color-blue);
    background: #F3F6FF;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 51, 255, 0.05);
}

/* =========================================
   4. LATEST PUBLICATIONS
   ========================================= */
.latest-section {
    padding: 60px 0 100px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.latest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.latest-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-navy);
    margin: 0;
    text-transform: uppercase;
}

.latest-tabs {
    display: flex;
    gap: 25px;
}

.tab-link {
    color: #6B7280;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding-bottom: 6px;
    position: relative;
    transition: color 0.3s;
}

.tab-link:hover,
.tab-link.active {
    color: var(--color-blue);
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-blue);
}

/* Grid */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.article-card-new {
    background: var(--color-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.article-card-new:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.ac-thumb-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.ac-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.article-card-new:hover .ac-thumb {
    transform: scale(1.05);
}

.ac-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ac-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    color: var(--color-white);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    align-self: flex-start;
}

/* Dynamic Pill Colors */
.ac-pill.energia {
    background-color: #0033ff;
}

.ac-pill.integridad {
    background-color: #8A2BE2;
}

.ac-pill.industria {
    background-color: #10B981;
}

.ac-pill.gestion {
    background-color: #F59E0B;
}

/* Default */
.ac-pill {
    background-color: var(--color-blue);
}

.ac-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-navy);
    line-height: 1.4;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-new:hover .ac-title {
    color: var(--color-blue);
}

.ac-excerpt {
    font-size: 0.9rem;
    color: #6B7280;
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ac-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.ac-date {
    font-size: 0.8rem;
    color: #9CA3AF;
}

.ac-arrow {
    color: var(--color-blue);
    font-weight: bold;
    font-size: 1.2rem;
}

/* =========================================
   5. TRENDING SECTION
   ========================================= */
.trending-section {
    max-width: 1240px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.trending-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-navy);
    margin-bottom: 25px;
    text-transform: uppercase;
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.trending-card {
    background-color: var(--color-navy);
    border-radius: 12px;
    padding: 24px;
    color: var(--color-white);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.trending-card:hover {
    background-color: #002266;
    transform: translateY(-4px);
}

.tc-cat {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.tc-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tc-date {
    margin-top: auto;
    font-size: 0.75rem;
    opacity: 0.5;
}

/* =========================================
   Responsive Adjustments
   ========================================= */

/* Tablet */
@media (max-width: 1024px) {
    .pillars-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .explore-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .latest-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .articles-hero {
        padding-bottom: 160px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .articles-hero {
        padding: 60px 20px 140px;
        /* Still need overlap padding */
        border-radius: 0 0 30px 30px;
    }

    .articles-hero h1 {
        font-size: 2.2rem;
    }

    .hero-search-form {
        flex-direction: column;
        padding: 10px;
        background: rgba(30, 41, 89, 0.9);
        border-radius: 20px;
    }

    .hero-search-form button {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        padding: 12px;
    }

    /* Pillars Carousel on Mobile */
    .pillars-container {
        margin-top: -100px;
        padding: 0;
    }

    .pillars-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 20px 20px 40px;
        /* Space for shadow */
        gap: 15px;
    }

    .pillar-card {
        min-width: 280px;
        scroll-snap-align: center;
        height: 400px;
    }

    /* Grids to single column */
    .explore-grid {
        grid-template-columns: 1fr;
    }

    .latest-grid {
        grid-template-columns: 1fr;
    }

    .trending-grid {
        grid-template-columns: 1fr;
    }

    .latest-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Scrollable Tabs */
    .latest-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .tab-link {
        white-space: nowrap;
        margin-right: 15px;
    }
}