/* ==========================================================================
   MVM CBSE TRICHY - SCHOOL EVENTS GALLERY PAGE
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-page: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #475569;
  --primary: #4f46e5;
  --secondary: #0284c7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
}

.gallery-hero {
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.gallery-hero-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.gallery-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 0.28rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 0.6rem;
}

.gallery-hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.15;
}

.gallery-hero p {
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-size: 0.95rem;
}

.gallery-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.gallery-search-wrap {
  position: relative;
  min-width: 240px;
}

.gallery-search-wrap i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.88rem;
}

.gallery-search-wrap input {
  width: 100%;
  padding: 0.62rem 0.9rem 0.62rem 2.35rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #f8fafc;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.gallery-search-wrap input:focus {
  border-color: var(--primary);
  background: #ffffff;
}

.btn-gallery-nav {
  padding: 0.62rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #ffffff;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-gallery-nav:hover {
  background: #f1f5f9;
}

.btn-gallery-primary {
  background: linear-gradient(135deg, #4f46e5, #0284c7);
  border: none;
  color: #ffffff;
}

.btn-gallery-primary:hover {
  background: linear-gradient(135deg, #4338ca, #0369a1);
}

.gallery-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.event-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.06);
}

.event-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #ffffff;
}

.event-card-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.event-meta-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.event-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.7rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.event-badge.photos {
  background: #e0e7ff;
  color: #3730a3;
}

.event-badge.videos {
  background: #e0f2fe;
  color: #0369a1;
}

.event-media-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.media-sub-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
}

.photo-tile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  cursor: pointer;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-tile:hover img {
  transform: scale(1.04);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.video-tile {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #0f172a;
}

.video-tile video {
  width: 100%;
  max-height: 240px;
  display: block;
}

.gallery-empty {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.gallery-empty i {
  font-size: 2.75rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

/* Lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.88);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-backdrop.open {
  display: flex;
}

.lightbox-content {
  max-width: 92vw;
  max-height: 86vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  color: #e2e8f0;
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.lightbox-close { top: 1.25rem; right: 1.25rem; }
.lightbox-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }
