/* ═══════════════════════════════════════════════
   GALLERY PAGE — So-Rig Institute
   Dedicated stylesheet for page-gallery.php
   ═══════════════════════════════════════════════ */

/* ── 1. HERO HEADER ──────────────────────────── */
.gallery-hero {
  position: relative;
  background: linear-gradient(135deg, #0a1628 0%, #0f2847 50%, #0b56c7 100%);
  padding: 120px 0 64px;
  overflow: hidden;
  text-align: center;
}
.gallery-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('') center/cover no-repeat;
  opacity: 0.12;
  z-index: 0;
}
.gallery-hero .container {
  position: relative;
  z-index: 1;
}
.gallery-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  padding: 8px 20px;
  font-family: var(--sorig-font-body);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.gallery-hero__kicker i {
  font-size: 14px;
  color: #3f8cff;
}
.gallery-hero__title {
  font-family: var(--sorig-font-heading);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin: 0 0 20px;
  letter-spacing: -0.03em;
}
.gallery-hero__title span {
  color: #3f8cff;
}
.gallery-hero__lead {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: rgba(255, 255, 255, 0.75);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── 2. STORY + SEO SECTION ──────────────────── */
.college-gallery-story {
  padding: 60px 0 0;
  background: #ffffff;
}
.college-gallery-story__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: start;
}
.college-gallery-story__main .section-kicker {
  display: inline-block;
  font-family: var(--sorig-font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--sorig-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.college-gallery-story__main h2 {
  font-family: var(--sorig-font-heading);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: #101828;
  line-height: 1.25;
  margin: 0 0 18px;
}
.college-gallery-story__main p {
  font-size: 1rem;
  color: #334155;
  line-height: 1.75;
  margin: 0;
}
.college-gallery-story__seo {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 32px;
}
.college-gallery-story__seo h3 {
  font-family: var(--sorig-font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #101828;
  margin: 0 0 12px;
}
.college-gallery-story__seo p {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.7;
  margin: 0;
}

/* ── 3. HIGHLIGHT CARDS ──────────────────────── */
.college-gallery-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 48px 0 80px;
}
.college-gallery-highlight {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 32px 28px;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.college-gallery-highlight:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(11, 86, 199, 0.08);
}
.college-gallery-highlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sorig-primary), var(--sorig-secondary));
  border-radius: 5px 5px 0 0;
}
.college-gallery-highlight .hl-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--sorig-primary), var(--sorig-secondary));
  border-radius: 5px;
  color: #ffffff;
  font-size: 20px;
  margin-bottom: 18px;
}
.college-gallery-highlight h4 {
  font-family: var(--sorig-font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #101828;
  margin: 0 0 10px;
}
.college-gallery-highlight p {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.65;
  margin: 0;
}

/* ── 4. FILTER TABS ──────────────────────────── */
.gallery-section {
  padding: 0 0 80px;
  background: #f8fafc;
}
.gallery-tabs-wrapper {
  padding: 48px 0 32px;
  text-align: center;
}
.gallery-filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 6px;
}
.gallery-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: 5px;
  background: transparent;
  font-family: var(--sorig-font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.gallery-tab:hover {
  background: #f1f5f9;
  color: #101828;
}
.gallery-tab.is-active {
  background: linear-gradient(135deg, var(--sorig-primary), var(--sorig-secondary));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(11, 86, 199, 0.25);
}
.gallery-tab .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  line-height: 1;
}
.gallery-tab.is-active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

/* ── 5. GALLERY GRID ─────────────────────────── */
.gallery-grid {
  display: grid;
  gap: 20px;
  padding: 0 0 48px;
}
.gallery-grid--3-cols { grid-template-columns: repeat(3, 1fr); }
.gallery-grid--2-cols { grid-template-columns: repeat(2, 1fr); }
.gallery-grid--4-cols { grid-template-columns: repeat(4, 1fr); }
.gallery-grid--1-cols { grid-template-columns: 1fr; }

/* Cinematic mosaic spans */
.gallery-grid--cinematic .gallery-grid__item--wide {
  grid-column: span 2;
}
.gallery-grid--cinematic .gallery-grid__item--tall {
  grid-row: span 2;
}

.gallery-grid__item {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  background: #e2e8f0;
  aspect-ratio: 4 / 3;
}
.gallery-grid--cinematic .gallery-grid__item--wide {
  aspect-ratio: 16 / 9;
}
.gallery-grid--cinematic .gallery-grid__item--tall {
  aspect-ratio: auto;
}
.gallery-grid__link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  text-decoration: none;
}
.gallery-grid__link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-grid__link:hover img {
  transform: scale(1.06);
}

/* ── Overlay ─────────────────────────────────── */
.gallery-grid__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.15) 40%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.gallery-grid__link:hover .gallery-grid__overlay {
  opacity: 1;
}
.gallery-grid__overlay-cat {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 12px;
  background: var(--sorig-primary);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.gallery-grid__overlay-title {
  font-family: var(--sorig-font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  margin: 0;
}
.gallery-grid__overlay-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 4px;
  line-height: 1.4;
}
.gallery-grid__zoom {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 5px;
  color: #ffffff;
  font-size: 16px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-grid__link:hover .gallery-grid__zoom {
  opacity: 1;
  transform: scale(1);
}

/* ── Empty state ─────────────────────────────── */
.gallery-no-items {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  font-size: 1rem;
  line-height: 1.7;
}

/* ── 6. LIGHTBOX ─────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px;
}
.lightbox.is-open {
  display: flex;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
  line-height: 1;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 5px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}
#lightbox-title {
  font-family: var(--sorig-font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 16px 0 4px;
  text-align: center;
}
#lightbox-description {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin: 0;
}
.lightbox-counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
  line-height: 1;
}
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ── 7. RESPONSIVE ───────────────────────────── */
@media (max-width: 1024px) {
  .gallery-hero { padding: 100px 0 48px; }
  .college-gallery-story__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .college-gallery-highlights {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid--3-cols,
  .gallery-grid--4-cols {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid--cinematic .gallery-grid__item--wide {
    grid-column: span 1;
  }
}
@media (max-width: 768px) {
  .gallery-hero { padding: 90px 0 40px; }
  .college-gallery-story { padding: 56px 0 0; }
  .college-gallery-highlights {
    grid-template-columns: 1fr;
    padding: 32px 0 56px;
  }
  .gallery-filter-tabs {
    flex-direction: column;
    width: 100%;
  }
  .gallery-tab { justify-content: center; }
  .gallery-grid--3-cols,
  .gallery-grid--4-cols,
  .gallery-grid--2-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 16px; }
}
@media (max-width: 980px) {
  .gallery-grid__overlay,
  .gallery-grid__overlay-title,
  .gallery-grid__overlay-desc,
  .gallery-grid__overlay-cat,
  .gallery-grid__zoom {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
@media (max-width: 480px) {
  .gallery-hero { padding: 80px 0 32px; }
  .gallery-grid--3-cols,
  .gallery-grid--4-cols,
  .gallery-grid--2-cols {
    grid-template-columns: 1fr;
  }
  .gallery-grid__overlay,
  .gallery-grid__overlay-title,
  .gallery-grid__overlay-desc,
  .gallery-grid__overlay-cat,
  .gallery-grid__zoom {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}