.homecategories-grid-container {
  margin-bottom: 50px; /* Or as configured */
  width: 100%;
}

/*
  The .homecategories-grid styles (display: grid, grid-template-columns, grid-auto-rows, gap)
  are now primarily handled by inline <style> tags with media queries generated in homecategories.php (hookDisplayHeader).
  This allows dynamic grid parameters per breakpoint from the database.
  You can keep fallback/default styles here if needed, or styles for when JS is disabled, though this module relies on those dynamic params.
*/
.homecategories-grid {
  /* Fallback or base if inline styles fail - though they should take precedence */
  display: grid;
  gap: 15px; /* Default gap */
  grid-template-columns: repeat(3, 1fr); /* Default columns */
  grid-auto-rows: minmax(200px, auto); /* Default row height */
}

.homecategories-banner {
  position: relative;
  overflow: hidden;
  border-radius: 5px; /* Or as configured */
  /* background-size, background-position, background-repeat set inline */
  min-height: 100px; /* Minimum height for a banner area */
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.homecategories-banner:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.homecategories-banner .banner-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

/*
  If using <img> tag directly inside .homecategories-banner
  .homecategories-banner img {
    width: 100%;
    height: 100%;
    object-fit: inherit;  <-- 'inherit' might not be what you want, better to set directly based on $banner.image_fit
    transition: transform 0.3s ease;
  }
  .homecategories-banner:hover img {
    transform: scale(1.05);
  }
*/

.banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  padding: 15px; /* Adjust padding as needed */
  color: white;
  display: flex; /* For alignment */
  align-items: flex-end; /* Align text to bottom */
  min-height: 30%; /* Ensure overlay has some height */
  box-sizing: border-box;
  transition: background 0.3s ease;
}
.homecategories-banner:hover .banner-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
}

.banner-overlay h3 {
  margin: 0;
  font-size: 1.4em; /* Adjust as needed */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
  color: white !important; /* Ensure it overrides theme styles if any */
  line-height: 1.2;
}

/* Example of adjusting text size for smaller screens (could also be part of dynamic CSS) */
@media (max-width: 768px) {
  .banner-overlay h3 {
    font-size: 1.1em;
  }
  .banner-overlay {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .banner-overlay h3 {
    font-size: 1em;
  }
}
