/* ============================================================
   TS FAST AUTO LOGISTICS, LLC — GLOBAL RESPONSIVE OVERRIDES
   File: assets/css/responsive.css
   Purpose: Site-wide mobile, tablet, print, accessibility rules
   Depends on: style.css (design tokens)
   Load order: LAST (after all other CSS files)
   ============================================================ */

/* ------------------------------------------------------------
   1. TABLET BREAKPOINT (<= 1024px)
   ------------------------------------------------------------ */
@media (max-width: 1024px) {

    :root {
        --space-16: 3rem;
        /* reduce heavy desktop padding */
        --space-20: 4rem;
        --gutter: 1.25rem;
        /* 20px */
    }

    .section {
        padding-top: var(--space-12);
        padding-bottom: var(--space-12);
    }

    h1 {
        font-size: var(--fs-3xl);
    }

    h2 {
        font-size: var(--fs-2xl);
    }

    h3 {
        font-size: var(--fs-xl);
    }
}

/* ------------------------------------------------------------
   2. MOBILE BREAKPOINT (<= 640px)
   ------------------------------------------------------------ */
@media (max-width: 640px) {

    :root {
        --space-16: 2.5rem;
        --space-20: 3rem;
        --fs-4xl: 2rem;
        --fs-3xl: 1.75rem;
        --fs-2xl: 1.5rem;
        --gutter: 1rem;
        /* 16px */
    }

    .section {
        padding-top: var(--space-10);
        padding-bottom: var(--space-10);
    }

    .section-sm {
        padding-top: var(--space-8);
        padding-bottom: var(--space-8);
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    p {
        font-size: var(--fs-sm);
    }

    /* Buttons full-width on very small screens */
    .btn {
        padding: var(--space-3) var(--space-5);
        font-size: var(--fs-sm);
    }

    .btn-lg {
        padding: var(--space-3) var(--space-6);
        font-size: var(--fs-base);
        width: 100%;
    }

    /* Form rows collapse */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Section headings tighten */
    .section-head {
        margin-bottom: var(--space-8);
    }

    .section-head h2 {
        font-size: var(--fs-2xl);
    }
}

/* ------------------------------------------------------------
   3. EXTRA SMALL PHONES (<= 380px)
   ------------------------------------------------------------ */
@media (max-width: 380px) {

    :root {
        --gutter: 0.75rem;
        /* 12px */
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .btn {
        font-size: var(--fs-xs);
        padding: var(--space-2) var(--space-4);
    }
}

/* ------------------------------------------------------------
   4. LANDSCAPE PHONES (short height)
   ------------------------------------------------------------ */
@media (max-height: 500px) and (orientation: landscape) {

    .hero {
        padding-top: var(--space-8);
        padding-bottom: var(--space-8);
    }

    .section {
        padding-top: var(--space-8);
        padding-bottom: var(--space-8);
    }
}

/* ------------------------------------------------------------
   5-6. LARGE / ULTRA-WIDE DESKTOPS
   No width overrides here on purpose: every wrapper uses
   --container-max (style.css) so the header, content and footer
   edges stay aligned at every screen size.
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   7. TOUCH DEVICE TARGETS (bigger tap areas)
   ------------------------------------------------------------ */
@media (hover: none) and (pointer: coarse) {

    .btn,
    .nav-link,
    .dropdown a,
    .header-phone,
    .theme-toggle,
    .menu-toggle,
    .footer-col ul li a,
    .footer-social a {
        min-height: 44px;
        /* Apple HIG minimum tap target */
        min-width: 44px;
    }

    .dropdown a {
        padding-top: var(--space-3);
        padding-bottom: var(--space-3);
    }
}

/* ------------------------------------------------------------
   8. REDUCED MOTION (accessibility — respects user OS setting)
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-badge .dot {
        animation: none;
    }
}

/* ------------------------------------------------------------
   9. HIGH CONTRAST (accessibility — respects user OS setting)
   ------------------------------------------------------------ */
@media (prefers-contrast: more) {

    :root {
        --color-border: #000000;
        --color-text-muted: #333333;
    }

    [data-theme="dark"] {
        --color-border: #FFFFFF;
        --color-text-muted: #CCCCCC;
    }

    .btn {
        border-width: 3px;
    }
}

/* ------------------------------------------------------------
   10. PRINT STYLES
   ------------------------------------------------------------ */
@media print {

    /* Hide non-essential UI when printing */
    header,
    footer,
    .theme-toggle,
    .menu-toggle,
    .header-cta,
    .btn-quote,
    .footer-social,
    .footer-newsletter-form,
    .mobile-menu {
        display: none !important;
    }

    body {
        background: #FFFFFF !important;
        color: #000000 !important;
        font-size: 12pt;
    }

    a {
        color: #000000 !important;
        text-decoration: underline;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666666;
    }

    .container,
    .hero-inner,
    .footer-inner {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .hero::before,
    .quote-box::before {
        display: none;
    }

    /* Avoid page breaks inside important blocks */
    .quote-box,
    .hero,
    .section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ------------------------------------------------------------
   11. DARK MODE + HOVER FIXES
   ------------------------------------------------------------ */
[data-theme="dark"] .btn-ghost {
    color: var(--color-text-main);
    border-color: var(--color-border);
}

[data-theme="dark"] .btn-ghost:hover {
    background-color: var(--color-bg-alt);
    border-color: var(--color-border-strong);
}

/* ------------------------------------------------------------
   12. SMOOTH THEME TRANSITION
   ------------------------------------------------------------ */
body,
.site-header,
.site-footer,
.quote-box,
.btn,
.input,
.select,
.textarea {
    transition: background-color var(--transition-base),
        color var(--transition-base),
        border-color var(--transition-base);
}

/* ------------------------------------------------------------
   13. NO-JS FALLBACK
   If JS is disabled, keep the theme toggle hidden instead of broken
   ------------------------------------------------------------ */
.no-js .theme-toggle,
.no-js .menu-toggle {
    display: none;
}