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

body {
  font-family: Arial, sans-serif;
}

/* =================================
   ========== HERO SECTION ==========
   ================================= */
.hero {
  position: relative;
  width: 100%;
  height: 100vh; /* Full viewport height */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1; /* Place video behind hero content */
}

#background-video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures video covers the section fully */
}

/* =================================
   ========== GRID SECTION ==========
   ================================= */
.grid-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive columns */
  gap: 20px;
  padding: 20px;
}

/* Grid Items */
.grid-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 10 / 16; /* Maintain aspect ratio */
  background-color: #f4f4f4; /* Optional: background color for empty items */
}

/* Images and Videos Inside Grid Items */
.grid-item img,
.grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures media fills the grid-item */
  display: block;
}

/* Hover Effect for Media */
.grid-item:hover img,
.grid-item:hover video {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

/* Grid Captions */
.grid-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: #fff;
  padding: 15px;
  box-sizing: border-box;
  font-size: 1rem;
  text-align: center;
  transform: translateY(100%); /* Hidden initially */
  transition: transform 0.4s ease; /* Smooth slide-up effect */
}

/* Hover Effect for Captions */
.grid-item:hover .grid-caption {
  transform: translateY(0); /* Slide up to visible */
}

/* For Video Items */
.video-ratio {
  position: relative;
  overflow: hidden;
}

.video-ratio::before {
  content: "";
  display: block;
  padding-top: 56.25%; /* Enforces 16:9 aspect ratio */
}

.video-ratio .grid-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =================================
   ========== RESPONSIVENESS ==========
   ================================= */

/* At max-width 1024px, 2 columns */
@media (max-width: 1030px) {
  .grid-section {
    grid-template-columns: repeat(auto-fit, minmax(150px, 3fr)); /* Adjusts for smaller screens */
  }
  .grid-caption {
    font-size: 0.9rem; /* Slightly smaller text */
    padding: 05px;
  }
}

/* For Very Small Screens */
@media (max-width: 320px) {
  .grid-section {
    display: grid; /* Ensure grid layout */
    grid-template-columns: repeat(4, 1fr); /* 3 items per row */
    gap: 5px; /* Adjust spacing between items */
  }

  .grid-item {
    padding: 5px; /* Optional: Add padding for spacing inside grid items */
  }

  .grid-caption {
    font-size: 0.8rem; /* Smaller font for captions */
    padding: 5px;
  }
}


/* =================================
   ========== MISCELLANEOUS ==========
   ================================= */
/* Captions under each grid item (alternative text) */
.grid-item p {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 16px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 05px;
  text-transform: uppercase;
}


.grid-section-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Always 3 columns */
  gap: 20px;
  padding: 40px 20px;
}

.myhero-media-block {
  position: relative;
  width: 100%;
  padding-top: 145%; /* 4:5 aspect ratio */
  overflow: hidden;
  border-radius: 0px;
}

.myhero-media-block video,
.myhero-media-block img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
