/* Style for Nested Image Filter Plugin */

/* Parent Filter Controls */
.parent-filter-controls {
  position: sticky;
  top: 5px; /* Distance from the top of the viewport */
  z-index: 10; /* Ensure it stays above other content */
  margin-top: 2rem;
  background-color: #fff; /* Optional: Add a background to avoid transparency issues */
  padding: 10px; /* Optional: Add padding for better appearance */
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd; /* Optional: Add a bottom border for better separation */
}

.parent-filter-button {
  padding: 10px 15px;
  background-color: #0073aa;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.parent-filter-button:hover {
  background-color: #005177;
}

/* Sub Filter Controls */
.sub-filter-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.sub-filter-button {
  padding: 8px 12px;
  background-color: #005177;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.sub-filter-button:hover {
  background-color: #003954;
}
.category-section {
  margin-top: 20px;
}
/* Image Gallery */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  justify-items: center;
  align-items: start;
  transition: all 0.3s ease;
}

/* Image Item */
.image-item {
  width: 100%;
  aspect-ratio: 1;
  /* position: relative; */
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, opacity 0.3s;
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: 100%;

  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Hidden Items */
.image-item.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

/* Visible Items */
.image-item {
  opacity: 1;
  transform: scale(1);
}
/* Image Caption */
.image-caption {
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  font-style: italic;
  text-align: center;
}

.image-filter > h3.content-block::before {
  border-top: 3px solid #ffcc42;
  width: 275px;
  display: block;
  content: "";
  padding-bottom: 0.8em;
}

/* Go to Top Button */
#go-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background-color: #0073aa;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 20px;
  text-align: center;
  cursor: pointer;
  display: none; /* Hidden by default */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s, transform 0.3s;
}

#go-to-top:hover {
  background-color: #005177;
  transform: scale(1.1);
}

.case-study {
  display: flex !important;
  gap: 10px;
  flex-direction: row;
  grid-column: span 4; /* Span 2 columns */

  background-color: #ffcc42;
}

.case-study img {
  flex: 1;
  object-fit: cover;
  max-width: 100%;
  aspect-ratio: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.case-study.image-item {
  aspect-ratio: auto;
}
.case-study-description {
  flex: 3;
  padding: 10px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .parent-filter-controls,
  .sub-filter-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
  .image-gallery {
    grid-template-columns: unset !important; /* Clears any previous settings */
    display: block !important; /* As a backup, force block layout */
  }
  .image-gallery {
    /* display: flex; */
    /* flex-direction: column; */
    grid-template-columns: 100%;
  }
  .case-study {
    flex-direction: column;

    grid-column: span 2; /* Span 2 columns */
  }
  .parent-filter-controls {
    position: relative;
  }

  .image-item {
    width: 100% !important; /* Prevent shrinking */
    min-width: 100% !important; /* Ensure it spans the full row */
  }
}
