/* Additional CSS tweaks that don't require SCSS compilation */

/* Fix for the gap between header and hero image */
body {
  padding-top: 80px !important; /* Add space for fixed navbar */
  margin-top: 0 !important;
  overflow-x: hidden !important; /* Prevent horizontal scrolling */
}
  
  /* Remove padding that Quarto may add to certain containers */
  .quarto-title-banner {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Custom styles for the navbar that are easier to add via CSS than SCSS */
  .navbar {
    box-shadow: none !important;
    border-bottom: 1px solid #e5e5e5;
  }
  
  /* Make the nav links align perfectly with the logo */
  .navbar .navbar-nav-scroll {
    height: auto !important;
  }
  
  .navbar-nav .nav-link {
    height: 100%;
    display: flex;
    align-items: center;
  }
  
  /* Fix for the hero map image to ensure no gap */
  .richmond-map-hero {
    margin-top: -1px; /* Remove any tiny gap caused by browser rendering */
  }
  
  /* Make buttons branded */
  .btn {
    border-radius: 4px;
    font-family: 'Roboto Slab', Georgia, serif;
  }
  
  /* Override any Quarto or Bootstrap defaults that interfere with your design */
  .container-xl, .container-xxl {
    max-width: 1200px; /* Larger than your theme default for more breathing room when needed */
  }
  
  /* Style fixes for mobile devices */
  @media (max-width: 767.98px) {
    .navbar-brand img {
      max-height: 40px; /* Smaller logo on mobile */
    }
    
    h1 {
      font-size: 1.8rem;
    }
    
    h2 {
      font-size: 1.5rem;
    }
  }

  .navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
  }

/* Custom layout for blog post with sidebar - only apply to blog posts */
.blog-post .column-page {
  display: grid;
  grid-template-columns: 3fr 1fr;
  grid-gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.blog-post .column-body {
  grid-column: 1;
}

.blog-post .column-margin {
  grid-column: 2;
}

/* Override the default column-page grid layout for pages that should be full width */
body:not(.blog-post) .column-page {
  display: block !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
}

/* Specifically target services, staff, and about pages to ensure no sidebar layout */
.quarto-title-banner + .quarto-body .column-page,
main .column-page {
  display: block !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
}

/* Ensure these specific pages don't use grid layout */
body.services .column-page,
body.staff .column-page,
body.about .column-page {
  display: block !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
}

/* Specific fix for about page content */
.about .quarto-body {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
  display: block !important;
  width: auto !important;
}

/* Fix services page layout */
.services .quarto-body {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
  display: block !important;
  width: auto !important;
}

/* Fix staff page layout */
.staff .quarto-body {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
  display: block !important;
  width: auto !important;
}

/* Home page specific layout fixes */
.home-page .column-page {
  display: block;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* Newsletter sidebar styling */
.newsletter-sidebar {
  background-color: #F6F5F3;
  border-radius: 8px;
  border: 1px solid #8baeaa;
  padding: 1rem;
  margin-bottom: 2rem;
}

.embeddable-buttondown-form {
  display: flex;
  flex-direction: column;
}

.embeddable-buttondown-form label {
  font-family: 'Roboto Slab', 'Georgia', serif;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #445ca9;
}

.embeddable-buttondown-form input[type="email"] {
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: 'Lato', 'Corbel', sans-serif;
  width: 100%;
}

.embeddable-buttondown-form input[type="submit"] {
  background-color: #445ca9;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Lato', 'Corbel', sans-serif;
  font-weight: 500;
  align-self: flex-start;
  transition: background-color 0.3s ease;
}

.embeddable-buttondown-form input[type="submit"]:hover {
  background-color: #384b87;
}

.embeddable-buttondown-form .buttondown-credit {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #757883;
}

/* For mobile devices */
@media (max-width: 991px) {
  .column-page {
    display: block !important;
  }
  
  .column-margin {
    margin-top: 2rem;
  }
  
  .newsletter-sidebar {
    max-width: 100%;
  }
}

/* Force non-blog pages to use block layout */
body:not(.blog-post) main,
body:not(.blog-post) .column-page,
body:not(.blog-post) .quarto-body {
  display: block !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Reset any grid styles for non-blog pages */
body:not(.blog-post) .column-body,
body:not(.blog-post) .column-margin {
  display: block !important;
  width: 100% !important;
  grid-column: auto !important;
}

/* Full width content wrapper for about page */
.full-width-content {
  display: block !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* Fix the container width for about and services pages */
.about .container, 
.services .container,
.staff .container {
  max-width: 1200px !important;
  width: 100% !important;
}
  
  /* Full-width banner components */
.banner-container {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: relative;
}

/* Banner with background image */
.banner-image {
  width: 100% !important;
  max-width: 100% !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  min-height: 300px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* Height variations */
.banner-sm {
  min-height: 200px;
}

.banner-md {
  min-height: 300px;
}

.banner-lg {
  min-height: 400px;
}

.banner-xl {
  min-height: 500px;
}

/* Text overlay container */
.banner-text {
  padding: 2rem;
  max-width: 800px;
  width: 90%;
  z-index: 2;
}

/* Background overlay for better text readability */
.overlay-dark::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.overlay-light::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 1;
}

.overlay-brand::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(68, 92, 169, 0.7); /* Using your brand blue color */
  z-index: 1;
}

/* Text positioning */
.text-left {
  justify-content: flex-start;
}

.text-right {
  justify-content: flex-end;
}

.text-bottom {
  align-items: flex-end;
}

.text-top {
  align-items: flex-start;
}

/* Text color options */
.text-light {
  color: white;
}

.text-dark {
  color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .banner-image {
    min-height: 250px;
  }
  
  .banner-lg {
    min-height: 300px;
  }
  
  .banner-xl {
    min-height: 350px;
  }
  
  .banner-text {
    padding: 1.5rem;
    max-width: 100%;
  }
}

/* Full-width carousel fixes - ONLY FOR HOMEPAGE */
.home-page .carousel-section {
  width: 100vw !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  position: relative !important;
}

.home-page .carousel-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
}

.home-page .carousel-slides {
  width: 100%;
  height: 500px; /* Increased default height */
  position: relative;
}

.home-page .carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.home-page .carousel-slide.active {
  opacity: 1;
  z-index: 2;
}

/* Height variations - ONLY FOR HOMEPAGE */
.home-page .carousel-height-sm {
  height: 250px;
}

.home-page .carousel-height-md {
  height: 400px;
}

.home-page .carousel-height-lg {
  height: 500px;
}

.home-page .carousel-height-xl {
  height: 600px;
}

/* Carousel navigation - ONLY FOR HOMEPAGE */
.home-page .carousel-nav {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 10;
}

.home-page .carousel-nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  margin: 0 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.home-page .carousel-nav-dot.active {
  background-color: white;
}

/* Carousel arrows - ONLY FOR HOMEPAGE */
.home-page .carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.3);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.home-page .carousel-arrow:hover {
  background-color: rgba(0, 0, 0, 0.6);
}

.home-page .carousel-arrow-prev {
  left: 20px;
}

.home-page .carousel-arrow-next {
  right: 20px;
}

/* Text overlay - ONLY FOR HOMEPAGE */
.home-page .carousel-text {
  padding: 2rem;
  max-width: 1000px;
  width: 90%;
  z-index: 5;
  position: relative;
}

/* Positioning variants - ONLY FOR HOMEPAGE */
.home-page .carousel-text-left {
  text-align: left;
  margin-right: auto;
  margin-left: 5%;
  padding-left: 0;
}

.home-page .carousel-text-center {
  text-align: center;
  margin: 0 auto;
}

.home-page .carousel-text-right {
  text-align: right;
  margin-left: auto;
  margin-right: 5%;
  padding-right: 0;
}

/* Make text responsive on smaller screens - ONLY FOR HOMEPAGE */
@media (max-width: 768px) {
  .home-page .carousel-text {
    width: 85%;
    max-width: 600px;
    padding: 1.5rem;
  }
  
  .home-page .carousel-text-right, 
  .home-page .carousel-text-left {
    margin: 0 auto;
    text-align: center;
  }
  
  .home-page .carousel-text h2 {
    font-size: 1.75rem;
  }
}

/* Overlay variants - Universal but won't cause layout issues */
.overlay-dark::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 3;
}

.overlay-light::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 3;
}

.overlay-brand::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(68, 92, 169, 0.7); /* Your brand blue */
  z-index: 3;
}

.overlay-coral::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(231, 111, 82, 0.7); /* Your coral color */
  z-index: 3;
}

.overlay-green::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(42, 157, 143, 0.7); /* Your green color */
  z-index: 3;
}

.overlay-sand::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(233, 196, 106, 0.7); /* Your sand color */
  z-index: 3;
}

/* Text color helpers */
.text-light {
  color: white !important;
  position: relative;
  z-index: 10;
}

.text-dark {
  color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .carousel-slides,
  .carousel-height-md {
    height: 300px;
  }
  
  .carousel-height-lg {
    height: 350px;
  }
  
  .carousel-height-xl {
    height: 400px;
  }
  
  .carousel-text {
    padding: 1.5rem;
    max-width: 90%;
  }
  
  .carousel-arrow {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
}

/* Fix for carousel container to prevent overflow issues */
body {
  overflow-x: hidden !important;
}

/* Ensure the container adjusts properly */
.quarto-title-block, 
.quarto-body,
.quarto-container {
  overflow-x: hidden; /* Prevents horizontal scrollbar */
}

/* Apply proper sizing to carousel elements */
.carousel-fullwidth .carousel-slides {
  width: 100%;
}

/* Make carousel text more visible on wider screens */
@media (min-width: 1200px) {
  .carousel-fullwidth .carousel-text {
    max-width: 1000px;
  }
}

/* Content section layout fixes */
.content-before-carousel {
  position: relative;
  z-index: 20;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  display: block;
  clear: both;
}

.content-after-carousel {
  position: relative;
  z-index: 20;
  margin-top: 3rem;
  padding-top: 1rem;
  width: 100%;
  max-width: 100%;
  display: block;
  clear: both;
}

.carousel-section {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: block;
  overflow: hidden;
  z-index: 10;
  margin-bottom: 2rem;
  clear: both;
}

.carousel-container-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Fix for carousel container */
.carousel-container {
  position: relative;
  z-index: 1;
}

/* Force carousel to clear float */
.carousel-section::after {
  content: "";
  display: table;
  clear: both;
  height: 0;
}

/* Full-width banner (spans entire viewport width) - Scoped to prevent layout issues */
.banner-fullwidth {
  width: 100% !important;
  position: relative !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* Apply proper sizing to banner elements */
.banner-fullwidth .banner-image {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Handle potential overflow issues */
body {
  overflow-x: hidden; /* Prevents horizontal scrollbar */
}

/* Ensure content after the banner flows normally */
.banner-fullwidth + * {
  margin-top: 1rem;
  width: 100% !important;
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Make banner text more visible on wider screens */
@media (min-width: 1200px) {
  .banner-fullwidth .banner-text {
    max-width: 1000px;
  }
}

/* Fix for content under carousel */
.content-wrapper {
  margin-top: 3rem;
  padding-top: 1rem;
  position: relative;
  z-index: 10;
  background-color: white;
}

/* Service image specific fixes - only for home page */
.home-page .service-image-container {
  margin: -20px -20px 15px -20px; /* Extend to edges */
  height: 220px; /* Fixed height for consistency */
  overflow: hidden;
  position: relative;
  width: calc(100% + 40px); /* Ensure full width */
}

.home-page .service-image,
.home-page .listing-box-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

/* Settings for service images only on services and staff pages */
.service-image-container {
  margin: -20px -20px 15px -20px; /* Extend to edges */
  height: 220px; /* Fixed height for consistency */
  overflow: hidden;
  position: relative;
}

/* Original image styling preserved */
.service-image, 
.listing-box-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* Ensure hover effects still work */
.listing-box:hover .service-image,
.listing-box:hover .listing-box-image {
  transform: scale(1.05);
}

/* Fix for incorrect HTML structure from Quarto rendering */
/* This handles both service.qmd and staff.qmd distortions */
section.listing-box-title.service-content,
section.listing-box-title.listing-box-content,
.service-content,
.listing-box-content {
  margin: 0 !important;
  padding: 0 20px 20px 20px !important;
  display: block !important;
  position: static !important;
  width: auto !important;
  max-width: none !important;
  flex: 1 1 auto !important;
  box-sizing: border-box !important;
}

/* Fix headings in both services and staff */
section.listing-box-title.service-content h3.listing-box-title,
section.listing-box-title.listing-box-content h3.listing-box-title,
.service-content h3.listing-box-title,
.listing-box-content h3.listing-box-title {
  margin-top: 10px !important;
  margin-bottom: 12px !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
  display: block !important;
  position: static !important;
  width: auto !important;
}

/* Service content should show below the title properly */
section.listing-box-title.service-content .listing-box-body,
section.listing-box-title.listing-box-content .listing-box-body,
.service-content .listing-box-body,
.listing-box-content .listing-box-body {
  margin-top: 0 !important;
  padding-top: 0 !important;
  display: block !important;
  position: static !important;
  width: auto !important;
}

/* Ensure service and staff boxes have proper height */
.listing-box.service-box,
.listing-box.has-image {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  padding-top: 0 !important;
  overflow: hidden !important;
  position: relative !important;
  width: auto !important;
}

/* Fix for images in service cards to prevent distortion at wide screens */
.service-image-container {
  margin: -20px -20px 15px -20px !important;
  height: 220px !important;
  overflow: hidden !important;
  position: relative !important;
  width: calc(100% + 40px) !important;
  display: block !important;
  box-sizing: border-box !important;
}

/* Special styling for staff page image containers */
.staff .listing-box-image-container {
  margin: -20px -20px 15px -20px !important;
  height: 300px !important; /* Taller for staff photos */
  overflow: hidden !important;
  position: relative !important;
  width: calc(100% + 40px) !important;
  display: block !important;
  box-sizing: border-box !important;
}

/* Force proper positioning for images */
.service-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  transition: transform 0.5s ease !important;
}

/* Special styling for staff images to show full faces */
.staff .listing-box-image {
  width: 100% !important;
  height: 400px !important;
  object-fit: cover !important;
  object-position: center 33% !important; /* Position to highlight faces */
  transition: transform 0.5s ease !important;
}

/* Individual adjustments for staff images if needed */
.staff .listing-box-image-container img[src*="erica.jpg"] {
  object-position: center 20% !important;
}

.staff .listing-box-image-container img[src*="jonathan.jpg"],
.staff .listing-box-image-container img[src*="jtk.jpg"] {
  object-position: center 25% !important;
}

.staff .listing-box-image-container img[src*="eric.jpg"] {
  object-position: center 30% !important;
}

.staff .listing-box-image-container img[src*="amelie.jpg"] {
  object-position: center 20% !important;
}

.staff .listing-box-image-container img[src*="maria.jpg"] {
  object-position: center 25% !important;
}

.staff .listing-box-image-container img[src*="kendra.jpg"] {
  object-position: center 25% !important;
}

/* Regular listing box images (for non-staff pages) */
.listing-box-image:not(.staff .listing-box-image) {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  transition: transform 0.5s ease !important;
}

/* Fix any flex-related issues for wider screens */
@media (min-width: 992px) {
  .listing-box.service-box,
  .listing-box.has-image {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 400px !important; /* Set min-height to prevent extreme stretching */
    max-height: 550px !important; /* Set max-height to keep reasonable proportions */
  }
  
  section.listing-box-title.service-content,
  section.listing-box-title.listing-box-content,
  .service-content,
  .listing-box-content {
    flex: 1 1 auto !important;
    display: block !important;
    width: auto !important;
    position: static !important;
    box-sizing: border-box !important;
  }
  
  /* Fix parent container layout */
  .container .row {
    display: flex !important;
    flex-wrap: wrap !important;
  }
  
  .container .col-md-4 {
    flex: 0 0 33.333333% !important;
    max-width: 33.333333% !important;
    margin-bottom: 30px !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
    box-sizing: border-box !important;
  }
  
  /* Ensure image containers are properly constrained */
  .service-image-container,
  .listing-box-image-container {
    height: 220px !important;
    max-height: 220px !important;
  }
}

/* Fix for staff page subtitle */
.listing-box-subtitle {
  font-family: 'Roboto Slab', 'Georgia', serif;
  font-weight: 400;
  font-size: 14px;
  margin-bottom: 0;
  color: #757883;
  line-height: 1.5;
}

/* Additional staff card customizations */
.staff .listing-box.has-image {
  padding-top: 0 !important;
  overflow: hidden !important;
  height: auto !important;
  min-height: 500px !important; /* Taller to accommodate more content */
}

/* Ensure content in staff cards has proper spacing */
.staff .listing-box-content {
  padding: 0 20px 20px 20px !important;
  display: block !important;
}

/* Responsive adjustments for staff images */
@media (max-width: 768px) {
  .staff .listing-box-image-container {
    height: 250px !important; /* Smaller on mobile but still showing faces */
  }
  
  .staff .listing-box.has-image {
    min-height: 450px !important;
  }
}

@media (min-width: 992px) and (max-width: 1200px) {
  .staff .listing-box-image-container {
    height: 280px !important; /* Medium size for tablets */
  }
}

/* Ensure consistent sizing on mobile */
@media (max-width: 767px) {
  .service-image-container {
    height: 180px !important;
  }
  
  .services .listing-box.service-box {
    height: auto !important;
    min-height: 380px !important;
  }
}

/* Services-specific card customizations */
.services .listing-box.service-box {
  padding-top: 0 !important;
  overflow: hidden !important;
  height: auto !important;
  min-height: 420px !important;
}

/* Ensure consistent image height for service cards */
.services .service-image-container {
  height: 200px !important;
}

/* ===== CAROUSEL FIXES ===== */

/* ===== NEW CAROUSEL FIXES ===== */

/* Container for the entire carousel section - ONLY FOR HOMEPAGE */
.home-page .carousel-section {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-bottom: 2rem; /* Add space between the carousel and the next section */
}

/* Container for content after carousel - ONLY FOR HOMEPAGE */
.home-page .content-section {
  position: relative;
  z-index: 100; /* Higher than any carousel elements */
  margin-top: 2rem;
  background-color: white; /* Ensure it has a solid background */
}

/* Fix for nested carousel-fullwidth - ONLY FOR HOMEPAGE */
.home-page .carousel-section .carousel-fullwidth {
  display: block;
  position: relative;
  overflow: hidden;
  height: auto; /* Allow proper height calculation */
  clear: both; /* Clear any floats */
}

/* Full reset on positioning context for content after carousel - ONLY FOR HOMEPAGE */
.home-page .content-section h1, 
.home-page .content-section h2,
.home-page .content-section h3,
.home-page .content-section p {
  position: relative;
  z-index: 5;
}

/* Ensure the fullwidth carousel content doesn't affect layout after it - ONLY FOR HOMEPAGE */
.home-page .carousel-fullwidth:after {
  content: "";
  display: table;
  clear: both;
}

/* Fix for containment issues - ensure carousel container closes properly - ONLY FOR HOMEPAGE */
.home-page .carousel-container {
  position: relative;
  z-index: 1;
}

/* Stronger reset for content after carousel - ONLY FOR HOMEPAGE */
.home-page .content-section {
  clear: both;
  position: relative;
  display: block;
}

/* For headings that might be added after the carousel - ONLY FOR HOMEPAGE */
.home-page h1.post-carousel, 
.home-page h2.post-carousel,
.home-page h3.post-carousel {
  margin-top: 2rem;
  position: relative;
  z-index: 100;
  clear: both;
}

/* Add specific class for gradient text headings */
.gradient-text {
  background: linear-gradient(
    45deg,
    #e9ab3f,
    #445ca9,
    #445ca9,
    #8baeaa,
    #e76f52,
    #445ca9,
    #e9ab3f
  );
  background-size: 800%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: animated_text 30s ease-in-out infinite;
  -moz-animation: animated_text 30s ease-in-out infinite;
  -webkit-animation: animated_text 30s ease-in-out infinite;
  
  /* Add these properties for proper display */
  display: inline-block;
  position: relative;
  z-index: 100;
}

@keyframes animated_text {
  0% {
    background-position: 0px 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0px 50%;
  }
}

/* Improved carousel layout classes */
.carousel-container-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.content-before-carousel {
  position: relative;
  width: 100%;
  margin-bottom: 2rem;
  z-index: 20;
  clear: both;
}

.content-after-carousel {
  position: relative;
  clear: both;
  width: 100%;
  margin-top: 2rem;
  z-index: 20;
}

/* Reset carousel positioning and stacking */
.carousel-section {
  position: relative;
  width: 100%;
  overflow: visible;
  display: block;
  clear: both;
  z-index: 10;
}

/* Fix z-index stacking for carousel elements */
.carousel-slides {
  position: relative;
  z-index: 10;
}

/* Ensure carousel doesn't break the document flow - ONLY FOR HOMEPAGE */
.home-page .carousel-fullwidth {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  z-index: 10;
  display: block;
}

/* Ensure the carousel doesn't affect layout of other elements */
.carousel-section::after {
  content: "";
  display: table;
  clear: both;
  height: 0;
}
