/* ─────────────────────────────────────────────────────────────────────────
   assets/css/gallery.css — Gallery section, album dialog and viewer (20/10/2026)
   Built by assets/js/gallery.js. Light section; the dialog and viewer are
   dark overlays that read the same in every UI style.
   ───────────────────────────────────────────────────────────────────────── */
.gallery-section { background: var(--off-white, #F4F6FB); }
html.ui-t .gallery-section { background: var(--sec-alt, var(--off-white, #F4F6FB)); }
.gallery-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 26px; }

.gal-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; border: 0; cursor: pointer;
  background: #fff; border-radius: 14px; overflow: hidden; color: var(--dark-text, #1A2340);
  box-shadow: 0 4px 24px rgba(13, 27, 62, .10); transition: transform .3s ease, box-shadow .3s ease; font: inherit;
}
.gal-card:hover, .gal-card:focus-visible { transform: translateY(-4px); box-shadow: 0 12px 36px rgba(13, 27, 62, .18); }
.gal-card:focus-visible { outline: 3px solid var(--gold, #D4AF37); outline-offset: 2px; }
.gal-cover { position: relative; aspect-ratio: 4 / 3; background: #0D1B3E; overflow: hidden; }
.gal-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.gal-card:hover .gal-cover img { transform: scale(1.05); }
.gal-cover-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 42px; }
.gal-count {
  position: absolute; right: 10px; bottom: 10px; background: rgba(8, 15, 36, .78); color: #fff;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; letter-spacing: .2px;
}
.gal-info { padding: 16px 18px 18px; }
.gal-title { font-family: var(--ff-head, sans-serif); font-size: 20px; font-weight: 700; line-height: 1.25; margin: 0; color: var(--navy, #0D1B3E); }
.gal-date { font-size: 12.5px; font-weight: 600; color: var(--gold, #B8962E); margin-top: 4px; letter-spacing: .3px; text-transform: uppercase; }
.gal-caption { font-size: 13.5px; color: var(--gray-text, #6B7A99); margin: 8px 0 0; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* album dialog */
html.gal-lock, html.gal-lock body { overflow: hidden; }
.gal-dialog { position: fixed; inset: 0; z-index: 100000; background: rgba(4, 9, 24, .86); display: flex; justify-content: center;
  align-items: flex-start; padding: 40px 16px; overflow-y: auto; animation: galIn .2s ease; }
.gal-box { width: min(1180px, 100%); background: #0D1B3E; border-radius: 16px; padding: 22px 22px 26px; color: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.gal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.gal-dtitle { font-family: var(--ff-head, sans-serif); font-size: 26px; font-weight: 700; margin: 0; line-height: 1.2; }
.gal-dmeta { font-size: 13px; color: var(--gold, #D4AF37); margin-top: 4px; font-weight: 600; }
.gal-dcap { font-size: 14px; color: rgba(255, 255, 255, .75); margin: 8px 0 0; max-width: 760px; line-height: 1.6; }
.gal-x { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08);
  color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.gal-x:hover, .gal-x:focus-visible { background: rgba(255, 255, 255, .2); outline: none; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.gal-thumb { position: relative; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: #080F24; }
.gal-thumb img, .gal-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease, opacity .35s; }
.gal-thumb:hover img, .gal-thumb:hover video { transform: scale(1.06); }
.gal-thumb:focus-visible { outline: 3px solid var(--gold, #D4AF37); outline-offset: 2px; }
.gal-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%;
  background: rgba(8, 15, 36, .7); color: #fff; display: grid; place-items: center; font-size: 18px; padding-left: 3px; }

/* full-screen viewer */
.gal-viewer { position: fixed; inset: 0; z-index: 100001; background: rgba(2, 5, 14, .96); animation: galIn .2s ease; }
.gal-stage { position: absolute; inset: 56px 64px 54px; display: flex; align-items: center; justify-content: center; }
.gal-media { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); background: #000; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 34px; line-height: 1; cursor: pointer; }
.gal-nav:hover, .gal-nav:focus-visible { background: rgba(255, 255, 255, .2); outline: none; }
.gal-prev { left: 8px; } .gal-next { right: 8px; }
.gal-vx { position: absolute; top: 8px; right: 8px; }
.gal-foot { position: absolute; left: 16px; right: 16px; bottom: 14px; text-align: center; color: rgba(255, 255, 255, .8); font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes galIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 640px) {
  .gallery-albums { grid-template-columns: 1fr; gap: 18px; }
  .gal-dialog { padding: 0; }
  .gal-box { border-radius: 0; min-height: 100%; padding: 16px 14px 22px; }
  .gal-dtitle { font-size: 21px; }
  .gal-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .gal-stage { inset: 54px 6px 50px; }
  .gal-nav { width: 42px; height: 42px; font-size: 28px; background: rgba(0, 0, 0, .35); }
}
@media (prefers-reduced-motion: reduce) {
  .gal-card, .gal-cover img, .gal-thumb img, .gal-thumb video { transition: none; }
  .gal-dialog, .gal-viewer { animation: none; }
}

/* ── Slideshow (20/10/2026): one photo at a time, right to left ─────────── */
.gal-show { position: relative; border-radius: 16px; overflow: hidden; background: #0D1B3E; margin: 0 auto 34px;
  max-width: 1100px; box-shadow: 0 18px 48px rgba(13, 27, 62, .22); outline: none; }
.gal-show:focus-visible { box-shadow: 0 0 0 3px var(--gold, #D4AF37), 0 18px 48px rgba(13, 27, 62, .22); }
.gal-show-vp { overflow: hidden; }
.gal-show-track { display: flex; transition: transform .9s cubic-bezier(.65, 0, .35, 1); will-change: transform; }
.gal-slide { position: relative; flex: 0 0 100%; aspect-ratio: 16 / 9; overflow: hidden; cursor: zoom-in; background: #0b1530; }
/* the frame's spare space is a blurred, darkened copy of the same photo — whole photo always visible */
.gal-slide::before { content: ''; position: absolute; inset: -30px; background: var(--gal-bg) center / cover no-repeat;
  filter: blur(26px) brightness(.55) saturate(1.1); transform: scale(1.08); }
.gal-slide-img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block; }
.gal-slide-cap { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 60px 26px 22px;
  background: linear-gradient(to top, rgba(4, 9, 24, .85), rgba(4, 9, 24, 0)); color: #fff; pointer-events: none; }
.gal-slide-title { font-family: var(--ff-head, sans-serif); font-size: 24px; font-weight: 700; line-height: 1.2; text-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.gal-slide-sub { font-size: 13.5px; color: rgba(255, 255, 255, .82); margin-top: 3px; letter-spacing: .2px; }
.gal-show-nav { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35); background: rgba(8, 15, 36, .45); color: #fff; font-size: 30px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .3s, background .3s; backdrop-filter: blur(4px); }
.gal-show:hover .gal-show-nav, .gal-show:focus-within .gal-show-nav { opacity: 1; }
.gal-show-nav:hover, .gal-show-nav:focus-visible { background: rgba(8, 15, 36, .75); outline: none; }
.gal-show-prev { left: 16px; } .gal-show-next { right: 16px; }
.gal-show-count { position: absolute; z-index: 3; top: 14px; right: 16px; background: rgba(8, 15, 36, .6); color: #fff;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; letter-spacing: .3px; }
.gal-show-dots { position: absolute; z-index: 3; right: 22px; bottom: 22px; display: flex; gap: 6px; flex-wrap: wrap; max-width: 45%; justify-content: flex-end; }
.gal-show-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .3s, background .3s; }
.gal-show-dot.on { width: 22px; background: var(--gold, #D4AF37); }
.gal-show-bar { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .12); }
.gal-show-bar span { display: block; height: 100%; width: 100%; background: var(--gold, #D4AF37); transform-origin: left; transform: scaleX(0);
  animation: galBar 5000ms linear forwards; }
.gal-show.is-paused .gal-show-bar span, .gal-show.is-offscreen .gal-show-bar span { animation-play-state: paused; }
@keyframes galBar { to { transform: scaleX(1); } }
@media (max-width: 640px) {
  .gal-show { border-radius: 12px; margin-bottom: 24px; }
  .gal-slide { aspect-ratio: 4 / 3; }
  .gal-slide-cap { padding: 44px 14px 30px; }
  .gal-slide-title { font-size: 18px; }
  .gal-slide-sub { font-size: 12px; }
  .gal-show-nav { opacity: 1; width: 38px; height: 38px; font-size: 24px; }
  .gal-show-prev { left: 8px; } .gal-show-next { right: 8px; }
  .gal-show-dots { left: 14px; right: 14px; bottom: 12px; max-width: none; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .gal-show-track { transition: none; } }
