/* ================================================================
   Ric's Professional Painting — Responsive Stylesheet
   ================================================================ */

/* ─── Large Tablets / Small Desktops (≤1024px) ─────────────── */
@media (max-width: 1024px) {
    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .about-grid {
        gap: 2.5rem;
    }
    .service-detail {
        grid-template-columns: 1fr;
    }
    .service-sidebar {
        position: static;
    }
    .trust-bar__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* ─── Tablets (≤768px) ─────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }

    /* Top Bar */
    .top-bar__right .top-bar__item:first-child span {
        display: none;
    }
    .top-bar__left span {
        display: none;
    }

    /* Header / Nav */
    .site-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 380px;
        height: 100vh;
        background: var(--color-white);
        box-shadow: var(--shadow-xl);
        z-index: 1000;
        overflow-y: auto;
        transition: right var(--duration) var(--ease);
        padding: 5rem 1.5rem 2rem;
    }
    .site-nav.open { right: 0; }

    .site-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .site-nav__list > li > a {
        padding: 1rem .5rem;
        border-bottom: 1px solid var(--color-light);
        font-size: 1.05rem;
    }

    /* Mobile dropdown */
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0 0 0 1rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height .4s ease;
    }
    .has-dropdown.open > .dropdown {
        max-height: 600px;
    }
    .dropdown li a {
        padding: .75rem .5rem;
        border-bottom: 1px solid var(--color-off-white);
    }

    .site-header__actions .btn--phone span {
        display: none;
    }
    .site-header__actions .btn--sm {
        display: none;
    }

    .mobile-toggle { display: flex; }

    /* Mobile overlay */
    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all var(--duration) var(--ease);
    }
    .mobile-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

    /* Hero */
    .hero { min-height: 70vh; }
    .hero__stats { gap: 1.5rem; flex-wrap: wrap; }
    .hero__stat-number { font-size: 2rem; }

    /* Grids */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .site-footer__bottom .container {
        flex-direction: column;
        text-align: center;
    }

    /* Sections */
    .section { padding: 3.5rem 0; }

    /* Form */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* CTA */
    .cta-banner__actions {
        flex-direction: column;
        align-items: center;
    }
}

/* ─── Small Mobile (≤480px) ────────────────────────────────── */
@media (max-width: 480px) {
    .container { padding: 0 1rem; }

    /* Top bar compact */
    .top-bar { font-size: .8rem; }
    .top-bar .container {
        justify-content: center;
    }
    .top-bar__right { display: none; }

    /* Hero */
    .hero { min-height: 60vh; padding: 2rem 0; }
    .hero__text { font-size: 1rem; }
    .hero__actions {
        flex-direction: column;
    }
    .hero__actions .btn { width: 100%; }
    .hero__stats { gap: 1rem; }
    .hero__stat-number { font-size: 1.75rem; }

    /* Trust bar */
    .trust-bar__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .trust-bar__item-number { font-size: 2rem; }

    /* Process */
    .process-grid { grid-template-columns: 1fr; }

    /* Features */
    .features-grid { grid-template-columns: 1fr; }

    /* Guarantees */
    .guarantees-grid { grid-template-columns: 1fr 1fr; }

    /* Service cards */
    .service-card { padding: 1.75rem; }

    /* Testimonials */
    .testimonial-card { padding: 1.5rem; }

    /* Buttons */
    .btn--lg { padding: .85rem 1.75rem; font-size: .95rem; }

    /* Portfolio */
    .portfolio-grid { grid-template-columns: 1fr; }
    .portfolio-item { aspect-ratio: 16/10; }

    /* Footer areas */
    .site-footer__areas { font-size: .8rem; }

    /* Map */
    .service-area-map iframe { height: 300px; }

    /* Back to top */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 42px;
        height: 42px;
    }
}

/* ─── Print Styles ─────────────────────────────────────────── */
@media print {
    .top-bar, .site-header, .cta-banner,
    .back-to-top, .site-footer__social,
    .mobile-toggle { display: none !important; }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    a { color: #000; text-decoration: underline; }
    .hero {
        background: #f5f5f5 !important;
        color: #000 !important;
        min-height: auto;
        padding: 2rem 0;
    }
    .hero__title, .hero__text,
    .page-hero h1, .page-hero p {
        color: #000 !important;
    }
    .section { padding: 1.5rem 0; }
}

/* ─── Prefers Reduced Motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .fade-in, .fade-in-left, .fade-in-right {
        opacity: 1;
        transform: none;
    }
}

/* ─── High Contrast Mode ──────────────────────────────────── */
@media (prefers-contrast: high) {
    :root {
        --color-gray: #444;
        --shadow-sm: 0 1px 3px rgba(0,0,0,.2);
        --shadow-md: 0 4px 12px rgba(0,0,0,.25);
    }
    .service-card, .testimonial-card, .faq-item {
        border-width: 2px;
        border-color: #333;
    }
}
