/* =========================================================
   Galeri interaktif — carousel · polaroid · mozaik · filmstrip · tumpukan kartu
   ========================================================= */
.gallery { overflow: hidden; }
.gallery__hint { font-size: .82rem; margin-bottom: 1.2rem; }
.gx { position: relative; margin-top: .4rem; touch-action: pan-y; }
.gx img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.gx button { padding: 0; border: 0; background: none; }
.gx-switch { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1.2rem; }
.gx-switch a { font-size: .72rem; font-weight: 600; text-decoration: none; padding: .35em .8em; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: var(--muted); }
.gx-switch a.is-on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.gx-ctrl { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
.gx-ctrl button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: var(--surface); color: var(--accent); font-size: 1.4rem; line-height: 1; display: grid; place-items: center; transition: background .2s, color .2s, transform .2s; }
.gx-ctrl button:hover { background: var(--accent); color: var(--bg); }
.gx-ctrl button:active { transform: scale(.92); }
.gx-count { font-family: var(--f-display); font-size: .9rem; letter-spacing: .1em; color: var(--muted); min-width: 4.5em; }
.gx-count b { color: var(--ink); font-weight: 600; }
.gx-actions { display: flex; gap: .5rem; justify-content: center; margin-top: 1.2rem; flex-wrap: wrap; }

/* carousel: slide besar, tetangga mengintip, efek ken-burns pada slide aktif */
.gx-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 6px 11%; margin: 0 -1.75rem; overscroll-behavior-x: contain; }
.gx-track::-webkit-scrollbar { display: none; }
.gx-slide { flex: 0 0 78%; margin: 0; aspect-ratio: 4 / 5; scroll-snap-align: center; border-radius: 18px; overflow: hidden; background: var(--bg); transform: scale(.9); opacity: .55; transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .5s; box-shadow: 0 20px 40px -24px rgba(0,0,0,.45); }
.gx-slide.is-on { transform: none; opacity: 1; }
.gx-slide button { width: 100%; height: 100%; cursor: zoom-in; }
.gx-slide img { transition: transform 6s ease-out; }
.gx-slide.is-on img { transform: scale(1.08); }
.gx-thumbs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: .9rem; padding: 3px; }
.gx-thumbs::-webkit-scrollbar { display: none; }
.gx-thumbs button { flex: 0 0 46px; height: 46px; border-radius: 10px; overflow: hidden; opacity: .45; transition: opacity .25s, outline-color .25s; outline: 2px solid transparent; outline-offset: 1px; }
.gx-thumbs button:first-child { margin-left: auto; }
.gx-thumbs button:last-child { margin-right: auto; }
.gx-thumbs button.is-on { opacity: 1; outline-color: var(--accent); }
.layout-frame .gx-slide, .layout-editorial .gx-slide { border-radius: 4px; }
.layout-arch .gx-slide { border-radius: 999px 999px 18px 18px; }

/* polaroid: berserakan, bisa diseret */
.gx--polaroid { height: 480px; margin-inline: -.5rem; }
.pola { position: absolute; left: var(--x); top: var(--y); width: 46%; margin: 0; padding: 8px 8px 30px; background: #fff; border-radius: 3px; box-shadow: 0 14px 30px -14px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.08); transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--r)); cursor: grab; touch-action: none; transition: transform .45s cubic-bezier(.2, .9, .3, 1.2), box-shadow .3s, left .6s cubic-bezier(.2, .9, .3, 1.1), top .6s cubic-bezier(.2, .9, .3, 1.1); }
.pola img { aspect-ratio: 1; height: auto; pointer-events: none; }
.pola figcaption { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-family: var(--f-script); font-size: 1.05rem; color: #555; }
.pola.is-drag { cursor: grabbing; transition: none; box-shadow: 0 30px 50px -18px rgba(0,0,0,.55); transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(0deg) scale(1.06); }

/* mozaik */
.gx--masonry { columns: 2; column-gap: 8px; }
.mason { display: block; width: 100%; margin: 0 0 8px; break-inside: avoid; border-radius: 14px; overflow: hidden; cursor: zoom-in; position: relative; }
.mason:nth-child(3n + 1) img { aspect-ratio: 3 / 4; }
.mason:nth-child(3n + 2) img { aspect-ratio: 1; }
.mason:nth-child(3n) img { aspect-ratio: 4 / 5; }
.mason img { height: auto; transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.mason:hover img { transform: scale(1.06); }
.mason::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, color-mix(in srgb, var(--ink) 35%, transparent)); opacity: 0; transition: opacity .3s; }
.mason:hover::after { opacity: 1; }
.mason.is-more { display: none; }
.gx--masonry.is-open .mason.is-more { display: block; animation: pop .6s both; }
.layout-frame .mason, .layout-editorial .mason { border-radius: 3px; }

/* filmstrip berjalan */
.gx--film { margin: 0 -1.75rem; display: grid; gap: 8px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.film { overflow: hidden; }
.film__track { display: flex; gap: 8px; width: max-content; animation: film 40s linear infinite; }
.film--rev .film__track { animation-direction: reverse; animation-duration: 48s; }
.gx--film:hover .film__track, .gx--film.is-paused .film__track { animation-play-state: paused; }
.film button { flex: none; width: 150px; height: 190px; border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.film--rev button { width: 130px; height: 130px; }
.film button img { transition: transform .5s; }
.film button:hover img { transform: scale(1.08); }
@keyframes film { to { transform: translateX(-50%); } }

/* tumpukan kartu */
.stack { position: relative; width: 78%; margin: 0 auto; aspect-ratio: 4 / 5; }
.stack__card { position: absolute; inset: 0; margin: 0; border-radius: 20px; overflow: hidden; background: var(--bg); border: 6px solid var(--surface); box-shadow: 0 18px 36px -18px rgba(0,0,0,.45); transform: translateX(var(--dx, 0px)) rotate(calc(var(--r) + var(--tilt, 0deg))); transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .4s; touch-action: none; cursor: grab; }
.stack__card.is-top { --r: 0deg; }
.stack__card.is-drag { transition: none; cursor: grabbing; }

/* lightbox */
.lightbox__stage { margin: 0; max-width: 100%; max-height: 86vh; overflow: hidden; touch-action: none; display: grid; place-items: center; }
.lightbox img { transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .25s; cursor: zoom-in; }
.lightbox img.is-zoom { transform: scale(2); cursor: zoom-out; }
.lightbox img.is-swap { opacity: 0; }
.lightbox__count { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; color: #fff; font: 600 13px/1 system-ui, sans-serif; letter-spacing: .1em; opacity: .8; }

/* tombol musik dengan equalizer */
.music__bars { position: absolute; right: -4px; top: -4px; display: none; gap: 2px; align-items: flex-end; height: 14px; padding: 3px; border-radius: 6px; background: var(--ink); }
.music__bars i { width: 2px; background: var(--bg); animation: eq .9s ease-in-out infinite; }
.music__bars i:nth-child(2) { animation-delay: -.3s; }
.music__bars i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 9px; } }
.music.is-playing { animation: none; }
.music.is-playing svg { animation: spin 5s linear infinite; }
.music.is-playing .music__bars { display: flex; }
.made__music { display: inline-block; margin-bottom: .3rem; opacity: .85; }

@media (min-width: 1000px) {
  .gx-track { margin: 0 -1.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .film__track { animation: none; }
}
.gx-wrap { transition: opacity .25s ease; }
.gx-wrap.is-loading { opacity: .35; pointer-events: none; }
