/* =========================================================
   RAJKUMAR29000 WEB STORIES
   ========================================================= */

:root {
    --stories-bg: #0b1026;
    --stories-surface: #111832;
    --stories-surface-light: #18213f;

    --stories-blue: #1fbcff;
    --stories-purple: #7f47dd;
    --stories-red: #ef1c23;

    --stories-text: #ffffff;
    --stories-muted: #aeb8d0;

    --stories-radius: 22px;
}


/* =========================================================
   PAGE
   ========================================================= */

.stories-page {
    width: 100%;
    min-height: 100vh;

    margin: 0;
    padding: 0;

    background:
        radial-gradient(
            circle at 15% 5%,
            rgba(31, 188, 255, .10),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 15%,
            rgba(127, 71, 221, .12),
            transparent 30%
        ),
        var(--stories-bg);

    color: var(--stories-text);

    overflow: hidden;
}


/* =========================================================
   HERO
   ========================================================= */

.stories-page .stories-hero {
    position: relative;

    display: block;

    width: 100%;
    min-height: 430px;

    margin: 0;
    padding:
        105px 20px 85px;

    box-sizing: border-box;

    text-align: center;

    background:
        radial-gradient(
            circle at 20% 0%,
            rgba(31, 188, 255, .13),
            transparent 32%
        ),
        radial-gradient(
            circle at 80% 10%,
            rgba(127, 71, 221, .15),
            transparent 32%
        );
}

.stories-hero::before {
    content: "";

    position: absolute;

    width: 500px;
    height: 500px;

    left: 50%;
    top: -300px;

    transform: translateX(-50%);

    background:
        radial-gradient(
            circle,
            rgba(31, 188, 255, .2),
            transparent 70%
        );

    pointer-events: none;
}


.stories-page .stories-hero-inner {
    position: relative;

    z-index: 1;

    display: block;

    width:
        min(
            850px,
            100%
        );

    margin: 0 auto;
}


.stories-page .stories-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding:
        8px 15px;

    border:
        1px solid
        rgba(31, 188, 255, .35);

    border-radius: 999px;

    background:
        rgba(31, 188, 255, .08);

    color:
        var(--stories-blue);

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 2px;
}


.stories-page .stories-hero h1 {
    display: block;

    margin:
        24px 0 18px;

    color: #fff;

    font-size:
        clamp(38px, 6vw, 72px);

    line-height: 1.02;

    letter-spacing: -2px;
}


.stories-page .stories-hero h1 span {
    display: block;

    margin-top: 5px;

    background:
        linear-gradient(
            90deg,
            var(--stories-blue),
            #ffffff,
            var(--stories-purple)
        );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}

.stories-page .stories-hero p {
    display: block;

    width:
        min(
            680px,
            100%
        );

    margin:
        0 auto;

    color:
        var(--stories-muted);

    font-size:
        clamp(16px, 2vw, 20px);

    line-height: 1.7;
}


/* =========================================================
   FILTER
   ========================================================= */

.stories-page .stories-filter-section {
    position: relative;

    width:
        min(
            1200px,
            calc(100% - 32px)
        );

    margin:
        0 auto;

    padding:
        28px 0 20px;
}


.stories-page .stories-filters {
    display: flex;
    align-items: center;

    gap: 10px;

    width: 100%;

    overflow-x: auto;

    padding:
        5px 2px 12px;

    scrollbar-width: none;
}


.stories-filters::-webkit-scrollbar {
    display: none;
}


.stories-page .story-filter {
    flex:
        0 0 auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;

    margin: 0;
    padding:
        9px 17px;

    border:
        1px solid
        rgba(255,255,255,.10);

    border-radius: 999px;

    background:
        rgba(255,255,255,.04);

    color:
        var(--stories-muted);

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background .25s ease,
        border-color .25s ease,
        color .25s ease,
        transform .25s ease;
}


.story-filter:hover,
.story-filter.active {
    border-color:
        rgba(31,188,255,.6);

    background:
        rgba(31,188,255,.12);

    color: #fff;
}


/* =========================================================
   SECTIONS
   ========================================================= */

.stories-page .stories-section {
    display: block;

    width:
        min(
            1200px,
            calc(100% - 32px)
        );

    margin:
        0 auto 80px;

    padding: 0;
}


.stories-page .stories-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    width: 100%;

    margin:
        0 0 25px;

    padding: 0;
}


.stories-page .section-kicker {
    display: block;

    margin:
        0 0 7px;

    color:
        var(--stories-blue);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 2px;
}


.stories-page .stories-section-heading h2 {
    margin: 0;

    color: #fff;

    font-size:
        clamp(26px, 4vw, 38px);

    line-height: 1.1;
}


/* =========================================================
   FEATURED STORY
   ========================================================= */

.featured-story {
    position: relative;

    display: grid;

    grid-template-columns:
        minmax(260px, 380px)
        1fr;

    overflow: hidden;

    min-height: 430px;

    border:
        1px solid
        rgba(255,255,255,.09);

    border-radius:
        var(--stories-radius);

    background:
        linear-gradient(
            120deg,
            #111832,
            #161d3a
        );

    color: inherit;

    text-decoration: none;

    box-shadow:
        0 30px 80px
        rgba(0,0,0,.25);

    transition:
        transform .3s ease,
        border-color .3s ease;
}


.featured-story:hover {
    transform:
        translateY(-5px);

    border-color:
        rgba(31,188,255,.35);
}


.featured-story-image {
    position: relative;

    overflow: hidden;

    min-height: 430px;
}


.featured-story-image::after {
    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(17,24,50,.2)
        );
}


.featured-story-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition:
        transform .6s ease;
}


.featured-story:hover
.featured-story-image img {
    transform: scale(1.04);
}


.featured-story-content {
    display: flex;

    flex-direction: column;

    justify-content: center;

    padding:
        clamp(30px, 6vw, 70px);
}


.story-category {
    display: inline-flex;

    width: fit-content;

    margin-bottom: 14px;

    padding:
        6px
        10px;

    border-radius: 999px;

    background:
        rgba(31,188,255,.1);

    color:
        var(--stories-blue);

    font-size: 11px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 1px;
}


.featured-story-content h2 {
    max-width: 600px;

    margin:
        0
        0
        18px;

    font-size:
        clamp(30px, 5vw, 55px);

    line-height: 1.05;

    letter-spacing: -1.5px;
}


.featured-story-content p {
    max-width: 550px;

    margin:
        0
        0
        28px;

    color: var(--stories-muted);

    font-size: 17px;

    line-height: 1.7;
}


.story-read-button {
    display: inline-flex;

    align-items: center;

    gap: 12px;

    width: fit-content;

    padding:
        12px
        18px;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            var(--stories-blue),
            var(--stories-purple)
        );

    color: white;

    font-size: 14px;

    font-weight: 800;
}


.story-read-button span {
    font-size: 18px;
}


/* =========================================================
   STORY GRID
   ========================================================= */

.stories-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(190px, 1fr)
        );

    gap: 22px;
}


.story-card {
    position: relative;

    overflow: hidden;

    display: block;

    aspect-ratio: 9 / 16;

    border-radius:
        var(--stories-radius);

    background:
        var(--stories-surface);

    color: white;

    text-decoration: none;

    box-shadow:
        0 15px 40px
        rgba(0,0,0,.22);

    transition:
        transform .3s ease,
        box-shadow .3s ease;
}


.story-card:hover {
    transform:
        translateY(-7px);

    box-shadow:
        0 25px 55px
        rgba(0,0,0,.35);
}


.story-card-image,
.story-card-image img {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;
}


.story-card-image img {
    object-fit: cover;

    transition:
        transform .5s ease;
}


.story-card:hover
.story-card-image img {
    transform: scale(1.05);
}


.story-card-overlay {
    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,.05) 25%,
            rgba(0,0,0,.2) 40%,
            rgba(0,0,0,.9) 100%
        );
}


.story-card-content {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    padding: 20px;
}


.story-card-content .story-category {
    margin-bottom: 8px;
}


.story-card-content h3 {
    margin:
        0
        0
        10px;

    font-size: 21px;

    line-height: 1.15;
}


.story-pages {
    color:
        rgba(255,255,255,.7);

    font-size: 12px;
}


/* =========================================================
   EMPTY
   ========================================================= */

.stories-page .stories-empty {
    display: block;

    width:
        min(
            700px,
            calc(100% - 32px)
        );

    margin:
        40px auto 100px;

    padding:
        70px 20px;

    box-sizing: border-box;

    text-align: center;
}


.stories-empty p {
    color:
        var(--stories-muted);
}


/* =========================================================
   STORY VIEWER
   ========================================================= */

.story-viewer {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;
    height: 100dvh;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background: var(--stories-bg);

    isolation: isolate;
    z-index: 9999;

    color: #fff;
}


/* ---------------------------------------------------------
   BLURRED BACKGROUND
   --------------------------------------------------------- */

.story-viewer::before {
    content: "";

    position: absolute;
    inset: -50px;

    z-index: -2;

    background:
        var(--story-background)
        center / cover
        no-repeat;

    filter: blur(40px);

    transform: scale(1.15);

    opacity: .45;

    pointer-events: none;
}


.story-viewer::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: -1;

    background:
        linear-gradient(
            180deg,
            rgba(4, 8, 25, .88),
            rgba(4, 8, 25, .72)
        );

    pointer-events: none;
}


/* =========================================================
   STORY STAGE
   ========================================================= */

.story-stage {
    position: relative;

    width: min(430px, 100vw);
    height: min(765px, 100dvh);

    aspect-ratio: 9 / 16;

    overflow: hidden;

    flex-shrink: 0;

    border-radius: 22px;

    background: #080d22;

    box-shadow:
        0 30px 100px rgba(0, 0, 0, .65);

    isolation: isolate;

    touch-action: pan-y;

    z-index: 5;
}


/* =========================================================
   STORY PAGE
   ========================================================= */

.story-page {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform: scale(1.02);

    transition:
        opacity .3s ease,
        transform .3s ease,
        visibility .3s ease;

    overflow: hidden;
}


.story-page.active {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform: scale(1);
}


/* =========================================================
   STORY IMAGE
   ========================================================= */

.story-page-image {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    object-position: center;

    user-select: none;
    -webkit-user-drag: none;

    pointer-events: none;
}


/* =========================================================
   STORY GRADIENT
   ========================================================= */

.story-page-gradient {
    position: absolute;
    inset: 0;

    z-index: 1;

    pointer-events: none;

    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, .58) 0%,
            rgba(0, 0, 0, .08) 28%,
            rgba(0, 0, 0, .02) 45%,
            rgba(0, 0, 0, .28) 62%,
            rgba(0, 0, 0, .92) 100%
        );
}


/* =========================================================
   STORY CONTENT
   ========================================================= */

.story-page-content {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    z-index: 3;

    padding:
        30px
        28px
        105px;

    color: #fff;

    pointer-events: none;
}


.story-page-number {
    display: inline-flex;

    align-items: center;

    min-height: 22px;

    margin-bottom: 10px;

    padding:
        4px
        8px;

    border-radius: 999px;

    background:
        rgba(0, 0, 0, .35);

    color:
        rgba(255, 255, 255, .8);

    font-size: 11px;

    font-weight: 700;

    backdrop-filter: blur(8px);
}


.story-page-content h1 {
    margin:
        0
        0
        12px;

    max-width: 100%;

    color: #fff;

    font-size:
        clamp(27px, 5vw, 42px);

    font-weight: 900;

    line-height: 1.05;

    letter-spacing: -1px;

    text-wrap: balance;
}


.story-page-content p {
    max-width: 100%;

    margin: 0;

    color:
        rgba(255, 255, 255, .9);

    font-size: 15px;

    line-height: 1.55;

    text-wrap: pretty;
}


/* =========================================================
   PROGRESS BAR
   ========================================================= */

.story-progress {
    position: absolute;

    top: 15px;
    left: 50%;

    z-index: 50;

    display: flex;

    width:
        calc(100% - 30px);

    max-width: 390px;

    height: 4px;

    gap: 4px;

    transform:
        translateX(-50%);

    pointer-events: none;
}


.story-progress-segment {
    position: relative;

    flex: 1;

    min-width: 0;

    height: 4px;

    overflow: hidden;

    border-radius: 999px;

    background:
        rgba(255, 255, 255, .32);
}


.story-progress-segment span {
    display: block;

    width: 0;
    height: 100%;

    border-radius: inherit;

    background: #fff;
}


.story-progress-segment.done span {
    width: 100%;
}


.story-progress-segment.current span {
    animation:
        storyProgress
        5s
        linear
        forwards;
}


@keyframes storyProgress {

    from {
        width: 0;
    }

    to {
        width: 100%;
    }

}


/* =========================================================
   BRAND
   ========================================================= */

.story-brand {
    position: absolute;

    top: 30px;
    left: 22px;

    z-index: 50;

    display: flex;

    align-items: center;

    gap: 9px;

    color: #fff;

    font-size: 13px;

    font-weight: 800;

    text-shadow:
        0 2px 8px rgba(0, 0, 0, .4);

    pointer-events: none;
}


.story-brand-logo {
    display: grid;

    place-items: center;

    width: 30px;
    height: 30px;

    flex-shrink: 0;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            var(--stories-blue),
            var(--stories-purple)
        );

    color: #fff;

    font-size: 14px;

    font-weight: 900;

    box-shadow:
        0 5px 18px
        rgba(0, 0, 0, .3);
}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.story-close {
    position: absolute;

    top: 25px;
    right: 25px;

    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    box-sizing: border-box;

    padding: 0;

    border: 1px solid
        rgba(255, 255, 255, .22);

    border-radius: 50%;

    background:
        rgba(0, 0, 0, .38);

    color: #fff;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 24px;

    font-weight: 400;

    line-height: 40px;

    text-align: center;

    text-decoration: none;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    transition:
        background .2s ease,
        transform .2s ease;
}


.story-close:hover {
    background:
        rgba(0, 0, 0, .65);

    transform: scale(1.05);
}


.story-close:active {
    transform: scale(.95);
}


/* =========================================================
   DESKTOP NAVIGATION
   ========================================================= */

.story-nav {
    position: absolute;

    top: 50%;

    z-index: 40;

    display: grid;

    place-items: center;

    width: 50px;
    height: 50px;

    padding: 0;

    border:
        1px solid
        rgba(255, 255, 255, .18);

    border-radius: 50%;

    background:
        rgba(255, 255, 255, .09);

    color: #fff;

    font-family: inherit;

    font-size: 34px;

    line-height: 1;

    cursor: pointer;

    transform:
        translateY(-50%);

    backdrop-filter:
        blur(12px);

    -webkit-backdrop-filter:
        blur(12px);

    transition:
        background .2s ease,
        transform .2s ease;
}


.story-nav:hover {
    background:
        rgba(255, 255, 255, .18);

    transform:
        translateY(-50%)
        scale(1.06);
}


.story-nav:active {
    transform:
        translateY(-50%)
        scale(.95);
}


.story-prev {
    right:
        calc(50% + 245px);
}


.story-next {
    left:
        calc(50% + 245px);
}


/* =========================================================
   BOTTOM ACTIONS
   ========================================================= */

.story-bottom {
    position: absolute;

    bottom: 25px;
    left: 50%;

    z-index: 60;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    width: auto;

    max-width:
        calc(100% - 30px);

    transform:
        translateX(-50%);

    pointer-events: auto;
}


.story-article-link,
.story-share {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding:
        10px
        15px;

    border:
        1px solid
        rgba(255, 255, 255, .22);

    border-radius: 999px;

    background:
        rgba(0, 0, 0, .38);

    color: #fff;

    font-family: inherit;

    font-size: 12px;

    font-weight: 800;

    line-height: 1.2;

    text-decoration: none;

    white-space: nowrap;

    backdrop-filter:
        blur(12px);

    -webkit-backdrop-filter:
        blur(12px);

    transition:
        background .2s ease,
        transform .2s ease;
}


.story-article-link:hover,
.story-share:hover {
    background:
        rgba(0, 0, 0, .65);

    transform:
        translateY(-2px);
}


.story-article-link span {
    margin-left: 6px;

    font-size: 16px;
}


/* =========================================================
   KEYBOARD FOCUS
   ========================================================= */

.story-close:focus-visible,
.story-nav:focus-visible,
.story-share:focus-visible,
.story-article-link:focus-visible {
    outline:
        2px solid
        var(--stories-blue);

    outline-offset: 3px;
}


/* =========================================================
   TABLET / SMALL DESKTOP
   ========================================================= */

@media (max-width: 1000px) {

    .story-nav {
        width: 44px;
        height: 44px;
    }

    .story-prev {
        right:
            calc(50% + 225px);
    }

    .story-next {
        left:
            calc(50% + 225px);
    }

}


/* ---------------------------------------------------------
   MOBILE VIEWER
   --------------------------------------------------------- */

@media (max-width: 700px) {

    .story-viewer {
        align-items: stretch;

        width: 100%;
        height: 100dvh;

        min-height: 100svh;

        padding: 0;

        background: #080d22;
    }


    .story-stage {
        width: 100%;
        max-width: none;

        height: 100dvh;
        min-height: 100svh;
        max-height: none;

        aspect-ratio: auto;

        border-radius: 0;

        box-shadow: none;
    }


    /* Hide desktop arrows */

    .story-nav {
        display: none;
    }


    /* Safe-area aware top controls */

    .story-progress {
        top:
            max(
                12px,
                calc(
                    env(safe-area-inset-top) + 8px
                )
            );

        width:
            calc(100% - 28px);
    }


    .story-brand {
        top:
            max(
                31px,
                calc(
                    env(safe-area-inset-top) + 28px
                )
            );

        left: 18px;
    }


    .story-close {
        top:
            max(
                28px,
                calc(
                    env(safe-area-inset-top) + 22px
                )
            );

        right: 18px;

        width: 38px;
        height: 38px;
    }


    /* Keep text above bottom controls */

    .story-page-content {
        bottom: 0;

        padding:
            30px
            20px
            max(
                105px,
                calc(
                    env(safe-area-inset-bottom) + 90px
                )
            );
    }


    .story-page-content h1 {
        font-size:
            clamp(
                27px,
                8vw,
                36px
            );
    }


    .story-page-content p {
        font-size: 15px;

        line-height: 1.5;
    }


    /* Bottom controls */

    .story-bottom {
        bottom:
            max(
                16px,
                calc(
                    env(safe-area-inset-bottom) + 10px
                )
            );

        width:
            calc(100% - 28px);

        max-width: none;

        justify-content: space-between;

        gap: 8px;
    }


    .story-article-link,
    .story-share {
        min-height: 40px;

        padding:
            9px
            13px;

        font-size: 11px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .stories-page .stories-hero {
        min-height: auto;

        padding:
            70px 16px 55px;
    }


    .stories-page .stories-hero h1 {
        font-size: 42px;

        letter-spacing:
            -1.5px;
    }


    .stories-page .stories-hero p {
        font-size: 16px;
    }


    .stories-page .stories-filter-section {
        width:
            calc(100% - 24px);

        padding:
            22px 0 18px;
    }


    .stories-page .stories-section {
        width:
            calc(100% - 24px);

        margin-bottom:
            55px;
    }

    .stories-page .stories-section-heading {
        margin-bottom:
            18px;
    }



    .stories-page .featured-story {
        display: block;

        min-height: 0;

        border-radius:
            20px;
    }

    .stories-page .featured-story-image {
        width: 100%;
        height:
            min(
                110vw,
                560px
            );
    }


    .featured-story-content {
        padding: 25px;
    }


    .featured-story-content h2 {
        font-size: 34px;
    }


    .featured-story-content p {
        font-size: 15px;
    }


    .stories-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 12px;
    }


    .story-card {
        border-radius: 16px;
    }


    .story-card-content {
        padding: 14px;
    }


    .story-card-content h3 {
        font-size: 16px;
    }


    .story-card-content .story-category {
        font-size: 9px;

        padding:
            5px
            7px;
    }


    .story-pages {
        font-size: 10px;
    }

}

@media (max-width: 420px) {

    .stories-page .stories-hero h1 {
        font-size:
            36px;
    }


    .stories-page .featured-story-content h2 {
        font-size:
            30px;
    }

}