/* OCS LLC — site-wide responsive overrides
 * Loaded after the per-page <style> blocks to override layout details
 * across every breakpoint. Designed for screens from 320px to 4K.
 */

/* === Reset / base === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
img, video, iframe, svg { max-width: 100%; height: auto; }
img[loading="lazy"] { content-visibility: auto; }
picture { display: inline-block; max-width: 100%; }
table { max-width: 100%; }

/* iOS safe areas (notched devices) */
body {
    padding-left:  env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* === Typography fluid scaling === */
html { font-size: clamp(14px, 0.875rem + 0.2vw, 17px); }
h1 { font-size: clamp(1.65rem, 1.3rem + 2vw, 3rem); line-height: 1.15; }
h2 { font-size: clamp(1.35rem, 1.15rem + 1.2vw, 2.25rem); line-height: 1.2; }
h3 { font-size: clamp(1.1rem, 1rem + 0.6vw, 1.5rem); line-height: 1.25; }

p { line-height: 1.55; }

/* === Inputs / forms — prevent iOS zoom on focus === */
input, textarea, select, button {
    font-size: max(16px, 1rem) !important;
    font-family: inherit;
}
input[type="text"], input[type="tel"], input[type="email"],
input[type="search"], input[type="number"], input[type="url"],
input[type="password"], textarea, select {
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
}
button, .btn-white, [role="button"], a.bg-white.text-black,
a.bg-custom-cyan, a[href^="tel:"].btn-white,
.cta-box .btn-white, .cta-box .tel-link {
    min-height: 44px;
    min-width: 44px;
}

/* === Container — fluid edges === */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left:  clamp(0.85rem, 4vw, 2rem);
    padding-right: clamp(0.85rem, 4vw, 2rem);
}

/* === Sticky nav / mobile call bar === */
nav.bg-custom-cyan { padding: 0.75rem 0; }
.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left:  clamp(0.85rem, 4vw, 2rem);
    padding-right: clamp(0.85rem, 4vw, 2rem);
}

/* === Service grid breakpoints === */
.grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4 {
    gap: clamp(0.75rem, 2vw, 1.5rem);
}

/* === Gallery grids === */
.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)) !important; }
.gal-grid     { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .gal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .gal-grid { grid-template-columns: 1fr; } }

.gal-strip { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .gal-strip { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 540px) { .gal-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 380px) { .gal-strip { grid-template-columns: repeat(2, 1fr); } }

/* === Hero & CTA buttons === */
.hero-mini { padding: clamp(2rem, 5vw + 1rem, 4.5rem) 1rem; }
.hero-mini h1 { word-break: break-word; }
.hero-cta-row { padding: 0 1rem; }
.hero-cta-row a.bg-white { display: inline-block; padding: 0.85rem 1.4rem; }
.cta-box { padding: clamp(1.25rem, 4vw, 2.5rem); }
.cta-box .btn-white { padding: 0.85rem 1.5rem; }

/* === Quote form === */
#quote-form, form[id="quote-form"] {
    width: 100%;
    padding: clamp(1rem, 3vw, 1.5rem);
}
#quote-form label { font-size: 0.95rem; }

/* === Footer === */
footer .container p { word-break: break-word; }
footer p.mt-3 { line-height: 2; }
footer p.mt-3 a { display: inline-block; padding: 0.15rem 0; }

/* === Trust pills wrap === */
.trust-row span { white-space: nowrap; }

/* === Photo cards & previews === */
.review-card { padding: clamp(0.9rem, 2vw, 1.25rem); }

/* === Mobile call bar — wider tap area + safe-area aware === */
.mobile-call-bar {
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom));
    min-height: calc(48px + env(safe-area-inset-bottom));
    font-size: 1.05rem !important;
}
@media (max-width: 720px) {
    body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

/* === Stack nav stack on mobile (logo + contact) === */
@media (max-width: 720px) {
    .nav-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.4rem !important;
    }
    .contact-info {
        align-items: flex-start !important;
        font-size: 0.95rem !important;
    }
    .contact-info p { margin: 0; }
}

/* === Tablet (641-1023) tweaks === */
@media (min-width: 641px) and (max-width: 1023px) {
    .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* === Tiny phones (320-380) === */
@media (max-width: 380px) {
    .hero-mini h1 { font-size: clamp(1.4rem, 7vw, 1.85rem) !important; }
    .hero-mini p  { font-size: 0.95rem !important; }
    .hero-cta-row a.bg-white { padding: 0.75rem 1rem; font-size: 0.95rem !important; }
    .trust-row { gap: 0.4rem !important; }
    .trust-row span { font-size: 0.8rem; padding: 0.3rem 0.65rem; }
    .container { padding-left: 0.75rem; padding-right: 0.75rem; }
    .cta-box { margin: 1.25rem 0; }
    section { padding: clamp(1.5rem, 5vw, 3rem) 0; }
    h1 { font-size: clamp(1.4rem, 6vw, 1.85rem); }
    h2 { font-size: clamp(1.2rem, 5vw, 1.5rem); }
}

/* === Mid-size phones (381-540) === */
@media (max-width: 540px) {
    .price-card { padding: clamp(1rem, 3vw, 1.5rem); }
    .price-card .price { font-size: clamp(1.6rem, 6vw, 2rem); }
    details summary { padding: 0.5rem 0; }
    .breadcrumbs { font-size: 0.8rem; }
    .related-grid { grid-template-columns: 1fr !important; }
}

/* === Long-form prose readable width === */
.article-prose,
section.bg-white > .container.max-w-3xl,
section > .container.max-w-3xl {
    max-width: min(100%, 70ch);
}
.article-prose p { font-size: clamp(1rem, 0.95rem + 0.15vw, 1.075rem); }

/* === Town/service combo grids === */
.related-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

/* === FAQ details === */
details {
    padding: clamp(0.75rem, 2vw, 1rem);
}
details summary {
    list-style: none;
    cursor: pointer;
    line-height: 1.4;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; color: #0CC0DF; font-weight: 700; }
details[open] summary::before { content: "− "; }

/* === Sticky scroll snapping for hero on tall mobile === */
@media (max-width: 720px) and (min-height: 600px) {
    .hero-mini { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }
}

/* === Honor user motion preference === */
@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;
    }
}

/* === Print: clean output for invoices/receipts === */
@media print {
    nav, footer, .mobile-call-bar, .cta-box, form, #quote { display: none !important; }
    body { padding: 0; background: white; color: black; font-size: 11pt; }
    a { color: black; text-decoration: underline; }
    .container { max-width: 100%; padding: 0; }
}

/* === Hi-DPI / retina === */
@media (min-resolution: 2dppx) {
    img { image-rendering: -webkit-optimize-contrast; }
}

/* === Ultra-wide content cap === */
@media (min-width: 1600px) {
    .container { max-width: 1280px; }
    section { padding: clamp(3rem, 5vw, 5rem) 0; }
}

/* === Dark mode hint (non-dark site, but respect when overlay) === */
@media (prefers-color-scheme: dark) {
    .review-card { background: #f3f4f6; }
}

/* === Overlap guards: prevent stuck content under sticky nav === */
section[id] {
    scroll-margin-top: clamp(80px, 12vh, 120px);
}

/* === Form fields more thumb-friendly === */
select, textarea {
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%),
                      linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 32px;
}
textarea { background-image: none; padding-right: 0.8rem; resize: vertical; min-height: 88px; }

/* === Better landscape phone layout === */
@media (max-height: 480px) and (orientation: landscape) {
    .hero-mini { padding: 1.25rem 1rem; min-height: auto; }
    .hero-mini h1 { font-size: clamp(1.25rem, 4vw, 1.85rem); margin-bottom: 0.4rem; }
    .hero-mini p  { font-size: 0.9rem; margin-bottom: 0.75rem; }
    .trust-row { display: none; }
    section { padding: 1.25rem 0; }
}
