/* Gallery: album cards, immersive slider, mosaic and lightbox */

/* ---------- List ---------- */
.gallery-hero {
  position: relative; text-align: center; padding-block: 64px 56px;
  background: var(--color-surface);
}
.gallery-title { font-weight: 900; font-size: clamp(2rem, 4.5vw, 3rem); margin-top: 8px; }
.gallery-lead { max-width: 620px; margin: 14px auto 0; color: var(--color-secondary); font-size: 1.0625rem; }
.gallery-count { margin-top: 18px; font-size: .9375rem; color: var(--color-muted); }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 48px 32px; }
.album-card { display: flex; flex-direction: column; gap: 18px; color: inherit; }
.album-stack { position: relative; display: block; aspect-ratio: 4 / 3; margin: 8px 8px 0; }
.album-stack::before, .album-stack::after {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius); background: var(--color-surface);
  border: 1px solid var(--color-border); transition: transform .35s ease; z-index: 0;
}
.album-stack::before { transform: rotate(-3deg); }
.album-stack::after { transform: rotate(2.5deg); }
.album-card:hover .album-stack::before { transform: rotate(-6deg) translateX(8px); }
.album-card:hover .album-stack::after { transform: rotate(5deg) translateX(-8px); }
.album-cover { position: absolute; inset: 0; z-index: 1; overflow: hidden; border-radius: var(--radius); background: var(--color-surface); box-shadow: var(--shadow); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.album-card:hover .album-cover img { transform: scale(1.06); }
.album-badge {
  position: absolute; z-index: 2; inset-block-end: 12px; inset-inline-start: 12px; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px 4px 10px; border-radius: 999px; color: #fff; font-size: .8125rem; font-weight: 700;
  background: rgb(10 20 16 / .62); backdrop-filter: blur(6px);
}
.album-badge svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.album-info { display: flex; flex-direction: column; gap: 4px; }
.album-name { font-size: 1.1875rem; line-height: 1.6; }
.album-card:hover .album-name { color: var(--color-accent); }
.album-desc { color: var(--color-secondary); font-size: .9375rem; line-height: 1.8; }
.album-date { color: var(--color-muted); font-size: .8125rem; }

/* ---------- Detail ---------- */
.album-head { text-align: center; padding-block: 48px 32px; }
.album-head .breadcrumbs ol { justify-content: center; }
.album-title { font-weight: 900; font-size: clamp(1.875rem, 4vw, 2.75rem); margin-top: 8px; }
.album-lead { max-width: 680px; margin: 16px auto 0; color: var(--color-secondary); font-size: 1.125rem; line-height: 2; }
.album-meta { margin-top: 16px; color: var(--color-muted); font-size: .9375rem; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.album-meta a { color: var(--color-accent); }

.gv-section { padding-block: 32px 28px; background: #0d0f11; }
.gv {
  position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 16 / 9; max-height: min(78vh, 760px); width: 100%;
  border-radius: var(--radius); background: #000; color: #fff; outline-offset: 3px;
}
.gv-bg {
  position: absolute; inset: -48px; z-index: -1; background-size: cover; background-position: center;
  filter: blur(38px) brightness(.55) saturate(1.35); transition: background-image .6s;
}
.gv-stage { position: absolute; inset: 0; cursor: zoom-in; }
.gv-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transform: scale(1.035);
  transition: opacity .7s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1); user-select: none; -webkit-user-drag: none;
}
.gv-img.is-active { opacity: 1; transform: scale(1); }
.gv svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gv-nav {
  position: absolute; top: 50%; translate: 0 -50%; z-index: 3; display: grid; place-items: center; width: 52px; height: 52px; padding: 0;
  border-radius: 50%; border: 1px solid rgb(255 255 255 / .28); background: rgb(0 0 0 / .38); color: #fff; cursor: pointer;
  backdrop-filter: blur(6px); transition: background .2s, transform .2s, opacity .2s; opacity: .85;
}
.gv-nav:hover { background: rgb(0 0 0 / .65); transform: scale(1.08); opacity: 1; }
.gv-prev { inset-inline-start: 16px; }
.gv-next { inset-inline-end: 16px; }
.gv-bar {
  position: absolute; z-index: 2; inset-inline: 0; bottom: 0; display: flex; align-items: center; gap: 12px;
  padding: 56px 20px 16px; background: linear-gradient(to top, rgb(0 0 0 / .78), transparent); pointer-events: none;
}
.gv-bar > * { pointer-events: auto; }
.gv-caption { flex: 1; margin: 0; font-size: 1rem; line-height: 1.8; text-shadow: 0 1px 8px rgb(0 0 0 / .6); }
.gv-count { font-size: .875rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: rgb(255 255 255 / .16); white-space: nowrap; }
.gv-tool {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 1px solid rgb(255 255 255 / .28);
  background: rgb(255 255 255 / .1); color: #fff; cursor: pointer; transition: background .2s;
}
.gv-tool:hover { background: rgb(255 255 255 / .25); }
.gv .i-play { display: none; fill: currentColor; stroke: none; }
.gv.is-paused .i-play { display: block; }
.gv.is-paused .i-pause { display: none; }
.gv-progress { position: absolute; z-index: 3; inset-inline: 0; bottom: 0; height: 3px; background: var(--color-accent); transform: scaleX(0); transform-origin: left center; }
[dir="rtl"] .gv-progress { transform-origin: right center; }
.gv-progress.is-running { animation: gv-progress linear forwards; }
@keyframes gv-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.gv-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 16px 2px 4px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.gv-section .gv-thumbs { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.gv-thumb {
  flex: none; width: 92px; height: 64px; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: #000;
  opacity: .5; cursor: pointer; scroll-snap-align: center; transition: opacity .25s, border-color .25s, transform .25s;
}
.gv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gv-thumb:hover { opacity: .85; }
.gv-thumb.is-active { opacity: 1; border-color: #fff; transform: translateY(-3px); }

.mosaic-title { font-size: 1.5rem; margin-bottom: 24px; }
.mosaic { columns: 3; column-gap: 16px; }
.mosaic-item {
  position: relative; display: block; width: 100%; margin: 0 0 16px; padding: 0; border: 0; overflow: hidden; break-inside: avoid;
  border-radius: var(--radius-sm); background: var(--color-surface); cursor: zoom-in; color: #fff;
}
.mosaic-item img { display: block; width: 100%; height: auto; transition: transform .5s ease; }
.mosaic-item:hover img { transform: scale(1.05); }
.mosaic-caption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 36px 14px 12px; font-size: .875rem; line-height: 1.7; text-align: start;
  background: linear-gradient(to top, rgb(0 0 0 / .75), transparent); transform: translateY(100%); transition: transform .3s ease;
}
.mosaic-item:hover .mosaic-caption, .mosaic-item:focus-visible .mosaic-caption { transform: translateY(0); }

/* ---------- Lightbox ---------- */
.gv-dialog { padding: 0; border: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: #000; color: #fff; }
.gv-dialog::backdrop { background: #000; }
.gv-dialog .gv { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; border-radius: 0; }
.gv-dialog .gv-stage { cursor: default; }
html.gv-lock { overflow: hidden; }

@media (max-width: 900px) {
  .mosaic { columns: 2; }
  .gv { aspect-ratio: 4 / 3; }
}
@media (max-width: 600px) {
  .gv { aspect-ratio: 1; border-radius: var(--radius-sm); }
  .gv-nav { width: 40px; height: 40px; }
  .gv-prev { inset-inline-start: 8px; }
  .gv-next { inset-inline-end: 8px; }
  .gv-bar { padding-inline: 14px; }
  .gv-thumb { width: 72px; height: 52px; }
  .album-grid { gap: 40px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .gv-img, .album-cover img, .mosaic-item img { transition: none; }
}
