.wp-stories-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0px 0;
    align-items: flex-start;
    justify-content: center;
}
.wp-story-bubble {
    border: 0;
    background: transparent;
    cursor: pointer;
    width: 90px;
    text-align: center;
    color: inherit;
    padding: 0;
}
.wp-story-avatar {
    display: flex;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);
    margin: auto;
}
.wp-story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
}
.wp-story-title {
    display: block;
    font-size: 12px;
    line-height: 1.2;
    margin-top: 5px;
/*    
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;*/
}
.wp-story-modal[aria-hidden="true"] {
    display: none;
}
.wp-story-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    background: rgba(0, 0, 0, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
}
.wp-story-viewer {
    position: relative;
    width: min(420px, 100vw);
    height: min(760px, 100vh);
    background: #000;
    overflow: hidden;
    border-radius: 14px;
}
.wp-story-media,
.wp-story-media img,
.wp-story-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wp-story-progress {
    position: absolute;
    z-index: 3;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
}
.wp-story-progress span {
    height: 3px;
    flex: 1;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 99px;
}
.wp-story-progress span.done,
.wp-story-progress span.active {
    background: #fff;
}
.wp-story-close {
    position: absolute;
    z-index: 5;
    right: 10px;
    top: 18px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    border: 0;
    border-radius: 50%;
    font-size: 28px;
    width: 38px;
    height: 38px;
    line-height: 1;
    cursor: pointer;
}
.wp-story-zone {
    position: absolute;
    z-index: 4;
    top: 0;
    bottom: 0;
    width: 50%;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.wp-story-prev {
    left: 0;
}
.wp-story-next {
    right: 0;
}
.wp-story-cta {
    position: absolute;
    z-index: 6;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #111;
    padding: 10px 18px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 700;
}
.wp-story-open {
    overflow: hidden;
}
@media (max-width: 520px) {
    .wp-story-viewer {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

/* Feed */
.wp-stories-feed {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    margin: 28px 0;
}
.wp-stories-feed-cols-1 {
    grid-template-columns: 1fr;
}
.wp-stories-feed-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.wp-stories-feed-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.wp-story-feed-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}
.wp-story-feed-media {
    aspect-ratio: 4/5;
    background: #111;
    overflow: hidden;
        min-height: 100%;
}
.wp-story-feed-media img,
.wp-story-feed-media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wp-story-feed-body {
    padding: 14px 16px 16px;
}
.wp-story-feed-body h3 {
    font-size: 17px;
    line-height: 1.25;
    margin: 0 0 8px;
}
.wp-story-feed-body p {
    font-size: 14px;
    line-height: 1.45;
    margin: 0 0 12px;
}
.wp-story-feed-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
}
.wp-story-feed-link:hover {
    color: #fff;
    opacity: 0.86;
}
@media (max-width: 900px) {
    .wp-stories-feed,
    .wp-stories-feed-cols-3,
    .wp-stories-feed-cols-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .wp-stories-feed,
    .wp-stories-feed-cols-2,
    .wp-stories-feed-cols-3,
    .wp-stories-feed-cols-4 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .wp-story-feed-card {
        border-radius: 14px;
    }
}

/* Story title and caption */
.wp-story-copy {
    position: absolute;
    z-index: 6;
    left: 20px;
    right: 20px;
    bottom: 28px;
    color: #fff;
    pointer-events: none;
    text-align: left;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
}
.wp-story-copy.has-cta {
    bottom: 82px;
}
.wp-story-copy::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: -20px;
    right: -20px;
    bottom: -28px;
    height: 220px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
    pointer-events: none;
}
.wp-story-viewer-title {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 7px;
}
.wp-story-viewer-caption {
    max-width: 34em;
    font-size: 15px;
    line-height: 1.45;
    white-space: pre-line;
}
.wp-story-viewer-title[hidden],
.wp-story-viewer-caption[hidden],
.wp-story-copy[hidden] {
    display: none;
}

/* Убирает линию/тень фокуса на кликабельных зонах сторис */
.wp-story-zone,
.wp-story-zone:hover,
.wp-story-zone:focus,
.wp-story-zone:focus-visible,
.wp-story-zone:active {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* Swiper feed carousel */
.wp-stories-feed-carousel {
    position: relative;
    width: 100%;
    margin: 10px 0;
    padding: 0px;
    overflow: hidden;
}
.wp-stories-feed-carousel .swiper-wrapper {
    align-items: stretch;
}
.wp-stories-feed-carousel .swiper-slide {
    height: auto;
    box-sizing: border-box;
}
.wp-stories-feed-carousel .wp-story-feed-card {
    display: flex;
    flex-direction: column;
    margin: 0;
}
.wp-stories-feed-carousel .wp-story-feed-body {
    display: flex;
    flex: 1;
    flex-direction: column;
}
.wp-stories-feed-carousel .wp-story-feed-link {
    margin-top: auto;
    align-self: flex-start;
}
.wp-stories-carousel-prev,
.wp-stories-carousel-next {
    position: absolute;
    z-index: 5;
    top: calc(50% - 30px);
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transform: translateY(-50%);
}
.wp-stories-carousel-prev {
    left: 12px;
}
.wp-stories-carousel-next {
    right: 12px;
}
.wp-stories-carousel-prev::before,
.wp-stories-carousel-next::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    border-top: 2px solid #111;
    border-right: 2px solid #111;
}
.wp-stories-carousel-prev::before {
    transform: translate(-35%, -50%) rotate(-135deg);
}
.wp-stories-carousel-next::before {
    transform: translate(-65%, -50%) rotate(45deg);
}
.wp-stories-carousel-prev:focus,
.wp-stories-carousel-next:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
.wp-stories-carousel-prev.swiper-button-disabled,
.wp-stories-carousel-next.swiper-button-disabled {
    opacity: 0.35;
    cursor: default;
}
.wp-stories-carousel-pagination {
    position: absolute;
    z-index: 4;
    left: 0 !important;
    right: 0;
    bottom: 8px !important;
    display: flex;
    justify-content: center;
    gap: 7px;
}
.wp-stories-carousel-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    margin: 0 !important;
}

/* Горизонтальная прокрутка, если Swiper ещё не подключён */
.wp-stories-carousel-fallback {
    overflow-x: auto;
    padding-bottom: 18px;
}
.wp-stories-carousel-fallback .swiper-wrapper {
    display: flex;
    gap: 22px;
    width: max-content;
}
.wp-stories-carousel-fallback .swiper-slide {
    width: min(340px, 82vw);
}
.wp-stories-carousel-fallback .wp-stories-carousel-prev,
.wp-stories-carousel-fallback .wp-stories-carousel-next,
.wp-stories-carousel-fallback .wp-stories-carousel-pagination {
    display: none;
}

@media (max-width: 640px) {
    .wp-story-copy {
        left: 16px;
        right: 16px;
        bottom: 24px;
    }
    .wp-story-copy.has-cta {
        bottom: 78px;
    }
    .wp-story-viewer-title {
        font-size: 20px;
    }
    .wp-story-viewer-caption {
        font-size: 14px;
    }
    .wp-stories-carousel-prev,
    .wp-stories-carousel-next {
        display: none;
    }
}
.wp-story-video-placeholder {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #222;
}
.wp-story-video-placeholder::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-38%, -50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
}

/* Embedded VK videos and clips keep the proportions of the exported iframe. */
.wp-story-vk-frame {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    background: #000;
    aspect-ratio: 16/9;
}
.wp-story-feed-media.wp-story-feed-embed {
    aspect-ratio: auto;
    height: auto;
    background: #000;
}
.wp-story-vk-embed-shell {
    position: relative;
    width: 100%;
    background: #000;
}
.wp-stories-feed-carousel .wp-story-vk-embed-shell:not(.is-interactive) .wp-story-vk-frame {
    pointer-events: none;
}
.wp-story-vk-gesture {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: grab;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}
.wp-story-vk-gesture:active {
    cursor: grabbing;
}
.wp-story-vk-gesture[hidden] {
    display: none !important;
}
.wp-story-vk-gesture:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}
.wp-stories-feed:not(.wp-stories-feed-carousel) .wp-story-vk-gesture {
    display: none !important;
}
.wp-story-vk-source {
    display: block;
    position: relative;
    z-index: 7;
    width: max-content;
    max-width: 100%;
    margin: 12px auto;
    color: #fff;
    text-decoration: underline;
    font-size: 14px;
}
.wp-story-vk-stage {
    position: absolute;
    top: 110px;
    bottom: 150px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
}
.wp-story-vk-stage .wp-story-vk-frame {
    flex: none;
    max-width: 100%;
}
.wp-story-is-vk .wp-story-zone {
    top: 62px;
    bottom: auto;
    width: 44px;
    height: 40px;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}
.wp-story-is-vk .wp-story-prev {
    left: 12px;
}
.wp-story-is-vk .wp-story-next {
    right: 12px;
}
.wp-story-is-vk .wp-story-prev::before {
    content: "‹";
    font-size: 30px;
}
.wp-story-is-vk .wp-story-next::before {
    content: "›";
    font-size: 30px;
}
.wp-story-is-vk .wp-story-copy {
    max-height: 105px;
    overflow: hidden;
}
.wp-story-is-vk .wp-story-copy::before {
    display: none;
}
.wp-story-vk-source:focus-visible,
.wp-story-is-vk .wp-story-zone:focus-visible {
    outline: 2px solid #0077ff !important;
    outline-offset: 2px;
}
@media (max-height: 500px) {
    .wp-story-is-vk .wp-story-viewer {
        width: min(700px, 100vw);
    }
    .wp-story-vk-stage {
        top: 58px;
        bottom: 40px;
        left: 60px;
        right: 60px;
    }
    .wp-story-is-vk .wp-story-copy {
        display: none;
    }
    .wp-story-is-vk .wp-story-cta {
        bottom: 4px;
        padding: 4px 12px;
    }
}

/* Native video: swipe over the picture, native controls remain available at the bottom. */
.wp-story-native-video-shell {
    position: relative;
    width: 100%;
    height: 100%;
    background: #111;
}
.wp-story-native-video-shell .wp-story-native-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wp-story-native-video-gesture {
    display: none;
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    bottom: 48px;
    left: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: grab;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}
.wp-stories-feed-carousel[data-wp-carousel-ready="true"] .wp-story-native-video-gesture {
    display: block;
}
.wp-story-native-video-gesture:active {
    cursor: grabbing;
}
.wp-story-native-video-gesture:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

/* Stories bubbles: centered while they fit, swipeable when the row overflows. */
.wp-stories-list {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    touch-action: pan-y pinch-zoom;
    scrollbar-width: none;
}
.wp-stories-list::-webkit-scrollbar {
    display: none;
}
.wp-stories-list.is-overflowing {
    justify-content: flex-start;
    cursor: grab;
}
.wp-stories-list.is-dragging {
    cursor: grabbing;
    user-select: none;
}
.wp-stories-list.is-dragging * {
    user-select: none;
}
.wp-stories-list .wp-story-bubble {
    flex: 0 0 90px;
}

/* VK and native video fill the complete Story viewer. */
.wp-story-vk-stage {
    inset: 0;
    width: 100%;
    height: 100%;
    flex-direction: row;
    background: #000;
}
.wp-story-vk-stage .wp-story-vk-frame {
    width: 100%;
    height: 100%;
    max-width: none;
    aspect-ratio: auto;
}
.wp-story-vk-unavailable {
    display: grid;
    min-height: 180px;
    padding: 20px;
    place-items: center;
    color: #fff;
    background: #000;
    text-align: center;
}
.wp-story-viewer .wp-story-media {
    position: absolute;
    inset: 0;
}
.wp-story-viewer .wp-story-media > video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
