/* Global Styles */
body, html {
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #f9f9f9;
    line-height: 1.6;
    overflow-x: hidden;
    font-family: "Libre Franklin", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

/* Hero Section Styles */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.hero-section img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-section .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45); /* Light opacity white background */
    z-index: 1!important;
}

.hero-section .text {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-weight: 450;
    z-index: 2!important;
    opacity: 1!important;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.52);
    width: 90%;
    max-width: 600px;
}

.hero-section .text h1 {
    font-size: 5rem;
    color: white;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Our History */
.our-history {
    background-color: white;
}

.responsive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal-width columns */
    align-items: center;
    gap: 40px;
    padding: 100px;
    margin: 0 auto;
    max-width: 1400px;
}

@media (max-width: 1000px) {
    .responsive-grid {
        grid-template-columns: 1fr; /* Single column on smaller screens */
        padding: 30px;
        gap: 30px;
    }
}

/* Mobile adjustments for hero and typography */
@media (max-width: 768px) {
    .hero-section {
        height: 60vh;
    }
    
    .hero-section img,
    .hero-section .overlay {
        height: 100%;
    }
    
    .hero-section .text {
        top: 50%;
        transform: translate(-50%, -50%);
        width: 95%;
    }
    
    .hero-section .text h1 {
        font-size: 2.4rem;
        line-height: 1.2;
    }
    
    .responsive-grid {
        padding: 20px;
        gap: 20px;
    }
    
    .responsive-grid h1 {
        font-size: 2.6em;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .responsive-grid p {
        font-size: 1.15em;
        line-height: 1.6;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .section-dark .content-container h1 {
        transform: none;
        font-size: 2.4em !important;
        line-height: 1.2;
    }
    
    .section-dark .content-container p {
        transform: none;
        max-width: 100%;
        font-size: 1.1em !important;
        line-height: 1.6;
    }
    
    .our-amazing-team h1 {
        font-size: 2.4em !important;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .our-amazing-team p {
        font-size: 1.1em !important;
        line-height: 1.6;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

@media (max-width: 480px) {
    .hero-section .text h1 {
        font-size: 2rem;
    }
    
    .responsive-grid h1 {
        font-size: 2.2em;
    }
    
    .responsive-grid p {
        font-size: 1em;
    }
}

.responsive-grid h1 {
    color: #0b477c;
    line-height: 1;
    font-size: 5em;
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.responsive-grid p {
    font-size: 1.6em;
    line-height: 1.4;
    text-align: left;
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.image-column {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* space between images */
    align-items: center; /* optional: center images horizontally */
}
  
.image-column img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease-in-out;
    border-radius: 8px;
    /* Image optimization */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Prevent layout shift during loading */
    aspect-ratio: 16/9;
    background-color: #f0f0f0; /* Placeholder color */
    /* Performance optimization */
    will-change: transform;
    backface-visibility: hidden;
}

/* Bode Floors - Section Styles */
.section-light, .section-dark {
    padding: 60px 20px;
    position: relative;
}

.section-light {
    background-color: #f9f9f9;
}

.section-dark {
    background-color: #333;
    color: white;
}

/* Content Container */
.content-container {
    max-width: 1800px;
    margin: 0 auto;
    text-align: left;
    opacity: 0;
    transform: translateX(100px);
    display: grid;
    grid-template-columns: 1fr 1fr; /* Ensure equal column width */
    gap: 40px;
    align-items: top; /* Align content vertically in the center */
}

@media (max-width: 1000px) {
    .content-container {
        grid-template-columns: 1fr; /* Display content in a single column on smaller screens */
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .content-container {
        gap: 20px;
        padding: 0 20px;
    }
    
    .section-light, .section-dark {
        padding: 40px 20px;
    }
}

.content-container h1 { /* rather fascinatingly, the vertical gap isn't taken care of by padding but rather translate y, and it ties with the max-height in content-container above*/
    font-size: 5.0rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.section-dark .content-container h1 {
    transform: translateY(-80px);
}

.content-container p {
    font-size: 1.6rem;
    margin: 0 auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.section-dark .content-container p {
    transform: translateY(-140px);
    max-width: 800px;
}

.content-container img {
    width: 100%;
    max-width: 800px;
    opacity: 0;
    justify-self: center; /* Centers the image within its grid cell */
    border-radius: 8px;
}

.section-dark .content-container img {
    transform: translateY(20px);
}

/* Mobile fixes for content container transforms */
@media (max-width: 768px) {
    .content-container {
        gap: 20px;
        padding: 0 20px;
        opacity: 1;
        transform: none;
    }
    
    .section-light, .section-dark {
        padding: 40px 20px;
    }
    
    .section-dark .content-container h1 {
        transform: none;
        font-size: 2.4em !important;
        line-height: 1.2;
    }
    
    .section-dark .content-container p {
        transform: none;
        max-width: 100%;
        font-size: 1.1em !important;
        line-height: 1.6;
    }
    
    .section-dark .content-container img {
        transform: none;
        opacity: 1;
    }
    
    .content-container h1 {
        font-size: 2.4em;
        line-height: 1.2;
    }
    
    .content-container p {
        font-size: 1.1em;
        line-height: 1.6;
    }
    
    .content-container img {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .content-container {
        padding: 0 15px;
    }
    
    .section-light, .section-dark {
        padding: 30px 15px;
    }
    
    .content-container h1 {
        font-size: 2.2em;
    }
    
    .content-container p {
        font-size: 1em;
    }
}

/* Add optional styling to ensure the text content is vertically centered in its column */
.content-container div {
    display: flex;
    flex-direction: column;
    justify-content: left; /* Vertically centers the content */
}

/* Builder Design Center, text reuses from responsive-grid*/
.builder-design-center .learn-more-link {
    color: #00ccfc;
    text-decoration: none;
}

/*What We Install*/
.what-we-install {
    background-color: #d0d0d0; /* some light gray*/
    text-align: center;
    padding-top: 50px;
    padding-bottom: 50px;
}

.what-we-install h1 {
    color: #0b477c;
    line-height: 1;
    font-size: 5em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.what-we-install p {
    font-size: 1.6em;
    line-height: 1.4;
    padding-left: 40px;
    padding-right: 40px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .what-we-install {
        padding: 30px 20px;
    }
    
    .what-we-install h1 {
        font-size: 2.4em;
        line-height: 1.2;
    }
    
    .what-we-install p {
        font-size: 1.1em;
        padding-left: 20px;
        padding-right: 20px;
    }
}

.products-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 0 40px;
}

@media (min-width: 1200px) {
    .products-cards {
      grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background: white;
    min-height: 300px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.card h3 {
    color: #0b477c;
    font-size: 2.2em;
    font-weight: bold;
}

.card p {
    text-align: center;
    font-size: 1.6em;
    line-height: 1.6;
}

/*Our National Partners*/
.our-national-partners {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 80px;
}

.our-national-partners h1 {
    color: white;
    line-height: 1.3;
    font-size: 5em;
    text-align: center;
    padding: 0px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.our-national-partners p {
    text-align: center;
    padding-bottom: 40px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .our-national-partners {
        padding: 40px 20px;
    }
    
    .our-national-partners h1 {
        font-size: 2.4em;
        line-height: 1.2;
    }
    
    .our-national-partners p {
        font-size: 1.1em;
        line-height: 1.6;
    }
}

/*Our Amazing Team*/
.our-amazing-team {
    background-color: #f9f9f9;
    text-align: center;
    padding: 120px;
}

.our-amazing-team h1 {
    color: #0b477c;
    line-height: 1;
    font-size: 5em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .our-amazing-team {
        padding: 40px 20px;
    }
    
    .our-amazing-team h1 {
        font-size: 2.4em;
        line-height: 1.2;
    }
    
    .our-amazing-team p {
        font-size: 1.1em;
        line-height: 1.6;
        text-align: left;
    }
}

/* Keyframes for the fade-in and slide-in effect */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(50px); /* Start below the view */
    }
    100% {
        opacity: 1;
        transform: translateY(0); /* Move to original position */
    }
}

/* Animation class for cards */
.card.animate {
    animation: fadeInUp 0.4s ease-out forwards; /* Each card animation lasts 0.4 seconds */
}

/* Staggered delays for individual cards */
.card:nth-of-type(1) { animation-delay: 0s; }
.card:nth-of-type(2) { animation-delay: 0.2s; }
.card:nth-of-type(3) { animation-delay: 0.4s; }

/* Animations */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.fade-in {
    animation: fadeIn 1.5s ease-out forwards;
}

.slide-in {
    animation: slideIn 1.5s ease-out forwards;
    animation-delay: 0.5s;
}

.in-view {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Learn More Link Styling */
.learn-more-link {
    display: inline-flex;
    align-items: center;
    font-size: 1.4rem;
    font-weight: bold;
    text-decoration: none;
    color: #00ccff;
    transition: color 0.3s ease;
    margin-top: 15px;
    cursor: pointer;
    position: relative;
    z-index: 3;
    background-color: transparent;
    border: none;
}

.learn-more-link:hover {
    color: #00aaff;
}

.learn-more-link .arrow {
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.learn-more-link:hover .arrow {
    transform: translateX(5px);
}

@media (min-width: 990px) {
    /* Adjust the grid to have fewer columns */
    .affiliation-logos {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important; /* Adjust column width */
        gap: 15px; /* Slightly smaller gap */
    }

    .logo-box {
        width: 120px; /* Adjust box width */
        height: 80px; /* Adjust box height */
    }
}

@media (max-width: 989px) {
    /* For very small devices */
    .affiliation-logos {
        grid-template-columns: 1fr 1fr !important; /* Force 2 columns */
        gap: 10px; /* Smaller gap */
    }

    .logo-box {
        width: 100px; /* Smaller width */
        height: 70px; /* Smaller height */
    }

    .affiliations {
        padding: 40px 5%; /* Reduce padding for smaller screens */
    }
}

@media (max-width: 600px) {
    /* For mobile devices */
    .affiliation-logos {
        grid-template-columns: 1fr !important; /* Force single column */
        gap: 5px; /* Smaller gap */
    }

    .logo-box {
        width: 75px; /* Smaller width */
        height: 45px; /* Smaller height */
    }

    .affiliations {
        padding: 20px 5%; /* Reduce padding for mobile */
    }
}

/* Affiliations Section Styling */
.affiliations {
    background: #f4f4f4;
    padding: 80px 5%;
}

.affiliation-logos {
    display: grid !important;
    /* grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important; */
    gap: 20px;
    justify-items: center; /* Center logos horizontally */
}

.logo-box {
    height: 125px;
    width: 215px; /* Consistent width for medium screens */
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    transition: transform 0.3s ease-in-out;
}

.logo-box img {
    max-width: 100%; /* Ensure logos fit within the box */
    max-height: 100%; /* Prevent logos from exceeding box height */
    object-fit: contain; /* Maintain aspect ratio */
    object-position: center; /* Center the image */
    justify-content: center;
    align-self: center;
}

.logo-box:hover {
    transform: scale(1.05); /* Slight hover effect */
}


/* Container holding all cards */
.flip-card-container {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
    justify-items: center;
    max-width: 1100px; /* Limit container width */
    margin: 0 auto;    /* Center the container */
}

@media (min-width: 600px) {
    .flip-card-container {
      grid-template-columns: repeat(2, 1fr); /* 2 columns for tablets/smaller laptops */
    }
}
  
@media (min-width: 992px) {
    .flip-card-container {
      grid-template-columns: repeat(3, 1fr); /* 3 columns for larger laptops/desktops */
    }
}
  
  /* Basic styling for each flip card */
  .flip-card {
    background-color: transparent;
    width: 300px;
    height: 200px;
    perspective: 1000px; /* Enables 3D effects */
    transition: transform 0.3s ease; /* Optional scaling effect */
  }

  .flip-card h2 {
    font-size: 1.9rem;
    margin-bottom: 10px;
    color: #0b477c;
  }
  
  /* Optional: Scale up slightly on hover */
  .flip-card:hover {
    transform: scale(1);
  }
  
  /* Inner container for card faces */
  .flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
  }
  
  /* Rotate the inner container on hover */
  .flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
  }
  
  /* Shared styling for both sides */
  .flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  /* Front side appearance */
  .flip-card-front {
    background-color: #ffffff;
    color: #000;
  }
  
  /* Back side appearance and rotated by default */
.flip-card-back {
    background-color: #0b477c;
    color: #fff;
    font-size: 10px;
    transform: rotateY(180deg);
    height: 320px;
    width: auto;
}

.flooring-services-image img{
    width: 100%;
    border-radius: 8px;
}