/* Base Styling */
body, html {
    scroll-behavior: smooth;
    background: #f4f4f4;
    color: black;
    overflow-x: hidden;
}

.hero {
    position: relative;
    background-image: url('./img/projects/large/liberty_harbor_east_1_large.webp');
    background-size: cover;
    background-attachment: fixed; /* Parallax effect */
    background-position: center;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-align: center;
    color: white;
    margin-top: -70px; /* Compensate for body padding-top */
    padding-top: 70px; /* Add padding to account for fixed header */
    /* Performance optimizations */
    will-change: transform;
    contain: layout style paint;
}

@media (max-width: 989px) {
    .hero {
        margin-top: -65px;
        padding-top: 65px;
    }
}

@media (max-width: 768px) {
    .hero {
        margin-top: -60px;
        padding-top: 60px;
    }
}

@media (max-width: 480px) {
    .hero {
        margin-top: -55px;
        padding-top: 55px;
    }
}

.hero h1 {
    font-size: 6em;
    z-index: 2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hero p {
    font-size: 1.2em;
    margin-top: 10px;
    z-index: 2;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.41);
    z-index: 1;
    pointer-events: none; /* Ensure that the overlay does not interfere with user interactions */
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0; /* Initial opacity */
    animation: fadeIn 1.75s ease-in-out forwards; /* Fade-in animation */
    transform: translateY(0);
    animation: fadeInUp 2s ease-in-out forwards;
    margin-top: -50px;
    width: 90%;
    max-width: 800px;
}

/* 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 */
    }
}

/* Flooring Services Styling */
.flooring-installation {
    background-color: white;
    padding: 60px 5%;
}

.commercial-flooring {
    background-color: #f4f4f4;
    padding: 60px 5%;
    text-align: center;
}

.commercial-flooring h1 {    
    font-size: 4em;
    color: #0b477c;
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.commercial-flooring h2 {    
    font-size: 4em;
    color: #0b477c;
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.commercial-flooring p {
    text-align: justify;
    font-size: 1.5em;
    line-height: 1.6;
    text-align-last: center;
    margin-left: 55px;
    margin-right: 55px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.responsive-text h1,
.responsive-text h2 {
    font-size: 4em;
    color: #0b477c;
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.responsive-text p {
    font-size: 1.5em;
    line-height: 1.6;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.responsive-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .responsive-grid {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
        gap: 20px;
        padding: 0 20px;
    }
}

/* Mobile adjustments: hero, headings, paragraphs, fixed heights */
@media (max-width: 768px) {
    .hero {
        height: auto;
        min-height: 60vh;
        background-attachment: scroll;
        padding: 80px 20px 40px;
    }
    
    /* Fix overlay opacity for better text readability on mobile */
    .overlay {
        background-color: rgba(0, 0, 0, 0.25) !important;
        height: 100% !important;
    }
    
    /* Ensure hero content is properly visible */
    .hero-content {
        margin-top: 0;
        opacity: 1;
        width: 95%;
    }
    
    .hero h1 {
        font-size: 2.2em;
        line-height: 1.2;
        padding: 0 10px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .responsive-text h1,
    .responsive-text h2,
    .commercial-flooring h1,
    .commercial-flooring h2,
    .who-we-serve h1,
    .who-we-serve h2 {
        font-size: 2.4em;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .responsive-text p,
    .commercial-flooring p,
    .who-we-serve p {
        font-size: 1.1em;
        line-height: 1.6;
        margin-left: 15px;
        margin-right: 15px;
        text-align: left !important;
        text-align-last: left !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .remainingGrid {
        height: auto;
        background-attachment: scroll;
        padding-bottom: 40px;
    }
    
    /* Fix section padding and margins */
    .flooring-installation,
    .commercial-flooring,
    .who-we-serve {
        padding: 40px 20px;
    }
    
    /* Fix large headings that extend beyond viewport */
    h2[style*="font-size: 4.5em"] {
        font-size: 2.4em !important;
        margin: 0 15px 20px 15px !important;
        line-height: 1.2 !important;
        word-spacing: normal !important;
        letter-spacing: normal !important;
    }
    
    /* Override any inline styles for main headings */
    section h2 {
        font-size: 2.4em !important;
        line-height: 1.2 !important;
        word-spacing: normal !important;
        letter-spacing: normal !important;
        margin: 0 15px 20px 15px !important;
    }
    
    /* Fix paragraph margins that cause horizontal overflow */
    p[style*="margin: 0 80px"] {
        margin: 0 15px !important;
        font-size: 1.1em !important;
        line-height: 1.5 !important;
        word-spacing: normal !important;
        letter-spacing: normal !important;
        text-align: left !important;
        text-align-last: left !important;
    }
    
    /* Fix accordion content padding */
    .accordion-content {
        padding: 0 20px 0 20px !important;
    }
    
    /* Fix learn more link margins */
    .learn-more-link {
        margin: 15px 15px !important;
        font-size: 1.2em !important;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8em;
    }
    
    .responsive-text h1,
    .responsive-text h2,
    .commercial-flooring h1,
    .commercial-flooring h2,
    .who-we-serve h1,
    .who-we-serve h2 {
        font-size: 2.2em;
    }
    
    .responsive-text p,
    .commercial-flooring p,
    .who-we-serve p {
        font-size: 1em;
        margin-left: 10px;
        margin-right: 10px;
    }
}

.responsive-text h1 {
    font-size: 4em;
    color: #0b477c;
    margin-bottom: 20px;
}

.responsive-text h2 {
    font-size: 4em;
    color: #0b477c;
    margin-bottom: 20px;
}

.responsive-text p {
    text-align: left;
    font-size: 1.5em;
    line-height: 1.6;
}

.responsive-image {
    width: 100%;
    display: flex;
    justify-content: center;
}

.responsive-image img {
    width: 100%;
    height: 100%; /* Makes the image fill its container */
    object-fit: cover; /* Crops it nicely instead of squishing */
    border-radius: 6px;
}

.accordion-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
}

.accordion-item {
    background-color: #0b477c;
    border-radius: 8px;
    overflow: hidden;
}

/* Button style */
.accordion-toggle {
    .accordion-toggle h3:first-child {
        font-size: 1.4em;
        text-align: left;
    }
    background: none;
    border: none;
    width: 100%;
    padding: 18px 25px;
    color: white;
    font-size: 1.4em;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: inherit;
}

/* Hidden content style */
.accordion-content {
    background-color: #e7e7e7;
    color: #000;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 40px 0 40px;
}

.accordion-content p {
    font-size: 1.4em;
    line-height: 1.8;
    margin: 20px 0;
    text-align: left;
}

/* When open */
.accordion-item.open .accordion-content {
    max-height: 500px; /* enough for full content */
    padding-bottom: 20px;
}

.accordion-item.open .plus-icon {
    transform: rotate(45deg); /* turns + into an x */
    transition: transform 0.3s ease;
}

/* 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;
}

.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);
}

.installation-process {
    background-color: #f9f9f9;
    padding: 60px 20px;
    font-family: Arial, sans-serif; /* Swap for your site's font */
}

.installation-process .container {
    max-width: 1100px;
    margin: 0 auto;
}

.installation-process h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
}

/* The timeline container with a central vertical line */
.timeline {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px 0;
  }
  
  /* Create a vertical line in the middle */
  .timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: #1667B8; /* Change to your design’s accent color */
    transform: translateX(-50%);
  }
  
  /* Each timeline item spans the full width */
  .timeline-item {
    position: relative;
    width: 100%;
    padding: 40px 0;
    box-sizing: border-box;
  }
  
  /* Content boxes – set to 45% width to leave space for the center circle and some breathing room */
  .timeline-item .content {
    width: 43.5%;
    background: #0b477c;
    color: white;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 1.2em;
  }
  
  /* Left-side items: float left and right‑aligned text */
  .timeline-item .content.left {
    float: left;
    text-align: left;
    clear: both;
    position: relative;
  }
  
  /* Right-side items: float right and left‑aligned text */
  .timeline-item .content.right {
    float: right;
    text-align: left;
    clear: both;
    position: relative;
  }
  
  /* Arrow for left-side content: use ::after to create a small pointer on the right edge */
  .timeline-item .content.left::after {
    content: "";
    position: absolute;
    top: 20px;
    right: -40px;
    border-width: 20px;
    border-style: solid;
    border-color: transparent transparent transparent #00ccfc;
  }
  
  /* Arrow for right-side content: use ::before to create a small pointer on the left edge */
  .timeline-item .content.right::before {
    content: "";
    position: absolute;
    top: 20px;
    left: -40px;
    border-width: 20px;
    border-style: solid;
    border-color: transparent #00ccfc transparent transparent;
  }
  
  /* The number circle is positioned in the middle of the timeline */
  .timeline-item .number {
    position: absolute;
    top: 77.5px; /* Adjust to vertically center relative to the content */
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    height: 60px;
    width: 60px;
    z-index: 2; /* Ensure it sits above the vertical line */
  }
  
  /* Clear floats if necessary */
  .timeline-item::after {
    content: "";
    display: table;
    clear: both;
  }
  
  /* Responsive adjustments: On smaller screens, stack the timeline items */
  @media (max-width: 768px) {
    .timeline::before {
      left: 20px; /* shift line to the left */
      transform: none;
    }
    .timeline-item .content {
      width: calc(100% - 60px);
      float: none;
      text-align: left;
      margin-left: 40px;
    }
    .timeline-item .content.left::after,
    .timeline-item .content.right::before {
      display: none;
    }
    .timeline-item .number {
      left: 20px;
      transform: translate(0, -50%);
    }
  }
  
.who-we-serve {
    background-color: #fff;
    padding: 60px 20px;
    color: #0b477c;
}

.who-we-serve h1 {
    font-size: 4em;
    color: #0b477c;
    margin-bottom: 20px;
    text-align: center;
}

.who-we-serve h2 {
    font-size: 4em;
    color: #0b477c;
    margin-bottom: 20px;
    text-align: center;
}

.who-we-serve p {
    text-align: left;
    font-size: 1.5em;
    line-height: 1.6;
    text-align-last: center;
    margin-left: 55px;
    margin-right: 55px;
    color: #000;
}

.industry-section {
    text-align: center;
    padding: 60px 5%;
    background-color: white;
}

.industry-section h2 {
    font-size: 1.8em;
    color: #0b477c;
    margin-bottom: 40px;
}

.industry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    justify-items: center;
    margin: 0px 200px;
}
  
.industry-subgrid {
    grid-column: 1 / -1; /* Span all 4 columns */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}
  
.industry-card {
    max-width: 200px;
    text-align: center;
}
  
/* Responsive: stack on mobile */
@media (max-width: 1200px) {
    .industry-grid {
        grid-template-columns: repeat(2, 1fr);
        margin: 0px 30px;
    }

    .industry-subgrid {
        grid-template-columns: repeat(2, 1fr);
        grid-column: 1 / 0;
    }
}

@media (max-width: 560px) {
    .industry-grid {
        grid-template-columns: 1fr;
        margin: 0px 20px;
    }

    .industry-subgrid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 2300px) {
    .industry-grid {
        margin: 0px 500px;
    }
}

@media (min-width: 3000px) {
    .industry-grid {
        margin: 0px 800px;
    }
}

.industry-card {
    max-width: 380px;
    text-align: center;
}

.industry-card i {
    color: #0b477c;
    margin-bottom: 15px;
}

.industry-card p {
    font-size: 1.4em;
    color: #0b477c;
    font-weight: bold;
    text-align-last: center;
    text-align: center;
}

/* Post Installation Section */
.remainingGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    color: white;
    background: url("/CSS/img/CB_Flooring_Flooring_Installation_Service.png");
    background-size: cover;
    background-attachment: fixed; /* Parallax effect */
    background-position: center;
    height: 85vh;
}

.gridElementAbout, .gridElementServices {
    background: linear-gradient(135deg, rgba(29, 108, 177, 0.97), rgba(11, 71, 124, 0.97));
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
}

.gridElementAbout:hover, .gridElementServices:hover {
    transform: translateY(-15px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    border-radius: 15px;
}

.gridElementAbout::before, .gridElementServices::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gridElementAbout:hover::before, .gridElementServices:hover::before {
    opacity: 1;
}

.gridElementAbout h2, .gridElementServices h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.gridElementAbout p, .gridElementServices p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #f1f1f1;
}

.gridElementServices {
    top: 0px;
}

@media (max-width: 753px) {
    .remainingGrid {
        overflow: scroll!important;
    }
}

@media (min-width: 754px) {
    .remainingGrid {
        overflow: hidden!important;
    }
}

/* Grid Element Animations */
@keyframes fadeInGrid {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.gridElementAbout, .gridElementServices {
    animation: fadeInGrid 1s ease-in-out forwards;
}
