/* =========================================================
   PERISTIWAPALU - PHOTO GALLERY READER
   Dipakai khusus halaman detail Foto Pilihan.
========================================================= */

.photo-gallery-page {
    width: 100%;
    background: #050505;
}

.photo-gallery-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
    align-items: stretch;
    width: 100%;
    min-height: calc(100vh - 160px);
}

.photo-gallery-stage {
    display: flex;
    min-width: 0;
    min-height: calc(100vh - 160px);
    flex-direction: column;
    padding: 16px 24px 26px;
    background: #050505;
    color: #fff;
}

.photo-gallery-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    min-height: 42px;
}

.photo-gallery-back,
.photo-gallery-fullscreen,
.photo-gallery-share a,
.photo-gallery-share button,
.photo-gallery-arrow,
.photo-gallery-thumb-arrow {
    border: 0;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}

.photo-gallery-back {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 9px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 9px;
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .88);
    font-size: 11px;
    font-weight: 750;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.photo-gallery-back:hover {
    border-color: rgba(255, 177, 0, .75);
    background: rgba(255, 177, 0, .14);
    color: #fff;
    transform: translateX(-2px);
}

.photo-gallery-back i {
    color: #ffb000;
    font-size: 13px;
}

.photo-gallery-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.photo-gallery-share a,
.photo-gallery-share button,
.photo-gallery-fullscreen {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.photo-gallery-share a:hover,
.photo-gallery-share button:hover,
.photo-gallery-fullscreen:hover {
    border-color: #ffb000;
    background: #ffb000;
    color: #151515;
    transform: translateY(-2px);
}

.photo-gallery-fullscreen {
    justify-self: end;
}

.photo-gallery-viewer {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 1240px;
    height: clamp(420px, calc(100vh - 345px), 660px);
    min-height: 420px;
    margin: 10px auto 0;
}

.photo-gallery-figure {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    background: #090909;
}

.photo-gallery-image-wrap {
    position: relative;
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
}

.photo-gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    transition: opacity .18s ease;
}

.photo-gallery-image.is-changing {
    opacity: .22;
}

.photo-gallery-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    display: none;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, .24);
    border-top-color: #ffb000;
    border-radius: 50%;
    animation: photo-gallery-spin .7s linear infinite;
    transform: translate(-50%, -50%);
}

.photo-gallery-loading.is-visible {
    display: block;
}

@keyframes photo-gallery-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.photo-gallery-caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 18px;
    padding: 42px 28px 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .9));
}

.photo-gallery-caption-count {
    align-self: end;
    color: #ffb000;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.photo-gallery-caption p {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, .94);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-gallery-caption-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.photo-gallery-caption-link:hover {
    color: #ffb000;
}

.photo-gallery-arrow {
    display: grid;
    width: 38px;
    height: 64px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .9);
    font-size: 17px;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.photo-gallery-arrow:hover {
    border-color: #ffb000;
    background: #ffb000;
    color: #151515;
}

.photo-gallery-arrow--prev:hover {
    transform: translateX(-2px);
}

.photo-gallery-arrow--next:hover {
    transform: translateX(2px);
}

.photo-gallery-thumbs {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 10px;
    width: min(100%, 850px);
    margin: 16px auto 0;
}

.photo-gallery-thumbs-track {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    overflow-x: auto;
    padding: 3px 2px 8px;
    scrollbar-color: #59606c transparent;
    scrollbar-width: thin;
}

.photo-gallery-thumb {
    position: relative;
    flex: 0 0 96px;
    height: 62px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 7px;
    background: #222;
    cursor: pointer;
    opacity: .62;
    transition: border-color .18s ease, opacity .18s ease, transform .18s ease;
}

.photo-gallery-thumb:hover,
.photo-gallery-thumb.is-active {
    border-color: #ffb000;
    opacity: 1;
}

.photo-gallery-thumb:hover {
    transform: translateY(-2px);
}

.photo-gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-gallery-thumb-arrow {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .82);
    font-size: 11px;
}

.photo-gallery-thumb-arrow:hover {
    background: #ffb000;
    color: #151515;
}

.photo-gallery-info {
    min-height: calc(100vh - 160px);
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    background: #fff;
    color: #101a33;
    scrollbar-color: #b9c4d8 transparent;
    scrollbar-width: thin;
}

.photo-gallery-info-inner {
    padding: 36px 34px 52px;
}

.photo-gallery-kicker,
.photo-gallery-section-heading > div > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #245eea;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.photo-gallery-kicker i {
    color: #ff9e00;
    font-size: 13px;
}

.photo-gallery-story-head h1 {
    margin: 13px 0 16px;
    color: #111a33;
    font-size: clamp(25px, 2.4vw, 36px);
    line-height: 1.12;
    letter-spacing: -.045em;
}

.photo-gallery-story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: #74819a;
    font-size: 11px;
    font-weight: 600;
}

.photo-gallery-story-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.photo-gallery-story-meta i {
    color: #245eea;
}

.photo-gallery-divider {
    height: 1px;
    margin: 28px 0 24px;
    background: #e6eaf1;
}

.photo-gallery-story-copy h2,
.photo-gallery-latest h2 {
    margin: 0;
    color: #111a33;
    font-size: 19px;
    letter-spacing: -.025em;
}

.photo-gallery-story-copy p {
    margin: 11px 0 0;
    color: #53617a;
    font-size: 14px;
    line-height: 1.7;
    text-align: justify;
}

.photo-gallery-credit {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 25px;
    padding: 12px 0;
    border-top: 1px solid #edf0f5;
    border-bottom: 1px solid #edf0f5;
}

.photo-gallery-credit-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: #fff1d7;
    color: #f28b00;
    font-size: 14px;
}

.photo-gallery-credit div {
    display: grid;
    gap: 3px;
}

.photo-gallery-credit small {
    color: #8a96aa;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.photo-gallery-credit strong {
    color: #18233e;
    font-size: 12px;
}

.photo-gallery-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 17px;
}

.photo-gallery-tags span {
    padding: 6px 9px;
    border: 1px solid #dce5fb;
    border-radius: 999px;
    background: #f5f8ff;
    color: #245eea;
    font-size: 10px;
    font-weight: 750;
}

.photo-gallery-read-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    margin-top: 20px;
    border-radius: 9px;
    background: #0d1b9b;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    transition: background-color .18s ease, transform .18s ease;
}

.photo-gallery-read-button:hover {
    background: #172bc1;
    color: #fff;
    transform: translateY(-1px);
}

.photo-gallery-latest {
    margin-top: 35px;
    padding-top: 26px;
    border-top: 1px solid #e6eaf1;
}

.photo-gallery-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 17px;
}

.photo-gallery-section-heading > div {
    display: grid;
    gap: 5px;
}

.photo-gallery-section-heading > div > span {
    color: #ff8f00;
    font-size: 8px;
}

.photo-gallery-section-heading a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #245eea;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.photo-gallery-section-heading a:hover {
    color: #0d1b9b;
}

.photo-gallery-latest-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
}

.photo-gallery-latest-card {
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.photo-gallery-latest-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1.42;
    border-radius: 8px;
    background: #e9edf5;
}

.photo-gallery-latest-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.photo-gallery-latest-card:hover .photo-gallery-latest-image img {
    transform: scale(1.045);
}

.photo-gallery-latest-image span {
    position: absolute;
    right: 6px;
    bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 5px;
    background: rgba(8, 15, 37, .8);
    color: #fff;
    font-size: 8px;
    font-weight: 750;
}

.photo-gallery-latest-card strong {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    color: #1b2743;
    font-size: 11px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.photo-gallery-latest-card small {
    display: block;
    margin-top: 6px;
    color: #8a96aa;
    font-size: 9px;
}

.photo-gallery-latest-empty {
    margin: 0;
    color: #8a96aa;
    font-size: 11px;
}

.photo-gallery-share-status {
    position: fixed;
    top: 22px;
    left: 50%;
    z-index: 20;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background: #121a2c;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .25);
    color: #fff;
    font-size: 11px;
    font-weight: 750;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -8px);
    transition: opacity .18s ease, transform .18s ease;
}

.photo-gallery-share-status.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.photo-gallery-viewer:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    min-height: 0;
    padding: 18px;
    background: #050505;
}

.photo-gallery-viewer:fullscreen .photo-gallery-figure {
    max-height: 100%;
}

.photo-gallery-back:focus-visible,
.photo-gallery-fullscreen:focus-visible,
.photo-gallery-share a:focus-visible,
.photo-gallery-share button:focus-visible,
.photo-gallery-arrow:focus-visible,
.photo-gallery-thumb:focus-visible,
.photo-gallery-thumb-arrow:focus-visible,
.photo-gallery-read-button:focus-visible,
.photo-gallery-section-heading a:focus-visible,
.photo-gallery-latest-card:focus-visible {
    outline: 3px solid rgba(255, 176, 0, .7);
    outline-offset: 3px;
}

body.dark-mode .photo-gallery-info {
    background: #111a2e;
    color: #edf3ff;
}

body.dark-mode .photo-gallery-story-head h1,
body.dark-mode .photo-gallery-story-copy h2,
body.dark-mode .photo-gallery-latest h2,
body.dark-mode .photo-gallery-credit strong,
body.dark-mode .photo-gallery-latest-card strong {
    color: #f4f7ff;
}

body.dark-mode .photo-gallery-story-meta,
body.dark-mode .photo-gallery-story-copy p,
body.dark-mode .photo-gallery-latest-card small,
body.dark-mode .photo-gallery-latest-empty {
    color: #aab7d0;
}

body.dark-mode .photo-gallery-divider,
body.dark-mode .photo-gallery-credit,
body.dark-mode .photo-gallery-latest {
    border-color: #2b3857;
}

body.dark-mode .photo-gallery-credit-icon,
body.dark-mode .photo-gallery-tags span {
    background: #202d4a;
    border-color: #354666;
}

body.dark-mode .photo-gallery-tags span {
    color: #a9c1ff;
}

@media (max-width: 1100px) {
    .photo-gallery-shell {
        grid-template-columns: minmax(0, 1fr) 370px;
    }

    .photo-gallery-stage {
        padding-inline: 16px;
    }

    .photo-gallery-info-inner {
        padding-inline: 25px;
    }

    .photo-gallery-caption {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .photo-gallery-caption-link {
        grid-column: 2;
    }
}

@media (max-width: 850px) {
    .photo-gallery-shell {
        display: block;
        min-height: 0;
    }

    .photo-gallery-stage {
        min-height: 0;
        padding: 12px 12px 22px;
    }

    .photo-gallery-viewer {
        height: min(72vw, 560px);
        min-height: 300px;
        grid-template-columns: 34px minmax(0, 1fr) 34px;
        gap: 5px;
    }

    .photo-gallery-arrow {
        width: 30px;
        height: 52px;
        font-size: 13px;
    }

    .photo-gallery-caption {
        gap: 8px 12px;
        padding: 36px 14px 13px;
    }

    .photo-gallery-caption p {
        font-size: 11px;
    }

    .photo-gallery-caption-link {
        font-size: 9px;
    }

    .photo-gallery-info {
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .photo-gallery-info-inner {
        padding: 30px 16px 46px;
    }
}

@media (max-width: 560px) {
    .photo-gallery-toolbar {
        grid-template-columns: auto 1fr auto;
        gap: 8px;
    }

    .photo-gallery-back {
        width: 36px;
        justify-content: center;
        padding: 0;
    }

    .photo-gallery-back span {
        display: none;
    }

    .photo-gallery-share {
        gap: 6px;
    }

    .photo-gallery-share a,
    .photo-gallery-share button,
    .photo-gallery-fullscreen {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .photo-gallery-thumbs {
        grid-template-columns: 28px minmax(0, 1fr) 28px;
        gap: 6px;
    }

    .photo-gallery-thumb {
        flex-basis: 78px;
        height: 52px;
    }

    .photo-gallery-story-head h1 {
        font-size: 26px;
    }

    .photo-gallery-story-copy p {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .photo-gallery-back,
    .photo-gallery-share a,
    .photo-gallery-share button,
    .photo-gallery-fullscreen,
    .photo-gallery-arrow,
    .photo-gallery-thumb,
    .photo-gallery-latest-image img,
    .photo-gallery-read-button {
        transition: none;
    }

    .photo-gallery-loading {
        animation: none;
    }

    .photo-gallery-share-status {
        transition: none;
    }
}
