/* ============================================================
 * Homepage Styles
 * Matches the Divi-built homepage layout for Green & Grow.
 *
 * Sections:
 *   .homepage-hero-slider  — Full-width 4-slide auto-rotating hero
 *   .homepage-cta          — Green CTA section
 *   .services-container     — 3×3 service card grid
 *   .homepage-value-props  — Dark green value proposition bar
 *   .homepage-blog         — Blog post grid
 * ============================================================ */

/* -----------------------------------------------
   Hero Slider
   ----------------------------------------------- */
.homepage-hero-slider {
  position: sticky;
  top: 0;
  z-index: 1;
  width: 100%;
  height: clamp(50vh, 60vh, 80vh);
}

.hero-slides {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
}

.hero-slide-content {
  position: absolute;
  top: 45%;
  left: 50%;
  padding: 2rem 1rem .5rem;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  max-width: 75vw;
  width: 90%;
}

.hero-slide-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0em 0.1em 0.1em rgba(0, 0, 0, 0.4);
  margin: 0 0 10px;
  line-height: 1.2;
}

.hero-slide-subtitle {
  font-size: 2.8rem;
  font-weight: 100;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0em 0.1em 0.1em rgba(0, 0, 0, 0.4);
  margin: 0;
}

/* Slider dots */
.hero-slider-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}

.hero-slider-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.3s;
}

.hero-slider-dots .dot.active {
  background: #F58220;
}

/* -----------------------------------------------
   Services Grid
   ----------------------------------------------- */
.services-container {
  background-color: #fafaff;
  padding: 60px 0;
  position: relative;
  z-index: 4;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.service-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.service-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.service-card-image {
  display: block;
  overflow: hidden;
}

.service-card-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.service-card:hover .service-card-image img {
  transform: scale(1.05);
}

.service-card-title {
  margin: 0;
  padding: 15px 20px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.service-card-title a {
  color: #044704;
  text-decoration: none;
  transition: color 0.2s;
}

.service-card-title a:hover {
  color: #F58220;
}

.service-card-empty {
  visibility: hidden;
}

/* -----------------------------------------------
   Value Propositions
   ----------------------------------------------- */
.homepage-value-props {
  background-color: #044704;
  color: #fff;
  padding: 50px 0;
  position: relative;
  z-index: 4;
}

.value-props-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  text-align: center;
}

.value-prop {
  padding: 20px;
}

.value-prop-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  color: #F58220;
}

.value-prop-icon svg {
  width: 100%;
  height: 100%;
}

.value-prop-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

/* -----------------------------------------------
   Blog Posts Section
   ----------------------------------------------- */
.homepage-blog {
  background-color: #fafaff;
  padding: 60px 0;
  position: relative;
  z-index: 4;
}
/* Force the Views element container to isolate its layout context */
.homepage-blog .views-element-container {
  clear: both;
  display: block;
  width: 100%;
}

/* Ensure Drupal's responsive grid wrapper spans full width */
.views-view-responsive-grid {
  width: 100%;
  box-sizing: border-box;
}
.homepage-blog-heading {
  text-align: center;
  font-size: 2rem;
  color: #044704;
  margin: 0 0 40px;
}

.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* Blog post cards */
.blog-posts-grid article {
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.blog-posts-grid article:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.blog-posts-grid .node-featured-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.blog-posts-grid .node-title {
  padding: 15px 20px 5px;
  margin: 0;
  font-size: 1.05rem;
}

.blog-posts-grid .node-title a {
  color: #044704;
  text-decoration: none;
}

.blog-posts-grid .node-title a:hover {
  color: #F58220;
}

.blog-posts-grid .node-content {
  padding: 0 20px 15px;
  font-size: 0.9rem;
  color: #575279;
}

.blog-posts-grid .node-content p:last-child {
  margin-bottom: 0;
}

.blog-posts-grid .node-links {
  padding: 0 20px 15px;
}

.blog-posts-grid .node-links a {
  color: #F58220;
  font-weight: 600;
  text-decoration: none;
}

.blog-posts-grid .node-links a:hover {
  text-decoration: underline;
}

/* -----------------------------------------------
   Responsive
   ----------------------------------------------- */
@media (max-width: 980px) {
  .hero-slide-content {
    top: 50%;
    padding: 20px 30px;
  }

  .hero-slide-title {
    font-size: 2rem;
  }

  .hero-slide-subtitle {
    font-size: 1rem;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .value-props-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .blog-posts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .hero-slide-content {
    top: 55%;
    padding: 15px 20px;
  }

  .hero-slide-title {
    font-size: 1.5rem;
  }

  .hero-slide-subtitle {
    font-size: 0.9rem;
  }

  .cta-heading {
    font-size: 1.5rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 479px) {
  .homepage-hero-slider {
    position: sticky;
    top: 0;
    z-index: 1;
    min-height: 400px;
  }

  .hero-slide-content {
    top: 60%;
    width: 95%;
  }

  .hero-slide-title {
    font-size: 1.2rem;
  }
}
