/* CSS Variables for consistent theming and easy updates */
:root {
    --primary-color: #85182a;
    --primary-dark: #661724;
    --primary-color-transparent: #85182ae6; /* e6 makes transparent */
    --text-color: #333;
    --background-color: #f4f4f9;
    --white: #fff;
    --spacing-unit: 1rem;          /* Base unit for consistent spacing */
    --container-width: 1200px;
    --transition-speed: 0.3s;      /* Consistent animation speed */
    --service-carousel-height: calc(var(--service-item-height) * 1.5); /* Flexable carousel height to ensure service items remain visible*/
    --service-item-width: 350px; /* Width and height for each service item */
    --service-item-height: 500px;
    --service-item-spacing: 200px; /* Spacing between service item */

    /*Service items must account for half their width to prevent overlap */
    /* Calculates the position of service items on the right */
    --service-item-Rpositioning: calc(var(--service-item-spacing) + calc(var(--service-item-width) / 2));
    /* Calculates the position of services items on the left */
    --service-item-Lpositioning: calc(calc(var(--service-item-spacing) + calc(var(--service-item-width) / 2)) * -1);

}

/* CSS Reset - Ensures consistent styling across browsers */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base HTML settings */
html {
    scroll-behavior: smooth;  /* Enables smooth scrolling for anchor links */
    scroll-padding: 10rem; /*Makes navbar scroll 10rem above any section, to make sure it's not obscured*/
    font-size: 16px;         /* Base font size for rem units */
}

/* Body styles - Sets the main document styles */
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Global image settings */
img {
    max-width: 100%;
    height: auto;            /* Maintain aspect ratio */
    display: block;          /* Remove default inline spacing */
}

/* Navigation Bar Styles */
.nav-bar {
    background-color: var(--primary-color);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;          /* Ensures nav stays above other content */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);  /* Subtle shadow for depth */
    transition: background-color var(--transition-speed) ease; /*Transition used to match navbar background to home image*/
}


/* Navigation Bar Transparency - for transparency when over homes section */
.nav-bar.nav-bar-transparent, 
.hamburger-menu.nav-bar-transparent {
    background-color: rgb(0, 0, 0, 0.3); /*Semi-transparent black*/
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Navigation container - centers and spaces navigation items */
.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 2rem;              /* Space between nav items */
    padding: 0 var(--spacing-unit);
}

.nav-logo {
    width: 70px;
    height: auto;
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Individual navigation links */
.individual-nav-bar {
    color: var(--white);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;     /* Rounded corners */
    font-weight: 500;        /* Slightly bold text */
    transition: all var(--transition-speed) ease;  /* Smooth hover effects */
}

/* Navigation hover and focus states */
.individual-nav-bar:hover,
.individual-nav-bar:focus {
    background-color: var(--primary-dark);
    transform: translateY(-2px);  /* Slight lift effect */
}

/*Special hover and focus effects for when navbar is over home section*/
.nav-bar-transparent .individual-nav-bar:hover,
.nav-bar-transparent .individual-nav-bar:focus,
.nav-bar-transparent #myLinks a:hover {
    background-color: rgba(255, 255, 255, 0.25); /*A light white sheen on hover*/
    transform: translateY(-2px);
}

/*Hamburger nav*/
.hamburger-menu {
    background-color: var(--primary-color);
    padding: 10px;
    position: fixed;
    text-align: right;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color var(--transition-speed) ease; /*Transition used to match navbar background to home image*/
}

.hamburger-menu .icon {
    font-size: 24px;
    color: white;
    background-color: transparent;
    border: none;
    text-decoration: none;
    cursor: pointer;
    padding: 10px;
}

#myLinks {
    max-height: 0;
    overflow: hidden;    
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    position: relative;
    left: 0;
    padding: 0px;
    transition: max-height 0.5s ease, padding 0.5s ease;
}

#myLinks.show {
    max-height: 500px;
    padding: 10px;
}

#myLinks a {
    color: white;
    padding: 10px;
    text-decoration: none;
    display: block;
    text-align: center;
    transition: all var(--transition-speed) ease;
}

#myLinks a:hover {
    background-color: var(--primary-dark);
}

/* Home Section Styles */
.home-section {
    padding: 0;
    margin: 0;
    margin-top: 0;
    text-align: center;
    background-image: url(./Stock\ Imgs/pexels-ivan-samkov-4491918.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    position: relative;
    overflow: hidden;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* Ensure content stays above the overlay */
.home-header {
    position: relative;
    z-index: 2;
    background-color: var(--primary-color-transparent);
    color: var(--white);
    padding: 3rem 2rem;
    border-radius: 10px;
    margin: 0 auto;
    max-width: 900px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}


/* Main heading styles */
.home-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Subtitle styles */
.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;          
}

/* Home image container */
.home-image-container {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 var(--spacing-unit);
}


/* Main Section Styles */
.default-section {
    max-width: var(--container-width);
    margin: 10rem auto;
    padding: 0 var(--spacing-unit);
}

/* Section headers */
.section-header {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.section-header-centered {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-align: center;
}

/* Content block layout */
.content-block {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin: 4rem 0;
}

/* Reversed content block (image on left) */
.content-block.reverse {
    flex-direction: row-reverse;
}

/* Text content container */
.text-content {
    flex: 1;                /* Takes up equal space with image */
}

/* Text styles for About Us and Mission Statement */
.about-us-text,
.mission-statement-text {
    font-size: 1.1rem;
    line-height: 1.8;       /* Improved readability */
}

/* Image wrapper */
.section-image-wrapper {
    flex: 1;
    max-width: 500px;
}

/* Section image styles */
.section-image {
    width: 100%;
    height: 400px;
    object-fit: cover;      /* Maintains aspect ratio while filling space */
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-speed) ease;
}

/* Image hover effect */
.section-image:hover {
    transform: translateY(-5px);  /* Slight lift on hover */
}

/* Services Styles */
.service-subheader {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 10px;
    font-weight: normal;
}

.service-image {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: -1;
}

.service-carousel {
    position: relative;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    align-items: top;
    display: flex;
    min-height: var(--service-carousel-height);
    overflow: hidden;
    top: -150px;
    border: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: -250px;
}

.carousel-viewport {
    width: 100%;
    height: calc(var(--service-item-height) + 200px); /*Viewport is 200px taller than service-items for more generous mobile swipe detection*/
    display: flex;
    justify-content: center;
    align-items: center;
}

.service-item {
    position: absolute;   
    color: #F8F8F8;
    height: var(--service-item-height);
    width: var(--service-item-width);
    margin: 1.5rem;
    padding: 20px;
    border: 2px solid black;
    background-color: var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: top;
    padding-top: 75px; /* padding to account for icon-box */
    transition: all 0.8s ease;
  
}

.service-item-header {
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.service-item-spacer {
    border: 0;
    width: calc(var(--service-item-width) * 0.8); /* Spacer is 80% of item's width */
    border-top: 1px solid var(--white);
    margin-top: 0px; /* Spacer closer to heading than content */
    margin-bottom: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.service-item-text {
    font-size: 1.1rem;
    padding: 10px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.service-item > .icon-box {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    background-color: var(--primary-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid black;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.service-item > .icon-box > .icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
/* Service items further on the left must account for items that precede it */
.service-item.far-left {
    transform: translateX(calc(var(--service-item-Lpositioning) * 2));
    opacity: 0;
     z-index: 0;
}

.service-item.left {
    transform: translateX(var(--service-item-Lpositioning));
    z-index: 1;
}

.service-item.center {
    transform: translateY(-20px);
    z-index: 2;
}

.service-item.right {
    transform: translateX(var(--service-item-Rpositioning));
    z-index: 1;
}
/* Service items further on the right must account for items that precede it*/
.service-item.far-right {
    transform: translateX(calc(var(--service-item-Rpositioning) * 2));
    opacity: 0;
    z-index: 0;
}

.carousel-button {
    position: absolute;
    color: var(--white);
    width: 60px;
    height: 60px;
    background-color: var(--primary-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-size: 24px;
    z-index: 3;
    border: none;
    border-radius: 50%;
    transition: all var(--transition-speed) ease-in;
}
.carousel-button:hover {
    opacity: 0.8;
}
.carousel-button:active {
    background-color: black;
}

.carousel-button-left {
    left: 0px;
}

.carousel-button-right {
    right: 0px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/*Contact us*/
.contact-page {
    max-width: var(--container-width);
    margin: 5rem auto;
    padding: 0 var(--spacing-unit);
    padding-bottom: 8rem;
}

.contact-layout {
    display: flex;
    gap: 3rem;
    align-items: stretch;
}

.contact-form {
    flex: 1.2;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
}

.contact-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    justify-content: space-between;
}

.contact-info-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    justify-content: center;
}

.contact-info-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.contact-info-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.contact-card-text {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.form-container {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
}

textarea {
    min-height: 150px;
    resize: vertical;
    font-family: 'Roboto', sans-serif;
}

::placeholder,
input::placeholder,
textarea::placeholder {
    color: #999;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    opacity: 0.8;
}

input[type="f_name"],
input[type="l_name"],
input[type="email"],
input[type="text"],
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color var(--transition-speed) ease;
}

input[type="f_name"]:focus,
input[type="l_name"]:focus,
input[type="email"]:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 2px rgba(133, 24, 42, 0.2);
}

.agreement-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-speed) ease;
}

input[type="checkbox"]:checked {
    background-color: var(--primary-color);
}

input[type="checkbox"]:checked::after {
    content: '✔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
}

.privacy-icon {
    color: var(--primary-color); 
    padding: 5px; 
    font-size: 20px; 
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

#form-privacy-icon {
    border: none;
    background-color: transparent;
    transition: all var(--transition-speed) ease;
}

#form-privacy-icon:hover,
#form-privacy-icon:focus {
    scale: 1.15;
}

.confirm {
    display: none;
}

.submit-button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    margin-top: 1rem;
}

.submit-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
    
/* Footer Styles */
.main-footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 3rem 1rem 1rem;
    margin-top: 5rem;
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.footer-section p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    transition: opacity var(--transition-speed) ease;
}

.footer-section a:hover {
    opacity: 0.8;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--primary-dark);
    border-radius: 4px;
    transition: transform var(--transition-speed) ease;
}

.social-icons a:hover {
    transform: translateY(-3px);
}

.footer-links {
    list-style-type: none;
    padding: 0;
    text-decoration: underline;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

/* Privacy Policy & Accessibility modals */

#privacy,
#accessibility {
    all: unset;
    cursor: pointer;
    padding: 1px;
    transition: color 0.2s ease;
}

#privacy:focus,
#accessibility:focus {
    color: color-mix(in srgb, white 85%, black);
    text-decoration: underline;
    border-radius: 2px;
    outline: none;
    box-shadow:
        0 0 0 2px black,
        0 0 0 3px white;
    border-radius: 2px; 
}
#privacy:hover,
#accessibility:hover {
    color: color-mix(in srgb, white 85%, black);
}

/* The Modal (background) */
.modal {
    display: none; 
    position: fixed; 
    z-index: 5;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

/* Modal Content */
.modal-content {
    background-color: #F8F8F8;
    color: black;
    margin: auto;
    padding: 20px;
    border: 4px solid var(--primary-color);
    width: 80%;
    max-width: 1250px;
}

/* The Close Button */
.close-modal {
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary-dark);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    float: right;
    font-size: 32px;
    font-weight: bold;
    transition: color 200ms ease-in;
}

.sr-close-modal {
    width: 1px;
    height: 1px;
}

.close-modal:hover,
.close-modal:focus {
    color: #888;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive Design - Larger Tablets and Small Desktops */
@media (max-width: 1024px) {
    :root {
        --container-width: 90%;   /* Smaller container on smaller screens */
    }

    .nav-logo {
        left: 2.5rem;
    }

    .service-item {
        scale: 0.9; /*Scaling for carousel items*/
    }

    .service-carousel {
       min-height: calc(var(--service-carousel-height) * 0.9); /* Scaling for carousel container matching service-item*/
    }

    .carousel-button {
        scale: 0.9; /* Scaling for carousel buttons*/
    }
    
    .content-block {
        gap: 2rem;               /* Reduced spacing */
    }

    .section-image {
        height: 350px;          /* Smaller image height */
    }

    .contact-layout {
        gap: 2rem;
    }
    
    .contact-info-card h3 {
        font-size: 1.5rem;
    }
    
    .contact-card-text {
        font-size: 1.7rem;
    }
}

/* Show the main nav bar on larger screens */
@media (min-width: 769px) {
    .hamburger-menu {
        display: none; /* Hide hamburger menu */
    }
    .nav-bar{
        display: block;
    }
}

/* Responsive Design - Tablets and Large Phones */
@media (max-width: 768px) {
    /* Stack content vertically on smaller screens */
    .content-block,
    .content-block.reverse {
        flex-direction: column;
        gap: 2rem;
    }

    /* Section spacing */
    .default-section{
        margin: 4rem auto;
    }

    .contact-page {
        margin: 4rem auto;
        padding-bottom: 4rem;
    }

    .main-footer {
        margin-top: 4rem;
    }

    /* Full width images on mobile */
    .section-image-wrapper {
        max-width: 100%;
    }

    .section-image {
        height: 300px;
    }

    /* Smaller text sizes for mobile */
    .home-header h1 {
        font-size: 2rem;
    }

    .section-header {
        font-size: 2rem;
    }

    /* Adjusted navigation for mobile */
    .nav-container {
        gap: 1rem;
    }

    .individual-nav-bar {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Hide the main nav bar on smaller screens */
    .nav-bar {
        display: none; /* hide navbar for hamburger menu */
    }

    .hamburger-menu {
        display: block; /* Show hamburger menu */
    }

    .service-item {
        scale: 0.8;
    }

    .service-carousel {
        min-height: calc(var(--service-carousel-height) * 0.8); /* Scaling for carousel container matching service-item*/
     }

     .carousel-button {
        scale: 0.8;
     }
     
    .footer-container {
        flex-direction: column;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .social-icons {
        justify-content: center;
    }

    .contact-layout {
        flex-direction: column;
    }
    
    .contact-form,
    .contact-info-section {
        width: 100%;
    }
    
    .contact-info-section {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .contact-form {
        order: 2;
    }
    
    .contact-info-section {
        order: 1;
    }

    .contact-info-card h3 {
        font-size: 1.4rem;
    }
    
    .contact-card-text {
        font-size: 1.6rem;
    }
}

@media (max-width: 640px) {
    .contact-info-section {
        grid-template-columns: 1fr;
    }
    
    .contact-info-card {
        padding: 1.75rem;
    }
    
    .contact-card-text {
        font-size: 1.5rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
}

/* Responsive Design - Small Phones */
@media (max-width: 480px) {

    /* Further reduced sizes for smallest screens */
    .home-header {
        padding: 2rem 1rem;
    }

    .home-header h1 {
        font-size: 1.5rem;
    }

    .section-header {
        font-size: 1.75rem;
    }

    /* Section spacing */
    .default-section {
        margin: 3rem auto;
    }

    .contact-page {
        margin: 3rem auto;
        padding-bottom: 3rem;
    }

    .main-footer {
        margin-top: 3rem;
    }

    .about-us-text,
    .mission-statement-text {
        font-size: 1rem;
    }

    .section-image {
        height: 250px;
    }

    .service-item {
        scale: 0.7;
    }

    .service-carousel {
        min-height: calc(var(--service-carousel-height) * 0.7); /* Scaling for carousel container matching service-item*/
     }

     .carousel-button {
        scale: 0.7;
        opacity: 0.5; /* for better visibility of service items on small screens */
     }
     .contact-form {
        padding: 1rem;
    }

    input[type="f_name"],
    input[type="l_name"],
    input[type="email"],
    input[type="text"],
    textarea {
        padding: 10px;
        font-size: 16px;
    }

    .submit-button {
        padding: 12px 10px;
        font-size: 1rem;
    }

    .agreement-container {
        margin: 0.5rem 0;
    }

    .contact-page {
        margin: 2rem auto;
    }
    
    .contact-info-card {
        padding: 1.5rem;
    }
    
    .contact-info-card h3 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    
    .contact-card-text {
        font-size: 1.4rem;
    }
    
    .contact-form {
        padding: 1.25rem;
    }
    
    .section-header-centered {
        margin-bottom: 1.5rem;
    }
}
