/* ============================================================
   gallery.css — Missahoe Montessori School
   Uniform with about/programs design system
   desktop · tablet · mobile
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  color: #2d2d2d;
  background: #ffffff;
  line-height: 1.65;
  overflow-x: hidden;
}
a   { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

:root {
  --teal:    #58d4f0;
  --gold:    #cfa900;
  --gold-dk: #a88200;
  --dark:    #0b3d2e;
  --text:    #444;
  --light:   #f7fbfd;
  --radius:  14px;
  --shadow:  0 8px 32px rgba(0,0,0,0.08);
  --header-h: 70px;
}

.container { width: 92%; max-width: 1180px; margin: 0 auto; }

/* ─────────────────────────────────────────────
   HEADER
───────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(88,212,240,0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: background 0.3s, box-shadow 0.3s;
}
.site-header.scrolled {
  background: rgba(88,212,240,1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; width: 92%; max-width: 1180px; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img  { width: 48px; height: 48px; object-fit: contain; }
.logo-name { display: block; font-size: 1rem; font-weight: 700; color: #1a1a1a; line-height: 1.2; }
.logo-tag  { display: block; font-size: 0.7rem; color: #333; }

.nav-desktop { display: flex; align-items: center; gap: 6px; }
.nav-desktop a {
  font-size: 0.9rem; font-weight: 500; color: #222;
  padding: 6px 10px; border-radius: 6px;
  transition: color 0.2s;
}
.nav-desktop a:hover, .nav-desktop a.active { color: var(--gold-dk); }
.btn-enroll {
  background: var(--gold) !important; color: #fff !important;
  padding: 8px 18px !important; border-radius: 8px !important;
  font-weight: 600 !important; transition: background 0.2s !important;
}
.btn-enroll:hover { background: var(--gold-dk) !important; }

/* ─────────────────────────────────────────────
   HAMBURGER
───────────────────────────────────────────── */
.hamburger {
  display: none; flex-direction: column; justify-content: center;
  align-items: center; gap: 5px;
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.2); border: none;
  border-radius: 9px; cursor: pointer; padding: 8px;
  z-index: 1100; transition: background 0.25s;
}
.hamburger:hover { background: rgba(207,169,0,0.2); }
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: #1a1a1a; border-radius: 3px;
  transition: transform 0.38s cubic-bezier(0.23,1,0.32,1),
              opacity 0.25s, width 0.25s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─────────────────────────────────────────────
   DRAWER
───────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(3px);
  z-index: 1050; opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }

.nav-drawer {
  position: fixed; top: 0; right: 0;
  width: 300px; max-width: 85vw; height: 100vh;
  background: #fff; z-index: 1100;
  display: flex; flex-direction: column;
  padding: 0 0 30px;
  box-shadow: -6px 0 40px rgba(0,0,0,0.14);
  transform: translateX(100%);
  transition: transform 0.42s cubic-bezier(0.23,1,0.32,1);
  overflow-y: auto;
}
.nav-drawer.open { transform: translateX(0); }

.drawer-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 24px 20px; border-bottom: 1px solid #f0f0f0; margin-bottom: 10px;
}
.drawer-brand img  { width: 38px; }
.drawer-brand span { font-weight: 700; font-size: 0.95rem; color: #1a1a1a; }

.nav-drawer a {
  display: block; padding: 13px 24px;
  font-size: 0.97rem; font-weight: 500; color: #333;
  opacity: 0; transform: translateX(16px);
  transition: background 0.2s, color 0.2s, opacity 0.35s, transform 0.35s, padding-left 0.2s;
}
.nav-drawer.open a                { opacity: 1; transform: translateX(0); }
.nav-drawer.open a:nth-child(2)   { transition-delay: 0.06s; }
.nav-drawer.open a:nth-child(3)   { transition-delay: 0.10s; }
.nav-drawer.open a:nth-child(4)   { transition-delay: 0.14s; }
.nav-drawer.open a:nth-child(5)   { transition-delay: 0.18s; }
.nav-drawer.open a:nth-child(6)   { transition-delay: 0.22s; }
.nav-drawer.open a:nth-child(7)   { transition-delay: 0.26s; }
.nav-drawer.open a:nth-child(8)   { transition-delay: 0.30s; }
.nav-drawer a:hover                { background: #f5fbfe; color: var(--gold); padding-left: 30px; }
.nav-drawer a.active               { color: var(--gold); font-weight: 600; background: rgba(207,169,0,0.07); }
.drawer-enroll {
  margin: 14px 24px 0 !important; padding: 13px 24px !important;
  background: var(--gold) !important; color: #fff !important;
  border-radius: 10px !important; text-align: center !important; font-weight: 600 !important;
}
.drawer-enroll:hover { background: var(--gold-dk) !important; padding-left: 24px !important; }

/* ─────────────────────────────────────────────
   HERO
───────────────────────────────────────────── */
.hero {
  position: relative; height: 88vh; min-height: 520px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-top: var(--header-h);
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.2s ease;
}
.hero-slide.active { opacity: 1; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.6) 100%);
  z-index: 1;
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center; color: #fff; padding: 0 20px; max-width: 720px;
}
.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700;
  line-height: 1.15; margin: 14px 0 18px;
}
.hero-content h1 em { font-style: normal; color: var(--gold); }
.hero-content p { font-size: clamp(0.95rem, 1.8vw, 1.1rem); opacity: 0.9; }

/* Scroll hint */
.scroll-hint {
  position: absolute; bottom: 32px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.75); font-size: 0.75rem;
  z-index: 2; animation: bounce 2.4s ease-in-out infinite;
}
.scroll-mouse {
  width: 22px; height: 34px;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 12px; display: flex; justify-content: center; padding-top: 5px;
}
.scroll-wheel {
  width: 3px; height: 7px;
  background: rgba(255,255,255,0.8); border-radius: 3px;
  animation: scrollWheel 1.8s ease-in-out infinite;
}
@keyframes scrollWheel {
  0%,100% { opacity: 1; transform: translateY(0); }
  50%      { opacity: 0; transform: translateY(8px); }
}
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-6px); }
}

/* ─────────────────────────────────────────────
   BADGES
───────────────────────────────────────────── */
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 50px; margin-bottom: 10px;
}
.badge-gold { background: rgba(207,169,0,0.22); color: #b08f00; }
.badge-teal { background: rgba(88,212,240,0.18); color: #0a8faa; }

/* ─────────────────────────────────────────────
   FILTER BAR
───────────────────────────────────────────── */
.filter-section {
  padding: 36px 0 0;
  background: #fff;
  position: sticky; top: var(--header-h);
  z-index: 100;
  border-bottom: 1px solid #f0f0f0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; padding-bottom: 24px;
}
.filter-btn {
  background: #f3f3f3; color: #555;
  border: none; border-radius: 50px;
  padding: 9px 22px; font-size: 0.85rem; font-weight: 500;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.2s, box-shadow 0.2s;
}
.filter-btn:hover {
  background: rgba(207,169,0,0.12); color: var(--gold-dk);
  transform: translateY(-2px);
}
.filter-btn.active {
  background: var(--gold); color: #fff;
  box-shadow: 0 4px 14px rgba(207,169,0,0.35);
}

/* ─────────────────────────────────────────────
   GALLERY SECTION
───────────────────────────────────────────── */
.gallery-section { padding: 60px 0 90px; }
.section-header  { text-align: center; margin-bottom: 50px; }
.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700;
  color: var(--dark); margin: 6px 0 12px;
}
.section-header p { color: var(--text); max-width: 520px; margin: 0 auto; font-size: 0.97rem; }

/* Masonry-style grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 16px;
}

/* ─── GALLERY ITEMS ─── */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  background: #e8f4f8;
  box-shadow: var(--shadow);
  transition: transform 0.4s cubic-bezier(0.23,1,0.32,1),
              box-shadow 0.4s ease;
}
.gallery-item:hover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: 0 24px 56px rgba(0,0,0,0.16);
  z-index: 2;
}

/* Wide item spans 2 columns */
.gallery-wide { grid-column: span 2; }

/* Tall item spans 2 rows */
.gallery-tall { grid-row: span 2; }

.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.23,1,0.32,1);
}
.gallery-item:hover img { transform: scale(1.08); }

/* Caption overlay — slides up on hover */
.gallery-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(11,61,46,0.92) 0%, transparent 100%);
  padding: 28px 18px 18px;
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.23,1,0.32,1);
  color: #fff;
}
.gallery-item:hover .gallery-caption { transform: translateY(0); }

.caption-tag {
  display: inline-block;
  background: rgba(207,169,0,0.85); color: #fff;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 50px;
  margin-bottom: 7px;
}
.gallery-caption h4 {
  font-size: 0.95rem; font-weight: 700; margin-bottom: 5px; line-height: 1.3;
}
.gallery-caption p { font-size: 0.78rem; opacity: 0.88; line-height: 1.4; }

/* Zoom icon */
.gallery-zoom-icon {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.18); backdrop-filter: blur(4px);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff;
  opacity: 0; transform: scale(0.7);
  transition: opacity 0.3s, transform 0.3s;
}
.gallery-item:hover .gallery-zoom-icon { opacity: 1; transform: scale(1); }

/* Hidden items (filter) */
.gallery-item.hidden {
  display: none;
}

/* No results */
.no-results {
  display: none; text-align: center;
  padding: 60px 20px; color: #888; font-size: 1rem;
}
.no-results.show { display: block; }

/* ─────────────────────────────────────────────
   LIGHTBOX
───────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.lightbox.open {
  opacity: 1; pointer-events: auto;
}

.lb-inner {
  position: relative;
  max-width: 88vw; max-height: 88vh;
  display: flex; flex-direction: column; align-items: center;
  gap: 0;
}
.lb-img {
  max-width: 100%; max-height: 72vh;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  object-fit: contain;
  transform: scale(0.92);
  transition: transform 0.4s cubic-bezier(0.23,1,0.32,1);
}
.lightbox.open .lb-img { transform: scale(1); }

.lb-caption-panel {
  width: 100%; background: rgba(255,255,255,0.07);
  border-radius: 0 0 12px 12px;
  padding: 16px 22px;
  color: #fff; text-align: center;
  backdrop-filter: blur(8px);
}
.lb-tag {
  display: inline-block;
  background: var(--gold); color: #fff;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 50px;
  margin-bottom: 7px;
}
.lb-caption-panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.lb-caption-panel p  { font-size: 0.82rem; opacity: 0.82; }

/* Nav buttons */
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: rgba(255,255,255,0.1);
  border: none; color: #fff; border-radius: 50%;
  cursor: pointer; backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
  font-family: inherit;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: rgba(207,169,0,0.7); transform: scale(1.1);
}
.lb-close {
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  font-size: 1.6rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lb-prev, .lb-next {
  top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px;
  font-size: 2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-prev:hover { transform: translateY(-50%) scale(1.1); }
.lb-next:hover { transform: translateY(-50%) scale(1.1); }

.lb-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.6); font-size: 0.8rem; letter-spacing: 0.06em;
}

/* ─────────────────────────────────────────────
   SCROLL ANIMATIONS (same as about/programs)
───────────────────────────────────────────── */
[data-animate] {
  opacity: 0; transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-animate="fade-up"]    { transform: translateY(40px); }
[data-animate="fade-left"]  { transform: translateX(-45px); }
[data-animate="fade-right"] { transform: translateX(45px); }
[data-animate].animated     { opacity: 1; transform: translate(0); }

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
.site-footer {
  background: #1c1c1c; color: #bbb;
  padding: 28px 0; text-align: center; font-size: 0.88rem;
}

/* ─────────────────────────────────────────────
   BACK TO TOP
───────────────────────────────────────────── */
#back-to-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 44px; height: 44px;
  background: var(--gold); color: #fff;
  border: none; border-radius: 50%; font-size: 1.1rem;
  cursor: pointer; z-index: 999;
  box-shadow: 0 4px 16px rgba(207,169,0,0.4);
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  pointer-events: none;
}
#back-to-top.show  { opacity: 1; transform: translateY(0); pointer-events: auto; }
#back-to-top:hover { background: var(--gold-dk); }

/* ═══════════════════════════════════════════
   TABLET (≤ 960px)
═══════════════════════════════════════════ */
@media (max-width: 960px) {
  .nav-desktop { display: none; }
  .hamburger   { display: flex; }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
  }
}

/* ═══════════════════════════════════════════
   MOBILE (≤ 640px)
═══════════════════════════════════════════ */
@media (max-width: 640px) {
  :root { --header-h: 62px; }
  .logo-tag { display: none; }

  .hero { height: 72vh; min-height: 400px; }

  .filter-section { position: relative; top: auto; }
  .filter-bar     { gap: 8px; }
  .filter-btn     { padding: 7px 16px; font-size: 0.78rem; }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 170px;
    gap: 12px;
  }
  /* On small screens remove span modifiers for cleaner layout */
  .gallery-wide, .gallery-tall { grid-column: span 1; grid-row: span 1; }

  /* Always show captions on mobile */
  .gallery-caption { transform: translateY(0); }
  .gallery-zoom-icon { display: none; }

  .lb-prev { left: 8px; width: 40px; height: 40px; font-size: 1.6rem; }
  .lb-next { right: 8px; width: 40px; height: 40px; font-size: 1.6rem; }

  #back-to-top { bottom: 18px; right: 18px; width: 40px; height: 40px; font-size: 1rem; }
}

/* ═══════════════════════════════════════════
   VERY SMALL (≤ 380px)
═══════════════════════════════════════════ */
@media (max-width: 380px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }
  .logo-name { font-size: 0.88rem; }
}
