/* ============================================================
   gallery.css — Soroban Abacus | Gallery Page Styles
   ============================================================ */

/* ─── HERO ───────────────────────────────────────────────────── */
#gallery-hero {
  position: relative;
  background: var(--cream);
  padding: calc(var(--nav-h) + 60px) 0 0;
  overflow: hidden;
  text-align: center;
}
.gallery-hero-bg {
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='3' fill='%230f172a' fill-opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}
.gallery-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin-inline: auto;
  padding-bottom: 0;
}
.gallery-hero-inner .tag {
  margin-bottom: 1.2rem;
}
.gallery-hero-inner .tag::before { }
.gallery-hero-title {
  font-family: 'Fredoka One', var(--font-head);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 1.1rem;
}
.gallery-hero-title span { color: var(--gold); }
.gallery-hero-sub {
  font-size: 1.05rem;
  color: var(--text-body);
  line-height: 1.75;
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 2.5rem;
}

/* ─── Filter tabs ────────────────────────────────────────────── */
.gallery-filters {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  padding-bottom: 0;
  position: relative;
  z-index: 2;
}
.gf-btn {
  padding: 0.55rem 1.3rem;
  border-radius: 50px;
  border: 1.5px solid rgba(92,31,58,0.20);
  background: rgba(255,255,255,0.65);
  color: var(--text-dark);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2rem;
}
.gf-btn:hover {
  background: rgba(92,31,58,0.08);
  border-color: var(--maroon);
  color: var(--maroon);
}
.gf-btn.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--white);
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(92,31,58,0.28);
}


/* ─── GALLERY SECTIONS ───────────────────────────────────────── */
.gallery-section { transition: opacity 0.4s ease; }
.gallery-section.hidden { display: none; }

.bg-alt { background: #FAF5E8; }

/* Section header */
.gsec-header {
  text-align: center;
  margin-bottom: 3rem;
}
.gsec-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--maroon);
  background: rgba(92,31,58,0.07);
  border: 1px solid rgba(92,31,58,0.15);
  border-radius: 50px;
  padding: 0.4rem 1.1rem;
  margin-bottom: 1rem;
}
.bg-alt .gsec-label { background: rgba(92,31,58,0.10); }
.gsec-title {
  font-family: 'Fredoka One', var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 0.8rem;
}
.gsec-title span { color: var(--gold); }
.gsec-sub {
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 580px;
  margin-inline: auto;
}


/* ─── FEATURED VIDEO (Abacus) ────────────────────────────────── */
.featured-video-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--maroon-deeper), var(--maroon));
  border: 1px solid rgba(245,166,35,0.15);
}
.fv-video-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.fv-video-wrap .gal-video {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
  background: #000;
}
.fv-badge {
  position: absolute;
  top: 14px; left: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-dark);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  letter-spacing: 0.05em;
  z-index: 3;
  display: flex; align-items: center; gap: 0.35rem;
}
.fv-info {
  padding: 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}
.fv-info h3 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
}
.fv-info p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.75;
}

@media (max-width: 860px) {
  .featured-video-card { grid-template-columns: 1fr; }
  .fv-info { padding: 1.8rem; }
}


/* ─── VIDEO GRIDS ────────────────────────────────────────────── */
/* Landscape grid — 2 cols */
.gal-grid--landscape {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
/* Portrait grid — 5 cols for vertical mobile videos */
.gal-grid--portrait {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.2rem;
}

@media (max-width: 1024px) {
  .gal-grid--portrait { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .gal-grid--landscape { grid-template-columns: 1fr; }
  .gal-grid--portrait  { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
}
@media (max-width: 480px) {
  .gal-grid--portrait  { grid-template-columns: 1fr 1fr; }
}


/* ─── VIDEO CARD ─────────────────────────────────────────────── */
.gal-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, var(--maroon-deeper), var(--maroon-dark));
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.gal-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: var(--shadow-lg);
}
.gal-card.playing {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* Video wrap — landscape 16:9 */
.gal-video-wrap.landscape {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #000;
}
/* Video wrap — portrait 9:16 */
.gal-video-wrap.portrait {
  position: relative;
  aspect-ratio: 9/16;
  overflow: hidden;
  background: #000;
}
.gal-video {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
  background: #000;
}

/* Overlay gradient */
.gal-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(92,31,58,0.50) 0%, transparent 55%);
  pointer-events: none;
  transition: opacity var(--transition);
}
.gal-card.playing .gal-overlay { opacity: 0.15; }

/* Play / Pause button */
.gal-play-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(232,185,32,0.92);
  border: none;
  color: var(--navy-dark);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: opacity var(--transition), transform var(--transition), background var(--transition);
  z-index: 2;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  cursor: pointer;
  opacity: 1;
}
.gal-play-btn:hover {
  background: var(--gold-light);
  transform: translate(-50%, -50%) scale(1.15);
}
/* Hide button entirely while video is playing */
.gal-card.playing .gal-play-btn {
  opacity: 0;
  pointer-events: none;
}
/* Also hide for featured card */
.featured-video-card.playing .gal-play-btn {
  opacity: 0;
  pointer-events: none;
}

/* Cards info strip below video */
.gal-card-info {
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.gal-card-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  line-height: 1.3;
  margin: 0;
}

/* Category badges */
.gal-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 50px;
  letter-spacing: 0.04em;
  width: fit-content;
}
.gal-cat-badge.abacus      { background: rgba(92,31,58,0.20);  color: #f0a0b8; }
.gal-cat-badge.vedic       { background: rgba(245,166,35,0.22); color: #f7be5c; }
.gal-cat-badge.rubik       { background: rgba(107,63,160,0.22); color: #c4a0e8; }
.gal-cat-badge.testimonial { background: rgba(245,166,35,0.22); color: var(--amber-light); }


/* ─── CTA BANNER ─────────────────────────────────────────────── */
#gallery-cta {
  position: relative;
  overflow: hidden;
  padding: 100px 0;
  text-align: center;
  background: #C8DDFF; /* flat pastel sky blue */
}

/* 5-colour stripe bar */
#gallery-cta .cta-stripe {
  display: flex;
  height: 10px;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
}
#gallery-cta .cta-stripe span { flex: 1; display: block; }
#gallery-cta .cta-stripe span:nth-child(1) { background: #FF85A8; }
#gallery-cta .cta-stripe span:nth-child(2) { background: #FFB07A; }
#gallery-cta .cta-stripe span:nth-child(3) { background: #FFFE99; }
#gallery-cta .cta-stripe span:nth-child(4) { background: #96F5A8; }
#gallery-cta .cta-stripe span:nth-child(5) { background: #99BBFF; }

/* Pastel colour dots */
#gallery-cta .cta-dot {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.42;
}
#gallery-cta .cta-dot-1 { width: 170px; height: 170px; background: #96F5A8; top: -35px; left: -35px; }
#gallery-cta .cta-dot-2 { width: 120px; height: 120px; background: #FF85A8; bottom: -25px; right: -25px; }
#gallery-cta .cta-dot-3 { width: 85px;  height: 85px;  background: #FFFE99; bottom: 30px; left: 20%; }
#gallery-cta .cta-dot-4 { width: 65px;  height: 65px;  background: #FFB07A; top: 25px; right: 18%; }

.gallery-cta-inner { position: relative; z-index: 2; max-width: 600px; margin-inline: auto; }
.gallery-cta-inner .tag {
  color: var(--maroon);
  background: rgba(92,31,58,0.08);
  border-color: rgba(92,31,58,0.22);
}
.gallery-cta-inner .tag::before { color: var(--maroon); }
.gallery-cta-inner h2 {
  font-family: 'Fredoka One', var(--font-head);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: var(--maroon-dark);
  font-weight: 400;
  margin-bottom: 0.9rem;
  line-height: 1.25;
}
.gallery-cta-inner h2 span { color: var(--maroon); }
.gallery-cta-inner p {
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 2rem;
}
.gallery-cta-actions {
  display: flex; gap: 1rem;
  justify-content: center; flex-wrap: wrap;
}

/* Primary button — solid hot pink */
.cta-gold {
  background: #FF85A8;
  color: #4a0020;
  box-shadow: 0 6px 20px rgba(255,133,168,0.45);
  border: none;
  font-weight: 700;
}
.cta-gold:hover {
  transform: translateY(-3px);
  background: #ff6d96;
  box-shadow: 0 12px 30px rgba(255,133,168,0.55);
}

#gallery-cta .btn-outline {
  border-color: var(--navy);
  color: var(--navy);
}
#gallery-cta .btn-outline:hover {
  background: rgba(37,99,235,0.08);
}
#gallery-about { background: #FAF5E8; }

.gabout-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 5rem;
}
.gabout-row:last-child { margin-bottom: 0; }

/* Reverse: text left, image right */
.gabout-row--reverse .gabout-img-wrap { order: 2; }
.gabout-row--reverse .gabout-text     { order: 1; }

.gabout-img-wrap {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--light-gray);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-md);
}

.gabout-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s ease;
}
.gabout-row:hover .gabout-img-wrap img { transform: scale(1.04); }

.gabout-text .tag { margin-bottom: 1rem; }

.gabout-heading {
  font-family: 'Fredoka One', var(--font-head);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.25;
  margin-bottom: 1.1rem;
}

.gabout-text p {
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.85;
}
.gabout-text p strong { color: var(--navy); }

@media (max-width: 800px) {
  .gabout-row,
  .gabout-row--reverse { grid-template-columns: 1fr; gap: 1.8rem; }
  .gabout-row--reverse .gabout-img-wrap { order: 0; }
  .gabout-row--reverse .gabout-text     { order: 0; }
  .gabout-row { margin-bottom: 3.5rem; }
}


/* ─── PHOTO COLLAGE ──────────────────────────────────────────── */
#gallery-collage {
  background: #FAF5E8;
  padding: 0 0 90px;
}

.collage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 10px;
}

.collage-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--light-gray);
}

.collage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}
.collage-item:hover img { transform: scale(1.06); }

/* Spanning variants */
.collage-tall  { grid-row: span 2; }
.collage-wide  { grid-column: span 2; }

@media (max-width: 760px) {
  .collage-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
  }
  .collage-tall  { grid-row: span 1; }
  .collage-wide  { grid-column: span 1; }
}

@media (max-width: 480px) {
  .collage-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 130px; gap: 6px; }
}


/* ─── CTA — text overrides (dark on pastel blue background) ─── */
#gallery-cta::before { content: none; } /* remove old dot pattern overlay */

/* These override the higher-up declarations to guarantee dark text */
.gallery-cta-inner { position: relative; z-index: 2; max-width: 600px; margin-inline: auto; }
.gallery-cta-inner .tag {
  color: var(--maroon) !important;
  background: rgba(92,31,58,0.10) !important;
  border-color: rgba(92,31,58,0.25) !important;
}
.gallery-cta-inner .tag::before { color: var(--maroon) !important; }
.gallery-cta-inner h2 {
  font-family: 'Fredoka One', var(--font-head);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: var(--maroon-dark) !important;
  font-weight: 400;
  margin-bottom: 0.9rem;
  line-height: 1.25;
}
.gallery-cta-inner h2 span { color: var(--maroon) !important; }
.gallery-cta-inner p {
  color: var(--text-body) !important;
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 2rem;
}
.gallery-cta-actions {
  display: flex; gap: 1rem;
  justify-content: center; flex-wrap: wrap;
}
.cta-gold {
  background: #FF85A8;
  color: #4a0020;
  box-shadow: 0 6px 20px rgba(255,133,168,0.45);
  border: none;
  font-weight: 700;
}
.cta-gold:hover {
  transform: translateY(-3px);
  background: #ff6d96;
  box-shadow: 0 12px 30px rgba(255,133,168,0.55);
}


/* ─── Scroll Reveal ──────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
