/* 1. Global and Foundational Styles */
:root {
    --clr-dark-blue: #102e40;
    --clr-cream: #fdf9ed;
    --clr-yellow: #fac423;
    --clr-light-blue: #74bae5;
    --clr-coral: #ffa17e;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Quicksand', sans-serif;
    line-height: 1.6;
    background-color: var(--clr-cream);
    color: var(--clr-dark-blue);
    padding-top: 80px; /* To prevent content being hidden under fixed header */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

img {
    max-width: 100%;
    display: block;
}


/* 2. Header Mobile Styles */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--clr-cream);
    z-index: 1000; /* High z-index to stay on top */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

}

.site-header--hidden {
    transform: translateY(-100%);
}

.site-header.scrolled {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
}

.logo img {
    width: 119px;
    height: 37px;
    margin-right: 0.5rem;
}

.nav {
    display: none;
    /* Hidden on mobile by default */
}

/* 2. Header Mobile Styles - Additions */
.nav-toggle {
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0.5em;
    /* Easier to tap */
    position: absolute;
    /* Allows precise positioning */
    right: 1em;
    /* Position on the right */
    top: 1.7rem;
    /* Adjust vertical position */
    z-index: 10001;
    /* Ensure it's above other elements */
}

.hamburger {
    display: block;
    position: relative;
    width: 2em;
    /* Width of the hamburger lines */
    height: 3px;
    /* Thickness of the lines */
    background: var(--clr-dark-blue);
    transition: transform 250ms ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--clr-dark-blue);
    transition: transform 250ms ease-in-out, opacity 250ms linear;
}

.hamburger::before {
    top: -8px;
    /* Position the top line */
}

.hamburger::after {
    bottom: -8px;
    /* Position the bottom line */
}


/* Styles for the navigation when it's open */
.nav--visible {
    display: block;
    /* Make the nav visible */
    position: fixed; /*Fixed position makes sure background covers full screen*/
    /* Take it out of normal flow */
    background: var(--clr-dark-blue);
    color: var(--clr-cream);
    top: 0;
    /* Align to the top */
    right: 0;
    /* Align to the right */
    bottom: 0;
    left: 0;
    height: 100vh; /* Background covers full viewport height */
    width: 100%;
    /* Make it full screen */
    padding-top: 5rem;
    /* Space for the close button */
    text-align: center;
    z-index: 9999;
    /* Below the toggle button but above content */
    
}

.no-scroll {
    overflow: hidden;
    /* Prevent background scrolling when nav is open */
}

.nav__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav__item {
    margin-bottom: 2em;
}

.nav__item:hover {
    color: var(--clr-light-blue);
    transition: color 0.3s ease;
}

.nav__link {
    color: inherit;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav__link--button {
    background: var(--clr-dark-blue);
    color: var(--clr-cream);
    padding: 1rem 1rem;
    border-radius: 2rem;
}
.nav__link--button:hover {
    background: var(--clr-light-blue);
    color: var(--clr-cream);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Animation for hamburger -> X */
.nav-open .hamburger {
    transform: rotate(0.625turn);
    /* Rotate the middle line */
    background: var(--clr-cream);
    /* Change color when open */
}

.nav-open .hamburger::before {
    transform: rotate(90deg) translateX(8px);
    /* Rotate top line */
    background: var(--clr-cream);
}

.nav-open .hamburger::after {
    opacity: 0;
    /* Hide bottom line */
}

/* Adjust header container padding for mobile */
.site-header .container {
    padding: 1rem;
    /* Add horizontal padding too */
}

/* 3. Hero Section Mobile Styles */
.hero {
    text-align: center;
    padding: 2rem 0;
}

.hero__logo {
    width: 500px;
    margin: 0 auto 0rem;
}

.hero__title {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0;
    line-height: 1.2;
}

.hero__subtitle {
    font-size: 1.25rem;
    font-weight: 400;
}

/* 5. About Section Mobile Styles */
.about {
    padding: 3rem 0;
    /* Add top and bottom spacing */
    text-align: center;
    /* Center the section title and image */
}

.section-title {
    font-size: 2.25rem;
    /* Slightly smaller than hero title */
    font-weight: 700;
    text-transform: uppercase;
    /* As seen in the brand kit */
    color: var(--clr-dark-blue);
    margin-bottom: 2rem;
    /* Space below the title */
}

.about__image {
    width: 350px;
    height: 350px;
    /* border-radius: 50%; */
    /* This was our old rule for a circle */
    border-radius: 175px 175px 0 0;
    /* This creates the arch! */
    object-fit: cover;
    /* Prevents the image from stretching or squishing */
    margin: 0 auto 1.5rem;
    /* Centers the image and adds space below */
    border: 2px solid var(--clr-coral);
    /* Adds the brand's coral border */
}

.about__text p {
    font-size: 1.25rem;
    line-height: 1.7;
    /* Extra spacing for readability */
    text-align: left;
    /* Left-align paragraphs for easier reading */
    margin-bottom: 1em;
    /* Space between paragraphs */
}

.about__text p:last-child {
    margin-bottom: 0;
    /* Remove space after the last paragraph */
}

/* 7. Subjects Section Mobile Styles */
.subjects {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
}

h3.subject-card__title{
    padding-right: 1.5rem;
}

.subjects__wrapper {
    /* On mobile, this just acts as a container */
}

.subject-card {
    margin-bottom: 2rem;
    /* Space between the cards when stacked */
}

.subject-card__header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    /* Space between header and list */
}

.subject-card__icon {
    font-size: 40px;
    /* Size of the icon */
    width: 40px;
    /* Force element to be 40px wide */
    text-align: center;
    /* Center the icon in its box */
    margin-right: 1rem;
    flex-shrink: 0;
    /* Don't allow icon to be squished */
}

.icon--english {
    color: var(--clr-light-blue);
}

.icon--math {
    color: var(--clr-yellow);
}

.subject-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    /* Override default h3 margin */
}

.subject-card__list {
    list-style: disc;
    /* Use standard bullets */
    padding-left: calc(40px + 2rem);
    font-size: 1.25rem;        
    line-height: 1.7;
}

/* This is the new image wrapper */
.subjects__image-wrapper {
    display: block;
    margin-top: 2rem;
    /* Add space on mobile if we decide to show it */
}

.subjects__image {
    align-items: start;
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 15px;
    
    object-fit: cover;
    /* Prevents the image from stretching or squishing */
    margin: 0 auto 1.5rem;
    /* Centers the image and adds space below */
    border: 2px solid var(--clr-coral);
    /* Adds the brand's coral border */
    margin: 0 auto;
    /*enter the max-width image */

}

.subject-card__list {
    /*list-style: none;
    margin: 0;
    /* Bullet alignment */
    padding-left: calc(40px + 2rem);
}


/* 7. Testimonials Section Mobile Styles */
.testimonials {
    padding: 3rem 0;
    text-align: center;
    /* Center section title and card */
}

.testimonials .section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.slider {
    position: relative;
    max-width: 500px;
    /* On mobile, same as old card */
    margin: 0 auto;
}

/* This is the "window" of the slider */
.slider-container {
    overflow: hidden; 
}

/* This is the "track" that holds all slides */
.slider-wrapper {
    display: flex;
    /* JS will add a transition here */
    transition: transform 300ms ease-in-out;
}

/* This is a single slide */
.testimonial-slide {
    flex: 0 0 100%;
    /* Make slide take up 100% of container */
    width: 100%;
}

.testimonial-card {
    background: var(--clr-cream);

    padding: 2rem;
    border-radius: 15px;
    /* Rounded corners */


    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    /* Soft shadow */
    width: 90%;
    /* Make card slightly smaller than slide */
    margin: 0 auto;
    /* Center card within the slide */
}

/* === Modifier classes for border colors === */
.testimonial-card--blue {
    border: 5px solid var(--clr-light-blue);
}

.testimonial-card--coral {
    border: 5px solid var(--clr-coral);
}

.testimonial-card--yellow {
    border: 5px solid var(--clr-yellow);
}


.testimonial-card__stars {
    color: var(--clr-yellow);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.testimonial-card blockquote {
    margin: 0 0 1rem;
    /* Remove browser default margin */
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.6;
}

.testimonial-card__author {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
    text-align: right;
    /* Align author to the right */
}

.slider-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    background-color: var(--clr-cream);
    color: var(--clr-dark-blue);
    transition: color 0.3s ease, top 300ms ease-in-out;
    border: 0;
    padding: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 2rem;
    line-height: 0;
    cursor: pointer;
    z-index: 10;

    display: flex;
    justify-content: center;
    align-items: center;
    
}




.slider-button:hover {
    color: var(--clr-light-blue);
}

.slider-button--prev {
    left: calc(5% - 20px);
}

.slider-button--next {
    right: calc(5% - 20px);
}

/* 8. FAQ Section Mobile Styles */
.faq {
    padding: 3rem 0;
    background-color: var(--clr-cream);
    /* Ensure background matches */
}

.faq .section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.faq-container {
    max-width: 800px;
    /* Limit width for readability */
    margin: 0 auto;
}

.faq-item {
    border-bottom: 2px solid rgba(16, 46, 64, 0.1);
    /* Subtle divider */
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem 0;
    text-align: left;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--clr-dark-blue);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: var(--clr-light-blue);
}

.faq-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    /* For rotating the plus to an X */
}

/* This is the hidden answer.
   We set height to 0 and overflow hidden to collapse it.
   We will use JS to change the height to 'auto' (or a specific pixel value).
*/
.faq-answer {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
    font-size: 1.25rem;
}

.faq-answer-content {
    padding-bottom: 1.5rem;
    color: #4a5568;
    /* Slightly lighter text for answers */
    line-height: 1.6;
}

/* Styles for when the FAQ is open (added by JS) */
.faq-item.active .faq-icon {
    transform: rotate(45deg);
    /* Turn + into X */
    color: var(--clr-coral);
}

.faq-item.active .faq-question {
    color: var(--clr-coral);
}

/* 9. Contact Section Mobile Styles */

.contact {
    padding: 3rem 0;

}
.contact-details{
    font-size: 1.25rem;
}

.contact-options p {
    margin: .25rem 0rem;
}

.contact-options i {
    margin-right: .5rem;
    font-size: 1.2rem;
}

.contact-button {
    display: inline-block;
    text-decoration: none;
    margin: 1rem 0rem;
    padding: 1rem 1rem;
    background-color: var(--clr-dark-blue);
    color: var(--clr-cream);
    font-size: 1rem;
    border-radius: 1.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;

}

.contact-button:hover {
    background-color: var(--clr-coral);
}

/* 10. Footer Section Mobile Styles */
.site-footer {
    padding: 2rem 0;
    border-top: 1px solid rgba(16, 46, 64, 0.1); /* Subtle divider */
    margin-top: 3rem; /* Separate from content */
}

.footer-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-company {
    font-size: 1.25rem;
    color: var(--clr-dark-blue);
    margin: 0;
}

.footer-socials {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-handle {
    font-weight: 700;
    color: var(--clr-dark-blue);
    margin: 0;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: var(--clr-dark-blue);
    font-size: 1.5rem;
    transition: color 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    color: var(--clr-light-blue);
}


/* 4. Media Query for TABLET Screens and wider (768px and up) */
@media (min-width: 768px) {


    .logo img {
    width: 238px;
    height: 74px;
    }

    /* ... (Desktop nav styles) ... */
    .nav {
        display: block;
        /* Override display: none */
        position: static;
        /* Return to normal document flow */
        background: none;
        /* Remove mobile background */
        color: inherit;
        /* Inherit text color from body */
        padding-top: 0;
        /* Remove mobile padding */
        text-align: left;
        /* Align text normally */
        height: auto;
        overflow-y: visible;
        /* Ensure desktop menu doesn't inherit full-screed fixed stles from mobile menu state */
    }

    /* Arrange nav items horizontally */
    .nav__list {
        display: flex;
        /* Use flexbox for horizontal layout */
        align-items: center;
        /* Vertically align items */
    }

    .nav__item {
        margin-bottom: 0;
        /* Remove vertical spacing */
        margin-left: 1.5em;
        /* Add horizontal spacing between items */
    }

    /* Reset link styles */
    .nav__link {
        font-size: 1rem;
        /* Reset font size */
        font-weight: 400;
        /* Regular weight */
        /*font-weight: 700;*/
    }

    .nav__link--button {
        /* Keep button styles, maybe adjust padding slightly */
        padding: 0.4em 1.2em;
        font-weight: 700;
        /* Keep it bold */
    }

    /* Hide the hamburger toggle */
    .nav-toggle {
        display: none;
    }

    /* Optional: Adjust header padding on larger screens */
    .site-header .container {
        padding: .5rem 0;
        /* Maybe less vertical padding */
    }

    /* UPDATED Hero section styles for desktop */
    .hero {
        padding: 6rem 0;
        /* More vertical padding */
        /* text-align: center; is inherited from mobile, which is correct */
    }

    .hero .container {
        display: block;
        /* Revert to default block layout */
        align-items: initial;
        /* Reset */
        gap: 0;
        /* Reset */
        text-align: center;
        /* Explicitly re-center text */
    }

    .hero__logo {
        width: 60%;
        /* Make logo larger */
        /* margin: 0 auto 1rem; is inherited from mobile, which is correct */
    }

    /* We can remove the empty .hero__text rule */

    .hero__title {
        font-size: 3.5rem;
        /* Larger title */
        /* margin-bottom: 0.5rem; can be removed or kept, removed for default */
        margin-bottom: 0;
    }

    .hero__subtitle {
        font-size: 1.25rem;
        /* Slightly larger subtitle */
        margin-top: 0.5rem;
        /* Add a little space from the title */
    }


    /* 5. About Section, TABLET Styles
    /* On tablet, keep the centered, stacked layout, but make it bigger */

    .about .container {
        /* We are NOT using flex here */
        display: block;
        text-align: center;
        /* Ensure container text is centered */
    }

    .about__image {
        /* This is NOT a flex item here */
        flex: initial;
        /* Reset any flex properties */

        /* Make it larger for tablets */
        width: 350px;
        height: 350px;

        /* Keep it centered */
        margin: 0 auto 1.5rem;

        /* Adjust radius for new size */
        border-radius: 175px 175px 0 0;
    }

    .about__content-wrapper {
        /* This is NOT a flex item here */
        flex: initial;
        /* Reset any flex properties */
    }

    .section-title {
        /* Ensure title is centered, overriding any potential left-align */
        text-align: center;
        margin-bottom: 1.5rem;
    }

    h3.subject-card__title{
    padding-right: 1.5rem;
    }

    .about__text p {
        /* For readability, we can make the text block */
        /* wider than mobile, but not full-width. */
        max-width: 600px;
        /* Or a bit wider */
        margin-left: auto;
        margin-right: auto;
        text-align: left;
        /* Keep paragraphs left-aligned */
    }

    /* 7. Subjects Section TABLET & UP Styles*/

    .subjects .section-title {
        text-align: left;
        /* Align title left for side-by-side layout */
    }

    .subjects__layout-wrapper {
        display: flex;
        align-items: center;
        gap: 2.5rem;
    }

    .subjects__content {
        flex: 1 1 0;
        /* 50% column */
    }

    .subjects__image-wrapper {
        display: block;
        /* Show the image */
        flex: 1 1 0;
        /* 50% column */
        margin-top: 0;
        /* Remove mobile margin */
    }

    .subjects__image {
        max-width: 100%;
        /* Make image responsive within its column */
        height: auto;
        /* Maintain aspect ratio */
    }

    .subject-card {
        margin-bottom: 2.5rem;
        /* More space between cards */
    }

    /* 7. Testimonials Tablet Styles */

    .slider {
        max-width: 700px;
    }

    .slider-button--prev {
        left: -20px;
    }

    .slider-button--next {

        right: -20px;
    }

    /* 7. Testimonials Section TABLET & UP Styles */

    .testimonial-card {
        max-width: 700px;
        /* Make testimonial card wider */
        width: 100%;
    }

    /* 10. Footer Tablet/Desktop Styles */
    .footer-wrapper {
        flex-direction: row; /* Side-by-side */
        justify-content: space-between; /* Push apart */
        align-items: center; /* Vertically align */
        text-align: left; /* Reset text align */
    }

    .footer-socials {
        align-items: flex-end; /* Align handle and icons to the right */
        
    }
}

/* 6. NEW Media Query for DESKTOP Screens (1050px and up) */
@media (min-width: 1050px) {

    /* 5. About Section DESKTOP Styles */
    .about .container {
        display: flex;
        /* Use flexbox for side-by-side layout */
        align-items: center;
        /* Vertically center the image and text block */
        gap: 2.5rem;
        /* Create space between the image and text */
        text-align: left;
        /* Make all text inside align left */
    }

    .about__image {
        /* This is now a flex item. */
        flex: 1 1 0;
        /* Allow it to grow and shrink, with a 0 starting basis */
        margin: 0 auto;
        /* Center image within its 50% column */

        /* Set width/height/radius based on our previous fix */
        width: 100%;
        /* Fill its flex container */
        max-width: 580px;
        height: 580px;
        border-radius: 290px 290px 0 0;
    }

    .about__content-wrapper {
        /* This div is now our second flex item. */
        flex: 1 1 0;
        /* Allow it to grow and shrink, with a 0 starting basis */
    }

    .section-title {
        /* On mobile, this was centered. We need to override that. */
        text-align: left;
        /* Explicitly align title to the left */
        margin-bottom: 1.5rem;
        /* Adjust space below title */
    }

    .about__text {
        text-align: left;
        /* This is already set, but good to confirm */
    }

    .about__text p {
        /* Remove the max-width from the tablet style */
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    /* 6. Subjects Desktop Styles */
    .subjects__layout-wrapper {
        gap: 3rem;
        /* A bit more space on desktop */
    }


    /* 7. Testimonials Desktop Styles */
    .slider {
        max-width: 800px;
    }

    /* 8. Contact Section Desktop Styles */
    .contact {
        max-width: 1280px;
        margin: 0 auto;
    }
}