/* Gallery Page */

.gallery-main {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 40px 100px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: rgba(18, 24, 39, 0.75);
  border: 1px solid rgba(154, 209, 255, 0.25);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 45px rgba(5, 10, 30, 0.45);
}

.gallery-tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #cbd6e6;
  background: rgba(12, 18, 32, 0.65);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: none;
}

.gallery-tab-button:hover,
.gallery-tab-button:focus-visible {
  color: #f8fbff;
  border-color: rgba(154, 209, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(82, 140, 255, 0.35);
  outline: none;
}

.gallery-tab-button.active {
  color: #0a0a0a;
  background: linear-gradient(135deg, #2563eb, #60a5fa, #a78bfa);
  border-color: rgba(154, 209, 255, 0.65);
  box-shadow: 0 18px 38px rgba(56, 129, 212, 0.45);
}

.gallery-panel {
  display: none;
  flex-direction: column;
  gap: 24px;
  animation: gallery-panel-fade 0.6s ease forwards;
}

.gallery-panel.active {
  display: flex;
}

@keyframes gallery-panel-fade {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-panel-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-panel-description {
  color: #cbd6e6;
  font-size: 1.05rem;
  max-width: 60ch;
}

.gallery-panel-description a {
  color: inherit;
  text-decoration: underline;
}

.gallery,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  width: 100%;
  align-items: start;
  justify-items: start;
}

.gallery {
  padding: 40px 80px;
}

.gallery-item {
  position: relative;
  display: flex;
  border-radius: 18px;
  background: rgba(20, 30, 45, 0.35);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  z-index: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: background, box-shadow;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-width: 500px;
  width: 100%;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: block;
  transition: filter 0.3s ease;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.gallery-item:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 25px rgba(210, 220, 255, 0.45);
  z-index: 2;
}

.gallery-item:hover img {
  filter: brightness(1.1);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  max-width: 80%;
  max-height: 80%;
  border-radius: 10px;
  animation: fadeInScale 0.4s ease;
}

.close {
  position: absolute;
  top: 30px;
  right: 50px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: #b5b5ff;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Multi-Section Gallery Layout */
.gallery-sections {
  width: 100%;
  max-width: 1400px; /* controls total width on very large screens */
  margin: 0 auto;
  padding: 40px 60px;
  display: flex;
  flex-direction: column;
  gap: 100px; /* space between sections */
}

.gallery-section {
  width: 100%;
}

.gallery-section-title {
  font-size: 2rem;
  color: #9ad1ff;
  margin-bottom: 25px;
  text-align: left;
  text-shadow: 1px 1px 6px rgba(0,0,0,0.6);
  padding-left: 10px;
}

/* Video Subsections */
.video-subsection {
  margin-bottom: 60px;
}

.video-subsection:last-child {
  margin-bottom: 0;
}

.video-subsection-title {
  font-size: 1.5rem;
  color: #a78bfa;
  margin-bottom: 20px;
  margin-top: 0;
  text-align: left;
  text-shadow: 1px 1px 6px rgba(0,0,0,0.6);
  padding-left: 10px;
  font-weight: 600;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  width: 100%;
  align-items: start;
  justify-items: start;
}

.video-item {
  position: relative;
  display: flex;
  border-radius: 18px;
  background: rgba(20, 30, 45, 0.35);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  z-index: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: background, box-shadow;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-width: 500px;
  width: 100%;
}

.video-item iframe {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
  display: block;
  transition: filter 0.3s ease;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.video-item:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 25px rgba(210, 220, 255, 0.45);
  z-index: 2;
}

.video-item:hover iframe {
  filter: brightness(1.1);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .gallery,
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
  }
  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
  }
  .gallery-main {
    padding: 30px 20px 80px;
  }
  .gallery {
    padding: 32px 24px;
  }
}

@media (max-width: 600px) {
  .gallery,
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
  }
  .video-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .gallery {
    padding: 24px 16px;
  }
  .gallery-tabs {
    gap: 10px;
    padding: 12px;
  }
  .gallery-tab-button {
    flex: 1 1 100%;
    width: 100%;
  }
}

