/* =========================================================
   PERISTIWAPALU — VIDEO STORY
   Mengikuti warna utama website: navy, biru, putih, dan oranye.
========================================================= */

.video-story-section {
    width: 100%;
    padding: 8px 0 30px;
    overflow: hidden;
    background: var(--page);
    color: var(--text);
}

.video-story-container {
    width: min(var(--container-width), calc(100% - 32px));
    margin-inline: auto;
}

.video-story-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
}

.video-story-heading-copy {
    min-width: 0;
}

.video-story-all-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 5px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.video-story-all-link:hover,
.video-story-all-link:focus-visible {
    color: #ff9d00;
}

.video-story-carousel {
    position: relative;
    min-width: 0;
}

.video-story-kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--blue);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.video-story-heading h2 {
    color: var(--text);
    font-size: clamp(21px, 2vw, 26px);
    line-height: 1.1;
}

.video-story-heading h2 i {
    color: var(--blue);
    font-size: .82em;
}

.video-story-heading-copy p {
    max-width: 580px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.video-story-controls {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.video-story-carousel > .video-story-controls {
    position: absolute;
    inset: 0;
    z-index: 8;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    pointer-events: none;
}

.video-story-control {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.video-story-control:hover:not(:disabled),
.video-story-control:focus-visible:not(:disabled) {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
    transform: translateY(-1px);
}

.video-story-control:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.video-story-carousel > .video-story-controls .video-story-control {
    pointer-events: auto;
    transform: none;
}

.video-story-carousel > .video-story-controls .video-story-control:hover:not(:disabled),
.video-story-carousel > .video-story-controls .video-story-control:focus-visible:not(:disabled) {
    transform: translateY(-1px);
}

.video-story-carousel > .video-story-controls .video-story-control:first-child {
    margin-left: 4px;
}

.video-story-carousel > .video-story-controls .video-story-control:last-child {
    margin-right: 4px;
}

.video-story-track {
    display: flex;
    gap: 14px;
    width: 100%;
    padding: 2px 2px 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.video-story-track::-webkit-scrollbar {
    display: none;
}

.video-story-card {
    flex: 0 0 calc((100% - 56px) / 5);
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    scroll-snap-align: start;
}

.video-story-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 9 / 14;
    overflow: hidden;
    border: 1px solid rgba(11, 22, 143, .1);
    border-radius: 14px;
    background: #10182e;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
}

.video-story-media img,
.video-story-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.video-story-media img {
    display: block;
    object-fit: cover;
    transition: transform .45s ease;
}

.video-story-overlay {
    background: linear-gradient(180deg, rgba(5, 10, 27, .08) 20%, rgba(5, 10, 27, .8) 100%);
    pointer-events: none;
}

.video-story-card:hover .video-story-media img,
.video-story-card:focus-visible .video-story-media img {
    transform: scale(1.045);
}

.video-story-pin,
.video-story-duration,
.video-story-play {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.video-story-pin {
    top: 10px;
    right: 10px;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: rgba(5, 10, 27, .78);
    color: #fff;
    font-size: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .22);
}

.video-story-pin i {
    color: #ffb900;
}

.video-story-duration {
    right: 9px;
    bottom: 9px;
    min-height: 22px;
    padding: 0 7px;
    border-radius: 6px;
    background: rgba(5, 10, 27, .82);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .02em;
}

.video-story-play {
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    border: 3px solid rgba(255, 255, 255, .82);
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 14px;
    transform: translate(-50%, -50%) scale(.94);
    box-shadow: 0 10px 25px rgba(5, 10, 27, .3);
    transition: transform .18s ease, background .18s ease;
}

.video-story-card:hover .video-story-play,
.video-story-card:focus-visible .video-story-play {
    background: #ff9d00;
    color: #10182e;
    transform: translate(-50%, -50%) scale(1);
}

.video-story-card-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
    padding: 9px 1px 2px;
}

.video-story-card-copy > strong {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    line-height: 1.38;
    font-weight: 800;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.video-story-channel {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-story-channel > i {
    color: var(--blue);
    font-size: 9px;
}

.video-story-channel-mark {
    width: 19px;
    height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 19px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), #2563eb);
    color: #fff;
    font-size: 7px;
    font-weight: 900;
    overflow: hidden;
}

.video-story-channel-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-story-empty {
    width: 100%;
    min-height: 190px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 30px 18px;
    border: 1px dashed rgba(37, 99, 235, .24);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    color: var(--muted);
    text-align: center;
}

.video-story-empty i {
    color: var(--blue);
    font-size: 25px;
}

.video-story-empty strong {
    color: var(--text);
    font-size: 13px;
}

.video-story-empty span {
    font-size: 10px;
}

/* Modal pemutar dengan susunan video kiri dan detail kanan. */

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

.video-story-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(4, 9, 25, .82);
    backdrop-filter: blur(8px);
}

.video-story-modal-dialog {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, .75fr);
    width: min(100%, 1000px);
    max-height: min(760px, calc(100vh - 48px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 25px 80px rgba(0, 0, 0, .38);
}

.video-story-player-panel {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 520px;
    place-items: center;
    overflow: hidden;
    background: #050812;
}

.video-story-player-panel video {
    display: block;
    width: 100%;
    height: min(76vh, 700px);
    min-height: 520px;
    object-fit: contain;
    background: #050812;
}

.video-story-modal-close {
    position: absolute;
    z-index: 4;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: rgba(5, 10, 27, .72);
    color: #fff;
    cursor: pointer;
}

.video-story-modal-close:hover,
.video-story-modal-close:focus-visible {
    background: var(--blue);
}

.video-story-modal-nav {
    position: absolute;
    z-index: 3;
    top: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 10px;
    background: rgba(5, 10, 27, .68);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
}

.video-story-modal-nav:hover,
.video-story-modal-nav:focus-visible {
    background: #ff9d00;
    color: #10182e;
}

.video-story-modal-nav--previous {
    left: 12px;
}

.video-story-modal-nav--next {
    right: 12px;
}

.video-story-modal-detail {
    min-width: 0;
    overflow-y: auto;
    padding: 30px 28px 26px;
    background: var(--surface);
    color: var(--text);
}

.video-story-modal-channel {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 24px;
}

.video-story-modal-channel > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.video-story-modal-channel strong {
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-story-modal-channel small {
    color: var(--muted);
    font-size: 9px;
}

.video-story-modal-channel > i {
    color: var(--blue);
    font-size: 11px;
}

.video-story-modal-detail h2 {
    margin: 0 0 13px;
    color: var(--text);
    font-size: clamp(20px, 2.1vw, 27px);
    line-height: 1.2;
    letter-spacing: -.035em;
}

.video-story-modal-detail > p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-line;
}

.video-story-modal-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.video-story-modal-actions button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--blue);
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.video-story-modal-actions button:hover,
.video-story-modal-actions button:focus-visible {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.video-story-modal-actions > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.video-story-modal-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 24px;
    padding: 12px;
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 10px;
    background: var(--blue-soft);
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.video-story-modal-note i {
    margin-top: 2px;
    color: var(--blue);
}

body.video-story-modal-open {
    overflow: hidden;
}

.video-story-card:focus-visible,
.video-story-control:focus-visible,
.video-story-modal-close:focus-visible,
.video-story-modal-nav:focus-visible,
.video-story-modal-actions button:focus-visible {
    outline: 3px solid rgba(255, 157, 0, .55);
    outline-offset: 3px;
}

/* Tablet. */

@media (max-width: 1100px) {
    .video-story-card {
        flex-basis: calc((100% - 42px) / 4);
    }

    .video-story-modal-dialog {
        grid-template-columns: minmax(0, 1fr) minmax(280px, .74fr);
    }

    .video-story-player-panel,
    .video-story-player-panel video {
        min-height: 480px;
    }
}

@media (max-width: 768px) {
    .video-story-container {
        width: calc(100% - 24px);
    }

    .video-story-section {
        padding: 5px 0 24px;
    }

    .video-story-card {
        flex-basis: calc((100% - 28px) / 3);
    }

    .video-story-modal {
        padding: 12px;
    }

    .video-story-modal-dialog {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    .video-story-player-panel {
        min-height: 0;
    }

    .video-story-player-panel video {
        width: 100%;
        height: min(64vh, 560px);
        min-height: 300px;
    }

    .video-story-modal-detail {
        padding: 20px 20px 22px;
    }

    .video-story-modal-channel {
        margin-bottom: 16px;
    }
}

@media (max-width: 560px) {
    .video-story-heading {
        align-items: center;
        gap: 12px;
    }

    .video-story-heading-copy p {
        max-width: 360px;
        font-size: 9px;
    }

    .video-story-controls {
        gap: 6px;
    }

    .video-story-all-link {
        font-size: 10px;
    }

    .video-story-control {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        font-size: 10px;
    }

    .video-story-track {
        gap: 10px;
        margin-right: -12px;
        padding-right: 12px;
    }

    .video-story-card {
        flex-basis: calc((100% - 10px) / 2);
    }

    .video-story-media {
        border-radius: 12px;
    }

    .video-story-card-copy > strong {
        font-size: 11px;
    }

    .video-story-modal-detail h2 {
        font-size: 20px;
    }

    .video-story-modal-detail > p {
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    .video-story-kicker {
        font-size: 8px;
    }

    .video-story-heading h2 {
        font-size: 19px;
    }

    .video-story-heading-copy p {
        display: none;
    }

    .video-story-card-copy {
        gap: 5px;
    }

    .video-story-channel {
        font-size: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-story-track,
    .video-story-media img,
    .video-story-play,
    .video-story-control {
        scroll-behavior: auto;
        transition: none;
    }
}

/* Mode gelap memakai variabel tema yang sama dengan halaman depan. */

:is(html.theme-dark, body.dark-mode) .video-story-media {
    border-color: var(--border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}

:is(html.theme-dark, body.dark-mode) .video-story-empty {
    border-color: rgba(126, 157, 255, .28);
}

/* =========================================================
   INSTAGRAM EMBED — DESKTOP / TABLET / MOBILE
   Embed dibuat sebagai kartu yang bisa digeser horizontal.
========================================================= */

.video-story-card {
    flex-basis: calc((100% - 32px) / 3);
}

.video-story-card--instagram {
    min-width: 0;
}

.video-story-card--local {
    min-width: 0;
}

.video-story-local-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.video-story-local-trigger:focus-visible {
    outline: 3px solid rgba(255, 157, 0, .55);
    outline-offset: 3px;
}

.video-story-instagram-shell {
    position: relative;
    min-height: 540px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
}

.video-story-instagram-fallback {
    position: absolute;
    inset: 50% 20px auto;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: #475569;
    text-align: center;
    transform: translateY(-50%);
}

.video-story-instagram-fallback i {
    color: #e1306c;
    font-size: 36px;
}

.video-story-instagram-fallback span {
    font-size: 12px;
}

.video-story-instagram-fallback a {
    color: #2457d6;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.video-story-instagram-shell.is-failed .video-story-instagram-fallback {
    display: flex;
}

.video-story-card--instagram .video-story-card-copy {
    padding-top: 10px;
}

.video-story-card--instagram .video-story-channel > i {
    color: #e1306c;
}

@media (max-width: 1100px) {
    .video-story-card {
        flex-basis: calc((100% - 16px) / 2);
    }
}

@media (max-width: 768px) {
    .video-story-track {
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 0;
        touch-action: pan-x;
    }

    .video-story-card {
        flex-basis: min(100%, 390px);
    }

    .video-story-instagram-shell {
        min-height: 500px;
        border-radius: 14px;
    }
}

@media (max-width: 560px) {
    .video-story-card {
        flex-basis: min(100%, 350px);
    }

    .video-story-instagram-shell {
        min-height: 470px;
        border-radius: 12px;
    }
}

@media (max-width: 380px) {
    .video-story-card {
        flex-basis: calc(100vw - 24px);
    }

    .video-story-instagram-shell {
        min-height: 440px;
    }
}

/* =========================================================
   VIDEO-ONLY INSTAGRAM CARD
   Ukuran ringkas dan fokus pada area video. Elemen tambahan
   dari layout website (judul, channel, link, suka, komentar)
   tidak lagi dirender di bawah embed.
========================================================= */

.video-story-track {
    align-items: flex-start;
}

.video-story-card--instagram {
    /* Lebar kartu mengikuti frame Video Story, bukan lebar post Instagram lengkap. */
    flex: 0 0 clamp(210px, 15vw, 230px);
    overflow: hidden;
    border-radius: 14px;
    background: transparent;
    line-height: 0;
}

.video-story-card--instagram .video-story-instagram-shell {
    width: 100%;
    height: auto;
    min-height: 0;
    /* Ukuran frame Video Story mengikuti rasio yang diminta: 6,1:10. */
    aspect-ratio: 6.1 / 10;
    border: 0;
    border-radius: 14px;
    background: #050812;
    box-shadow: none;
    line-height: 0;
}

.video-story-card--instagram .video-story-instagram-shell iframe {
    position: absolute;
    top: -16%;
    left: -21.25%;
    display: block;
    /* Frame media-only menampung isi video tanpa footer tambahan. */
    /*
       Isi iframe diperkecil sedikit agar ikon play tidak memenuhi kartu.
       Ukuran viewport diperbesar dengan nilai kebalikan supaya ukuran video,
       crop, dan posisi yang sudah rapi tetap sama.
    */
    width: 173.78%;
    height: 173.17%;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    transform: scale(.82);
    transform-origin: top left;
    vertical-align: top;
}

.video-story-card--instagram .video-story-card-copy {
    display: none !important;
}

.video-story-card--instagram .video-story-instagram-click-target {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: block;
    border-radius: inherit;
    background: transparent;
    cursor: pointer;
}

.video-story-card--instagram .video-story-instagram-click-target:focus-visible {
    outline: 3px solid rgba(255, 157, 0, .72);
    outline-offset: -3px;
}

.video-story-card--instagram .video-story-instagram-fallback {
    inset: 50% 16px auto;
    z-index: 3;
    color: #d8e1f4;
    line-height: 1.4;
}

.video-story-card--instagram .video-story-instagram-fallback i {
    color: #ff9d00;
}

.video-story-card--instagram .video-story-instagram-shell.is-failed iframe {
    opacity: .08;
}

@media (max-width: 1100px) {
    .video-story-card--instagram {
        flex-basis: 220px;
    }
}

@media (max-width: 768px) {
    .video-story-card--instagram {
        flex-basis: 215px;
        border-radius: 13px;
    }

    .video-story-card--instagram .video-story-instagram-shell {
        border-radius: 13px;
    }
}

@media (max-width: 560px) {
    .video-story-card--instagram {
        flex-basis: calc((100% - 10px) / 2);
        border-radius: 12px;
    }

    .video-story-card--instagram .video-story-instagram-shell iframe {
        /* Potong header putih bawaan embed yang masih tersisa di mobile. */
        top: -20%;
    }
}

@media (max-width: 380px) {
    .video-story-card--instagram {
        flex-basis: calc((100% - 10px) / 2);
    }
}
