/* --- GALERI DOKUMENTASI PAGE SPECIFIC STYLES --- */

/* Page Header Section (Optional) */

/* Common styles for gallery sections */
.gallery-section {
  padding: 80px 0;
  text-align: center;
}

.gallery-section.light-bg {
  background-color: var(
    --light-gray
  ); /* Assuming var(--light-gray) is defined in style.css */
}

.gallery-section.dark-bg {
  background-color: var(
    --dark-green
  ); /* Assuming var(--dark-green) is defined in style.css */
  color: var(--white);
}

.gallery-section .section-title {
  color: var(--dark-green);
  font-size: 2.8rem;
  margin-bottom: 15px;
}
.gallery-section .section-title.white-text {
  color: var(--white);
}

.gallery-section .section-subtitle {
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 50px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.gallery-section .section-subtitle.white-text {
  color: rgba(255, 255, 255, 0.8);
}

/* --- Photo Grid Styles --- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(280px, 1fr)
  ); /* Responsive grid */
  gap: 20px;
  margin-top: 40px;
}

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.photo-item img {
  width: 100%;
  height: 200px; /* Fixed height for thumbnails */
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-item:hover img {
  transform: scale(1.05);
}

.photo-item .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(
    var(--primary-rgb),
    0.7
  ); /* Using RGB variable from style.css */
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-item:hover .overlay {
  opacity: 1;
}

.photo-item .overlay i {
  color: var(--white);
  font-size: 2.5rem;
}

/* --- Lightbox Styles --- */
.lightbox {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
  animation: fadeIn 0.3s forwards;
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85%;
  object-fit: contain; /* Ensure image fits while maintaining aspect ratio */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: zoomIn 0.3s forwards;
}

.lightbox-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  position: absolute;
  bottom: 50px; /* Adjust as needed */
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 30px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  -webkit-user-select: none;
  text-decoration: none; /* Remove underline */
}

.lightbox-prev {
  left: 0;
  border-radius: 3px 0 0 3px;
}

.lightbox-next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Animations for lightbox */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* --- Video Grid Styles --- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.video-item {
  background-color: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.video-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-item iframe {
  width: 100%;
  height: 200px; /* Fixed aspect ratio for responsive video (e.g., 16:9 for 56.25%) */
  /* For 16:9, a common trick is padding-top: 56.25% */
  /* This can be achieved with a container and padding-bottom for responsiveness */
  /* Example:
    .video-wrapper {
        position: relative;
        padding-bottom: 56.25%; // 16:9 aspect ratio
        height: 0;
        overflow: hidden;
    }
    .video-wrapper iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    */
  display: block; /* Remove extra space below iframe */
}

.video-item .video-caption {
  padding: 15px;
  font-size: 1.1em;
  color: var(--dark-green);
  font-weight: 600;
  text-align: center;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
  /* Tablet view */
  .page-header-section.galeri-header-bg h1 {
    font-size: 2.8rem;
  }
  .page-header-section.galeri-header-bg p {
    font-size: 1.1rem;
  }
  .gallery-section .section-title {
    font-size: 2.4rem;
  }
  .gallery-section .section-subtitle {
    font-size: 1em;
  }
  .photo-grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(250px, 1fr)
    ); /* Slightly smaller cards */
    gap: 15px;
  }
  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  /* Mobile Large */
  .page-header-section.galeri-header-bg {
    padding: 60px 0;
    min-height: 200px;
  }
  .page-header-section.galeri-header-bg h1 {
    font-size: 2rem;
  }
  .page-header-section.galeri-header-bg p {
    font-size: 0.95rem;
  }
  .gallery-section {
    padding: 60px 0;
  }
  .gallery-section .section-title {
    font-size: 2rem;
  }
  .gallery-section .section-subtitle {
    margin-bottom: 30px;
  }
  .photo-grid {
    grid-template-columns: 1fr; /* Stack on mobile */
    max-width: 400px; /* Limit width for stacked items */
    margin-left: auto;
    margin-right: auto;
  }
  .photo-item img {
    height: 220px; /* Slightly taller for single column */
  }
  .video-grid {
    grid-template-columns: 1fr; /* Stack on mobile */
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
  .video-item iframe {
    height: 220px; /* Adjust height for mobile */
  }
  .lightbox-content {
    max-width: 95%;
    max-height: 80%;
  }
  .lightbox-close {
    font-size: 30px;
    top: 15px;
    right: 20px;
  }
  .lightbox-prev,
  .lightbox-next {
    font-size: 24px;
    padding: 10px;
    margin-top: -40px;
  }
  .lightbox-caption {
    font-size: 1em;
    bottom: 20px;
    width: 90%;
  }
}

@media (max-width: 480px) {
  /* Mobile Small */
  .photo-item img {
    height: 180px;
  }
  .video-item iframe {
    height: 180px;
  }
}
