/* PGM — Galeri interaktif & penuh animasi */
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
:root { --gw-ease: cubic-bezier(.2,.8,.2,1); }

/* ================= HERO ================= */
.gal-hero { isolation: isolate; padding-bottom: 120px; background:
    radial-gradient(60% 80% at 15% 20%, rgba(94,172,78,.55), transparent 60%),
    radial-gradient(50% 70% at 90% 80%, rgba(228,184,28,.28), transparent 60%),
    linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-2) 55%, var(--accent) 100%);
    background-size: 140% 140%, 140% 140%, 100% 100%; animation: ghBg 16s ease-in-out infinite alternate; }
@keyframes ghBg { from { background-position: 0% 0%, 100% 100%, 0 0; } to { background-position: 100% 60%, 0% 20%, 0 0; } }
.gh-orb { position: absolute; border-radius: 50%; filter: blur(8px); z-index: 0; pointer-events: none;
    translate: calc(var(--mx,0) * var(--k,20) * 1px) calc(var(--my,0) * var(--k,20) * 1px + var(--sy,0) * var(--s,.2) * 1px); }
.gh-orb.o1 { --k: 38; --s: .35; width: 280px; height: 280px; left: -70px; bottom: -80px; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), rgba(255,255,255,0) 70%); animation: ghFloat 9s ease-in-out infinite; }
.gh-orb.o2 { --k: -26; --s: .2; width: 170px; height: 170px; right: 12%; bottom: 26px; background: radial-gradient(circle at 30% 30%, rgba(240,207,58,.65), rgba(240,207,58,0) 70%); animation: ghFloat 11s ease-in-out -3s infinite; }
.gh-orb.o3 { --k: 20; --s: .5; width: 90px; height: 90px; left: 22%; top: 24%; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.4), rgba(255,255,255,0) 70%); animation: ghFloat 7s ease-in-out -2s infinite; }
@keyframes ghFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-26px) scale(1.08); } }

.gh-fly { position: absolute; bottom: -40px; left: var(--x); font-size: var(--z); color: rgba(255,255,255,.2); z-index: 1; pointer-events: none;
    animation: ghRise var(--t) linear var(--d) infinite; }
@keyframes ghRise { 0% { transform: translateY(0) rotate(0); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translateY(-420px) rotate(40deg); opacity: 0; } }

.gal-hero .eyebrow { animation: ghIn .8s var(--gw-ease) both; }
.gal-hero h1 { display: flex; justify-content: center; gap: .02em; font-size: clamp(2.6rem, 8vw, 5rem); letter-spacing: -.01em; margin: 6px 0 12px; }
.gh-l { display: inline-block; opacity: 0; transform: translateY(60%) rotate(8deg) scale(.6); filter: blur(8px);
    animation: ghLetter .9s var(--gw-ease) calc(.15s + var(--i) * .07s) forwards; transition: transform .35s var(--gw-ease), color .3s; cursor: default; }
.gh-l:hover { transform: translateY(-10px) rotate(-6deg) scale(1.15); color: var(--gold); }
@keyframes ghLetter { to { opacity: 1; transform: none; filter: none; } }
.gh-line { display: block; width: 0; height: 4px; margin: 0 auto 16px; border-radius: 4px; background: var(--gradient-gold); animation: ghLine 1s var(--gw-ease) .9s forwards; box-shadow: 0 0 18px rgba(240,207,58,.7); }
@keyframes ghLine { to { width: 96px; } }
.gal-hero p { animation: ghIn .9s var(--gw-ease) .8s both; }
.gh-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.gh-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    animation: ghIn .8s var(--gw-ease) both; animation-delay: calc(1s + var(--c) * .12s); }
.gh-chip i { color: var(--gold); }
.gh-chip b { font-size: 1.1em; font-variant-numeric: tabular-nums; }
@keyframes ghIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ================= BAR (cari + tampilan) ================= */
.gal-section { padding-top: 0 !important; margin-top: -58px; position: relative; z-index: 3; }
.gw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 14px; margin-bottom: 26px; border-radius: 22px;
    background: rgba(255,255,255,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
    animation: ghIn .8s var(--gw-ease) 1.2s both; }
.gw-search { position: relative; flex: 1 1 240px; }
.gw-search i { position: absolute; left: 16px; top: 50%; translate: 0 -50%; color: var(--muted); transition: color .3s, scale .3s; }
.gw-search input { width: 100%; padding: 13px 16px 13px 44px; border: 2px solid transparent; border-radius: 14px; background: var(--tint); font: inherit; color: var(--ink); transition: border-color .3s, box-shadow .3s, background .3s; }
.gw-search input:focus { outline: 0; background: #fff; border-color: var(--primary-light); box-shadow: 0 0 0 5px rgba(var(--primary-light-rgb), .18); }
.gw-search:focus-within i { color: var(--primary); scale: 1.2; }
.gw-info { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.gw-info b { color: var(--primary); }
.gw-view { position: relative; display: inline-flex; padding: 4px; border-radius: 14px; background: var(--tint); }
.gw-view button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 0; background: none; border-radius: 11px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--muted); cursor: pointer; transition: color .3s; }
.gw-view button[aria-pressed="true"] { color: #fff; }
.gw-pill { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 11px; background: var(--gradient); box-shadow: 0 6px 16px rgba(var(--primary-rgb), .35); transition: transform .45s var(--gw-ease), width .45s var(--gw-ease); }

/* ================= MARQUEE ================= */
.gm { overflow: hidden; margin: 0 -6vw 28px; padding: 8px 0 14px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); }
.gm-track { display: flex; gap: 14px; width: max-content; animation: gmRun var(--gm-t, 60s) linear infinite; }
.gm:hover .gm-track { animation-play-state: paused; }
@keyframes gmRun { to { transform: translateX(-50%); } }
.gm-item { flex: none; width: 190px; height: 118px; padding: 0; border: 0; border-radius: 18px; overflow: hidden; cursor: pointer; background: var(--tint); box-shadow: var(--shadow-sm);
    transition: transform .4s var(--gw-ease), box-shadow .4s; }
.gm-item:nth-child(even) { margin-top: 10px; height: 108px; }
.gm-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--gw-ease); }
.gm-item:hover { transform: translateY(-8px) rotate(-2.5deg) scale(1.06); box-shadow: var(--shadow-lg); }
.gm-item:hover img { transform: scale(1.15); }

/* ================= WALL ================= */
.gallery-wall.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; grid-auto-flow: dense; gap: 16px; }
.gallery-wall .gallery-item { aspect-ratio: auto; height: 100%; width: 100%; border-radius: 24px; position: relative; overflow: hidden; background: var(--tint); cursor: zoom-in;
    transform: perspective(900px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));
    transition: transform .7s var(--gw-ease), box-shadow .45s var(--gw-ease), opacity .6s, translate .6s, scale .6s; }
.gallery-wall .gallery-item:hover, .gallery-wall .gallery-item:focus-visible { box-shadow: 0 26px 55px rgba(var(--primary-rgb), .38); z-index: 5; }
.gallery-wall .gallery-item.is-tilt { transition: transform .12s linear, box-shadow .45s var(--gw-ease); }
.gallery-wall .gallery-item:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.gallery-wall.is-mosaic .gallery-item.sz-big  { grid-column: span 2; grid-row: span 2; }
.gallery-wall.is-mosaic .gallery-item.sz-tall { grid-row: span 2; }
.gallery-wall.is-mosaic .gallery-item.sz-wide { grid-column: span 2; }
.gallery-wall.is-grid { grid-auto-rows: auto; }
.gallery-wall.is-grid .gallery-item { aspect-ratio: 4 / 3; height: auto; }
.gallery-wall .gallery-item.is-off { display: none; }

/* masuk bertahap (hanya bila JS aktif) */
.gw-js .gallery-wall .gallery-item.gw-pre { opacity: 0; translate: 0 56px; scale: .88; rotate: var(--r, 0deg); filter: blur(12px); }
.gw-js .gallery-wall .gallery-item.gw-in { transition: opacity .8s ease var(--dl,0ms), translate .95s var(--gw-ease) var(--dl,0ms), scale .95s var(--gw-ease) var(--dl,0ms), rotate .95s var(--gw-ease) var(--dl,0ms), filter .8s ease var(--dl,0ms), transform .6s, box-shadow .45s; }
.gallery-wall .gallery-item.gw-pop { animation: gwPop .6s var(--gw-ease) both; }
@keyframes gwPop { from { opacity: 0; scale: .85; filter: blur(8px); } to { opacity: 1; scale: 1; filter: none; } }

/* foto */
.gi-media { position: absolute; inset: 0; transition: transform .9s var(--gw-ease); }
.gallery-wall .gallery-item:hover .gi-media { transform: scale(1.1); }
.gallery-wall .gallery-item img { width: 100%; height: 100%; object-fit: cover; animation: gwDrift 22s ease-in-out var(--dd,0s) infinite alternate; translate: var(--px,0px) var(--py,0px); transition: translate .25s ease-out, filter .5s; }
.gallery-wall .gallery-item:hover img { filter: saturate(1.15) contrast(1.04); }
@keyframes gwDrift { from { transform: scale(1.04) translate(0,0); } to { transform: scale(1.13) translate(-1.6%, -1.2%); } }
.gallery-wall .gallery-placeholder { position: absolute; inset: 0; }

/* kilau mengikuti kursor + garis tepi berputar */
.gallery-wall .gallery-item::before { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .35s;
    background: radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,.34), transparent 46%); }
.gallery-wall .gallery-item:hover::before { opacity: 1; }
.gallery-wall .gallery-item::after { content: ''; position: absolute; inset: 0; z-index: 4; border-radius: inherit; padding: 3px; pointer-events: none; opacity: 0; transition: opacity .4s;
    background: conic-gradient(from var(--ang), #f0cf3a, #5eac4e, rgba(255,255,255,0) 45%, #f0cf3a);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: gwSpin 3.2s linear infinite paused; }
.gallery-wall .gallery-item:hover::after, .gallery-wall .gallery-item:focus-visible::after { opacity: 1; animation-play-state: running; }
@keyframes gwSpin { to { --ang: 360deg; } }

/* nomor, tombol zoom, keterangan */
.gi-num { position: absolute; z-index: 2; left: 14px; top: 14px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .06em; color: #fff;
    background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .3s, color .3s, transform .4s var(--gw-ease); }
.gallery-wall .gallery-item:hover .gi-num { background: var(--gold); color: #3b2f00; transform: translateY(-2px) scale(1.06); }
.gi-zoom { position: absolute; z-index: 2; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--primary-dark); background: #fff;
    scale: 0; rotate: -90deg; transition: scale .45s var(--gw-ease), rotate .55s var(--gw-ease); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.gallery-wall .gallery-item:hover .gi-zoom, .gallery-wall .gallery-item:focus-visible .gi-zoom { scale: 1; rotate: 0deg; }
.gallery-wall .gallery-overlay { position: absolute; inset: auto 0 0 0; z-index: 2; padding: 56px 18px 16px; color: #fff; background: linear-gradient(transparent, rgba(4,30,22,.88)); opacity: 1; transform: none; display: block; }
.gi-cap { display: block; transform: translateY(22px); opacity: 0; transition: transform .55s var(--gw-ease), opacity .45s; }
.gallery-wall .gallery-item:hover .gi-cap, .gallery-wall .gallery-item:focus-visible .gi-cap { transform: none; opacity: 1; }
.gi-date { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--gold); margin-bottom: 4px; }
.gi-date i { margin-right: 5px; }
.gi-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 1rem; font-weight: 700; line-height: 1.3; }
.gi-bar { display: block; height: 3px; width: 0; margin-top: 10px; border-radius: 3px; background: var(--gradient-gold); transition: width .7s var(--gw-ease) .1s; }
.gallery-wall .gallery-item:hover .gi-bar { width: 56px; }

.gw-empty { display: none; text-align: center; padding: 60px 20px; color: var(--muted); }
.gw-empty.show { display: block; animation: ghIn .5s var(--gw-ease) both; }
.gw-empty i { font-size: 54px; color: var(--primary-light); margin-bottom: 12px; animation: ghFloat 3s ease-in-out infinite; }

/* ================= RESPONSIF ================= */
@media (max-width: 1100px) { .gallery-wall.gallery-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 180px; } }
@media (max-width: 720px) {
    .gal-hero { padding-bottom: 100px; }
    .gallery-wall.gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; gap: 10px; }
    .gallery-wall .gallery-item { border-radius: 18px; }
    .gallery-wall .gallery-overlay { padding: 34px 11px 10px; }
    .gi-title { font-size: .8rem; }
    .gi-num { left: 9px; top: 9px; font-size: 11px; padding: 3px 9px; }
    .gw-bar { padding: 10px; border-radius: 18px; }
    .gw-info { order: 3; width: 100%; }
    .gm-item { width: 140px; height: 88px; }
    .gm-item:nth-child(even) { height: 80px; }
}
/* layar sentuh: keterangan selalu terlihat */
@media (hover: none) {
    .gi-cap { transform: none; opacity: 1; }
    .gi-zoom { scale: .85; rotate: 0deg; opacity: .9; width: 34px; height: 34px; right: 9px; top: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    .gal-hero, .gh-orb, .gh-fly, .gm-track, .gallery-wall .gallery-item img, .gw-empty i { animation: none !important; }
    .gh-l, .gal-hero .eyebrow, .gal-hero p, .gh-chip, .gw-bar { animation: none !important; opacity: 1; transform: none; filter: none; }
    .gh-line { animation: none; width: 96px; }
    .gm { overflow-x: auto; }
}
