/* =========================================================
   CASOS DE ÉXITO - LISTADO + DETALLE
   - Listado tipo publicación / feed
   - Detalle fijo en pantalla
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.cases-body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
    background: #050505;
}

.cases-page {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
        padding-top: 80px;

}

.cases-wrap {
    width: min(1180px, 94%);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* ============================
   HERO DEL LISTADO
============================ */

.cases-hero {
    padding: 170px 0 30px;
    position: relative;
}

.cases-back-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 24px;
    color: #f0cf65;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.cases-back-link:hover {
    color: #ffffff;
    transform: translateX(-2px);
}

.cases-hero h1 {
    font-size: 2.8rem;
    margin: 14px 0;
    color: #ffffff;
}

.cases-hero p {
    color: rgba(255,255,255,0.82);
    line-height: 1.7;
    max-width: 760px;
}

/* =========================================================
   LISTADO DE CASOS - ESTILO PUBLICACIÓN / FEED
========================================================= */

.cases-list-section {
    padding: 10px 0 80px;
}

.cases-list {
    display: grid;
    gap: 26px;
    justify-items: center;
}

/* Cada caso como publicación */
.case-row {
    width: 100%;
    max-width: 760px;

    display: grid;
    grid-template-columns: 1fr;
    gap: 0;

    padding: 16px;
    border-radius: 28px;

    background:
        radial-gradient(circle at top right, rgba(212,175,55,0.05), 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);

    box-shadow:
        0 18px 42px 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;
}

.case-row:hover {
    transform: translateY(-4px);
    box-shadow:
        0 24px 54px rgba(0,0,0,0.42),
        0 0 24px rgba(212,175,55,0.06);
    border-color: rgba(212,175,55,0.14);
}

/* Sin línea lateral */
.case-row::before {
    display: none;
}

/* Imagen tipo publicación */
.case-row-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 22px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 14px 32px rgba(0,0,0,0.30);
    margin-bottom: 16px;
}

.case-row-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.case-row-media-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,0.58);
    font-size: 0.92rem;
    font-weight: 700;
    background: linear-gradient(145deg, rgba(46,46,50,0.95), rgba(20,20,22,0.94));
}

/* Contenido del post */
.case-row-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}

/* Encabezado */
.case-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.case-row-meta span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #f0cf65;
    background: rgba(212,175,55,0.12);
    border: 1px solid rgba(212,175,55,0.20);
}

/* Título */
.case-row-title {
    margin: 0 0 12px;
    font-size: 1.4rem;
    line-height: 1.22;
    color: #ffffff;
    overflow-wrap: anywhere;
}

/* Texto */
.case-row-extract {
    margin: 0;
    color: rgba(255,255,255,0.82);
    line-height: 1.8;
    font-size: 0.98rem;
    overflow-wrap: anywhere;
}

/* Bloque inferior */
.case-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Pastillas */
.case-row-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.case-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(212,175,55,0.14);
    color: #f0cf65;
    border: 1px solid rgba(212,175,55,0.22);
    font-weight: 700;
    font-size: 0.84rem;
}

.case-pill-soft {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.84);
    border: 1px solid rgba(255,255,255,0.06);
}

/* Botón */
.case-row-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;
}

.case-row-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 26px rgba(212,175,55,0.30),
        0 0 18px rgba(243,211,122,0.10);
    filter: brightness(1.03);
}

/* =========================================================
   DETALLE DEL CASO
   MISMA LÓGICA FIJA QUE EL BLOG
========================================================= */

.case-detail-section {
    min-height: 100vh;
    padding: 120px 0 70px;
    position: relative;
}

/* Fondo fijo detrás del detalle */
.case-detail-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;
}

/* Botón volver fijo */
.case-detail-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;
}

.case-detail-back-link:hover {
    color: #ffffff;
    transform: translateX(-2px);
    background: rgba(20,20,24,0.72);
}

/* Card fija */
.case-detail-card {
   
position: relative; /* ✅ FIX REAL */

    width: min(980px, 92%);
    margin: 0 auto; /* ✅ centrado correcto */

    max-height: none; /* ✅ quita scroll interno */
    overflow: visible; /* ✅ scroll natural */

    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);
}
.cases-page {
    padding-top: 120px; /* ajusta si tu header mide más o menos */
}

.case-detail-card::-webkit-scrollbar {
    width: 10px;
}

.case-detail-card::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
    border-radius: 999px;
}

.case-detail-card::-webkit-scrollbar-thumb {
    background: rgba(212,175,55,0.38);
    border-radius: 999px;
    border: 2px solid rgba(18,18,20,0.95);
}

.case-detail-card::-webkit-scrollbar-thumb:hover {
    background: rgba(243,211,122,0.55);
}

/* Cabecera del detalle */
.case-detail-top {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 24px;
}

.case-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.case-detail-meta span {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #f0cf65;
    background: rgba(212,175,55,0.12);
    border: 1px solid rgba(212,175,55,0.22);
}

.case-detail-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;
}

.case-detail-highlight {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(212,175,55,0.14);
    color: #f0cf65;
    border: 1px solid rgba(212,175,55,0.22);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.case-result {
    margin: 0;
    color: rgba(255,255,255,0.86);
    font-weight: 700;
    line-height: 1.7;
}

/* Imagen detalle más pequeña */
.case-featured-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);
}

.case-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.case-extract {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 22px;
    color: rgba(255,255,255,0.84);
    font-size: 1.02rem;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.case-story {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    color: rgba(255,255,255,0.84);
    font-size: 1rem;
    line-height: 1.9;
    overflow-wrap: anywhere;
    word-break: normal;
}

.case-media-section {
    width: 100%;
    max-width: 760px;
    margin: 36px auto 0;
}

.case-media-section h2 {
    margin: 0 0 18px;
    font-size: 1.6rem;
    color: #ffffff;
}

.case-media-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.case-media-card {
    background: #111;
    border-radius: 20px;
    overflow: hidden;
    min-height: 240px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 14px 32px rgba(0,0,0,0.28);
}

.case-media-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.case-video-card iframe {
    width: 100%;
    height: 100%;
    min-height: 280px;
    display: block;
    border: none;
}

.case-video-link {
    display: grid;
    place-items: center;
    padding: 20px;
}

.case-video-link a {
    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;
}

/* ============================
   RESPONSIVE
============================ */

@media (max-width: 768px) {
    .cases-hero {
        padding: 120px 0 30px;
    }

    .cases-hero h1 {
        font-size: 2rem;
    }

    .case-row {
        gap: 14px;
        padding: 14px;
        border-radius: 22px;
    }

    .case-row-media {
        border-radius: 18px;
        margin-bottom: 14px;
    }

    .case-row-title {
        font-size: 1.12rem;
        line-height: 1.28;
    }

    .case-row-extract {
        font-size: 0.92rem;
        line-height: 1.65;
    }

    .case-row-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .case-row-btn {
        width: 100%;
    }

    .case-detail-section {
        padding: 60px 0 50px;
    }

    .case-detail-back-link {
        top: 30px;
        left: 12px;
        padding: 8px 12px;
        font-size: 20px;
    }

    .case-detail-card {
        width: min(94%, 94%);
        padding: 22px;
        border-radius: 22px;
    }

    .case-detail-card h1 {
        font-size: 2rem;
        line-height: 1.15;
    }

    .case-extract,
    .case-story {
        font-size: 0.96rem;
        line-height: 1.75;
    }

    .case-featured-image {
        max-width: 100%;
        margin: 22px auto;
        border-radius: 18px;
    }

    .case-media-card {
        min-height: 200px;
        border-radius: 18px;
    }

    .case-video-card iframe {
        min-height: 220px;
    }
}

@media (max-width: 480px) {
    .case-detail-card {
        padding: 18px;
    }

    .case-detail-card h1 {
        font-size: 1.75rem;
    }
}
