/* ============================================================
   GALLERY PAGE — Section Styles
   ============================================================ */

/* ─── Gallery Hero ────────────────────────────────────────── */
.gallery-hero {
  position: relative;
  height: 55vh;
  min-height: 480px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-height);
}

.gallery-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.gallery-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.05);
  transition: transform 6s ease;
}

.gallery-hero.loaded .gallery-hero-bg img { transform: scale(1); }

.gallery-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 111, 191, 0.75) 0%,
    rgba(10, 30, 60, 0.90) 100%
  );
  z-index: 1;
}

.gallery-hero-content {
  position: relative;
  z-index: 2;
  padding-inline: var(--container-pad);
  max-width: var(--container-wide);
  margin-inline: auto;
  width: 100%;
}

/* ─── Filter Bar ──────────────────────────────────────────── */
.gallery-filter-bar {
  background: var(--white);
  position: sticky;
  top: var(--nav-height);
  z-index: var(--z-dropdown);
  border-bottom: 1px solid var(--light-grey);
  box-shadow: 0 4px 24px rgba(26,111,191,0.07);
  transition: box-shadow var(--transition-base);
}

.gallery-filter-bar.is-stuck {
  box-shadow: 0 6px 32px rgba(26,111,191,0.14);
}

.gallery-filter-inner {
  max-width: var(--container-wide);
  margin-inline: auto;
  padding: 1.1rem var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-family: var(--font-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--light-grey);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-spring);
  white-space: nowrap;
  user-select: none;
}

.filter-tab:hover {
  color: var(--sky-blue);
  background: var(--sky-blue-soft);
  border-color: rgba(26,111,191,0.15);
}

.filter-tab.active {
  background: var(--sky-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(26,111,191,0.28);
}

.filter-tab i {
  font-size: 0.8rem;
}

.gallery-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--light-grey);
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem;
  transition: all var(--transition-base);
}

.gallery-search:focus-within {
  background: white;
  border-color: var(--sky-blue);
  box-shadow: 0 0 0 3px rgba(26,111,191,0.1);
}

.gallery-search i {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.gallery-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--charcoal);
  width: 160px;
}

.gallery-search-input::placeholder {
  color: var(--text-muted);
}

/* ─── Gallery Grid ────────────────────────────────────────── */
.gallery-main {
  background: var(--off-white);
  padding: 3rem 0 5rem;
}

.gallery-container {
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.gallery-grid {
  columns: 4;
  column-gap: 1rem;
  transition: all var(--transition-slow);
}

.gallery-card {
  break-inside: avoid;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: block;
}

/* Size variants for visual variety */
.gallery-card--tall img   { aspect-ratio: 2/3; }
.gallery-card--wide img   { aspect-ratio: 16/9; }
.gallery-card--square img { aspect-ratio: 1; }
.gallery-card--short img  { aspect-ratio: 4/3; }

.gallery-card img {
  width: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-card:hover img {
  transform: scale(1.08);
}

/* Hover overlay */
.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(10, 30, 60, 0.85) 0%,
    rgba(26, 111, 191, 0.3) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
}

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

.gallery-card-info {
  transform: translateY(8px);
  transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-card-info {
  transform: translateY(0);
}

.gallery-card-cat {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.25rem;
}

.gallery-card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: white;
  line-height: 1.3;
}

/* Zoom icon */
.gallery-card-zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  opacity: 0;
  transition: all var(--transition-spring);
}

.gallery-card:hover .gallery-card-zoom {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Hidden state for filtering */
.gallery-card.hidden {
  display: none;
}

/* Fade in animation */
.gallery-card.fade-in {
  animation: galleryFadeIn 0.4s ease forwards;
}

@keyframes galleryFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── Empty State ─────────────────────────────────────────── */
.gallery-empty {
  display: none;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}

.gallery-empty.visible {
  display: block;
}

.gallery-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--mid-grey);
}

.gallery-empty h4 {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* ─── Load More ───────────────────────────────────────────── */
.gallery-load-more {
  text-align: center;
  margin-top: 3rem;
}

/* ─── Gallery Count ───────────────────────────────────────── */
.gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.gallery-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.gallery-count strong {
  color: var(--sky-blue);
  font-weight: 700;
}

.gallery-view-toggle {
  display: flex;
  gap: 0.4rem;
}

.view-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--light-grey);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  font-size: 0.85rem;
}

.view-btn.active,
.view-btn:hover {
  background: var(--sky-blue);
  color: white;
}

/* Grid view variants */
.gallery-grid.view-3 { columns: 3; }
.gallery-grid.view-2 { columns: 2; }

/* ─── Category Feature Sections ──────────────────────────── */
.gallery-feature {
  background: var(--charcoal);
  padding: 5rem var(--container-pad);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gallery-feature-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.gallery-feature-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.1;
}

.gallery-feature-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin-inline: auto;
}

/* ─── Lightbox Custom Overrides ───────────────────────────── */
.glightbox-clean .gslide-description {
  background: rgba(10,20,40,0.95);
  backdrop-filter: blur(20px);
}

.glightbox-clean .gslide-title {
  font-family: var(--font-secondary);
  font-weight: 700;
  color: white;
}

.glightbox-clean .gslide-desc {
  color: rgba(255,255,255,0.65);
  font-size: var(--text-sm);
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 1200px) {
  .gallery-grid { columns: 3; }
  .gallery-grid.view-3 { columns: 3; }
  .gallery-grid.view-2 { columns: 2; }
}

@media (max-width: 900px) {
  .gallery-grid         { columns: 2; }
  .gallery-grid.view-3  { columns: 2; }
  .gallery-filter-inner { justify-content: center; }
  .gallery-search       { display: none; }
}

@media (max-width: 640px) {
  .gallery-grid         { columns: 1; }
  .gallery-grid.view-3  { columns: 1; }
  .gallery-grid.view-2  { columns: 1; }
  .filter-tabs          { justify-content: center; }
  .filter-tab           { font-size: var(--text-xs); padding: 0.45rem 0.875rem; }
}

/* ─── Loading Skeleton ────────────────────────────────────── */
.gallery-skeleton {
  background: linear-gradient(
    90deg,
    var(--light-grey) 25%,
    #e8edf2 50%,
    var(--light-grey) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease infinite;
  border-radius: var(--radius-lg);
  pointer-events: none;
}

/* Give skeletons a visible height matching the size variants */
.gallery-skeleton.gallery-card--tall   { padding-top: calc(100% * 3/2); }
.gallery-skeleton.gallery-card--wide   { padding-top: calc(100% * 9/16); }
.gallery-skeleton.gallery-card--square { padding-top: 100%; }
.gallery-skeleton.gallery-card--short  { padding-top: calc(100% * 3/4); }

@keyframes skeletonShimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}
