/* =========================================================
   BLOG - LISTADO + DETALLE
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.blog-body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
    background: #050505;
}

.blog-page {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.blog-wrap {
    width: min(1180px, 94%);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* ============================
   HERO DEL BLOG
============================ */

.blog-hero {
    padding: 170px 0 30px;
}

.blog-back-link {
    position: fixed;
    top: 78px;
    left: clamp(18px, 4vw, 42px);
    z-index: 4;

    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 10px 14px;
    border-radius: 999px;

    color: #f0cf65;
    font-weight: 700;
    text-decoration: none;

    background: rgba(10,10,12,0.55);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    transition: color 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.blog-back-link:hover {
    color: #ffffff;
    transform: translateX(-2px);
    background: rgba(20,20,24,0.72);
}


.blog-hero h1 {
    font-size: 2.8rem;
    margin: 14px 0;
}

.blog-hero p {
    color: rgba(255,255,255,0.82);
    line-height: 1.7;
    max-width: 760px;
}

/* ============================
   FEED BLOG ALTERNADO
============================ */

.blog-list-section {
    padding: 10px 0 80px;
}

.blog-feed {
    display: grid;
    gap: 24px;
}

.blog-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 26px;
    align-items: center;
    background: linear-gradient(145deg, rgba(34,34,36,0.96), rgba(18,18,20,0.94));
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 26px;
    padding: 18px;
    box-shadow:
        0 16px 40px rgba(0,0,0,0.34),
        inset 0 1px 0 rgba(255,255,255,0.04);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.blog-row:hover {
    transform: translateY(-4px);
    box-shadow:
        0 24px 56px rgba(0,0,0,0.44),
        0 0 26px rgba(212,175,55,0.06);
    border-color: rgba(212,175,55,0.14);
}

/* Alternar imagen derecha / izquierda */
.blog-row:nth-child(even) {
    grid-template-columns: 1fr 280px;
}

.blog-row:nth-child(even) .blog-row-media {
    order: 2;
}

.blog-row:nth-child(even) .blog-row-content {
    order: 1;
}

/* ============================
   IMAGEN DEL LISTADO
============================ */

.blog-row-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    overflow: hidden;
    background: #111;
}

.blog-row-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Placeholder si no hay imagen */
.blog-row-media-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255,255,255,0.68);
    background:
        linear-gradient(145deg, rgba(50,50,54,0.95), rgba(26,26,28,0.94));
}

/* ============================
   CONTENIDO DEL LISTADO
============================ */

.blog-row-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.blog-meta,
.blog-post-meta {
    margin-bottom: 10px;
}

.blog-date-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #f0cf65;
    background: rgba(212,175,55,0.12);
    border: 1px solid rgba(212,175,55,0.22);
}

.blog-row-title {
    margin: 0 0 12px;
    font-size: 1.35rem;
    line-height: 1.28;
    color: #fff;
    overflow-wrap: anywhere;
}

.blog-row-extract {
    margin: 0;
    color: rgba(255,255,255,0.82);
    line-height: 1.75;
    font-size: 0.97rem;
    overflow-wrap: anywhere;
}

.blog-row-actions {
    margin-top: 18px;
}

.blog-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #d4af37, #f3d37a);
    color: #111;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow:
        0 10px 22px rgba(212,175,55,0.22),
        inset 0 1px 0 rgba(255,255,255,0.35);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        filter 0.3s ease;
}

.blog-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 26px rgba(212,175,55,0.30),
        0 0 18px rgba(243,211,122,0.12);
    filter: brightness(1.03);
}

/* =========================================================
   DETALLE DEL ARTÍCULO
========================================================= */

.blog-post-section {
    min-height: 100vh;
    padding: 120px 0 70px;
    position: relative;
}

/* fondo real fijo detrás del artículo */
.blog-post-section::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top center, rgba(212,175,55,0.06), transparent 30%),
        radial-gradient(circle at bottom center, rgba(212,175,55,0.08), transparent 36%),
        linear-gradient(to top, #050505 0%, #0d0d10 48%, #17171b 100%);
    z-index: 0;
    pointer-events: none;
}

.blog-post-card {
    /* ✅ CAMBIO CLAVE */
    position: relative;

    /* ✅ centrado limpio */
    width: min(900px, 92%);
    margin: 0 auto;

    /* ✅ elimina scroll raro */
    max-height: none;
    overflow: visible;

    padding: 34px;

    background:
        radial-gradient(circle at top right, rgba(212,175,55,0.06), transparent 34%),
        linear-gradient(145deg, rgba(34,34,36,0.96), rgba(18,18,20,0.94));

    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 28px;

    box-shadow:
        0 18px 45px rgba(0,0,0,0.38),
        inset 0 1px 0 rgba(255,255,255,0.04);

    z-index: 3;
}


.blog-post-header {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 24px;
}

.blog-post-card h1 {
    margin: 0 0 16px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    color: #ffffff;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.blog-post-extract {
    margin: 0;
    color: rgba(255,255,255,0.82);
    font-size: 1.05rem;
    line-height: 1.8;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Imagen del detalle más pequeña */
.blog-post-image {
    width: 100%;
    max-width: 680px;
    margin: 28px auto;
    border-radius: 22px;
    overflow: hidden;
    background: #111;
    aspect-ratio: 16 / 9;
    box-shadow:
        0 16px 38px rgba(0,0,0,0.34),
        0 0 22px rgba(212,175,55,0.05);
}

.blog-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-post-content {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    color: rgba(255,255,255,0.84);
    font-size: 1.02rem;
    line-height: 1.9;
    overflow-wrap: anywhere;
    word-break: normal;
}

.blog-post-content p {
    margin-bottom: 18px;
}

.blog-post-content a,
.blog-post-content span,
.blog-post-content div {
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* ============================
   NO ENCONTRADO
============================ */

.blog-post-not-found {
    max-width: 760px;
}

.blog-post-not-found h1 {
    margin-top: 0;
}

.blog-post-not-found p {
    color: rgba(255,255,255,0.82);
    line-height: 1.7;
}

/* ============================
   RESPONSIVE
============================ */

@media (max-width: 1024px) {
    .blog-row,
    .blog-row:nth-child(even) {
        grid-template-columns: 220px 1fr;
    }

    .blog-row:nth-child(even) .blog-row-media {
        order: 0;
    }

    .blog-row:nth-child(even) .blog-row-content {
        order: 0;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 120px 0 30px;
    }

    .blog-hero h1 {
        font-size: 2rem;
    }

    .blog-row,
    .blog-row:nth-child(even) {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px;
    }

    .blog-row:nth-child(even) .blog-row-media,
    .blog-row:nth-child(even) .blog-row-content {
        order: initial;
    }

    .blog-row-media {
        width: 100%;
    }

    .blog-row-title {
        font-size: 1.1rem;
    }

    .blog-row-extract {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .blog-btn {
        width: 100%;
    }

    .blog-post-section {
        padding: 60px 0 50px;
    }

    .blog-wrap {
        width: min(100%, 92%);
    }

    .blog-post-card {
        padding: 22px;
        border-radius: 22px;
    }

    .blog-post-card h1 {
        font-size: 2rem;
        line-height: 1.15;
    }

    .blog-post-extract {
        font-size: 0.98rem;
        line-height: 1.7;
    }

    .blog-post-image {
        max-width: 100%;
        margin: 22px auto;
        border-radius: 18px;
    }

    .blog-post-content {
        font-size: 0.96rem;
        line-height: 1.75;
    }
    .blog-back-link{
        margin-top: -60px;
    }
}

@media (max-width: 480px) {
    .blog-post-card {
        padding: 18px;
    }

    .blog-post-card h1 {
        font-size: 1.75rem;
    }

    .blog-date-badge {
        font-size: 0.75rem;
    }
}