.eg-story {
    --eg-story-width: 1240px;
    --eg-story-gap: 96px;
    --eg-story-text: #3e332c;
    --eg-story-accent: #20b9b5;
    --eg-hero-height: 680px;
    width: 100%;
    max-width: var(--eg-story-width);
    margin: 0 auto;
    padding: clamp(36px, 6vw, 88px) clamp(20px, 4vw, 48px) clamp(70px, 8vw, 120px);
    color: var(--eg-story-text);
    box-sizing: border-box;
    overflow: clip;
}

.eg-story *,
.eg-story *::before,
.eg-story *::after { box-sizing: border-box; }

.eg-story figure,
.eg-story blockquote,
.eg-story p { margin-top: 0; }

.eg-story img {
    display: block;
    width: 100%;
}

.eg-story figcaption {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.45;
    opacity: .68;
}

/* Portada */
.eg-story__hero {
    display: grid;
    gap: clamp(34px, 5vw, 62px);
}

.eg-story__hero-copy {
    width: min(850px, 100%);
    margin-left: clamp(0px, 5vw, 68px);
}

.eg-story__kicker {
    margin: 0 0 10px;
    color: var(--eg-story-accent);
    font-family: "Amatic SC", cursive;
    font-style: normal !important;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    font-size: clamp(38px, 4.2vw, 58px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: .02em;
    text-transform: none;
}

.eg-story__eyebrow {
    margin-bottom: 12px;
    color: var(--eg-story-accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.eg-story__hero-title {
    max-width: 920px;
    margin: 0 0 24px;
    font-family: "Amatic SC", cursive;
    font-style: normal !important;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    font-size: clamp(58px, 7vw, 92px);
    font-weight: 700;
    line-height: .98;
    letter-spacing: .015em;
}

.eg-story__hero-text {
    max-width: 720px;
    font-size: clamp(17px, 1.8vw, 22px);
    line-height: 1.65;
}

.eg-story__hero-text > :last-child,
.eg-story__chapter-text > :last-child { margin-bottom: 0; }

.eg-story__hero-image {
    margin: 0;
    width: 100%;
}

.eg-story__hero-image img {
    width: 100%;
    height: var(--eg-hero-height);
    max-height: 78vh;
    object-fit: cover;
    object-position: center;
}

/* Historia: alternancia estable en escritorio */
.eg-story__chapters {
    margin-top: clamp(92px, 11vw, 155px);
}

.eg-story__chapter {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(280px, 5fr);
    align-items: center;
    gap: 0;
    margin-top: var(--eg-story-gap);
    isolation: isolate;
}

.eg-story__chapter:first-child { margin-top: 0; }

.eg-story__chapter-media {
    position: relative;
    z-index: 1;
    width: 100%;
}

.eg-story__chapter-media::before {
    content: "";
    position: absolute;
    width: 34%;
    aspect-ratio: 1 / 1;
    background: color-mix(in srgb, var(--eg-story-accent) 10%, transparent);
    z-index: -1;
}

.eg-story__chapter--image-left .eg-story__chapter-media::before {
    left: -20px;
    bottom: -20px;
}

.eg-story__chapter--image-right .eg-story__chapter-media::before {
    right: -20px;
    top: -20px;
}

.eg-story__chapter-media figure { margin: 0; }

.eg-story__chapter-media img {
    width: 100%;
    aspect-ratio: 6 / 5;
    height: auto;
    object-fit: cover;
    object-position: center;
}

.eg-story__chapter-copy {
    position: relative;
    z-index: 2;
    width: calc(100% + 48px);
    padding: clamp(28px, 4vw, 50px);
    background: #fff;
}

.eg-story__chapter--image-left .eg-story__chapter-media { order: 1; }
.eg-story__chapter--image-left .eg-story__chapter-copy {
    order: 2;
    margin-left: -48px;
}

.eg-story__chapter--image-right {
    grid-template-columns: minmax(280px, 5fr) minmax(0, 7fr);
}
.eg-story__chapter--image-right .eg-story__chapter-copy {
    order: 1;
    margin-right: -48px;
}
.eg-story__chapter--image-right .eg-story__chapter-media { order: 2; }

.eg-story__quote {
    position: relative;
    margin: 0 0 22px;
    padding: 0;
    color: var(--eg-story-text);
    font-family: "Amatic SC", cursive;
    font-style: normal !important;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    font-size: clamp(38px, 4.2vw, 54px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: .015em;
    border: 0;
}

.eg-story__quote::before {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin-bottom: 14px;
    background: var(--eg-story-accent);
}

.eg-story__chapter-title {
    margin: 0 0 16px;
    font-family: "Amatic SC", cursive;
    font-style: normal !important;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    font-size: clamp(34px, 3.5vw, 48px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: .015em;
}

.eg-story__chapter-text {
    max-width: 560px;
    font-size: clamp(16px, 1.35vw, 19px);
    line-height: 1.7;
}

.eg-story__placeholder {
    display: grid;
    min-height: 320px;
    place-items: center;
    align-content: center;
    gap: 12px;
    padding: 30px;
    border: 1px dashed currentColor;
    color: #756b65;
    background: rgba(0,0,0,.025);
    text-align: center;
}

.eg-story__placeholder span { font-size: 40px; }
.eg-story__placeholder p { margin: 0; }

@media (max-width: 900px) {
    .eg-story { --eg-story-gap: 78px; }
    .eg-story__hero-copy { margin-left: 0; }

    .eg-story__chapter,
    .eg-story__chapter--image-right {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .eg-story__chapter--image-left .eg-story__chapter-media,
    .eg-story__chapter--image-right .eg-story__chapter-media {
        order: 1;
        width: calc(100% - 28px);
    }

    .eg-story__chapter--image-left .eg-story__chapter-media { margin-right: 28px; }
    .eg-story__chapter--image-right .eg-story__chapter-media { margin-left: 28px; }

    .eg-story__chapter--image-left .eg-story__chapter-copy,
    .eg-story__chapter--image-right .eg-story__chapter-copy {
        order: 2;
        width: calc(100% - 28px);
        margin-top: -26px;
        margin-right: 0;
        margin-left: 0;
        padding: clamp(24px, 5vw, 40px);
    }

    .eg-story__chapter--image-left .eg-story__chapter-copy { margin-left: 28px; }
    .eg-story__chapter--image-right .eg-story__chapter-copy { margin-right: 28px; }
}

@media (max-width: 600px) {
    .eg-story {
        --eg-story-gap: 15px;
        padding: 32px 18px 66px;
    }

    .eg-story__kicker {
        font-size: clamp(36px, 12vw, 48px);
        margin-bottom: 8px;
    }

    .eg-story__hero-title {
        font-size: clamp(50px, 15vw, 68px);
        line-height: .98;
    }

    .eg-story__hero-text {
        font-size: 17px;
        line-height: 1.65;
    }

    /* En móvil la portada conserva la fotografía completa. */
    .eg-story__hero-image img {
        height: auto !important;
        max-height: none;
        aspect-ratio: auto;
        object-fit: contain;
    }

    .eg-story__chapters {
        margin-top: 86px;
    }

    .eg-story__chapter--image-left .eg-story__chapter-media,
    .eg-story__chapter--image-right .eg-story__chapter-media {
        width: 100%;
    }

    .eg-story__chapter--image-left .eg-story__chapter-media { margin-right: 0; }
    .eg-story__chapter--image-right .eg-story__chapter-media { margin-left: 0; }

    .eg-story__chapter--image-left .eg-story__chapter-copy,
    .eg-story__chapter--image-right .eg-story__chapter-copy {
        width: 100%;
        margin-top: -18px;
        padding: 18px 8px 18px;
    }

    .eg-story__chapter--image-left .eg-story__chapter-copy { margin-left: 0; }
    .eg-story__chapter--image-right .eg-story__chapter-copy { margin-right: 0; }

    .eg-story__chapter-media img {
        width: 100%;
        aspect-ratio: 6 / 5;
        height: auto;
        object-fit: cover;
        object-position: center;
    }

    .eg-story__quote {
        font-size: clamp(36px, 11vw, 46px);
        margin-bottom: 12px;
    }

    .eg-story__chapter-title {
        font-size: clamp(34px, 10vw, 44px);
        margin-bottom: 10px;
    }

    .eg-story__chapter-media::before { width: 30%; }
}

@media (prefers-reduced-motion: reduce) {
    .eg-story *,
    .eg-story *::before,
    .eg-story *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
