/* Triển lãm ký ức (gallery.js) — co giãn theo khung .cs. --W = bề rộng một bức tranh */
.pl.pl-gallery { display: block; padding: 0; gap: 0; overflow: hidden; --u: min(1cqh, 1.8cqw); font-size: calc(var(--u) * 2.1); color: #fff;
  --W: min(60cqw, 36cqh); --G: calc(var(--W) * .38); background: var(--wall2); }
.pl-gallery button { font-family: var(--bf); -webkit-tap-highlight-color: transparent; }
.pl-gallery button svg { width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pl-gallery ~ .cs-wm, #stage .pl-gallery ~ .cs-wm { top: auto; bottom: 1cqmin; left: 50%; transform: translateX(-50%); }
.view-body .pl-gallery { --sb: 58px; }
.pl-gallery.zooming ~ .pm-finale-btn { opacity: 0; pointer-events: none; }

/* phòng: tường nhung hoa văn, nẹp tường, sàn bóng */
.ga-room, .ga-room i { position: absolute; display: block; }
.ga-room { inset: 0; }
.ga-wall { inset: 0 0 20% 0; background:
  radial-gradient(ellipse 70% 55% at 50% 42%, color-mix(in srgb, var(--wall) 70%, #fff 8%), transparent 70%),
  radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .05) 0 18%, transparent 19%) 0 0 / 7cqmin 7cqmin,
  linear-gradient(180deg, var(--wall2), var(--wall) 30%, var(--wall) 75%, var(--wall2)); }
.ga-mold { left: 0; right: 0; bottom: 20%; height: 1.6%; background: linear-gradient(180deg, #e9cf8a, #8a6a1f); box-shadow: 0 .4cqh 1cqh rgba(0, 0, 0, .45); }
.ga-floor { left: 0; right: 0; bottom: 0; height: 20%; background:
  linear-gradient(180deg, rgba(255, 255, 255, .12), transparent 40%),
  repeating-linear-gradient(90deg, transparent 0 11cqw, rgba(0, 0, 0, .18) 11cqw calc(11cqw + 1px)),
  linear-gradient(180deg, var(--floor), var(--floor2)); }

.ga-sign { position: absolute; top: 4%; left: 8%; right: 8%; z-index: 3; text-align: center; animation: ga-in 1s ease both; }
.ga-sign small { display: inline-block; padding: .2em .9em; border: 1px solid rgba(233, 207, 138, .7); border-radius: .2em; color: #e9cf8a; font-size: .66em; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; }
.ga-sign h2 { margin: .25em 0 .1em; font-family: var(--tf); font-weight: 400; font-size: 2.1em; line-height: 1.15; color: #fff; text-shadow: 0 0 .6em color-mix(in srgb, var(--accent2) 60%, transparent); overflow-wrap: anywhere; }
.ga-sign p { margin: 0; font-size: .74em; letter-spacing: .06em; opacity: .75; }

/* hành lang tranh */
.ga-track { position: absolute; left: 50%; top: 23%; z-index: 2; display: flex; align-items: flex-start; gap: var(--G);
  transform: translateX(calc(-1 * (var(--i, 0) * (var(--W) + var(--G)) + var(--W) / 2))); transition: transform .9s cubic-bezier(.3, .8, .25, 1); }
.ga-art { position: relative; flex: none; width: var(--W); margin: 0; cursor: pointer; opacity: .45; scale: .86; filter: brightness(.55) saturate(.8); transition: opacity .8s, scale .8s, filter .8s; }
.ga-art.on { opacity: 1; scale: 1; filter: none; }
.ga-spot { position: absolute; left: 50%; top: -30%; width: 190%; height: 175%; translate: -50% 0; pointer-events: none; opacity: 0; transition: opacity 1s .2s;
  background: radial-gradient(ellipse 42% 58% at 50% 6%, color-mix(in srgb, var(--light) 55%, transparent), transparent 72%); }
.ga-spot::before { content: ''; position: absolute; left: 50%; top: 2%; width: 13%; height: 2.4%; translate: -50% 0; border-radius: 0 0 1em 1em; background: linear-gradient(#333, #111); box-shadow: 0 .6em 1.2em .2em color-mix(in srgb, var(--light) 70%, transparent); }
.ga-art.on .ga-spot { opacity: 1; }
.ga-frame { position: relative; padding: 7%; border-radius: .15em; box-shadow: 0 2.4em 3em -1.6em rgba(0, 0, 0, .8), inset 0 0 0 .18em rgba(0, 0, 0, .25), inset 0 0 0 .5em rgba(255, 255, 255, .18); }
.ga-f-gold .ga-frame { background: linear-gradient(135deg, #7a5a14, #f3d98b 22%, #b8892c 45%, #fbe8b0 62%, #9c7424 82%, #e9cf8a); }
.ga-f-wood .ga-frame { background: linear-gradient(135deg, #4a2c14, #8b5a2b 30%, #5e3a1c 55%, #a0703d 80%, #4a2c14); }
.ga-f-white .ga-frame { background: linear-gradient(135deg, #e9e6e0, #fff 40%, #dcd8d0); }
.ga-f-black .ga-frame { background: linear-gradient(135deg, #0b0b0b, #3a3a3a 40%, #111 70%, #2b2b2b); }
.ga-mat { padding: 8%; background: #fbf8f1; box-shadow: inset 0 .25em .6em rgba(0, 0, 0, .3); }
.ga-mat img, .ga-mat svg { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.ga-plaque { width: 78%; margin: 1.1em auto 0; padding: .45em .7em .5em; border-radius: .2em; text-align: center; color: #3a2a10;
  background: linear-gradient(180deg, #f6e6b8, #c9a24b); box-shadow: 0 .3em .7em rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .7); }
.ga-plaque b { display: block; font-family: 'Cormorant Garamond', var(--bf); font-size: .92em; line-height: 1.2; overflow-wrap: anywhere; }
.ga-plaque span { display: block; margin-top: .15em; font-size: .68em; line-height: 1.35; opacity: .85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ga-final .ga-frame { padding: 9%; }
.ga-final .ga-plaque span { font-style: italic; }
.ga-final.on .ga-plaque { animation: ga-glow 2s ease-in-out infinite; }
.ga-ribbon { position: absolute; top: -.9em; left: 50%; translate: -50% 0; padding: .3em 1em; border-radius: .2em; background: linear-gradient(180deg, #c2253f, #8a1328); color: #fff; font-size: .7em; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; box-shadow: 0 .3em .6em rgba(0, 0, 0, .4); white-space: nowrap; }
.ga-rope { display: block; width: 130%; margin: .8em 0 0 -15%; }

/* điều khiển */
.ga-nav { position: absolute; left: 50%; bottom: calc(5% + var(--sb, 0px)); translate: -50% 0; z-index: 4; display: flex; align-items: center; gap: 1em; }
.ga-btn { display: grid; place-items: center; width: 2.8em; height: 2.8em; padding: 0; border-radius: 50%; border: 1px solid rgba(233, 207, 138, .6); background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #e9cf8a; cursor: pointer; transition: opacity .3s, transform .2s; }
.ga-btn:hover:not(:disabled) { transform: scale(1.08); }
.ga-btn:disabled { opacity: .3; cursor: default; }
.ga-count { min-width: 5.5em; text-align: center; font-size: .82em; font-weight: 700; letter-spacing: .12em; color: #e9cf8a; }
.ga-hint { position: absolute; left: 0; right: 0; bottom: calc(13% + var(--sb, 0px)); z-index: 4; margin: 0; text-align: center; font-size: .75em; opacity: .8; animation: ga-blink 2.4s ease-in-out infinite; transition: opacity .5s; }
.ga-hint.gone, .at-final .ga-hint { opacity: 0; animation: none; }

/* phóng to */
.ga-zoom { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; padding: 5cqmin; overflow: hidden; background: rgba(8, 4, 6, .82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: ga-fade .4s ease both; cursor: zoom-out; }
.ga-zoom.out { animation: ga-fade .35s ease reverse forwards; }
.ga-zbox { display: flex; flex-direction: column; align-items: center; gap: 1em; width: min(88cqw, 52cqh); max-height: 100%; cursor: default; animation: ga-pop .5s cubic-bezier(.3, 1.3, .5, 1) both; }
.ga-zpic { width: 100%; padding: 4%; background: #fbf8f1; box-shadow: 0 1em 3em rgba(0, 0, 0, .6); flex: 0 1 auto; min-height: 0; }
.ga-zpic img, .ga-zpic svg { display: block; width: 100%; max-height: 52cqh; aspect-ratio: 4 / 5; object-fit: cover; }
.ga-ztext { width: 100%; max-height: 34cqh; overflow-y: auto; text-align: center; }
.ga-ztext h3 { margin: 0 0 .3em; font-family: var(--tf); font-weight: 400; font-size: 1.9em; line-height: 1.15; color: #fff; }
.ga-ztext p { margin: 0; font-size: .95em; line-height: 1.6; white-space: pre-line; color: rgba(255, 255, 255, .9); }
.ga-zoom.final .ga-zbox { width: min(90cqw, 60cqh); }
.ga-zoom.final .ga-zpic img, .ga-zoom.final .ga-zpic svg { max-height: 40cqh; }
.ga-zfrom { margin-top: .6em !important; font-family: var(--tf); font-size: 1.6em !important; color: #e9cf8a !important; }
.ga-zx { position: absolute; top: 3cqmin; left: 3cqmin; display: grid; place-items: center; width: 2.6em; height: 2.6em; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; }
.ga-petal { position: absolute; top: -5%; width: 1.4cqmin; height: 2cqmin; border-radius: 80% 0 80% 0; background: var(--c); pointer-events: none; animation: ga-fall var(--t) linear var(--d) both; }

@keyframes ga-in { from { opacity: 0; transform: translateY(-1em); } }
@keyframes ga-fade { from { opacity: 0; } }
@keyframes ga-pop { from { opacity: 0; scale: .85; } }
@keyframes ga-blink { 50% { opacity: .35; } }
@keyframes ga-glow { 50% { box-shadow: 0 0 1.2em color-mix(in srgb, var(--light) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .7); } }
@keyframes ga-fall { to { transform: translate(6cqw, 110cqh) rotate(540deg); } }

.static .pl-gallery *, .static .pl-gallery *::before { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .ga-track { transition-duration: .01s; }
  .ga-hint, .ga-final.on .ga-plaque { animation: none; }
}
