
.tp-stories-section {
    --tp-primary: #6c4cf1;
    --tp-primary-soft: #eeeaff;
    --tp-dark: #101828;
    --tp-text: #667085;
    --tp-border: #e7eaf0;

    padding: 80px 0;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 5% 10%,
            rgba(108, 76, 241, 0.07),
            transparent 25%
        ),
        #fff;
    color: var(--tp-dark);
    font-family: Arial, Helvetica, sans-serif;
}

.tp-stories-section,
.tp-stories-section *,
.tp-stories-section *::before,
.tp-stories-section *::after {
    box-sizing: border-box;
}

/* Section container */

.tp-stories-section > .container,
.tp-stories-section > .tp-stories-container {
    width: 100%;
    max-width: 1180px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 12px;
    padding-left: 12px;
}

/* Header */

.tp-stories-section .tp-section-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 36px;
}

.tp-stories-section .tp-section-copy {
    max-width: 700px;
}

.tp-stories-section .tp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--tp-primary-soft);
    color: var(--tp-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.2;
    text-transform: uppercase;
}

.tp-stories-section .tp-eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tp-primary);
}

.tp-stories-section .tp-title {
    margin: 0;
    color: var(--tp-dark);
    font-size: clamp(30px, 4vw, 46px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -1.2px;
}

.tp-stories-section .tp-description {
    margin: 16px 0 0;
    color: var(--tp-text);
    font-size: 15px;
    line-height: 1.7;
}

.tp-stories-section .tp-section-note {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    padding: 11px 14px;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    background: #fff;
    color: #475467;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.tp-stories-section .tp-section-note i {
    color: var(--tp-primary);
    font-size: 16px;
}

/* Gallery */

.tp-stories-section .tp-gallery-wrap {
    position: relative;
}

.tp-stories-section .tp-gallery {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 18px;
    scrollbar-width: none;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
}

.tp-stories-section .tp-gallery::-webkit-scrollbar {
    display: none;
}

.tp-stories-section .tp-gallery.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* Story cards */

.tp-stories-section .tp-story-card {
    position: relative;
    flex: 0 0 118px;
    height: 500px;
    overflow: hidden;
    border-radius: 20px;
    background: #111;
    cursor: pointer;
    isolation: isolate;
    transition:
        flex-basis 0.5s cubic-bezier(0.22, 0.8, 0.25, 1),
        transform 0.35s ease,
        box-shadow 0.35s ease;
}

.tp-stories-section .tp-story-card.active {
    flex-basis: 285px;
    box-shadow: 0 20px 48px rgba(16, 24, 40, 0.18);
}

.tp-stories-section .tp-story-card:hover {
    transform: translateY(-3px);
}

.tp-stories-section .tp-story-card:focus-visible {
    outline: 3px solid rgba(108, 76, 241, 0.45);
    outline-offset: 3px;
}

/* Thumbnail */

.tp-stories-section .tp-thumb {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        opacity 0.3s ease,
        transform 0.5s ease;
}

.tp-stories-section .tp-story-card.active .tp-thumb {
    transform: scale(1.03);
}

/* Inline video */

.tp-stories-section .tp-inline-video {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.tp-stories-section .tp-story-card.is-playing .tp-inline-video {
    opacity: 1;
    pointer-events: auto;
}

.tp-stories-section .tp-story-card.is-playing .tp-thumb {
    opacity: 0;
}

/* Card overlay */

.tp-stories-section .tp-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 42%,
        rgba(0, 0, 0, 0.08) 58%,
        rgba(8, 12, 20, 0.9) 100%
    );
    transition: opacity 0.25s ease;
}

.tp-stories-section .tp-story-card.is-playing .tp-overlay {
    opacity: 0.15;
}

/* Card index */

.tp-stories-section .tp-index {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    background: rgba(10, 15, 25, 0.3);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tp-stories-section .tp-story-card.active .tp-index {
    opacity: 1;
}

.tp-stories-section .tp-story-card.is-playing .tp-index {
    opacity: 0;
}

/* Bottom card content */

.tp-stories-section .tp-card-content {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 6;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 60px 14px 16px;
    color: #fff;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        padding 0.3s ease;
}

.tp-stories-section .tp-story-card.active .tp-card-content {
    padding: 75px 20px 20px;
}

.tp-stories-section .tp-story-card.is-playing .tp-card-content {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.tp-stories-section .tp-story-label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    line-height: 1.2;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tp-stories-section .tp-story-card.active .tp-story-label {
    opacity: 1;
}

.tp-stories-section .tp-person-name {
    margin: 0;
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: font-size 0.3s ease;
}

.tp-stories-section .tp-story-card.active .tp-person-name {
    font-size: 19px;
}

/* Main play button */

.tp-stories-section .tp-play {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: #fff;
    color: var(--tp-dark);
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.tp-stories-section .tp-story-card.active .tp-play {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    border-radius: 15px;
}

/* Pause button shown while a video is playing */

.tp-stories-section .tp-pause-control {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--tp-dark);
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.tp-stories-section .tp-story-card.is-playing .tp-pause-control {
    display: flex;
}

/* Video controls */

.tp-stories-section .tp-video-controls {
    position: absolute;
    right: 14px;
    bottom: 14px;
    left: 14px;
    z-index: 10;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 14px;
    background: rgba(10, 14, 22, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tp-stories-section .tp-story-card.is-playing .tp-video-controls {
    display: flex;
}

.tp-stories-section .tp-mini-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font: inherit;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    appearance: none;
}

.tp-stories-section .tp-progress {
    width: 100%;
    margin: 0;
    accent-color: var(--tp-primary);
    cursor: pointer;
}

/* Gallery navigation */

.tp-stories-section .tp-gallery-nav {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    background: #fff;
    color: var(--tp-dark);
    font: inherit;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    transform: translateY(-50%);
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.12);
}

.tp-stories-section .tp-prev {
    left: -21px;
}

.tp-stories-section .tp-next {
    right: -21px;
}

.tp-stories-section .tp-gallery-nav:disabled {
    opacity: 0.3;
    cursor: default;
}

.tp-stories-section .tp-gallery-nav:focus-visible,
.tp-stories-section .tp-pause-control:focus-visible,
.tp-stories-section .tp-mini-btn:focus-visible {
    outline: 3px solid rgba(108, 76, 241, 0.45);
    outline-offset: 2px;
}

/* Desktop */

@media (min-width: 992px) {
    .tp-stories-section .tp-gallery-nav {
        display: flex;
    }
}

/* Tablet */

@media (max-width: 991.98px) {
    .tp-stories-section {
        padding: 60px 0;
    }

    .tp-stories-section .tp-section-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .tp-stories-section .tp-section-note {
        display: none;
    }

    .tp-stories-section .tp-story-card {
        flex-basis: 135px;
        height: 400px;
    }

    .tp-stories-section .tp-story-card.active {
        flex-basis: 220px;
    }
}

/* Mobile */

@media (max-width: 575.98px) {
    .tp-stories-section {
        padding: 45px 0;
    }

    .tp-stories-section > .container,
    .tp-stories-section > .tp-stories-container {
        padding-right: 12px;
        padding-left: 12px;
    }

    .tp-stories-section .tp-title {
        font-size: 28px;
    }

    .tp-stories-section .tp-description {
        font-size: 13px;
    }

    .tp-stories-section .tp-gallery {
        gap: 11px;
        margin-right: -12px;
        padding-right: 22px;
    }

    .tp-stories-section .tp-story-card {
        flex: 0 0 135px;
        height: 400px;
        border-radius: 17px;
    }

    .tp-stories-section .tp-story-card.active {
        flex-basis: 210px;
    }

    .tp-stories-section .tp-story-card.active .tp-person-name {
        font-size: 17px;
    }

    .tp-stories-section .tp-video-controls {
        right: 10px;
        bottom: 10px;
        left: 10px;
        padding: 8px;
    }
}

/* Respect reduced-motion browser preferences */

@media (prefers-reduced-motion: reduce) {
    .tp-stories-section .tp-gallery {
        scroll-behavior: auto;
    }

    .tp-stories-section .tp-story-card,
    .tp-stories-section .tp-thumb,
    .tp-stories-section .tp-inline-video,
    .tp-stories-section .tp-overlay,
    .tp-stories-section .tp-index,
    .tp-stories-section .tp-card-content,
    .tp-stories-section .tp-story-label,
    .tp-stories-section .tp-person-name,
    .tp-stories-section .tp-play {
        transition: none;
    }
}
