/* ============================================================
   Memoria Social — estilos del módulo público
   portal.blade.php · destacados/index.blade.php · destacados/show.blade.php
   ============================================================ */

/* ── Portal ─────────────────────────────────────────────── */

/* Grid ejes */
.ejes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
@media (max-width: 900px) { .ejes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .ejes-grid { grid-template-columns: 1fr; } }

/* Tarjeta eje */
.eje-card {
    cursor: pointer;
    border-radius: .5rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.09);
    display: flex;
    flex-direction: column;
    height: 300px;
    transition: transform .25s ease, box-shadow .25s ease;
    background: #fff;
}
.eje-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0,0,0,.15);
}
.eje-card-image-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    overflow: hidden;
}
.eje-card-image-area img {
    max-height: 170px;
    max-width: 100%;
    object-fit: contain;
}
.eje-card-footer {
    color: #1a1a1a;
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
    padding: .75rem .85rem;
    line-height: 1.35;
    flex-shrink: 0;
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botones portal */
.btn-portal {
    display: inline-block;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #1a1a1a;
    padding: .8rem 2.5rem;
    border-radius: 50px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn-portal:hover {
    background: #e05c2c;
    color: #fff !important;
    border-color: #e05c2c;
    text-decoration: none;
}

/* Botón cerrar modal */
#btn-cerrar-modal {
    background-color: #111827;
    transition: background-color .2s ease;
}
#btn-cerrar-modal:hover { background-color: #e05c2c; }


/* ── Destacados — barra de navegación ───────────────────── */

.ds-nav-active {
    color: #1a1a1a !important;
    border-bottom: 2px solid #e05c2c;
    padding-bottom: 2px;
}

/* ── Destacados — filtros ───────────────────────────────── */

.ds-filter-label {
    display: block;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: .25rem;
}
.ds-filter-select {
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    padding: 0 .65rem;
    font-size: .82rem;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    outline: none;
}
.ds-filter-input {
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    padding: 0 .65rem;
    font-size: .82rem;
    color: #1a1a1a;
    outline: none;
}

/* ── Destacados — tabs ──────────────────────────────────── */

.ds-tab {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 50px;
    padding: .35rem 1.1rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    cursor: pointer;
    color: #6b7280;
    transition: background .2s, color .2s, border-color .2s;
}
.ds-tab-active, .ds-tab:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

/* ── Destacados — grid ──────────────────────────────────── */

.ds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    align-items: stretch;
}
@media (max-width: 760px) {
    .ds-grid { grid-template-columns: 1fr; gap: 16px; }
    .dc-img-wrap { height: 170px; }
}

/* ── Referencia a destacado dentro de historias (enlace + tooltip) ── */
.ms-ref-destacado {
    cursor: pointer;
}
.ms-ref-tooltip {
    position: fixed;
    z-index: 10000;
    width: 300px;
    max-width: 92vw;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease;
}
.ms-ref-tooltip.is-visible { opacity: 1; transform: translateY(0); }

/* ── Destacados — tarjetas ──────────────────────────────── */

.destacado-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    min-height: 430px;
    box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.08), 0 24px 56px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    transition: box-shadow .28s ease;
}
.destacado-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,.05), 0 16px 48px rgba(0,0,0,.11), 0 32px 80px rgba(0,0,0,.07);
}
.dc-img-wrap {
    position: relative;
    overflow: hidden;
    height: 205px;
    background: #e5e7eb;
    flex-shrink: 0;
}
.dc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter .35s ease, transform .35s ease;
    display: block;
}
.destacado-card:hover .dc-img {
    filter: grayscale(0%);
    transform: scale(1.06);
}
.dc-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.dc-placeholder-text {
    color: #fff;
    font-size: .85rem;
    font-weight: 900;
    text-align: center;
    line-height: 1.25;
    text-transform: uppercase;
}
.dc-badge {
    position: absolute;
    top: .5rem;
    left: .5rem;
    background: #e05c2c;
    color: #fff;
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .2rem .5rem;
    border-radius: 3px;
}
.dc-body {
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.dc-body-proyecto {
    background: #c8fff4;
}
.dc-body-publicacion {
    background: #fffdf8;
}
.dc-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .08em;
    color: rgba(0,0,0,.58);
    text-transform: uppercase;
    margin: 0;
}
.dc-title {
    font-size: 16px;
    font-weight: 900;
    color: #1a1a1a;
    line-height: 1.22;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dc-desc {
    font-size: 12.7px;
    color: #6b7280;
    line-height: 1.45;
    opacity: .82;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dc-meta-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    color: rgba(0,0,0,.52);
    text-transform: uppercase;
    margin: 0;
}
.dc-meta-val {
    font-size: 12.5px;
    color: #1a1a1a;
    margin: 0;
    font-weight: 900;
    line-height: 1.25;
}
.dc-meta-year {
    font-size: 20px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: .5px;
}
.dc-meta-section {
    margin-top: auto;
    display: flex;
    flex-direction: column;
}
.dc-field {
    border-top: 1.5px solid rgba(0,0,0,.16);
    padding-top: 9px;
    margin-top: 10px;
}

/* ── Destacados — vista detalle (show) ───────────────────── */

.ds-show-nav-active {
    color: #1a1a1a !important;
    border-bottom: 2px solid #e05c2c;
    padding-bottom: 2px;
}
.show-layout {
    display: grid;
    grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr);
    gap: 34px;
    align-items: stretch;
}
@media (max-width: 768px) {
    .show-layout { grid-template-columns: 1fr; }
}
.show-img-col {
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 10px 36px rgba(0,0,0,.09), 0 28px 72px rgba(0,0,0,.07);
}
.show-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 14px;
    filter: grayscale(25%);
}
.show-img-placeholder {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.show-placeholder-text {
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
    line-height: 1.15;
    text-transform: uppercase;
}
.show-card {
    background: #fffdf8;
    border-radius: 14px;
    padding: 34px;
    position: relative;
    box-shadow: 0 1px 4px rgba(0,0,0,.05), 0 8px 28px rgba(0,0,0,.08), 0 18px 48px rgba(0,0,0,.05);
}
.show-card.has-eje { padding-right: 90px; }
.show-tipo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: #e05c2c;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.show-eje-float {
    position: absolute;
    top: 28px;
    right: 28px;
    width: 84px;
    height: 84px;
    perspective: 1000px;
}
.show-eje-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.show-eje-float:hover .show-eje-inner { transform: rotateY(180deg); }
.show-eje-face {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    backface-visibility: hidden;
    border: 3px solid var(--eje-color, #e05c2c);
    display: grid;
    place-items: center;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.06), 0 10px 24px rgba(0,0,0,.08);
}
.show-eje-face.back {
    transform: rotateY(180deg);
    padding: 3px;
    text-align: center;
    color: var(--eje-color, #b89a63);
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 8px;
    line-height: 1.1;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.show-eje-name {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    line-height: 1.1;
    font-size: 7px;
}
.show-eje-face.front img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}
.show-eje-face.front i { font-size: 2rem; }
.show-titulo {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(28px, 5.5vw, 48px);
    font-weight: 700;
    color: #1a1a1a;
    line-height: 0.95;
    margin: 0 0 22px;
    overflow-wrap: break-word;
    hyphens: auto;
}
.show-desc-short {
    font-family: 'Libre Baskerville', serif;
    font-size: 18px;
    line-height: 1.75;
    color: var(--gray-700);
    margin-bottom: 28px;
}
.show-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 28px 0;
}
.show-field-item {
    border: 2px solid rgba(0,0,0,.16);
    border-radius: 14px;
    padding: 14px;
    background: rgba(255,255,255,.48);
}
.show-field-item--wide { grid-column: 1 / -1; }
.show-field-subgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.show-field-label {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.2px;
    color: rgba(0,0,0,.52);
    text-transform: uppercase;
    margin: 0 0 5px;
}
.show-field-val {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}
.show-section {
    border-top: 2px solid rgba(0,0,0,.14);
    padding-top: 22px;
    margin-top: 24px;
}
.show-section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: .2px;
    margin: 0 0 12px;
}
.show-desc-full {
    font-size: 14.5px;
    color: #3d3834;
    line-height: 1.7;
}
.show-contenido-list { display: flex; flex-direction: column; gap: 10px; }
.show-contenido-row {
    display: grid;
    grid-template-columns: auto 1fr;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: box-shadow .2s ease;
}
.show-contenido-row:hover { box-shadow: 0 3px 12px rgba(0,0,0,.13); text-decoration: none; }
.show-contenido-tipo {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 18px;
    min-width: 168px;
    background: #c8fff4;
    font-size: 12.5px;
    font-weight: 900;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}
.show-contenido-nombre {
    padding: 13px 18px;
    font-size: 13.5px;
    font-weight: 700;
    color: #3d3834;
    background: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    align-self: center;
}


/* ── Historias Viewer ──────────────────────────────────────── */

body:has(.ms-viewer-page) .footer { display: none !important; }

.ms-viewer-page {
    --ms-orange: #e05c2c;
    --ms-mint: #c8fff4;
    --ms-yellow: #ffff63;
    --ms-black: #1a1a1a;
    --ms-cream: #f7f2ea;
    --ms-cream2: #fffdf8;
    --ms-gray200: #e7e2da;
    --ms-gray300: #d2ccc3;
    --ms-gray500: #77716b;
    --ms-gray700: #3d3834;
    font-family: 'Nunito', sans-serif;
    overflow-x: clip;
}

/* Nav bar interno del viewer */
.ms-viewer-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    position: relative;
    z-index: 10;
    height: 48px;
    box-sizing: border-box;
}
.ms-viewer-nav .ms-nav-brand {
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ms-orange);
}
.ms-viewer-nav .ms-nav-links {
    display: flex;
    gap: 2rem;
    padding-right: 1.5rem;
}
.ms-viewer-nav .ms-nav-links a {
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #1a1a1a;
    text-decoration: none;
    transition: color .2s;
}
.ms-viewer-nav .ms-nav-links a:hover { color: var(--ms-orange); }
.ms-viewer-nav .ms-nav-links a.ms-nav-active {
    color: var(--ms-orange);
    border-bottom: 2px solid var(--ms-orange);
    padding-bottom: 1px;
}

/* ── Historias — visualización interactiva (campo de tarjetas) ── */

#ms-historias {
    position: relative;
    background: radial-gradient(ellipse at 0% 0%, rgba(160,218,200,0.35) 0%, transparent 55%), #f9f8f3;
    min-height: calc(100dvh - 48px);
    overflow-x: hidden;
}

/* Título "Historias SINAC" */
.hist-title {
    position: absolute;
    top: 80px;
    left: 0; right: 0;
    z-index: 30;
    display: flex;
    justify-content: center;
    pointer-events: none;
    transform: translateY(0) scale(1);
    transition: transform 1s cubic-bezier(.2, .7, .25, 1);
}
.hist-title-box {
    font-weight: 700;
    text-align: center;
    color: var(--ms-black);
    padding: 6px 18px;
    letter-spacing: .04em;
    line-height: .95;
    font-size: clamp(30px, 3.6vw, 48px);
    paint-order: stroke fill;
}
/* Fase de introducción: el título arranca centrado y más grande */
#ms-historias.is-intro .hist-title {
    transform: translateY(40vh) scale(1.6);
}

/* Texto introductorio */
.hist-intro {
    position: absolute;
    top: clamp(204px, 24vh, 244px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: min(680px, 86vw);
    text-align: center;
    font-size: clamp(12px, 1.5vw, 20px);
    line-height: 1.4;
    color: var(--ms-gray700);
    opacity: 0;
    pointer-events: none;
    transition: opacity .8s ease .2s, transform .8s ease .2s;
    z-index: 25;
}
#ms-historias.is-presenting .hist-intro {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.hist-intro-link {
    pointer-events: auto;            /* .hist-intro tiene pointer-events:none */
    display: inline-block;
    margin-left: .35em;
    color: var(--ms-orange);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.hist-intro-link:hover { color: var(--ms-black); }

/* Filtro de historias por eje — rail fijo arriba-derecha */
.hist-filter {
    position: fixed;
    top: 86px;
    right: 16px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 6px;
}
.hist-filter-all {
    width: 64px;
    height: 40px;
    display: grid;
    place-items: center;
    background: #1a1a1a;
    color: #fff;
    border-radius: 14px;
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .08em;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
.hist-filter-eje {
    position: relative;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    background: #fff;
    border-radius: 16px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .10);
}
.hist-filter-icon img { width: 38px; height: 38px; object-fit: contain; display: block; }
.hist-filter-eje.is-active {
    box-shadow: 0 2px 9px color-mix(in srgb, var(--eje) 60%, transparent);
}
.hist-filter-label {
    position: absolute;
    right: calc(100% + 12px);     /* a la izquierda del ícono */
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    white-space: nowrap;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 16px;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .10);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.hist-filter-eje:hover .hist-filter-label { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (max-width: 760px) {
    .hist-filter {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        box-sizing: border-box;
        gap: 8px;
        padding: 8px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: rgba(255, 253, 248, .96);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, .12);
        z-index: 60;
    }
    .hist-filter-all,
    .hist-filter-eje { flex: 0 0 auto; }
    .hist-filter-eje { width: 44px; height: 44px; }
    .hist-filter-icon img { width: 30px; height: 30px; }
    .hist-filter-all { width: 50px; height: 34px; font-size: 11px; }
    .hist-filter-label { display: none; }
}

/* Campo de tarjetas */
.hist-field {
    position: relative;
    width: 100%;
    margin: 0 auto;
    --px: 0px;
    --py: 0px;
    /* la altura la fija el JS según el nº de tarjetas */
}

/* Tarjeta — capa exterior: parallax (instantáneo, suavizado por JS) + escala por scroll */
.hist-card {
    position: absolute;
    top: 0; left: 0;
    width: var(--cw, 220px);
    cursor: pointer;
    transform:
        translate(calc(var(--px) * var(--depth, 1)), calc(var(--py) * var(--depth, 1)))
        scale(var(--sscale, 1));
    will-change: transform;
    z-index: 1;
}
.hist-card.is-hover { z-index: 60; }

/* Capa media: animación de entrada (intro) */
.hist-card-inner {
    position: relative;
    transform: translate(var(--enterX, 0px), var(--enterY, 0px)) scale(var(--enterScale, 1));
    transition: transform .85s cubic-bezier(.2, .7, .25, 1);
    transition-delay: var(--enterDelay, 0s);
    transform-origin: center center;
}

/* Capa interior: hover (sólo en presentación) */
.hist-card-hov {
    transition: transform .35s cubic-bezier(.2, .7, .25, 1);
}
#ms-historias.is-presenting .hist-card:hover .hist-card-hov { transform: scale(var(--hoverScale, 1.12)); }

/* Tarjeta — la foto es la tarjeta (sin marco blanco) */
.hist-card-frame {
    position: relative;
    transform: rotate(var(--rot, 0deg));
    transition: transform .35s cubic-bezier(.2, .7, .25, 1);
}
/* Al hover, la tarjeta se endereza; al salir el mouse vuelve a su inclinación */
#ms-historias.is-presenting .hist-card:hover .hist-card-frame { transform: rotate(0deg); }

.hist-card-eyebrow {
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    color: var(--ms-gray700);
    text-transform: uppercase;
    margin: 0 2px 10px;
    opacity: 0;
    transition: opacity .5s ease;
}

.hist-card-media { position: relative; }

.hist-card-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 6;             /* más alto que cuadrado ⇒ la focal recorta */
    border-radius: 0;
    overflow: hidden;
}
.hist-card-photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
/* Ícono del eje — baldosa flotante con volteo 3D al hover */
.hist-card-eje {
    position: absolute;
    right: -40px; top: 22px;
    width: 84px; height: 84px;
    z-index: 3;
    opacity: 0;
    perspective: 600px;
    transition: opacity .5s ease .1s;
}
.hist-card-eje-flip {
    display: block;            /* sin esto, un <span> inline ignora width/height y colapsa */
    position: relative;
    width: 100%; height: 100%;
    transform-style: preserve-3d;
    transition: transform .6s cubic-bezier(.2, .7, .25, 1);
}
.hist-card-eje:hover .hist-card-eje-flip { transform: rotateY(180deg); }
.hist-card-eje-face {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: #fff;
    border: 2px solid var(--accent, #b89a63);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .16);
    display: grid; place-items: center;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: hidden;
}
.hist-card-eje-front { padding: 0; }
.hist-card-eje-front img { width: 90%; height: 90%; object-fit: contain; }
.hist-card-eje-back {
    transform: rotateY(180deg);
    padding: 3px;
    text-align: center;
    color: var(--accent, #b89a63);
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 8px;
    line-height: 1.1;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.hist-card-eje-name {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;   /* las palabras largas envuelven y no tocan el borde */
    line-height: 1.1;
    font-size: 7px;
}

.hist-card-caption {
    padding: 14px 2px 4px;
    opacity: 0;
    transition: opacity .5s ease .15s;
}
.hist-card-titlerow { display: flex; align-items: flex-start; gap: 8px; }
.hist-card-bullet {
    width: 18px; height: 18px;
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--ms-black);
}
.hist-card-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.16;
    color: var(--ms-black);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hist-card-sub {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--ms-black);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Durante la intro sólo se ve la foto; lo demás aparece al presentar */
#ms-historias.is-presenting .hist-card-eje,
#ms-historias.is-presenting .hist-card-caption { opacity: 1; }

/* Sentinel + spinner del scroll infinito */
.hist-sentinel {
    position: relative;
    width: 100%;
    height: 80px;
    display: grid; place-items: center;
}
.hist-spinner {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 3px solid var(--ms-gray300);
    border-top-color: var(--ms-orange);
    animation: hist-spin .8s linear infinite;
    opacity: 0;
    transition: opacity .2s;
}
.hist-sentinel.is-loading .hist-spinner { opacity: 1; }
@keyframes hist-spin { to { transform: rotate(360deg); } }

/* Responsive: columna vertical, sin parallax ni dispersión */
@media (max-width: 760px), (pointer: coarse) {
    .hist-field {
        position: static;
        height: auto !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 26px;
        padding: 18px 16px 96px;
    }
    .hist-card {
        position: static !important;
        width: min(300px, 84vw) !important;
        transform: none !important;
    }
    .hist-card-inner { transform: none !important; transition: none !important; }
    .hist-card-frame { transform: none !important; }
    #ms-historias.is-presenting .hist-card:active .hist-card-hov { transform: scale(1.03); }
    .hist-title { position: static; padding: 28px 16px 4px; transform: none !important; }
    #ms-historias.is-intro .hist-title { transform: none !important; }
    .hist-intro {
        position: static; transform: none; opacity: 1;
        margin: 6px auto 4px; padding: 0 16px;
    }
    #ms-historias.is-presenting .hist-intro { transform: none; }
}

/* Story Overlay */
.story-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--ms-cream);
    color: var(--ms-black);
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform .45s cubic-bezier(.2, .7, .25, 1), visibility 0s linear .45s;
}
.story-overlay.open {
    transform: translateY(0);
    visibility: visible;
    transition: transform .45s cubic-bezier(.2, .7, .25, 1), visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
    .story-overlay, .story-overlay.open { transition: none; }
}
.story-header {
    height: 72px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    padding: 14px 28px;
    background: rgba(255,253,248,.96);
    border-bottom: 1.5px solid rgba(0,0,0,.12);
    position: relative;
    z-index: 5;
}
.story-brand {
    font-family: 'Oswald', sans-serif;
    font-size: 24px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 700;
}
.story-brand small {
    display: block;
    font-family: 'Nunito', sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 900;
    color: var(--ms-gray700);
}
.story-header-meta {
    justify-self: center;
    font-size: 12px;
    color: var(--ms-gray500);
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-align: center;
}
.story-close {
    justify-self: end;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .25);
    background: var(--ms-yellow);
    color: var(--ms-black);
    font-size: 26px;
    cursor: pointer;
    display: grid;
    place-items: center;
    line-height: 1;
    font-family: inherit;
    margin-right: 45px;
    margin-bottom: 6px;
}
.story-close:hover { background: var(--ms-orange); color: #fff; }
.story-progress {
    position: absolute;
    left: 0; top: 72px;
    height: 4px; width: 100%;
    background: transparent;
    z-index: 10;
}
.story-progress span {
    display: block;
    width: 0%; height: 100%;
    background: var(--ms-orange);
    transition: width .08s linear;
}
.story-scroll {
    height: calc(100vh - 72px);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    overscroll-behavior: contain;
}
.story-scroll.is-wheel-scrolling { scroll-snap-type: none; scroll-behavior: auto; }
.story-scroll::-webkit-scrollbar { height: 11px; }
.story-scroll::-webkit-scrollbar-track { background: var(--ms-gray200); }
.story-scroll::-webkit-scrollbar-thumb { background: var(--ms-black); border-radius: 999px; }
.story-track { height: 100%; display: flex; flex-wrap: nowrap; }

/* Paneles base */
.ms-panel {
    height: 100%;
    min-width: 100vw;
    scroll-snap-align: start;
    flex: 0 0 100vw;
    position: relative;
    padding: 48px 60px;
    display: grid;
    gap: 34px;
    align-items: center;
    overflow: hidden;
}
.ms-panel::after {
    content: 'Scroll horizontal o rueda del mouse →';
    position: absolute;
    right: 28px; bottom: 18px;
    color: var(--ms-gray700);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

/* Hero */
.ms-panel.hero {
    grid-template-columns: minmax(520px, 1fr) minmax(360px, 540px);
    background: var(--ms-cream);
}
.hero-image {
    height: calc(100vh - 180px);
    min-height: 430px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.10), 0 28px 72px rgba(0,0,0,.07);
    background: var(--ms-gray300);
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.story-card {
    align-self: end;
    background: var(--ms-cream2);
    border-radius: 12px;
    padding: 28px 30px;
    max-width: 540px;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.09), 0 20px 56px rgba(0,0,0,.06);
    overflow: hidden;
}
.story-ep {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--ms-gray700);
    text-transform: uppercase;
    margin-bottom: 10px;
}
.story-title {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(30px, 3.25vw, 58px);
    line-height: 1.02;
    margin-bottom: 18px;
    overflow-wrap: break-word;
}
.story-title.long { font-size: clamp(26px, 2.8vw, 50px); line-height: 1.06; }
.story-desc { font-family: 'Libre Baskerville', serif; font-size: 15px; line-height: 1.72; color: var(--ms-gray700); }
.story-desc p { margin-bottom: .75rem; }

/* TOC */
.ms-panel.toc { background: var(--ms-cream2); place-items: center; text-align: left; }
.toc-box { max-width: 560px; }
.toc-box .toc-kicker {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ms-gray500);
    margin-bottom: 14px;
}
.toc-box h3 {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(36px, 4vw, 56px);
    line-height: 1.02;
    margin-bottom: 28px;
}
.toc-list { list-style: none; display: flex; flex-direction: column; }
.toc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1.5px solid var(--ms-gray200);
    cursor: pointer;
    transition: all .2s;
}
.toc-item:first-child { border-top: 1.5px solid var(--ms-gray200); }
.toc-item:hover { padding-left: 12px; color: var(--ms-orange); }
.toc-num { font-family: 'Oswald', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: 1px; color: var(--ms-gray500); min-width: 28px; }
.toc-name { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 600; line-height: 1.2; }
.toc-arrow { margin-left: auto; font-size: 18px; opacity: 0; transition: opacity .2s; }
.toc-item:hover .toc-arrow { opacity: 1; }

/* Bloques de texto */
.ms-copy-block {
    max-width: 860px;
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    padding-right: 12px;
}
.ms-copy-block.wide { max-width: 1060px; margin: 0 auto; }
.ms-copy-block.narrow { max-width: min(1024px, 100%); margin: 0 auto; }
.ms-kicker {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--ms-orange);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}
.ms-copy-block h3 {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(34px, 4vw, 70px);
    line-height: 1.02;
    margin-bottom: 22px;
}
.ms-prose p,
.ms-copy-block p {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(16px, 1.08vw, 20px);
    line-height: 1.82;
    margin-bottom: 16px;
}
.ms-prose ul, .ms-prose ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.ms-prose li { font-family: 'Libre Baskerville', serif; font-size: clamp(15px, 1vw, 18px); line-height: 1.72; margin-bottom: .5rem; }
.ms-caption { margin-top: 14px; color: var(--ms-gray500); font-weight: 900; font-size: 12px; letter-spacing: .5px; }

/* Imágenes en paneles */
.ms-panel-img,
.ms-image-block,
.ms-media-visual {
    height: calc(100vh - 190px);
    min-height: 430px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.10), 0 28px 72px rgba(0,0,0,.07);
    background: var(--ms-gray300);
}
.ms-panel-img img,
.ms-image-block img,
.ms-media-visual img { width: 100%; height: 100%; object-fit: cover; }
.ms-panel-img iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Invertir orden izquierda/derecha en paneles de 2 columnas */
.ms-panel.is-reversed { direction: rtl; }
.ms-panel.is-reversed > * { direction: ltr; }

/* Panel types */
.ms-panel.text { grid-template-columns: 1fr; background: var(--ms-cream2); }
.ms-panel.textPhoto,
.ms-panel.textPdf,
.ms-panel.quotePhoto { grid-template-columns: .9fr 1fr; background: var(--ms-cream2); }
.ms-panel.subtitle { place-items: center; text-align: center; background: var(--ms-yellow); }
.ms-panel.subtitle .roman { font-family: 'Libre Baskerville', serif; font-size: 42px; font-style: italic; margin-bottom: 14px; }
.ms-panel.subtitle h2 { font-family: 'Oswald', sans-serif; font-size: clamp(54px, 7vw, 112px); line-height: .94; max-width: 1050px; }
.ms-panel.quote { place-items: center; text-align: center; background: var(--ms-mint); }
.ms-quote-box { max-width: 1100px; width: 100%; }
.ms-quote-text { font-family: 'Libre Baskerville', serif; font-style: italic; font-size: clamp(22px, 4.4vw, 68px); line-height: 1.22; }
.ms-quote-credit { margin-top: 28px; font-size: 13px; font-weight: 950; letter-spacing: 1.7px; text-transform: uppercase; color: var(--ms-gray700); }
.ms-panel.foto {
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #111;
    overflow: hidden;
    gap: 0;
}
.ms-panel.foto::after { display: none; }
.ms-foto-full { flex: 1; overflow: hidden; min-height: 0; }
.ms-foto-full img { width: 100%; height: 100%; object-fit: cover; }
.ms-foto-caption { padding: 1rem 2rem; background: #111; color: #999; font-size: 12px; font-weight: 900; letter-spacing: .5px; }
.ms-panel.video,
.ms-panel.audio { place-items: center; background: var(--ms-cream2); grid-template-columns: 1fr; }
.ms-panel.video iframe,
.ms-panel.video video { width: 100%; max-width: 960px; height: calc(100vh - 200px); border: none; border-radius: 12px; }
/* Bloques "solo medio" (centrados, sin texto) */
.ms-panel.solo { place-items: center; grid-template-columns: 1fr; background: var(--ms-cream2); }
.ms-solo-box { max-width: 960px; width: 100%; text-align: center; }
.ms-solo-box > img {
    max-width: 100%; max-height: calc(100vh - 240px); object-fit: contain; border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.10), 0 28px 72px rgba(0,0,0,.07);
}
.ms-solo-title { font-family: 'Oswald', sans-serif; font-size: clamp(12px, 3.2vw, 22px); line-height: 1.05; margin-bottom: 22px; }
.ms-solo-pdf { max-width: 1100px; }
.ms-solo-pdf .ms-panel-img { height: calc(100vh - 240px); }
.ms-solo-video iframe,
.ms-solo-video video {
    width: 100%; max-width: 960px; height: auto !important; aspect-ratio: 16 / 9;
    border: none; border-radius: 12px;
}
.ms-panel.doublePhoto { grid-template-columns: 1fr 1fr .8fr; background: var(--ms-cream); }
.ms-panel.closing { place-items: center; text-align: center; background: var(--ms-yellow); }
.ms-panel.textAudio { grid-template-columns: .85fr 1fr; background: #d4b85c; }
.ms-panel.videoText { grid-template-columns: .85fr 1fr; background: #d4b85c; }
.ms-panel.textAudio > .ms-media-box,
.ms-panel.videoText > .ms-media-box { justify-self: center; margin: 0 auto; }
.ms-panel.videoText .ms-media-box {
    max-width: none; width: 100%;
    background: transparent; box-shadow: none; padding: 0; border-radius: 0;
}
.ms-panel.videoText .ms-media-box iframe {
    width: 100%; height: auto !important; aspect-ratio: 16 / 9;
    max-width: none; border-radius: 12px;
}
/* Shorts de YouTube — formato vertical 9:16 */
.ms-solo-short iframe,
.ms-solo-short video {
    width: auto !important; max-width: 100%;
    height: calc(100vh - 240px) !important; max-height: 80vh;
    aspect-ratio: 9 / 16;
    border: none; border-radius: 12px; margin: 0 auto; display: block;
}
.ms-panel.videoText .ms-media-box.ms-short iframe {
    width: auto !important; max-width: 100%;
    height: 70vh !important; max-height: calc(100vh - 200px);
    aspect-ratio: 9 / 16;
    border-radius: 12px; margin: 0 auto; display: block;
}
.ms-media-box {
    background: var(--ms-cream2);
    border-radius: 12px;
    padding: 34px;
    box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.09);
    max-width: 700px;
    width: 700px;
}
.ms-media-label {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--ms-black);
    color: #fff;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.ms-media-box h3 { font-family: 'Oswald', sans-serif; font-size: 1.5em; line-height: 1.3; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ms-audio-desc { font-size: clamp(13px,1vw,15px); color: rgba(0,0,0,.55); margin-bottom: 16px; line-height: 1.5; }
.ms-audio-player { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.ms-audio-play {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--ms-orange); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: transform .15s;
}
.ms-audio-play:hover { transform: scale(1.08); }
.ms-audio-play svg { width: 18px; height: 18px; margin-left: 3px; }
.ms-audio-bar {
    flex: 1; height: 6px; background: rgba(0,0,0,.15);
    border-radius: 3px; cursor: pointer; overflow: hidden;
}
.ms-audio-fill { height: 100%; background: var(--ms-orange); border-radius: 3px; width: 0; transition: width .15s linear; }
.ms-audio-time { font-size: 13px; color: rgba(0,0,0,.5); min-width: 44px; text-align: right; flex-shrink: 0; }

body.no-scroll { overflow: hidden; }

/* Responsive */
@media (max-width: 1100px) {
    .ms-panel.hero,
    .ms-panel.textPhoto,
    .ms-panel.textPdf,
    .ms-panel.quotePhoto,
    .ms-panel.textAudio,
    .ms-panel.videoText,
    .ms-panel.doublePhoto { grid-template-columns: 1fr !important; padding: 28px; overflow-y: auto; }
    .hero-image, .ms-panel-img, .ms-image-block, .ms-media-visual { min-height: 300px; height: 38vh; }
    .story-card { width: 100%; }
}
@media (max-width: 760px) {
    .ms-viewer-nav .ms-nav-links { display: none; }
    .story-header { padding: 10px 16px; height: 60px; }
    .story-brand { font-size: 18px; letter-spacing: 2px; }
    .story-header-meta { display: none; }
    .ms-panel { padding: 20px 18px !important; gap: 18px !important; overflow-y: auto; }
    .hero-image, .ms-panel-img, .ms-image-block, .ms-media-visual { height: 36vh; min-height: 200px; }
    .story-title { font-size: clamp(22px, 6.5vw, 38px) !important; }
    .story-close { margin-right: 0; }
    .ms-copy-block h3 { font-size: clamp(24px, 7vw, 40px); }
    .ms-prose p, .ms-copy-block p { font-size: clamp(15px, 1.08vw, 18px); line-height: 1.72; }
    .ms-quote-text { font-size: clamp(18px, 5.5vw, 40px) !important; }
}
