/* ======================================================
   Gallery Page (Refined to match Research Page aesthetics)
   — Typography, spacing, animations harmonized
   — SVG + background colors left untouched
====================================================== */


body, header, nav, footer {
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
  color: var(--text-color, #111);
  background: var(--bg-light, #fff);
}

/* ----------------------------------------
   Base Page Styles
---------------------------------------- */
.gallery-page {
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  color: var(--text-color, #111);
  background: var(--bg-light, #fff);
  line-height: 1.7;
  font-size: 1rem;
  margin: 0;
  padding: 0rem;
}

/* ----------------------------------------
   Scroll Fade / Visibility Animation
---------------------------------------- */
.fade-init {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-section.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------
   Headings & Text
---------------------------------------- */
.gallery-page h1,
.gallery-page h2 {
  text-align: center;
  color: var(--text-color, #111);
  line-height: 1.25;
  font-weight: bold;
  margin: 0 0 1rem;
}
.gallery-page h1 {
  font-size: clamp(1.8rem, 2.4vw, 2.1rem);
  margin-bottom: 1.25rem;
  font-weight: 700;
}

.gallery-page h2 {
  font-size: clamp(1.5rem, 2vw, 1.6rem);
  font-weight: bold;
  margin-bottom: 1rem;
}

/* Match Research paragraph sizing & line height */
.gallery-page p,
.overlay-description,
.overlay-credits {
  font-size: clamp(1.05rem, 1.2vw, 1.15rem);
  line-height: 1.8;
  color: var(--text-muted, #444);
  font-weight: 400;
}

/* ----------------------------------------
   Section Wrappers (Background colors unchanged)
---------------------------------------- */
.section-wrapper {
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
  padding-top: 1rem;
}


.intro-wrapper { background: #fff; }
.covers-wrapper { background: #d6e2f3; }
.contest-wrapper { background: #f3eff3; }
.electron-wrapper { background: #f3e1d6; }

/* Inner Containers */
.section-wrapper .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 0rem 0rem 0rem;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 3rem);
  animation: fadeUp 1.2s ease-out both;
}


/* ----------------------------------------
   SVG Dividers (Do Not Modify)
---------------------------------------- */
.divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.divider svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80px; /* ← adjust 60–100px range to taste */
}

/* ----------------------------------------
   Covers Grid
---------------------------------------- */
.covers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(1.5rem, 3vw, 3rem);
  justify-content: center;
  justify-items: center;
  align-items: start;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
	padding-bottom: 1rem;
}

.cover-item {
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
  max-width: 360px;
  transition: transform .32s, box-shadow .32s;
}
.cover-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.cover-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 14px 36px rgba(95, 141, 211, 0.18);
}

/* ----------------------------------------
   Contest Section
---------------------------------------- */
.contest-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}

.contest-item {
  background: #fff;
  border-radius: 10px;
  padding: clamp(1rem, 2vw, 1.5rem);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contest-image-wrapper {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3; /* or whatever your images naturally are */
}

.contest-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* fills the wrapper while respecting aspect ratio */
  border-radius: inherit;
  display: block;
}

.overlay-description {
  font-weight: 400;
  color: var(--text-color, #111);
  font-size: clamp(1.05rem, 1.2vw, 1.15rem);
  line-height: 1.8;
}

.overlay-credits {
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-muted, #555);
  font-style: italic;
  line-height: 1.7;
}

/* ----------------------------------------
   Electron Gallery (Wider + better text layout)
---------------------------------------- */
.electron-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(1.5rem, 3vw, 2rem);
  margin-top: clamp(1.5rem, 3vw, 3rem);
  padding-bottom: 80px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.electron-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform .25s, box-shadow .25s;
}

.electron-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.08);
}

.electron-item img {
  border-radius: inherit;
  overflow: hidden;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Improved text overlay */
.electron-title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255,255,255,0.9);
  color: #222;
  font-weight: 400;
  font-size: clamp(1.05rem, 1.2vw, 1.15rem);
  line-height: 1.8;
  padding: 0.75rem 1rem;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  text-align: left;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity .3s ease-in-out;
  pointer-events: none;
}
.electron-item:hover .electron-title {
  opacity: 1;
}

/* Responsive: stacked and readable on mobile */
@media (max-width: 900px) {
  .electron-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-width: 95%;
  }
}

@media (max-width: 600px) {
  .electron-grid {
    grid-template-columns: 1fr;
  }
  .electron-title {
    position: static;
    opacity: 1;
    background: none;
    text-align: left;
    padding: 0.5rem 0;
    margin-top: 0.25rem;
  }
}
/* ----------------------------------------
   Lightbox Overlay (Unchanged)
---------------------------------------- */
#lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 2rem;
  box-sizing: border-box;
}

#lightbox-overlay.active { display: flex; }

.lightbox-content {
  max-width: 1000px;
  width: 90%;
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#lightbox-image {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  margin-bottom: 1rem;
  object-fit: contain;
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.4rem;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  z-index: 10000;
  transition: color 0.2s, transform 0.12s;
}

#lightbox-close:hover {
  color: #ff6b6b;
  transform: scale(1.06);
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.9rem;
  color: #fff;
  cursor: pointer;
  width: 50px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  background: rgba(0, 0, 0, 0.42);
  border-radius: 50%;
  transition: background 0.25s, transform 0.15s;
  z-index: 10000;
}

.lightbox-arrow:hover {
  background: rgba(95, 141, 211, 0.6);
  transform: translateY(-50%) scale(1.08);
}

#lightbox-prev { left: 28px; }
#lightbox-next { right: 28px; }

#lightbox-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0.5rem 0 0.6rem;
}

#lightbox-description {
  font-size: 1rem;
  color: #e6eef8;
  line-height: 1.6;
  margin: 0.4rem auto 0.8rem;
  max-width: 80ch;
  text-align: justify;
}

#lightbox-credits {
  font-size: 0.9rem;
  font-style: italic;
  color: #cfcfcf;
  max-width: 70ch;
  text-align: center;
}

/* ----------------------------------------
   Responsive Adjustments
---------------------------------------- */
@media (max-width: 992px) {
  .covers-grid, .contest-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .electron-grid { grid-template-columns: 1fr; }
  .electron-title {
    position: static;
    opacity: 1;
    background: none;
    text-align: center;
    margin-top: 0.5rem;
  }
}
