/*------------------------
 Gallery Section Styles 
------------------------*/
.gallery {
  padding-top: 180px;
  background-image: url('/images/gallery.jpg');
  background-size: cover;
  background-position: center;
  height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  position: relative;
}
.gallery::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.1);
  z-index: 1;
}
.gallery-content {
  background-color: rgba(17, 121, 226, 0.85);  /* semi-transparent background */
  padding: 5px 10px;
  border-radius: 8px;
  opacity: 0.9;
  font-size: 2rem;
  z-index: 2;
  position: relative;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}
.home {
  margin-top: 20px;
  position: relative;
  z-index: 2;  /* makes it appear above the background overlay */
}
.home-span {
  color: rgba(93, 143, 219, 0.8);
  font-weight: 600;
  font-size: 1.2rem;
}
.home-btn {
  display: inline-block;
  background-color: rgba(224, 224, 224, 0.6);
  color: #020202;
  padding: 10px 20px;
  font-size: 1.2rem;
  border-radius: 15px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  position: relative;
  z-index: 2;  /* make sure it's clickable */
}
.home-btn:hover,.gallery-content:hover {
  background-color: #0055aa;
  color: #fff;
}
.gallery-section {
  padding: 40px 20px;
  max-width: 1200px;
  margin: auto;
}
.rows {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}
.Video,.Photo {
  flex: 1 1 48%;
  background: #fff;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-in-out;
  overflow: visible;
}

.Video:hover,
.Photo:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.sections-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.sections-header h4 {
  font-size: 1.5rem;
  color: #1d75cc;
  border-bottom: 2px solid #1d75cc;
  padding-bottom: 5px;
}

.btn-views {
  padding: 6px 14px;
  border: 1px solid #1d75cc;
  background: transparent;
  color: #1d75cc;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-views:hover {
  background: #1d75cc;
  color: #fff;
  transform: translateY(-3px);
}

/*------------------------
     Video Grid
    -------------------------*/
.video-grids {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  /* use max-height to clip initially but allow scrolling if user wants */
  max-height: 520px;
  overflow: hidden;
  transition: max-height 0.45s ease;
}

/* When expanded we remove the height limit */
.video-grids.expanded {
  max-height: 2000px;
  /* safe high value, or use 'none' if you prefer */
  overflow: visible;
}

.video-thumbnail video {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: block;
}

.video-thumbnail video:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

/*------------------------
     Photo Grid
    -------------------------*/
.photo-grids {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-height: 420px;
  /* clips at first */
  overflow: hidden;
  transition: max-height 0.45s ease;
}

/* Remove clipping when expanded */
.photo-grids.expanded {
  max-height: 2000px;
  /* or 'none' but some browsers animate better with a large value */
  overflow: visible;
}

.photo-grids img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: block;
}

.photo-grids img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

/*------------------------
     Responsive Design
    -------------------------*/
@media (max-width: 1024px) {
  .rows {
    flex-direction: column;
  }

  .Video,
  .Photo {
    flex: 1 1 100%;
  }
}

@media (max-width: 768px) {
  .sections-header h4 {
    font-size: 1.2rem;
  }

  .btn-views {
    font-size: 0.9rem;
    padding: 5px 10px;
  }

  .video-grids video,
  .photo-grids img {
    height: 180px;
  }
}

@media (max-width: 420px) {

  .video-grids,
  .photo-grids {
    grid-template-columns: 1fr;
  }

  .video-grids video,
  .photo-grids img {
    height: 150px;
  }
}