:root {
  --header-height: 5em;
  --circle-img-radius: 15em;
}

/* Basic resets for all media*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
  }

  html {
    scroll-behavior: smooth;
  }
  body {
    font-family: Arial, sans-serif;
    overflow-x: hidden; 
    background-color: #8B0000; /* Dark red evokes firefighter vibes */
    color: #fff;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
  }
  
  /* Fixed header styling */
  .header {
    display: grid;
    grid-template-areas:
      "company hamburger"
      "phone phone";
    grid-template-columns: auto auto;
    align-items: center;
    background: #333;
    color: #fff;
    padding: 1.2rem;
    position: fixed;
    width: 100%;
    height: var(--header-height); /* Fixed header height */
    z-index: 1100; /* Ensures header stays on top */
  }
  
  /* Company name as a clickable link */
  .company-name {
    grid-area: company;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    color: #fff;
  }
  
  /* Phone number styling */
  .phone-number {
    grid-area: phone;
    text-align: center;
    text-decoration: none;
    color: #fff;
    font-size: 1rem;
    margin-top: 0.5rem;
  }
 
   /* Desktop adjustments */
  @media (min-width: 768px) {
    .header > .phone-number {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, calc(-50% - 20px));
      margin-top: 0; /* Ensure no extra offset */
    }
  }
 
  
  /* Hamburger icon styling */
  .hamburger {
    grid-area: hamburger;
    justify-self: end;
    cursor: pointer;
    width: 25px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .hamburger .bar {
    height: 3px;
    width: 100%;
    background: #fff;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  
  /* Sidebar styling */
  .sidebar {
    position: fixed;
    top: var(--header-height); /* start below the header */
    right: -250px; /* hide offscreen to the right initially */
    max-width: 250px;
    width: 60%;
    height: calc(100vh - var(--header-height));
    background: #444;
    transition: right 0.3s ease;
    z-index: 1000;
  }
  
  .sidebar.active {
    right: 0;
  }
  
  .sidebar ul {
    list-style: none;
  }
  
  .sidebar li {
    padding: 15px 20px;
  }
  
  .sidebar li a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
  }
  
  /* Hamburger animation when active */
  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
  }
  
  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
  }
  
  section {
    position: relative;
    min-height: calc(100vh - var(--header-height));
    /* min-height: 100vh; */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    scroll-margin-top: var(--header-height);
    top: var(--header-height)
  }

  
  
  /* Background images container */
  .background-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row; /* Desktop: side by side */
    z-index: -1; /* Place behind content */
  }
  
  /* Each half of the background */
  .bg-half {
    flex: 1;
    background-size: cover;
    background-position: center;
  }
  
  #bg-half1 {
    background-image: url('images/fence_3.jpg');
    border-right: 2px solid #fff; /* Thin border between images */
  }
  
  #bg-half2 {
    background-image: url('images/deck_2.jpg');
  }
  
  /* Mobile adjustments: stack vertically */
  @media (max-width: 767px) {
    .background-wrapper {
      flex-direction: column;
    }
    #bg-half1 {
      border-right: none;
      border-bottom: 2px solid #fff;
    }
  }
  
  /* Foreground home content styling */
  .home-content {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.7); /* Optional overlay for readability */
    padding: 20px 0px;
    border-radius: 8px;
  }
  
  /* Logo styling */
  .home-logo {
    width: 100%;
    height: auto;
    padding: 75px;
  }
  
  /* Text styling */
  .home-half {
    color: #fff;
    margin-left: 20px;
    margin-right: 20px;
    text-align: center;
    width: 50%;
  }
  
  .home-half h2 {
    font-size: 2rem;
    margin-bottom: 10px;
  }
  
  .home-half p {
    font-size: 1.2rem;
  }
  .home-buttons {
    margin-top: 20px;
  }
  
  .btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 10px;
    text-align: center;
    border: 2px solid #fff;
    color: #fff;
    text-decoration: none;
    font-size: 2rem;
    border-radius: 50px;
    transition: background-color 0.3s, color 0.3s;
    background-color: rgba(139, 0, 0, .5);
  }
  
  .btn:hover {
    background-color: #fff;
    color: #8B0000; /* Dark red to match the theme */
  }
  
  /* Mobile: stack logo above text */
  @media (max-width: 767px) {
    .home-content {
      flex-direction: column;
      text-align: center;
      padding: 20px 20px;
      margin-top: 0vh;
    }
    .home-half {
      margin-left: 0;
      margin-right: 0;
      width: 100%;
      height: 50%;
    }
    .home-half img {
      padding: 10px 0px 20px;
    }
  }
  
  /* Remove max-width so wrapper spans full width */
  .content-wrapper {
    width: 100%;
    height: calc(100vh - var(--header-height));
  }
  

  /* Portfolio section unified container */
/* Unified container for portfolio */
.portfolio-inner {
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.4);  /* Unified dark backdrop */
    border-radius: 8px;
    padding: 20px;  /* Outer padding around both columns */
    height: calc(100vh - var(--header-height));
  }
  
  .intro p {
    font-size: 1.5em;
  }

  @media (max-width: 767px) {
    .portfolio-inner {flex-direction: column;}
    .intro p {
      font-size: 1em;
    }
  }

  /* Remove the background from children but keep their padding */
  .portfolio-testimonials,
  .portfolio-carousel {
    background: transparent;
    /* padding: 20px;  Maintain internal spacing so content isn't squished */
  }
  .portfolio-testimonials {
    width: 25%;  
  }
  .portfolio-carousel {
    width: 75%;  
  }

  @media (max-width: 767px) {
    .portfolio-testimonials,
    .portfolio-carousel {
      width: 100%;
    }
  }

  
  .portfolio-testimonials h2 {
    text-align: center;
    /* margin-bottom: 20px; */
    background: rgba(0, 0, 0, 0.5);
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
  }

  .portfolio-testimonials .intro {
    padding: 1em;
  }
  
  
  .testimonial {
    margin-bottom: 15px;
  }
  .testimonial p {
    font-style: italic;
    margin-bottom: 5px;
    font-size: 1.5em;
  }
  .testimonial cite {
    font-size: 0.9rem;
    color: #ccc;
  }

    
  .testimonial-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
  }
  
  .testimonial-carousel .carousel {
    display: flex;
    gap: 10px; /* Optional: space between slides */
    transition: transform 0.5s ease-in-out;
  }
  
  .testimonial-carousel .carousel-slide {
    flex: 0 0 100%;
    padding: 20px; /* Internal padding for testimonials */
    box-sizing: border-box;
  }
  
  /* Optionally, adjust the height if needed (or let it size to content) */
  .testimonial-carousel .testimonial {
    /* background: rgba(255, 255, 255, 0.1); A light overlay to differentiate slides */
    padding: 20px;
    border-radius: 8px;
    color: #fff;
  }
  
  /* Use the same nav button styles as your image carousel */
  .testimonial-carousel .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
  }
  
  .testimonial-carousel .prev {
    left: 10px;
  }
  
  .testimonial-carousel .next {
    right: 10px;
  }
  .portfolio-inner > div {
    /* flex: 1; */
    overflow: hidden;
  }

.carousel-container, .testimonial-carousel {
  touch-action: pan-y;
}

  @media (max-width: 767px) {
    .testimonial p {
      font-size: 1em;
    }
    .testimonial cite {
      font-size: 0.7rem;
    }
    .testimonial-carousel .testimonial {
      padding: 0px;
      background-color: #2b0000;
    }
  }
  
  /* Carousel container: set to 100% of parent with a fixed height */
  .carousel-container {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-height));  /* Default height for larger screens */
    overflow: hidden;
    margin: 0 auto;
  }
  
  /* Carousel inner: use flex gap to simulate a border between slides */
  .carousel {
    display: flex;
    gap: 2px;  /* This creates a slight boundary between slides */
    transition: transform 0.5s ease-in-out;
  }
  
  /* Each slide fills the container */
  .carousel-slide {
    width: 100%;
    height: 100%;
    flex: 0 0 100%;
    overflow: hidden;
    box-sizing: border-box;
    background-color: rgb(43 0 0);
    
  }
  
  /* Image styling: fill container without distortion */
  .carousel-slide img {
    width: 100%;
    height: calc(100vh - var(--header-height));
    object-fit: cover;
    object-position: center;
    display: block;
  }
  
  @media (max-width: 767px) {
    .carousel-slide img {
      height: auto;
    }
  }

  /* Carousel navigation buttons */
  .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
  }
  .prev { 
    left: 10px;
  }
  .next { 
    right: 10px;
  }
  
/* Mobile stacking */
@media (max-width: 767px) {
  .portfolio-inner {
    flex-direction: column;
  }
  .portfolio-testimonials {
    width: 100%;  
  }
  .portfolio-carousel {
    width: 100%;  
  } 
}

  /* Hide nav buttons on mobile */
  @media (max-width: 767px) {
    .carousel-btn {
      display: none;
    }
    .carousel-container {
      height: 40vh;  /* Reduced height for mobile view */
    }
  }
  .modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000; /* Lower than the header's z-index (which is 1100) */
    top: 70px; /* Starts below the header */
    left: 0;
    width: 100%;
    height: calc(100% - 70px); /* Full height minus header */
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
  }
  
  .modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    padding-top: 5%;
  }
  
  .modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1100;
  }
  
  /* Estimate Section Styling */
  .estimate-wrapper {
    width: 100%;
    
    /* padding: 20px 0px; */
    /* margin: 20px auto; */
  }
  .estimate-inner {
    display: flex;
    /* gap: 20px; */
    align-items: flex-start;
    background: rgba(0, 0, 0, 0.4);
  }
  .estimate-blurb {
    flex: 1;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    /* border-radius: 8px; */
  }
  .estimate-form {
    flex: 1;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    width: 100%;
    background-image: url('images/barn_door.jpg');
    background-size: cover;
  }

  
  
  /* Stack columns vertically on mobile */
  @media (max-width: 767px) {
    .estimate-inner {
      flex-direction: column;
    }
    .estimate-form iframe {
      height: 70vh;
    }
  }
  
  .services {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    font-size: 2em;
    font-weight: bold;
    position: relative;
    scroll-margin-top: 5px;
  }
  .slider-container {
    /* You can remove the fixed height if you want the container to size naturally */
    width: 32vw;
    max-width: 100vw;
    /* height: calc(100vh - 90px); */
    margin: auto;
    overflow: hidden;
  }
  .services-text h2 {
    text-align: center;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.5);
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
  }

  .services-text p {
    /* text-align: center; */
    margin-bottom: 20px;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.5em;
  }

  .benefits-blurbs {
    display: flex;
    flex-wrap: wrap;
  }

  .circle-img-container {
    flex: 1;
    justify-items: center;
  }

  .circle-img-container p {
    font-size: 1.5em;
    text-align: center;
  }

  .circular-mask {
    width: var(--circle-img-radius);
    height: var(--circle-img-radius);
    border-radius: 50%;
    object-fit: cover;
    overflow: hidden;
    /* object-position: 60px 40px; */
    border-color: white;
    border-width: 5px;
    border-style: solid;
    /* translate: revert-layer; */
}
  
.circular-mask img {
  height: var(--circle-img-radius);
  display: block;
  translate: calc(-1 * var(--circle-img-radius) / 2);
  object-fit: cover;
}
  
@media (max-width: 767px) {
  #services .content-wrapper {
    /* min-height: calc(175vh - var(--header-height)); */
    height: 100%;
  }
  .services-text p {
    text-align: justify;
    margin-bottom: 20px;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1em;
  }
  .circle-img-container {
    flex: 1;
    justify-items: center;
    --circle-img-radius: 8em;
  }

  .circle-img-container p {
    text-align: center;
  }

  .circular-mask {
    width: var(--circle-img-radius);
    height: var(--circle-img-radius);
    border-radius: 50%;
    object-fit: cover;
    overflow: hidden;
    /* object-position: 60px 40px; */
    border-color: white;
    border-width: 5px;
    border-style: solid;
    /* translate: revert-layer; */
  }
  
  .circular-mask img {
    height: var(--circle-img-radius);
    display: block;
    translate: calc(-1 * var(--circle-img-radius) / 2);
    object-fit: cover;
  }
}

  .services-slider p {
    font-style: italic;
    font-size: 0.9em;
    text-align: center;
  }

  .before-after {
    position: relative;
    width: 100%;
    /* Remove height: auto if present so the container’s height is determined by its content */
  }
  
  /* Let the "before" image be in the normal flow */
  .before-after .before {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
  }
  
  /* Position the "after" image absolutely on top */
  .before-after .after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: inset(0 75% 0 0); /* Show only the right half initially */
  }
  .before-after img {
    user-select: none;
    -webkit-user-drag: none;
  }
  
  
  
  /* Slider bar styles remain largely the same */
  .slider-bar {
    position: absolute;
    top: 0;
    left: 25%;
    transform: translateX(-75%);
    width: 4px;
    height: 100%; /* Now matches the height of the .before-after container (set by the "before" image) */
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .slider-bar::before {
    content: '\2630';
    font-size: 20px;
    color: black;
    background: white;
    padding: 5px;
    border-radius: 50%;
  }

  @keyframes shimmy {
    0% { transform: translateX(-0px); }
    20% { transform: translateX(-0px); }
    30% { transform: translateX(-50px); }
    50% { transform: translateX(+100px); }
    70% { transform: translateX(-75px); }
    90% { transform: translateX(+50px); }
    100% { transform: translateX(-0px); }
  }
  
  .slider-bar.shimmy {
    animation: shimmy 1.5s ease-in-out;
  }
  
  @keyframes afterShimmy {
    0% { clip-path: inset(0 75% 0 0); }
    20% { clip-path: inset(0 75% 0 0); }
    30% { clip-path: inset(0 calc(75% + 50px) 0 0); }
    50% { clip-path: inset(0 calc(75% - 100px) 0 0); }
    70% { clip-path: inset(0 calc(75% + 75px) 0 0); }
    90% { clip-path: inset(0 calc(75% - 50px) 0 0); }
    100% { clip-path: inset(0 75% 0 0); }
  }
  
  /* Apply the animation when the class is added */
  .afterShimmy {
    animation: afterShimmy 1.5s ease-in-out;
  }
  

/* Services section layout */
/* Services section unified container */
#services .services-inner {
    display: flex;
    /* align-items: center; */
    gap: 20px;
    background: rgba(0, 0, 0, 0.4);  /* Unified dark backdrop */
    border-radius: 8px;
    padding: 20px;
    height: 100%;
  }
  
  /* Remove individual background styling from these if present */
  .services-text,
  .services-slider {
    background: transparent;
    padding: 0;
  }

  .services-slider {
    width: calc(100vw - 80px);
  }

  
  
  /* Mobile stacking: text above slider */
  @media (max-width: 767px) {
    #services .services-inner {
      flex-direction: column;
    }

    .slider-container {
      width: 75vw;
    }
  }

  .jotform-side-estimate {
    transform: rotate(-90deg); 
    padding: 4px 18px; 
    position: fixed; 
    right: 0px; 
    font-family: verdana; 
    font-size: 13px; 
    color: rgb(139, 0, 0); 
    background: rgb(255, 255, 255); 
    z-index: 999; 
    cursor: pointer; 
    text-align: center; 
    text-decoration: none; 
    border-radius: 5px 5px 0px 0px; 
    margin-right: -78px; 
    top: 50%; 
    margin-top: -16px; 
    text-shadow: none;
  }

  main {
    flex: 1;
    /* height: 100vh; */
  }

  @media (max-width: 767px) {
    .btn {
      padding: 0px;
    }
  }

  /* Footer Base Styles */
.site-footer {
  background: #333;
  color: #fff;
  font-size: 0.9em;
  line-height: 1.4;
  transform: translateY(var(--header-height));
}

.footer-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 1em;
  justify-content: space-evenly;
}

@media (max-width: 767px) {
  .footer-content {
    flex-direction: column;
  }
}

/* Branding */
.footer-branding {
  text-align: center;
  margin-bottom: 1em;
}
.footer-logo {
  max-width: 5em; /* adjust as needed */
  margin-bottom: 0.5em;
}

/* Navigation */
.footer-nav {
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1em;
}
.footer-nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.3em 0.5em;
}
.footer-nav a:hover {
  text-decoration: underline;
}

/* Contact */
.footer-contact {
  text-align: center;
  margin-bottom: 1em;
}
.footer-contact a {
  color: #fff;
  text-decoration: none;
}
.footer-contact a:hover {
  text-decoration: underline;
}

/* Social Media */
.footer-social {
  margin-bottom: 1em;
}
.footer-social a {
  color: #fff;
  text-decoration: none;
  padding: 0.3em 0.5em;
}
.footer-social a:hover {
  text-decoration: underline;
}

/* Footer Bottom */
.footer-bottom {
  background: #222;
  text-align: center;
  padding: 0.5em;
  font-size: 0.8em;
}

iframe img {  
  max-height: max-content;
}