/* ============================================================
   GALLERY.CSS — Ashraf Islamia Model Public Secondary School
   Event-based gallery — all scoped styles for gallery.html
   ============================================================ */

/* ─── Accessibility Utility ──────────────────────────── */

/* Screen-reader only — visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Always show dark nav (no intro on inner pages) */
.gallery-page #navbar {
  background: rgba(10, 22, 45, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(201, 168, 76, 0.12);
}


/* ══════════════════════════════════════════════════════
   GALLERY HERO
   ══════════════════════════════════════════════════════ */

#gallery-hero {
  position: relative;
  background: var(--primary-dark);
  padding-top: clamp(100px, 14vw, 160px);
  padding-bottom: 0;
  overflow: hidden;
}

/* Subtle radial glow overlay */
#gallery-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 60% 30%, rgba(201, 168, 76, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 70%, rgba(42, 82, 152, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

/* Fine dot grid texture */
#gallery-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

.gallery-hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding-bottom: clamp(48px, 6vw, 80px);
}

.gallery-hero-text {
  padding-right: 20px;
}

.gallery-hero-text .section-label {
  font-size: 0.7rem;
  letter-spacing: 0.28em;
}

.gallery-hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.gallery-hero-h1 em {
  font-style: italic;
  color: var(--gold-light);
}

.gallery-hero-desc {
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.8;
  max-width: 440px;
  font-weight: 300;
}

/* Visual panel: stacked image cards */
.gallery-hero-visual {
  position: relative;
  height: clamp(320px, 42vw, 520px);
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.gallery-hero-card {
  position: absolute;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.65);
  transition: transform 0.4s ease;
}

.gallery-hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Card 1 — large background card, slight counter-clockwise tilt */
.gallery-hero-card:nth-child(1) {
  width: 68%;
  height: 75%;
  top: 4%;
  right: 2%;
  transform: rotate(-2.5deg);
  z-index: 1;
}

/* Card 2 — medium card, slight clockwise tilt, overlapping bottom-left */
.gallery-hero-card:nth-child(2) {
  width: 55%;
  height: 58%;
  bottom: 2%;
  left: 2%;
  transform: rotate(2deg);
  z-index: 2;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

/* Card 3 — small accent card, overlapping centre-top */
.gallery-hero-card:nth-child(3) {
  width: 38%;
  height: 40%;
  top: 6%;
  left: 6%;
  transform: rotate(-1.5deg);
  z-index: 3;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.75);
}

/* Gold accent line */
.gallery-hero-accent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 50%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, transparent 100%);
  z-index: 0;
}

/* Stat pills */
.gallery-hero-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 36px;
}

.gallery-hero-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
}

.gallery-hero-stat svg {
  color: var(--gold);
  flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════
   FILTER BAR
   ══════════════════════════════════════════════════════ */

#gallery-filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-block: 20px;
  position: sticky;
  top: var(--navbar-height, 72px); /* matches navbar height token from style.css */
  z-index: 100;
  box-shadow: 0 2px 12px rgba(26, 58, 92, 0.06);
}

#gallery-filter-bar .container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#filter-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
  flex: 1;
}

#filter-wrap::-webkit-scrollbar { display: none; }

.gallery-filter-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease-smooth),
    border-color var(--t-fast) var(--ease-smooth),
    color var(--t-fast) var(--ease-smooth),
    box-shadow var(--t-fast);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.gallery-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(26, 58, 92, 0.05);
}

.gallery-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-white);
  box-shadow: 0 3px 12px rgba(26, 58, 92, 0.25);
}

.gallery-filter-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 600;
}


/* ══════════════════════════════════════════════════════
   ALBUM GRID — Main Gallery View
   ══════════════════════════════════════════════════════ */

#gallery-main {
  padding-block: clamp(48px, 8vw, 80px);
  background: var(--cream);
}

#album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.5vw, 32px);
}

/* ─── Album Card ──────────────────────────────────────── */

.album-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition:
    transform var(--t-med) var(--ease-smooth),
    box-shadow var(--t-med) var(--ease-smooth);
  display: flex;
  flex-direction: column;
  text-align: left;
}

.album-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.album-card:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* Image wrapper */
.album-card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  flex-shrink: 0;
}

.album-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow) var(--ease-smooth);
}

.album-card:hover .album-card-img {
  transform: scale(1.07);
}

/* Overlay on hover */
.album-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 25, 47, 0.7) 0%, rgba(10, 25, 47, 0.1) 60%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-smooth);
}

.album-card:hover .album-card-overlay {
  opacity: 1;
}

.album-view-label {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Category badge */
.album-card-category {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--gold-light);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1px solid rgba(201, 168, 76, 0.3);
}

/* Card body */
.album-card-body {
  padding: 22px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.album-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.album-card-date {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.album-card-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 10px;
}

.album-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Media count badges */
.album-card-counts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.album-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(26, 58, 92, 0.07);
  padding: 5px 12px;
  border-radius: 50px;
  border: 1px solid rgba(26, 58, 92, 0.12);
}

.album-count-badge svg {
  flex-shrink: 0;
}


/* ─── Skeleton Cards ─────────────────────────────────── */

.album-card-skeleton {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(90deg, #e8e5df 0%, #f2efe9 50%, #e8e5df 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  border-radius: 4px;
  background: linear-gradient(90deg, #e8e5df 0%, #f2efe9 50%, #e8e5df 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite 0.1s;
  height: 12px;
}

.skeleton-title  { width: 80%; height: 18px; }
.skeleton-date   { width: 40%; height: 11px; }
.skeleton-desc   { width: 100%; height: 48px; border-radius: 6px; }
.skeleton-meta   { display: flex; gap: 8px; margin-top: 6px; }
.skeleton-badge  { width: 80px; height: 24px; border-radius: 50px; }


/* ─── Empty State ────────────────────────────────────── */

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: clamp(60px, 10vw, 100px) 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.gallery-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(26, 58, 92, 0.06);
  border: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.gallery-empty-icon svg {
  width: 38px;
  height: 38px;
  color: var(--gold);
  opacity: 0.7;
}

.gallery-empty-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  color: var(--text-dark);
}

.gallery-empty-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.8;
}

.gallery-empty-reset {
  margin-top: 8px;
}


/* ══════════════════════════════════════════════════════
   EVENT DETAIL VIEW
   ══════════════════════════════════════════════════════ */

#event-view {
  min-height: 60vh;
}

/* Back button */
.event-back-bar {
  background: var(--primary-dark);
  padding: 14px 0;
  border-bottom: 1px solid rgba(201, 168, 76, 0.1);
}

.event-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
  padding: 6px 0;
  transition: color var(--t-fast), gap var(--t-fast);
}

.event-back-btn:hover {
  color: var(--gold-light);
  gap: 12px;
}

.event-back-btn svg {
  flex-shrink: 0;
  transition: transform var(--t-fast);
}

.event-back-btn:hover svg {
  transform: translateX(-3px);
}


/* ─── Event Hero ─────────────────────────────────────── */

#event-hero {
  background: var(--primary-dark);
  position: relative;
  overflow: hidden;
  padding-top: clamp(36px, 6vw, 64px);
  padding-bottom: clamp(36px, 6vw, 64px);
}

#event-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(201, 168, 76, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.event-hero-grid {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 56px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.event-hero-text .section-label {
  font-size: 0.7rem;
}

.event-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.15;
  margin-bottom: 14px;
}

.event-hero-date {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-hero-date::before {
  content: '';
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--gold);
}

.event-hero-desc {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.8;
  max-width: 480px;
  font-weight: 300;
  margin-bottom: 28px;
}

.event-hero-counts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.event-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-light);
  border: 1px solid rgba(201, 168, 76, 0.3);
  background: rgba(201, 168, 76, 0.08);
  padding: 8px 18px;
  border-radius: 50px;
  letter-spacing: 0.02em;
}

.event-count-pill svg {
  color: var(--gold);
  flex-shrink: 0;
}

/* Event cover image */
.event-cover-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(201, 168, 76, 0.2);
}

.event-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-cover-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 50%);
  pointer-events: none;
}


/* ─── Photos Section ─────────────────────────────────── */

.event-media-section {
  padding-block: clamp(48px, 7vw, 72px);
}

.event-media-section:nth-child(even) {
  background: var(--cream-dark);
}

.event-media-section:nth-child(odd) {
  background: var(--cream);
}

.event-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(28px, 4vw, 40px);
  flex-wrap: wrap;
}

.event-section-title-group {
  flex: 1;
}

.event-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 6px;
}

.event-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.event-media-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 50px;
  background: rgba(26, 58, 92, 0.06);
  border: 1px solid var(--border);
}


/* ─── Photo Grid (Masonry-style) ─────────────────────── */

#photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.photo-thumb {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  aspect-ratio: 1 / 1;
}

.photo-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow) var(--ease-smooth);
}

.photo-thumb:hover .photo-thumb-img {
  transform: scale(1.08);
}

.photo-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 47, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-smooth);
}

.photo-thumb:hover .photo-thumb-overlay {
  opacity: 1;
}

.photo-thumb:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* Photo skeleton */
.photo-skeleton {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.photo-skeleton .skeleton-img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}


/* ─── Video Grid ──────────────────────────────────────── */

#video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
}

.video-card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--t-med) var(--ease-smooth),
    box-shadow var(--t-med) var(--ease-smooth);
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.video-card:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.video-card-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.video-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow) var(--ease-smooth);
}

.video-card:hover .video-card-thumb {
  transform: scale(1.06);
}

.video-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 47, 0.25);
  transition: background var(--t-fast);
}

.video-card:hover .video-card-overlay {
  background: rgba(10, 25, 47, 0.45);
}

.video-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.9);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 3px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition:
    transform var(--t-fast) var(--ease-smooth),
    background var(--t-fast);
  z-index: 2;
}

.video-card:hover .video-card-play {
  transform: translate(-50%, -50%) scale(1.12);
  background: var(--gold-light);
}

.video-card-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text-white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  z-index: 2;
}

.video-card-body {
  padding: 14px 16px 16px;
}

.video-card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
}


/* ══════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════ */

#gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lb-fade-in 0.2s ease forwards;
  /* Prevents scroll from leaking to background page on iOS/Android */
  overscroll-behavior: contain;
}

#gallery-lightbox[hidden] { display: none; }

@keyframes lb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 20, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lb-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 80px;
  gap: 20px;
}

.lb-image-wrap {
  flex: 1;
  max-height: 100%;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.lb-strip {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  width: 300%;
  height: 100%;
  will-change: transform;
  align-items: center;
  transform: translateX(-33.333333%);
}

.lb-slide {
  width: 33.333333%;
  height: 100%;
  flex: 0 0 33.333333%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  padding: 0;
  box-sizing: border-box;
}

#lb-image,
.lb-slide-img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
  display: block;
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

@keyframes lb-img-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* Close button */
#lb-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background var(--t-fast), border-color var(--t-fast);
}

#lb-close:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
}

#lb-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Prev/Next */
#lb-prev,
#lb-next {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    transform var(--t-fast) var(--ease-smooth);
}

#lb-prev:hover,
#lb-next:hover {
  background: rgba(201, 168, 76, 0.25);
  border-color: rgba(201, 168, 76, 0.5);
  transform: scale(1.08);
}

#lb-prev:disabled,
#lb-next:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

#lb-prev:focus-visible,
#lb-next:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Counter */
#lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.12em;
  background: rgba(255,255,255,0.08);
  padding: 6px 18px;
  border-radius: 50px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}


/* ══════════════════════════════════════════════════════
   VIDEO MODAL
   ══════════════════════════════════════════════════════ */

#video-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: lb-fade-in 0.2s ease forwards;
  /* Prevents scroll from leaking to background page on iOS/Android */
  overscroll-behavior: contain;
}

#video-modal[hidden] { display: none; }

.vm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.vm-inner {
  position: relative;
  z-index: 1;
  background: var(--primary-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  max-width: 800px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(201, 168, 76, 0.15);
}

.vm-header {
  padding: 16px 20px 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
}

#vm-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.3;
}

#vm-close {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-white);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast);
}

#vm-close:hover { background: rgba(255,255,255,0.2); }

#vm-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

#vm-embed {
  width: 100%;
}

/* Placeholder when real video not available */
.vm-placeholder {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.vm-placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: blur(3px) brightness(0.4);
}

.vm-placeholder-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}

.vm-placeholder-icon {
  opacity: 0.7;
}

.vm-placeholder-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 340px;
  line-height: 1.7;
}

.vm-placeholder-sublabel {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  max-width: 340px;
}

.vm-placeholder-sublabel strong {
  color: var(--gold-light);
}


/* ══════════════════════════════════════════════════════
   GALLERY CTA STRIP (bottom of gallery page)
   ══════════════════════════════════════════════════════ */

#gallery-cta {
  background: var(--cream-dark);
  padding-block: clamp(56px, 8vw, 80px);
  text-align: center;
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border-gold);
}

#gallery-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(201, 168, 76, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.gallery-cta-inner {
  position: relative;
  z-index: 1;
}

.gallery-cta-badge {
  display: inline-block;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 50px;
  padding: 7px 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 22px;
}

.gallery-cta-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 16px;
}

.gallery-cta-title em {
  font-style: italic;
  color: var(--gold-dark);
}

.gallery-cta-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 420px;
  margin-inline: auto;
  margin-bottom: 36px;
  line-height: 1.8;
  font-weight: 400;
}

.gallery-cta-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* On cream-dark background, outline button needs primary color border */
#gallery-cta .btn-outline {
  border-color: var(--primary);
  color: var(--primary);
}

#gallery-cta .btn-outline:hover {
  background: var(--primary);
  color: var(--text-white);
}


/* ══════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 1024px)
   ══════════════════════════════════════════════════════ */

@media (max-width: 1024px) {

  .gallery-hero-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .gallery-hero-text {
    padding-right: 0;
  }

  .gallery-hero-desc {
    max-width: 560px;
  }

  .gallery-hero-visual {
    height: clamp(240px, 50vw, 380px);
    max-width: 560px;
    margin-inline: auto;
    width: 100%;
  }

  .gallery-hero-accent {
    right: 0;
  }

  #album-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .event-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .event-cover-wrap {
    max-width: 480px;
    margin-inline: auto;
  }

  #photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}


/* ══════════════════════════════════════════════════════
   RESPONSIVE — SMALL TABLET / LARGE MOBILE (≤ 768px)
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Navbar */
  .gallery-page #navbar {
    padding-inline: 16px;
    padding-block: 12px;
  }

  /* Hero */
  #gallery-hero {
    padding-top: clamp(90px, 20vw, 120px);
  }

  .gallery-hero-card:nth-child(1) { width: 70%; height: 78%; }
  .gallery-hero-card:nth-child(2) { width: 55%; height: 50%; }
  .gallery-hero-card:nth-child(3) { display: none; }

  /* Filter */
  #gallery-filter-bar {
    top: 68px;
    padding-block: 14px;
  }

  #gallery-filter-bar .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  #filter-wrap {
    width: 100%;
  }

  /* Albums */
  #album-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .album-card-body {
    padding: 16px 18px 18px;
  }

  /* Event hero */
  .event-hero-desc {
    max-width: 100%;
  }

  /* Photo grid */
  #photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Video grid */
  #video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* Lightbox */
  .lb-inner {
    padding: 16px 0;
    gap: 0;
  }

  #lb-prev,
  #lb-next {
    display: none !important;
  }

  #lb-image,
  .lb-slide-img {
    max-height: calc(100vh - 120px);
    border-radius: 0;
  }

  #lb-close {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
  }
}


/* ══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 480px)
   ══════════════════════════════════════════════════════ */

@media (max-width: 480px) {

  /* Hero */
  .gallery-hero-visual {
    height: 220px;
  }

  .gallery-hero-stats {
    gap: 12px;
    margin-top: 24px;
  }

  /* Albums — single column on very small screens */
  #album-grid {
    grid-template-columns: 1fr;
  }

  /* Filter — scrollable row, no wrap */
  #filter-wrap {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .gallery-filter-btn {
    padding: 7px 16px;
    font-size: 0.78rem;
  }

  /* Event hero */
  .event-hero-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .event-hero-counts {
    gap: 8px;
  }

  .event-count-pill {
    font-size: 0.75rem;
    padding: 6px 14px;
  }

  /* Photo grid */
  #photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Video grid — single column */
  #video-grid {
    grid-template-columns: 1fr;
  }

  /* Gallery CTA */
  .gallery-cta-actions {
    flex-direction: column;
    align-items: center;
  }

  .gallery-cta-actions .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}


/* ══════════════════════════════════════════════════════
   RESPONSIVE — VERY SMALL MOBILE (≤ 360px)
   ══════════════════════════════════════════════════════ */

@media (max-width: 360px) {

  .gallery-hero-h1 {
    font-size: 2rem;
  }

  .gallery-hero-visual {
    height: 190px;
  }

  .gallery-hero-card:nth-child(2) { display: none; }
  .gallery-hero-card:nth-child(1) { width: 90%; height: 85%; right: 5%; }

  #photo-grid {
    grid-template-columns: 1fr 1fr;
  }

  .album-card-title {
    font-size: 1rem;
  }
}


/* ══════════════════════════════════════════════════════
   RESPONSIVE — WIDE SCREENS (≥ 1440px)
   ══════════════════════════════════════════════════════ */

@media (min-width: 1440px) {

  #album-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #photo-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  #video-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1920px) {
  #album-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* ══════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

  .album-card,
  .album-card-img,
  .photo-thumb-img,
  .video-card,
  .video-card-thumb,
  .video-card-play,
  .event-back-btn svg,
  .gallery-filter-btn {
    transition: none !important;
    animation: none !important;
  }

  #gallery-lightbox,
  #video-modal {
    animation: none !important;
  }

  #lb-image,
  .lb-slide-img,
  .lb-strip {
    animation: none !important;
  }
}
