/* 
* BrainSpark Digital - Responsive Styles
* Media queries to ensure the website is responsive across all device sizes
*
* WHAT THIS FILE DOES:
* Think of this like having different rules for different situations!
* Just like how you dress differently for summer vs winter, 
* websites need to look different on phones vs computers.
* 
* This file contains "media queries" - they're like "if-then" statements:
* "IF the screen is smaller than X pixels, THEN use these styles instead"
*
* WHY WE NEED THIS:
* - Phones have tiny screens compared to computers
* - Tablets are somewhere in between  
* - We want our website to look good on ALL devices
* - Without responsive design, websites would be impossible to use on phones!
*/

/* ====== TABLET DEVICES (SCREENS SMALLER THAN 1024PX) ====== */
/* This is for tablets like iPads, or smaller laptop screens.
   When someone visits our site on a tablet, these rules kick in! */

@media screen and (max-width: 1024px) {
    /* MAKE TEXT SMALLER - Because tablet screens aren't as big */
    html {
        font-size: 60%;  /* Shrink the base font size a bit */
    }

    /* ====== NAVBAR TABLET FIXES ====== */
    header {
        padding: 1.2rem 0;
    }

    header .container {
        padding: 0 2rem;
        flex-wrap: nowrap;
        gap: 1.5rem;
        align-items: center;
        max-width: 100%;
    }

    .logo {
        flex-shrink: 0;
        min-width: 0;
    }

    .logo-link {
        display: flex;
        align-items: center;
    }

    .logo-image {
        max-width: 120px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    nav {
        flex: 1 1 auto;
        min-width: 0;
        overflow: visible;
        display: flex;
        align-items: center;
    }

    .nav-links {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.3rem;
        justify-content: flex-start;
        align-items: center;
        margin: 0;
        list-style: none;
        padding: 0;
    }

    .nav-links li {
        margin: 0;
        flex-shrink: 1;
    }

    .nav-links a {
        font-size: 1.3rem;
        padding: 0.6rem 0.7rem;
        white-space: nowrap;
        display: block;
    }

    /* Shorter text for tablet nav items */
    .nav-links li:nth-child(2) a {
        font-size: 1.2rem;
        padding: 0.6rem 0.5rem;
    }

    .dropdown {
        position: relative;
    }

    .dropdown > a {
        font-size: 1.3rem;
        padding-right: 1.2rem;
    }

    .dropdown > a i {
        font-size: 0.85rem;
        margin-left: 0.3rem;
    }

    .cta-btn {
        flex-shrink: 0;
        margin-left: 0.5rem;
    }

    .cta-btn .btn-primary,
    .cta-btn .btn-roofing {
        font-size: 1.1rem;
        padding: 0.7rem 1.2rem;
        white-space: nowrap;
    }

    .mobile-toggle {
        display: none !important;
    }

    /* Dropdown menu adjustments for tablet */
    .dropdown-menu {
        min-width: 20rem;
        font-size: 1.3rem;
    }

    .dropdown-menu a {
        padding: 1rem 1.4rem !important;
        font-size: 1.3rem;
    }

    /* HERO SECTION CHANGES - Make it work better on tablets */
    .hero .container {
        flex-direction: column;  /* Stack content on top of image instead of side-by-side */
        text-align: center;      /* Center everything for better mobile look */
    }

    .hero-content {
        max-width: 100%;         /* Let content use full width now */
        margin-bottom: 5rem;     /* Add space before the image */
    }

    .hero-cta {
        justify-content: center; /* Center the buttons */
    }

    .hero-image {
        margin-left: 0;          /* Remove the side margin */
        justify-content: center; /* Center the image */
    }

    /* FEATURES GRID - Adjust how feature cards are laid out */
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(35rem, 1fr));
        /* Make feature cards a bit wider on tablets */
    }

    .feature {
        align-items: center;     /* Center everything in feature cards */
        text-align: center;      /* Center the text */
        flex-direction: column;  /* Stack icon above text */
    }

    .feature-icon {
        margin-right: 0;         /* Remove side margin */
        margin-bottom: 1.5rem;   /* Add space below icon */
    }

    /* CONTACT PAGE RESPONSIVE STYLES - Make contact form better on tablets */
    .contact-wrapper {
        grid-template-columns: 1fr;  /* Stack contact info above form */
        gap: 4rem;                   /* Add space between them */
    }

    .contact-info {
        padding: 0 2rem;            /* Add some side padding */
    }

    /* SERVICES PAGE RESPONSIVE - Adjust service cards for tablets */
    .service-large-card {
        flex-direction: column;      /* Stack image above content */
    }

    .service-large-card .service-icon {
        width: 100%;                 /* Make icon take full width */
        height: 12rem;               /* Set a fixed height */
        margin-bottom: 0;            /* Remove bottom margin */
    }

    .service-features ul {
        grid-template-columns: 1fr;  /* Stack features in single column */
    }

    /* PROCESS STEPS RESPONSIVE - Make the process easier to follow on tablets */
    .process-step {
        flex-direction: column;      /* Stack number above content */
        text-align: center;          /* Center everything */
        margin-bottom: 8rem;         /* More space between steps */
    }

    .step-number {
        margin-right: 0;             /* Remove side margin */
        margin-bottom: 2rem;         /* Add space below number */
    }

    .process-steps::before {
        display: none;               /* Hide the connecting line */
    }

    /* ABOUT PAGE RESPONSIVE STYLES - Make about page work on tablets */
    .about-content {
        grid-template-columns: 1fr;  /* Stack text above image */
        text-align: center;          /* Center everything */
    }

    .about-text {
        order: 2;                    /* Put text below image */
    }

    .about-image {
        order: 1;                    /* Put image above text */
        max-width: 60rem;            /* Limit image width */
        margin: 0 auto;              /* Center the image */
    }

    .team-member {
        grid-template-columns: 1fr;  /* Stack team member info */
    }

    .member-image {
        height: 35rem;               /* Fixed height for member photos */
    }

    .member-info {
        padding: 3rem;               /* Comfortable padding */
        text-align: center;          /* Center the text */
    }

    .member-social {
        justify-content: center;     /* Center social media icons */
    }
}

/* ====== TABLET PORTRAIT / LARGE MOBILE (768PX - 900PX) ====== */
/* Additional adjustments for smaller tablets in portrait mode */
@media screen and (max-width: 900px) and (min-width: 769px) {
    header .container {
        padding: 0 1.5rem;
        gap: 1rem;
    }

    .logo-image {
        max-width: 110px;
    }

    .nav-links {
        gap: 0.2rem;
    }

    .nav-links a {
        font-size: 1.2rem;
        padding: 0.5rem 0.5rem;
    }

    .nav-links li:nth-child(2) a {
        font-size: 1.1rem;
        padding: 0.5rem 0.4rem;
    }

    .dropdown > a {
        font-size: 1.2rem;
        padding-right: 1rem;
    }

    .cta-btn {
        margin-left: 0.3rem;
    }

    .cta-btn .btn-primary,
    .cta-btn .btn-roofing {
        font-size: 1rem;
        padding: 0.6rem 1rem;
    }
}

/* ====== LARGE MOBILE DEVICES (SCREENS SMALLER THAN 768PX) ====== */
/* This is for phones in landscape mode or small tablets.
   The screen is getting smaller, so we need to make bigger changes! */

@media screen and (max-width: 768px) {
    /* MAKE TEXT EVEN SMALLER - Phone screens are much smaller */
    html {
        font-size: 58%;  /* Shrink text even more for phones */
    }

    /* ADJUST HEADING SIZES - Make them fit better on small screens */
    h1 {
        font-size: 3.6rem;  /* Smaller main headings */
    }

    h2 {
        font-size: 3rem;    /* Smaller section headings */
    }

    /* ====== NAVIGATION CHANGES FOR MOBILE ====== */
    /* On mobile, we hide the normal menu and show a hamburger menu instead */
    
    header .container {
        padding: 0 2rem;    /* Add padding to header on mobile */
    }

    .cta-btn {
        display: none !important;      /* Hide the call-to-action button (takes up too much space) */
    }

    /* SHOW HAMBURGER BUTTON - The three lines that open the menu */
    .mobile-toggle {
        display: flex !important;      /* Show the hamburger menu button */
        z-index: 1002;      /* Keep it above the menu */
    }
    
    /* Nav container adjustments for mobile */
    nav {
        position: static;
        flex: 0;
    }
    
    /* Mobile nav-links - slide-in menu */
    .nav-links {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 85% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: #ffffff !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        padding-top: 8rem !important;
        z-index: 1000 !important;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15) !important;
        transition: left 0.3s ease !important;
        overflow-y: auto !important;
        gap: 0 !important;
    }
    
    .nav-links.active {
        left: 0 !important;
    }
    
    .nav-links li {
        margin: 0 !important;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .nav-links li a {
        display: block !important;
        padding: 1.8rem 2.5rem !important;
        font-size: 1.6rem !important;
        color: var(--text-color) !important;
        border-radius: 0 !important;
    }
    
    .nav-links li a:hover {
        background-color: #f8fafc !important;
    }
    
    .nav-links li a.active {
        background-color: var(--primary-color) !important;
        color: white !important;
    }

    /* ====== HERO SECTION MOBILE CHANGES ====== */
    .hero {
        padding: 12rem 0 6rem;  /* Less padding on mobile to save space */
    }

    .hero-content h1 {
        font-size: 3.6rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: 1.5rem;
    }

    .hero-cta a {
        width: 100%;
    }

    /* Services section */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Features grid */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Blog preview */
    .blog-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-top {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .feature-content {
        text-align: center;
    }

    .contact-info li {
        justify-content: center;
    }

    /* Contact form responsive */
    .contact-form-container {
        padding: 3rem 2rem;
    }

    .contact-form {
        grid-template-columns: 1fr;
    }

    .social-icons {
        justify-content: center;
    }

    .contact-method {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .method-icon {
        margin-right: 0;
        margin-bottom: 1.5rem;
    }

    /* About page additional responsive styles */
    .values-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .member-info {
        padding: 2.5rem 2rem;
    }

    /* ====== CENTER ALIGNMENT FOR ALL MOBILE CONTENT ====== */
    .service-hero-content,
    .section-header,
    .features-columns,
    .process-grid,
    .portfolio-grid,
    .testimonials-slider,
    .faq-container,
    .cta-content,
    .related-services-grid,
    .service-testimonials,
    .service-faq,
    .service-portfolio,
    .service-process,
    .service-features,
    .client-problems,
    .solution-content,
    .center-btn {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Page headers center aligned */
    .page-header {
        text-align: center;
        padding: 12rem 2rem 4rem;
    }
    
    .page-header h1,
    .page-header p {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Contact section wrapper - make it single column */
    .contact-wrapper {
        grid-template-columns: 1fr !important;
        gap: 3rem;
    }
    
    .contact-info {
        text-align: center;
    }
    
    .contact-info h2,
    .contact-info p {
        text-align: center;
    }
    
    /* Social connect section */
    .social-connect {
        text-align: center;
    }
    
    .social-connect h3 {
        text-align: center;
    }
    
    /* Map section */
    .map-section .section-header {
        text-align: center;
    }
    
    /* Blog main grid on mobile */
    .blog-main-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* About page centering */
    .about-content {
        text-align: center;
    }
    
    .about-text {
        text-align: center;
    }
    
    .about-text h2,
    .about-text p {
        text-align: center;
    }
    
    /* Team section centering */
    .team-grid {
        text-align: center;
    }
    
    .team-member {
        text-align: center;
    }
    
    .member-info {
        text-align: center;
    }
    
    .member-social {
        justify-content: center;
    }
    
    /* Values centering */
    .value-card {
        text-align: center;
    }
    
    /* Stats centering */
    .stats-content {
        text-align: center;
    }
    
    /* Roofing theme specific mobile fixes */
    .roofing-hero-content {
        text-align: center !important;
    }
    
    .roofing-hero-cta {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .roofing-hero-trust {
        justify-content: center;
    }
    
    .audience-cards,
    .audience-cards-4-col {
        grid-template-columns: 1fr !important;
    }
    
    .audience-card {
        text-align: center;
    }
    
    .audience-card-icon {
        margin: 0 auto 2rem;
    }
    
    /* Benefits grid */
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .benefit-card {
        flex-direction: column;
        text-align: center;
    }
    
    .benefit-icon {
        margin: 0 auto 1.5rem;
    }
    
    /* FAQ section mobile */
    .faq-section .section-header {
        text-align: center;
    }
    
    /* Buttons center aligned */
    .btn-primary,
    .btn-secondary,
    .hero-cta a,
    .cta-section .btn-primary {
        display: block;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
    
    .btn-roofing,
    .btn-roofing-outline {
        width: 100%;
        justify-content: center;
    }
}

/* Small Mobile Devices (less than 480px) */
@media screen and (max-width: 480px) {
    html {
        font-size: 55%;
    }

    .container {
        padding: 0 1.5rem;
    }

    h1 {
        font-size: 3.2rem;
    }

    h2 {
        font-size: 2.8rem;
    }

    .nav-links {
        width: 100%;
    }

    .testimonial-author {
        flex-direction: column;
        text-align: center;
    }

    .testimonial-author img {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .client-logos {
        gap: 1.5rem;
    }

    .client-logo {
        flex: 0 0 10rem;
    }

    .testimonial-controls {
        flex-direction: column;
        gap: 1.5rem;
    }

    .testimonial-dots {
        order: -1;
    }

    /* Smaller contact form padding */
    .contact-form-container {
        padding: 2rem 1.5rem;
    }

    .checkbox-group {
        align-items: flex-start;
    }

    .checkbox-group input[type="checkbox"] {
        margin-top: 0.5rem;
    }

    /* About page small mobile styles */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .value-card {
        padding: 2.5rem 1.5rem;
    }

    .value-icon {
        width: 7rem;
        height: 7rem;
        font-size: 2.5rem;
    }

    .service-hero-content,
    .section-header,
    .features-columns,
    .process-grid,
    .portfolio-grid,
    .testimonials-slider,
    .faq-container,
    .cta-content,
    .related-services-grid,
    .service-testimonials,
    .service-faq,
    .service-portfolio,
    .service-process,
    .service-features,
    .client-problems,
    .solution-content,
    .center-btn {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    .btn-primary,
    .btn-secondary,
    .hero-cta a,
    .cta-section .btn-primary {
        display: block;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
}

/* For very small phones */
@media screen and (max-width: 360px) {
    html {
        font-size: 50%;
    }

    .service-card,
    .blog-card,
    .testimonial {
        padding: 2rem;
    }

    .service-icon {
        width: 6rem;
        height: 6rem;
        font-size: 2.4rem;
    }
} 