.stories-page {
    min-height: 100vh;
    background: #f8f7f3;
    color: #263837;
}

.stories-index-main,
.story-detail-main {
    min-height: 64vh;
    padding: 60px 0 74px;
}

.stories-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 24px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e4e0d6;
}

.stories-intro h1 {
    margin: 0 0 20px;
    color: #263f3d;
    font-size: clamp(35px, 4vw, 52px);
    line-height: 1.1;
}

.stories-intro p:last-child {
    margin: 0;
    color: #566764;
    font-size: 14px;
}

.stories-count {
    flex: 0 0 auto;
    color: #5d6c69;
    font-size: 12px;
    font-weight: 800;
}

.stories-filters {
    display: flex;
    gap: 8px;
    max-width: 100%;
    margin-bottom: 22px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-margin-top: 88px;
}

.stories-filters::-webkit-scrollbar { display: none; }

.stories-filters button {
    flex: 0 0 auto;
    min-height: 33px;
    padding: 0 14px;
    border: 1px solid #d8d5cc;
    border-radius: 999px;
    background: #fff;
    color: #667572;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    transition: .2s ease;
}

.stories-filters button:hover,
.stories-filters button.active {
    border-color: #2f4f4f;
    background: #2f4f4f;
    color: #fff;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 25px 22px;
}

.stories-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid #e4e0d6;
}

.stories-pagination[hidden] { display: none; }
.stories-pagination-status { color: #566764; font-size: 12px; font-weight: 750; }
.stories-pagination-controls, .stories-pagination-numbers { display: flex; align-items: center; gap: 7px; }
.stories-pagination-nav, .stories-pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 38px;
    height: 38px;
    border: 1px solid #d8d5cc;
    border-radius: 999px;
    background: #fff;
    color: #526662;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 850;
}
.stories-pagination-nav { padding: 0 13px; }
.stories-pagination-number:hover, .stories-pagination-number[aria-current="page"], .stories-pagination-nav:hover:not(:disabled) { border-color: #2f4f4f; background: #2f4f4f; color: #fff; }
.stories-pagination-nav:disabled { opacity: .42; cursor: not-allowed; }
.stories-pagination-ellipsis { display: grid; place-items: center; width: 22px; color: #8b9693; font-weight: 900; }

.story-card {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 1px solid rgba(43, 68, 65, .1);
    border-radius: 16px;
    background: #d9ddd8;
    box-shadow: 0 8px 20px rgba(47, 79, 79, .11);
}

.story-card[hidden] { display: none; }
.story-card a { display: block; width: 100%; height: 100%; }

.story-card img,
.story-card video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease, filter .3s ease, opacity .2s ease;
}

.story-card video { opacity: 0; }
.story-card.is-playing img { opacity: 0; }
.story-card.is-playing video { opacity: 1; }
.story-card:hover img,
.story-card:hover video { transform: scale(1.035); }

.story-card-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(12, 23, 21, .03) 20%, rgba(11, 20, 18, .16) 50%, rgba(8, 17, 15, .9) 100%);
    pointer-events: none;
}

.story-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border: 1px solid rgba(255, 255, 255, .62);
    border-radius: 50%;
    background: rgba(28, 48, 44, .56);
    color: #fff;
    transform: translate(-50%, -50%);
    transition: opacity .2s ease, transform .2s ease;
    backdrop-filter: blur(6px);
}

.story-card-play i { margin-left: 2px; font-size: 20px; }
.story-card:hover .story-card-play,
.story-card.is-playing .story-card-play { opacity: 0; transform: translate(-50%, -50%) scale(.82); }

.story-card-copy {
    position: absolute;
    right: 17px;
    bottom: 16px;
    left: 17px;
    color: #fff;
}

.story-card-copy h2 {
    margin: 0 0 10px;
    font-size: clamp(20px, 2vw, 27px);
    line-height: 1.03;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .34);
}

.story-card-copy p {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    color: rgba(255, 255, 255, .72);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.story-card-views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #ead69b;
}

.story-card-views b { font: inherit; }

.stories-empty {
    grid-column: 1 / -1;
    padding: 78px 24px;
    border: 1px dashed #d5d0c4;
    border-radius: 14px;
    background: rgba(255, 255, 255, .58);
    color: #74807e;
    text-align: center;
}

.stories-empty i { color: #b99a36; font-size: 34px; }
.stories-empty h2 { margin: 9px 0 4px; color: #34514e; font-size: 25px; }
.stories-empty p { margin: 0; font-size: 13px; }

.story-detail-main .container { max-width: 1080px; }

.story-detail {
    display: grid;
    grid-template-columns: minmax(290px, 420px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(42px, 7vw, 86px);
    padding: 34px;
    border: 1px solid #e4dfd3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(47, 79, 79, .09);
}

.story-player {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 15px;
    background: #152b28;
    box-shadow: 0 15px 34px rgba(27, 53, 49, .21);
}

.story-player-poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.story-player video { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; }

.story-details h1,
.story-details h2 {
    margin: 0 0 20px;
    color: #273f3c;
    font-size: clamp(39px, 5vw, 58px);
    line-height: 1.04;
}

.story-details > p {
    margin: 0;
    color: #657471;
    font-size: 15px;
    line-height: 1.8;
}

.story-details > p a {
    color: #9a7910;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: rgba(154, 121, 16, .45);
    text-underline-offset: 2px;
}

.story-details > p a:hover { color: #715706; }

.story-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 23px 0 29px; }
.story-tags span { padding: 6px 10px; border: 1px solid #ded9ce; border-radius: 999px; background: #faf8f3; color: #5f6e6b; font-size: 10px; font-weight: 800; text-transform: capitalize; }
.story-detail-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.story-cta, .story-secondary-cta { display: inline-flex; align-items: center; gap: 7px; min-height: 41px; padding: 0 15px; border-radius: 999px; font-size: 12px; font-weight: 850; }
.story-cta { background: #2f4f4f; color: #fff; }
.story-secondary-cta { border: 1px solid #c6aa55; background: #fff; color: #806817; }
.story-detail-actions button { border: 0; cursor: pointer; font-family: inherit; }

.story-modal {
    width: min(1080px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: inherit;
    overflow: visible;
}

.story-modal::backdrop {
    background: rgba(18, 30, 28, .72);
    backdrop-filter: blur(7px);
}

.story-modal .story-detail {
    position: relative;
    max-height: calc(100vh - 32px);
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    transition: opacity .18s ease, transform .18s ease;
}

.story-modal .story-detail.is-switching { opacity: .42; }
.story-modal .story-detail.is-moving-next { transform: translateX(-12px); }
.story-modal .story-detail.is-moving-previous { transform: translateX(12px); }

.story-viewer-nav,
.story-immersive-nav {
    display: grid;
    place-items: center;
    border-radius: 50%;
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, opacity .18s ease;
}

.story-viewer-nav {
    position: absolute;
    z-index: 4;
    top: 50%;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(218, 213, 202, .9);
    background: rgba(255, 255, 255, .92);
    color: #2f4f4f;
    box-shadow: 0 6px 18px rgba(24, 43, 40, .16);
    transform: translateY(-50%);
}

.story-viewer-prev { left: 10px; }
.story-viewer-next { right: 10px; }
.story-viewer-nav:hover { background: #2f4f4f; color: #fff; transform: translateY(-50%) scale(1.05); }
.story-viewer-nav.is-disabled { pointer-events: none; opacity: .35; }

.story-modal-player { cursor: zoom-in; }
.story-expand {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    background: rgba(18, 34, 31, .7);
    color: #fff;
    box-shadow: 0 5px 14px rgba(0, 0, 0, .2);
    pointer-events: none;
}

.story-detail-progress {
    margin: 12px 0 8px;
    color: #82908d;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .12em;
}

.story-immersive {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    align-items: center;
    justify-items: center;
    gap: 18px;
    padding: 16px;
    background: rgba(8, 13, 12, .97);
    color: #fff;
    transition: opacity .18s ease;
}

.story-immersive.is-switching { opacity: .72; }
.story-immersive-stage {
    position: relative;
    width: min(100%, calc((100dvh - 32px) * .5625));
    height: min(calc(100dvh - 32px), 960px);
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 16px;
    background: #050807;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
    touch-action: pan-y;
}

.story-immersive-stage video { display: block; width: 100%; height: 100%; object-fit: contain; background: #050807; }
.story-immersive-caption {
    position: absolute;
    right: 0;
    bottom: 44px;
    left: 0;
    padding: 48px 18px 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .72));
    color: #fff;
    pointer-events: none;
}
.story-immersive-caption h2 { margin: 0 0 5px; color: #fff; font-size: 22px; line-height: 1.08; }
.story-immersive-caption span { color: #e4cf8a; font-size: 11px; font-weight: 850; letter-spacing: .12em; }

.story-immersive-nav {
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 20px;
}
.story-immersive-nav:hover { background: #fff; color: #203b37; transform: scale(1.06); }
.story-immersive-nav.is-disabled { pointer-events: none; opacity: .3; }
.story-immersive-close {
    position: fixed;
    z-index: 22;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    font-size: 17px;
}
.story-modal.is-immersive > .story-modal-close { display: none; }

.story-modal-close {
    position: absolute;
    z-index: 5;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border: 1px solid #d8d5cc;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #2f4f4f;
    cursor: pointer;
    box-shadow: 0 5px 18px rgba(24, 43, 40, .16);
}

.story-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 240px;
    border-radius: 18px;
    background: #fff;
    color: #61706d;
    font-size: 13px;
    font-weight: 800;
}

.story-modal [hidden] { display: none !important; }

.story-modal-loading span {
    width: 18px;
    height: 18px;
    border: 2px solid #d7dfdc;
    border-top-color: #2f4f4f;
    border-radius: 50%;
    animation: story-modal-spin .7s linear infinite;
}

@keyframes story-modal-spin { to { transform: rotate(360deg); } }

body[data-theme="dark"].stories-page { background: #182321; color: #e7ecea; }
body[data-theme="dark"].stories-page .site-logo, body[data-theme="dark"].stories-page .stories-intro h1 { color: #f0eee8; }
body[data-theme="dark"].stories-page .site-slogan, body[data-theme="dark"].stories-page .stories-intro p:last-child { color: #aebbb8; }
body[data-theme="dark"].stories-page .stories-intro { border-color: #394441; }
body[data-theme="dark"].stories-page .stories-count { color: #b7c3bf; }
body[data-theme="dark"].stories-page .stories-filters button { border-color: #47524f; background: #23302d; color: #c5cfcc; }
body[data-theme="dark"].stories-page .stories-filters button.active { background: #c29b31; border-color: #c29b31; color: #182321; }
body[data-theme="dark"].stories-page .stories-pagination { border-color: #394441; }
body[data-theme="dark"].stories-page .stories-pagination-status, body[data-theme="dark"].stories-page .stories-pagination-ellipsis { color: #aebbb8; }
body[data-theme="dark"].stories-page .stories-pagination-nav, body[data-theme="dark"].stories-page .stories-pagination-number { border-color: #47524f; background: #23302d; color: #c5cfcc; }
body[data-theme="dark"].stories-page .stories-pagination-number[aria-current="page"], body[data-theme="dark"].stories-page .stories-pagination-number:hover, body[data-theme="dark"].stories-page .stories-pagination-nav:hover:not(:disabled) { border-color: #c29b31; background: #c29b31; color: #182321; }
body[data-theme="dark"].stories-page .story-detail, body[data-theme="dark"].stories-page .stories-empty { border-color: #3c4744; background: #222f2c; }
body[data-theme="dark"].stories-page .story-details h1, body[data-theme="dark"].stories-page .stories-empty h2 { color: #f2f0ea; }
body[data-theme="dark"].stories-page .story-details h2 { color: #f2f0ea; }
body[data-theme="dark"].stories-page .story-details > p, body[data-theme="dark"].stories-page .stories-empty { color: #b7c2bf; }
body[data-theme="dark"].stories-page .story-modal-loading { background: #222f2c; color: #c5cfcc; }

/* Shared Story surfaces can also open from category pages, so modal theming must not depend on .stories-page. */
body[data-theme="dark"] .story-modal .story-detail {
    border-color: #43514e;
    background: #222f2c;
    color: #e7ecea;
    box-shadow: 0 22px 58px rgba(0, 0, 0, .42);
}

body[data-theme="dark"] .story-details h1,
body[data-theme="dark"] .story-details h2 { color: #f2f0ea; }
body[data-theme="dark"] .story-details > p { color: #b7c2bf; }
body[data-theme="dark"] .story-tags span {
    border-color: #4b5b57;
    background: #2b3a37;
    color: #d2dcda;
}
body[data-theme="dark"] .story-detail-progress { color: #a7b4b1; }
body[data-theme="dark"] .story-cta {
    background: #d4bd63;
    color: #182724;
}
body[data-theme="dark"] .story-secondary-cta {
    border-color: #a88e3f;
    background: #293835;
    color: #ecd982;
}
body[data-theme="dark"] .story-modal-close,
body[data-theme="dark"] .story-viewer-nav {
    border-color: #53635f;
    background: rgba(39, 53, 49, .96);
    color: #f2f0ea;
    box-shadow: 0 7px 20px rgba(0, 0, 0, .3);
}
body[data-theme="dark"] .story-viewer-nav:hover,
body[data-theme="dark"] .story-modal-close:hover {
    border-color: #d4bd63;
    background: #d4bd63;
    color: #182724;
}
body[data-theme="dark"] .story-modal-loading {
    background: #222f2c;
    color: #c5cfcc;
}
body[data-theme="dark"] .story-modal-loading span {
    border-color: #52615d;
    border-top-color: #d4bd63;
}
body[data-theme="dark"] .story-modal button:focus-visible,
body[data-theme="dark"] .story-modal a:focus-visible {
    outline: 2px solid #e4cf82;
    outline-offset: 3px;
}

@media (max-width: 980px) {
    .stories-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}

@media (max-width: 768px) {
    .stories-index-main, .story-detail-main { padding: 42px 0 50px; }
    .stories-intro { align-items: flex-start; margin-bottom: 18px; padding-bottom: 19px; }
    .stories-intro h1 { margin-bottom: 14px; font-size: 34px; }
    .stories-intro p:last-child { max-width: 270px; font-size: 12px; }
    .stories-count { padding-top: 22px; }
    .stories-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .stories-pagination { align-items: stretch; flex-direction: column; margin-top: 25px; padding-top: 18px; }
    .stories-pagination-controls { justify-content: center; }
    .stories-pagination-nav span { display: none; }
    .stories-pagination-nav { min-width: 38px; padding: 0; }
    .story-card { border-radius: 12px; }
    .story-card-play { width: 35px; height: 35px; }
    .story-card-copy { right: 11px; bottom: 11px; left: 11px; }
    .story-card-copy h2 { margin-bottom: 7px; font-size: 18px; }
    .story-card-copy p { font-size: 8px; }
    .story-detail { grid-template-columns: 1fr; gap: 28px; padding: 17px; }
    .story-player { width: min(100%, 390px); justify-self: center; }
    .story-details { padding: 0 4px 8px; }
    .story-details h1, .story-details h2 { font-size: 40px; }
    .story-modal {
        width: min(430px, calc(100% - 20px));
        max-height: calc(100dvh - 20px);
        overflow: hidden;
    }
    .story-modal .story-detail {
        display: flex;
        max-height: calc(100dvh - 20px);
        flex-direction: column;
        gap: 10px;
        padding: 42px 12px 12px;
        overflow: hidden;
    }
    .story-modal .story-player {
        width: min(43vw, 150px);
        flex: 0 0 auto;
        align-self: center;
        border-radius: 12px;
        box-shadow: 0 9px 22px rgba(27, 53, 49, .18);
    }
    .story-modal .story-details {
        width: 100%;
        min-height: 0;
        padding: 0 4px;
    }
    .story-modal .story-details h2 {
        display: -webkit-box;
        margin-bottom: 7px;
        overflow: hidden;
        font-size: clamp(23px, 6.7vw, 28px);
        line-height: 1.03;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }
    .story-modal .story-details > p {
        display: block;
        overflow: visible;
        font-size: 11px;
        line-height: 1.45;
    }
    .story-modal .story-tags {
        max-width: 100%;
        max-height: none;
        margin: 9px 0 10px;
        padding: 0 2px 3px;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
    }
    .story-modal .story-tags::-webkit-scrollbar { display: none; }
    .story-modal .story-tags span { flex: 0 0 auto; padding: 5px 8px; font-size: 9px; scroll-snap-align: start; }
    .story-modal .story-detail-actions { justify-content: center; flex-wrap: wrap; row-gap: 8px; }
    .story-modal .story-cta,
    .story-modal .story-secondary-cta {
        min-height: 36px;
        padding: 0 12px;
        max-width: 100%;
        justify-content: center;
        white-space: nowrap;
    }
    .story-modal-close { top: 9px; right: 9px; width: 35px; height: 35px; }
    .story-viewer-nav { top: 177px; width: 40px; height: 40px; }
    .story-viewer-prev { left: 8px; }
    .story-viewer-next { right: 8px; }
    .story-detail-progress { margin: 7px 0 6px; text-align: center; }
    .story-immersive { display: block; padding: 0; }
    .story-immersive-stage {
        width: min(100vw, calc(100dvh * .5625));
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }
    .story-immersive-nav { position: fixed; z-index: 22; top: 50%; width: 44px; height: 44px; transform: translateY(-50%); }
    .story-immersive-nav:hover { transform: translateY(-50%); }
    .story-immersive-prev { left: max(8px, env(safe-area-inset-left)); }
    .story-immersive-next { right: max(8px, env(safe-area-inset-right)); }
    .story-immersive-caption { bottom: 48px; padding-right: 60px; padding-left: 18px; }
    .story-immersive-caption h2 { font-size: 19px; }
}

@media (max-width: 520px) {
    .story-modal .story-detail-actions {
        flex-direction: column;
        align-items: center;
    }
    .story-modal .story-cta {
        width: min(100%, 290px);
        min-height: 38px;
        padding: 7px 12px;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
    }
    .story-modal .story-secondary-cta { width: min(100%, 210px); }
}

@media (max-width: 768px) and (max-height: 700px) {
    .story-modal .story-detail { gap: 8px; padding-top: 39px; }
    .story-modal .story-player { width: min(35vw, 125px); }
    .story-modal .story-details h2 { margin-bottom: 5px; font-size: 22px; -webkit-line-clamp: 3; }
    .story-modal .story-details > p { font-size: 10px; line-height: 1.35; }
    .story-modal .story-tags { margin: 7px 0 8px; }
    .story-viewer-nav { top: 151px; }
}

@media (prefers-reduced-motion: reduce) {
    .story-modal .story-detail,
    .story-immersive,
    .story-viewer-nav,
    .story-immersive-nav { transition: none; }
}

@media (max-width: 390px) {
    .stories-intro { display: block; }
    .stories-count { display: block; padding-top: 8px; }
    .stories-grid { gap: 8px; }
    .story-card-copy h2 { font-size: 16px; }
}
