*, body, html {
    height: auto;
}

/* --- CORE BLOG STYLES --- */
:root {
    --blog-bg: #181818;
    --blog-card: #222222;
    --blog-blue: #3b82f6; /* Azul brillante tipo Totalplay/Tech */
    --blog-blue-cta: #3579f6;
    --blog-blue-cta-hover: #2563eb;
    --blog-text: #ffffff;
    --blog-text-muted: #b0b0b0;
    --blog-border: #808080;
    --blog-panel-border: #707070;
    --blog-tag-gradient: linear-gradient(90deg, #251f45 0%, rgba(11, 6, 43, 0.47) 53%, rgba(7, 6, 14, 0) 100%);
    --blog-featured-overlay: linear-gradient(360deg, #241e44 0%, rgba(7, 6, 14, 0) 100%);
}

/* Corrección para que el body tenga fondo oscuro completo */
body#index {
    background-color: var(--blog-bg);
    color: var(--blog-text);
    font-family: 'Montserrat', sans-serif; /* Usando tu fuente */
}

/* --- 1. SLIDER (Full Width Fix) --- */
/* Usamos márgenes negativos para romper el padding del container-fluid del body */
.blog-hero {
    position: relative;
    width: calc(100% + 30px);
    margin-left: -18px;
    margin-bottom: 0;
}

.blog-hero__viewport {
    position: relative;
    min-height: 420px;
    overflow: hidden;
    background: #111111;
}

.blog-hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
    background-size: cover;
    background-position: center;
}

.blog-hero__slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.blog-hero__slide-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 420px;
    color: inherit;
    text-decoration: none;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(6, 8, 25, 0.9) 0%, rgba(9, 11, 33, 0.68) 34%, rgba(17, 19, 39, 0.32) 58%, rgba(12, 11, 32, 0.78) 100%),
        linear-gradient(180deg, rgba(9, 9, 17, 0.1) 0%, rgba(9, 9, 17, 0.55) 100%);
}

.hero-content {
    text-align: left;
    max-width: 1317px;
    width: 100%;
    padding: 0 56px;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    max-width: 760px;
    margin: 0 0 20px;
    font-size: clamp(2.5rem, 4.4vw, 3.4rem);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.04em;
    text-transform: none;
    color: #ffffff;
}

.blog-hero__description {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    max-width: 820px;
}

.blog-hero__description-line {
    width: 3px;
    min-width: 3px;
    height: 82px;
    background: rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    margin-top: 4px;
}

.blog-hero__description p {
    margin: 0;
    color: rgba(255, 255, 255, 0.94);
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 400;
    line-height: 1.18;
}

/* Paginación slider visual */
.blog-hero__bullets {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 0 8px;
}

.blog-hero__bullet {
    width: 14px;
    height: 14px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.blog-hero__bullet.is-active {
    background: #ffffff;
}

.blog-hero__bullet:hover {
    transform: scale(1.06);
}

/* --- CONTENEDOR PRINCIPAL DEL BLOG --- */
.blog-wrapper {
    width: min(calc(100% - 48px), 1317px);
    margin: 0 auto;
    padding-bottom: 60px;
}

.blog-search-section {
    padding: 42px 0 26px;
}

.search-wrapper {
    display: flex;
    justify-content: center;
}

/* --- 2. BUSCADOR --- */
.blog-search-bar {
    width: min(100%, 681px);
    min-height: 61px;
    display: flex;
    align-items: center;
    margin: 0 auto;
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.21);
    border: 1px solid var(--blog-panel-border);
    border-radius: 100px;
}

.blog-search-bar input {
    background: transparent;
    border: none;
    color: #ffffff;
    width: 100%;
    min-width: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 300;
    line-height: 29px;
    letter-spacing: 0;
}

.blog-search-bar input:focus {
    outline: none;
}

.blog-search-bar input::placeholder {
    color: #ffffff;
    opacity: 1;
}

.blog-search-bar i {
    display: none;
}

/* --- TITULOS DE SECCION --- */
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}
.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    margin-right: 20px;
    margin-bottom: 0;
    text-transform: capitalize;
}
.section-line {
    height: 1px;
    background-color: var(--blog-border);
    width: 100%;
}

.section-header-featured {
    margin-bottom: 28px;
}

.section-header-featured h2 {
    margin-right: 23px;
    font-size: 24px;
    font-weight: 700;
    line-height: 29px;
    text-transform: none;
    color: #ffffff;
}

.section-header-featured .section-line {
    background-color: #ffffff;
}

/* --- 3. LO MAS DESTACADO (GRID) --- */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.featured-grid-highlighted {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.card-featured-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

@media (max-width: 1100px) and (min-width: 769px) {
    .featured-grid-highlighted {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.card-featured {
    min-height: 466px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.card-featured::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 62%;
    background: var(--blog-featured-overlay);
    mix-blend-mode: multiply;
    pointer-events: none;
}

.card-featured:hover { transform: translateY(-5px); }

.card-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 22px;
}

.card-tag {
    position: absolute;
    top: 0;
    left: 0;
    width: 153px;
    height: 22px;
    flex: 0 0 auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 18px;
    background: var(--blog-tag-gradient);
    border-radius: 0 0 20px 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 15px;
    letter-spacing: -0.3px;
    text-transform: none;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-overlay h3 {
    max-width: 348px;
    margin: 0;
    padding: 0 20px;
    font-size: 24px;
    font-weight: 700;
    line-height: 29px;
    color: #ffffff;
}

/* --- 4. CATEGORIAS --- */
.categories-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(234px, 234px);
    gap: 32px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
    margin-bottom: 60px;
    padding: 36px 44px;
    scroll-padding-left: 44px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid var(--blog-panel-border);
    box-shadow:
        inset 22px 0 20px -20px rgba(24, 24, 24, 0.9),
        inset -22px 0 20px -20px rgba(24, 24, 24, 0.9);
}

.categories-grid::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    min-height: 155px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    border: 1px solid #ffffff;
    border-radius: 15px;
    background:
        linear-gradient(180deg, rgba(37, 31, 69, 0.2) 0%, rgba(12, 9, 37, 0.45) 100%),
        linear-gradient(135deg, #1d1845 0%, #0d0a2e 100%);
    color: #ffffff;
    font-size: 21px;
    font-weight: 700;
    line-height: 25px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    scroll-snap-align: start;
    user-select: none;
}

.cat-btn:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
    text-decoration: none;
    color: white;
}

/* --- 5. LO MAS RECIENTE --- */
.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}
.card-recent {
    background: transparent;
    display: flex;
    flex-direction: column;
    min-height: 359px;
    position: relative;
}

.recent-tag {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.recent-img {
    height: 203px;
    width: 100%;
    object-fit: cover;
    margin-bottom: 9px;
}

.recent-body {
    padding: 0 21px;
}

.recent-body h4 {
    min-height: calc(24px * 3);
    margin-bottom: 16px;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    line-height: 24px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-body p { 
    min-height: calc(15px * 2);
    margin-bottom: 15px;
    padding-left: 11px;
    border-left: 1px solid #ffffff;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 15px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-leermas {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 23px;
    padding: 6px 18px;
    border-radius: 24px;
    background: var(--blog-blue-cta);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    line-height: 11px;
    text-decoration: none;
    text-transform: none;
}

.btn-leermas i {
    font-size: 8px;
}

.btn-leermas:hover {
    background-color: var(--blog-blue-cta-hover);
    color: white;
    text-decoration: none;
}

/* Footer Action */
.blog-footer-action { text-align: left; padding-top: 20px; }
.btn-plus {
    min-width: 232px;
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    gap: 23px;
    padding: 0 28px 0 0;
    border: none;
    border-radius: 100px;
    background: var(--blog-blue-cta);
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 22px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.btn-plus i {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffffff;
    color: var(--blog-blue-cta);
    font-size: 40px;
    font-weight: 800;
    line-height: 49px;
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
}

.btn-plus:hover {
    transform: translateY(-2px);
    background-color: var(--blog-blue-cta-hover);
}

.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    width: min(100%, 120px);
    margin: 36px auto 0;
}

.blog-page-btn {
    width: 27px;
    height: 27px;
    min-width: 27px;
    min-height: 27px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 22px;
    white-space: nowrap;
    overflow: hidden;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.blog-page-btn.is-active {
    background: rgba(255, 255, 255, 0.19);
}

.blog-page-btn:hover {
    transform: translateY(-1px);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .blog-hero { width: calc(100% + 30px); margin-left: -15px; } /* Ajuste móvil */
    .blog-hero__viewport,
    .blog-hero__slide-link {
        min-height: 300px;
    }
    .hero-content {
        padding: 0 24px;
    }
    .hero-content h1 {
        max-width: 100%;
        margin-bottom: 14px;
        font-size: clamp(2.5rem, 12vw, 4.3rem);
        line-height: 0.94;
    }
    .blog-hero__description {
        gap: 10px;
    }
    .blog-hero__description-line {
        height: 58px;
    }
    .blog-hero__description p {
        font-size: 18px;
        line-height: 1.22;
    }
    .blog-hero__bullets {
        padding: 14px 0 4px;
    }
    .blog-search-section {
        padding: 28px 0 16px;
    }
    .blog-search-bar {
        min-height: 54px;
        padding: 0 20px;
    }
    .blog-search-bar input {
        font-size: 18px;
        line-height: 24px;
    }
    .blog-wrapper {
        width: min(calc(100% - 32px), 1317px);
    }
    .section-header-featured {
        margin-bottom: 24px;
    }
    .section-header-featured h2 {
        margin-right: 16px;
        font-size: 18px;
        line-height: 22px;
    }
    .featured-grid-highlighted {
        grid-template-columns: 1fr;
    }
    .categories-grid {
        gap: 20px;
        padding: 24px 24px;
        scroll-padding-left: 24px;
        grid-auto-columns: minmax(220px, 78%);
    }
    .cat-btn {
        min-height: 120px;
        font-size: 18px;
        line-height: 22px;
    }
    .card-featured {
        min-height: 360px;
    }
    .recent-grid {
        gap: 24px;
    }
    .recent-body {
        padding: 0 16px;
    }
    .recent-body h4 {
        min-height: calc(22px * 3);
        font-size: 18px;
        line-height: 22px;
    }
    .btn-plus {
        min-width: 210px;
        gap: 18px;
        padding-right: 24px;
        font-size: 16px;
        line-height: 20px;
    }
    .blog-pagination {
        margin-top: 28px;
    }
    .blog-page-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }
    .card-tag {
        width: 138px;
        padding: 0 14px;
        font-size: 11px;
    }
    .card-overlay h3 {
        max-width: none;
        padding: 0 16px 18px;
        font-size: 20px;
        line-height: 25px;
    }
}
