/* ==========================================================================
   West Coast Plumbing Pro — design system
   Plain CSS components layered on top of Tailwind utilities.
   ========================================================================== */
:root {
  --navy: #102A43;
  --navy-deep: #0B1F33;
  --accent: #1677C8;
  --accent-dark: #0F5FA3;
  --action: #F97316;
  --action-hover: #FB8A3C;
  --light: #F5F8FC;
  --white: #FFFFFF;
  --body: #334155;
  --muted: #64748B;
  --line: #E2E8F0;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 2px rgba(16, 42, 67, .06), 0 8px 24px -8px rgba(16, 42, 67, .12);
  --shadow-lift: 0 2px 4px rgba(16, 42, 67, .06), 0 18px 40px -12px rgba(16, 42, 67, .22);
  --font-display: 'Manrope', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --header-h: 80px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); color: var(--body); background: var(--white); overflow-x: hidden; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
main:focus { outline: none; }

.container-x { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 640px) { .container-x { padding-inline: 24px; } }
@media (min-width: 1024px) { .container-x { padding-inline: 32px; } }

/* Focus ------------------------------------------------------------------- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.cta-band :focus-visible, .side-cta :focus-visible, footer :focus-visible, .call-box :focus-visible, .home-hero :focus-visible { outline-color: #7DD3FC; }

.skip-link { position: absolute; left: 12px; top: -100px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; }

/* Typography -------------------------------------------------------------- */
.font-display { font-family: var(--font-display); }
.h1 { font-family: var(--font-display); color: var(--navy); font-weight: 800; letter-spacing: -0.025em; line-height: 1.08; font-size: clamp(2.1rem, 1.4rem + 3vw, 3.5rem); }
.h2 { font-family: var(--font-display); color: var(--navy); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem); margin-top: .5rem; }
.lead { font-size: clamp(1.05rem, 1rem + .3vw, 1.22rem); line-height: 1.7; color: var(--body); }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--action); border-radius: 2px; }
.section-intro { margin-top: 1rem; font-size: 1.08rem; line-height: 1.7; max-width: 46rem; }

/* Buttons ----------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .72rem 1.2rem; border-radius: 10px; font-weight: 700; font-size: .95rem; line-height: 1.2; text-decoration: none; border: 2px solid transparent; transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; white-space: nowrap; cursor: pointer; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: .95rem 1.55rem; font-size: 1.02rem; border-radius: 12px; }
/* Orange buttons use deep-navy text: white on #F97316 fails WCAG contrast. */
.btn-primary { background: var(--action); color: var(--navy-deep); box-shadow: 0 6px 18px -6px rgba(249, 115, 22, .55); }
.btn-primary:hover { background: var(--action-hover); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-deep); }
.btn-outline { background: #fff; color: var(--navy); border-color: #CBD5E1; }
.btn-outline:hover { border-color: var(--navy); }
.btn-ghost-light { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .14); border-color: #fff; }

/* Header ------------------------------------------------------------------ */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line); transition: box-shadow .2s ease; }
@supports (backdrop-filter: blur(8px)) { .site-header { background: rgba(255, 255, 255, .9); backdrop-filter: saturate(160%) blur(10px); } }
.site-header.is-scrolled { box-shadow: 0 6px 24px -12px rgba(16, 42, 67, .28); }
.nav-link { display: inline-flex; align-items: center; gap: .3rem; padding: .55rem .8rem; border-radius: 8px; font-weight: 600; font-size: .95rem; color: var(--navy); transition: background-color .15s, color .15s; }
.nav-link:hover, .nav-link[aria-expanded="true"] { background: var(--light); color: var(--accent); }
.nav-link.is-active { color: var(--accent); }
.nav-chevron { transition: transform .2s ease; }
[aria-expanded="true"] > .nav-chevron { transform: rotate(180deg); }
.dropdown-panel { position: absolute; left: -12px; top: calc(100% + 10px); width: 520px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lift); padding: 12px; animation: dd-in .16s ease-out; }
.dropdown-panel::before { content: ""; position: absolute; inset: -12px 0 auto 0; height: 12px; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown-link { display: flex; align-items: center; gap: .65rem; padding: .6rem .7rem; border-radius: 10px; font-size: .92rem; font-weight: 600; color: var(--navy); }
.dropdown-link:hover, .dropdown-link[aria-current="page"] { background: var(--light); color: var(--accent); }
.dropdown-all { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; padding: .75rem .9rem; border-radius: 10px; background: var(--light); font-weight: 700; font-size: .9rem; color: var(--accent); }
.dropdown-all:hover { background: #E8F1FB; }
.menu-toggle { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 10px; color: var(--navy); border: 1px solid var(--line); }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.mobile-menu { border-top: 1px solid var(--line); background: #fff; max-height: calc(100vh - 110px); overflow-y: auto; }
.mobile-link { display: flex; align-items: center; padding: .8rem .75rem; border-radius: 10px; font-weight: 600; font-size: 1.02rem; color: var(--navy); }
.mobile-link:hover, .mobile-link[aria-current="page"] { background: var(--light); color: var(--accent); }
.mobile-sublink { display: block; padding: .55rem .75rem; border-radius: 8px; font-size: .97rem; color: var(--body); }
.mobile-sublink:hover, .mobile-sublink[aria-current="page"] { background: var(--light); color: var(--accent); }

/* Hero -------------------------------------------------------------------- */
.home-hero { position: relative; background: var(--navy-deep); color: #fff; overflow: hidden; isolation: isolate; }
.home-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(900px 500px at 85% 10%, rgba(22, 119, 200, .28), transparent 60%); }
.home-hero .h1 { color: #fff; }
.service-hero, .page-hero { background: var(--light); border-bottom: 1px solid var(--line); }
.hero-img-wrap { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 3 / 2; box-shadow: var(--shadow-lift); background: #DCE6F2; }
.hero-badge { position: absolute; left: 16px; bottom: 16px; display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; background: rgba(255, 255, 255, .96); color: var(--navy); border-radius: 14px; box-shadow: var(--shadow-card); max-width: calc(100% - 32px); }

/* Cards ------------------------------------------------------------------- */
.service-card { display: flex; flex-direction: column; height: 100%; padding: 1.6rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(16, 42, 67, .04); transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: #BFD7EF; }
.icon-badge { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: #E8F1FB; color: var(--accent); }
.icon-badge-sm { width: 44px; height: 44px; border-radius: 12px; }
.service-card:hover .icon-badge { background: var(--accent); color: #fff; }
.service-card .icon-badge { transition: background-color .22s ease, color .22s ease; }
.info-card { padding: 1.4rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.process-step { position: relative; padding: 1.6rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; background: var(--navy); color: #fff; font-family: var(--font-display); font-weight: 800; }
.area-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.badge { display: inline-flex; align-items: center; padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.badge-blue { background: #E8F1FB; color: var(--accent-dark); }
.badge-green { background: #DCFCE7; color: #166534; }
.badge-muted { background: #F1F5F9; color: #475569; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .9rem; font-weight: 600; color: var(--navy); }
.chip svg { color: var(--accent); }
.post-card h3 a::after { content: none; }

/* Sidebar ----------------------------------------------------------------- */
.side-cta { padding: 1.6rem; border-radius: var(--radius-lg); background: var(--navy); background-image: radial-gradient(400px 200px at 100% 0%, rgba(22, 119, 200, .35), transparent 70%); }
.side-box { padding: 1.4rem; border-radius: var(--radius-lg); border: 1px solid var(--line); background: #fff; }
.side-link { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem; border-radius: 8px; font-size: .93rem; font-weight: 500; color: var(--navy); }
.side-link:hover { background: var(--light); color: var(--accent); }

/* CTA band ---------------------------------------------------------------- */
.cta-band { position: relative; background: var(--navy); overflow: hidden; isolation: isolate; }
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(700px 300px at 0% 100%, rgba(249, 115, 22, .18), transparent 60%), radial-gradient(700px 360px at 100% 0%, rgba(22, 119, 200, .35), transparent 60%); }
.call-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem; margin: 2.5rem 0; padding: 1.6rem; border-radius: var(--radius-lg); background: var(--navy); }

/* Long-form content ------------------------------------------------------- */
.content { font-size: 1.05rem; line-height: 1.78; color: var(--body); }
.content > * + * { margin-top: 1.1em; }
.content h2 { font-family: var(--font-display); font-weight: 800; color: var(--navy); font-size: clamp(1.5rem, 1.2rem + 1vw, 1.95rem); line-height: 1.2; letter-spacing: -0.015em; margin-top: 2.2em; }
.content h2:first-child { margin-top: 0; }
.content h3 { font-family: var(--font-display); font-weight: 700; color: var(--navy); font-size: 1.22rem; line-height: 1.35; margin-top: 1.8em; }
.content h2 + *, .content h3 + * { margin-top: .6em; }
.content a:not(.btn) { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.content a:not(.btn):hover { color: var(--accent-dark); }
.content strong { color: var(--navy); }
.content ul:not(.checklist):not(.not-content) { list-style: disc; padding-left: 1.3em; }
.content ol:not(.not-content):not(.steps) { list-style: decimal; padding-left: 1.4em; }
.content li + li { margin-top: .45em; }
.content li::marker { color: var(--accent); }
.content-sm { font-size: 1rem; line-height: 1.7; }
.content .checklist { display: grid; gap: .7rem; }
.content .checklist li { position: relative; padding-left: 2rem; margin: 0; }
.content .checklist li::before { content: ""; position: absolute; left: 0; top: .2em; width: 1.3rem; height: 1.3rem; border-radius: 999px; background: #E8F1FB url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231677C8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 62% no-repeat; }
.content .card-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .content .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.content .card-grid > div { padding: 1.25rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--light); }
.content .card-grid h3 { margin-top: 0; font-size: 1.05rem; }
.content .card-grid p { margin-top: .4em; font-size: .97rem; line-height: 1.65; }
.content .steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 1rem; }
.content .steps > li { counter-increment: step; position: relative; padding: 1.1rem 1.2rem 1.1rem 3.8rem; border: 1px solid var(--line); border-radius: var(--radius); margin: 0; }
.content .steps > li::before { content: counter(step); position: absolute; left: 1.1rem; top: 1.05rem; width: 1.9rem; height: 1.9rem; border-radius: 999px; background: var(--navy); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: .9rem; display: flex; align-items: center; justify-content: center; }
.content .steps strong { display: block; }
.content .callout { padding: 1.2rem 1.35rem; border-left: 4px solid var(--action); border-radius: 0 var(--radius) var(--radius) 0; background: #FFF7ED; }
.content .callout-info { border-left-color: var(--accent); background: #EFF6FF; }
.content .callout > :first-child { margin-top: 0; }
.content .callout p + p { margin-top: .6em; }
.content table { width: 100%; border-collapse: collapse; font-size: .97rem; display: block; overflow-x: auto; }
.content th, .content td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.content th { font-family: var(--font-display); color: var(--navy); background: var(--light); }
.content-figure { margin: 2rem 0; }
.content-figure figcaption { margin-top: .6rem; font-size: .88rem; color: var(--muted); }
.not-content, .not-content * { line-height: normal; }

/* FAQ accordion ----------------------------------------------------------- */
.faq-list { display: grid; gap: .75rem; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s; }
.faq-item:has(button[aria-expanded="true"]) { border-color: #BFD7EF; box-shadow: var(--shadow-card); }
.faq-q { margin: 0; }
.faq-q button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.3rem; text-align: left; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--navy); border-radius: var(--radius); }
.faq-q button:hover { color: var(--accent); }
.faq-chevron { color: var(--accent); transition: transform .25s ease; }
.faq-q button[aria-expanded="true"] .faq-chevron { transform: rotate(180deg); }
.faq-a { padding: 0 1.3rem 1.25rem; }

/* Forms ------------------------------------------------------------------- */
.request-form { padding: 1.6rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
@media (min-width: 640px) { .request-form { padding: 2.2rem; } }
.field label { display: block; margin-bottom: .4rem; font-weight: 600; font-size: .93rem; color: var(--navy); }
.field input, .field select, .field textarea { width: 100%; padding: .78rem .9rem; border: 1.5px solid #CBD5E1; border-radius: 10px; background: #fff; font: inherit; font-size: 1rem; color: var(--navy); transition: border-color .15s, box-shadow .15s; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; background-size: 18px; padding-right: 2.5rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(22, 119, 200, .18); }
.field [aria-invalid="true"] { border-color: #DC2626; }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .15); }
.field-error { margin-top: .35rem; font-size: .86rem; font-weight: 600; color: #B91C1C; }
.field-hint { margin-top: .35rem; font-size: .84rem; color: var(--muted); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.demo-note { display: flex; gap: .7rem; margin-bottom: 1.4rem; padding: .9rem 1rem; border-radius: 10px; background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E3A5F; font-size: .92rem; line-height: 1.55; }
.form-status { margin-top: 1.2rem; padding: 1rem 1.1rem; border-radius: 12px; font-weight: 500; line-height: 1.55; }
.form-status.is-success { background: #F0FDF4; border: 1px solid #86EFAC; color: #14532D; }
.form-status.is-error { background: #FEF2F2; border: 1px solid #FCA5A5; color: #7F1D1D; }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* Footer ------------------------------------------------------------------ */
.footer-title { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: .98rem; }
.footer-link { color: #CBD5E1; transition: color .15s; }
.footer-link:hover { color: #fff; }

/* Mobile CTA bar + back to top ------------------------------------------- */
.mobile-cta { position: fixed; inset: auto 0 0 0; z-index: 45; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(16, 42, 67, .3); transition: transform .25s ease; }
.mobile-cta a { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 50px; border-radius: 12px; font-weight: 800; font-size: 1rem; }
.mobile-cta-call { background: var(--action); color: var(--navy-deep); }
.mobile-cta-request { background: var(--navy); color: #fff; }
.mobile-cta.is-hidden { transform: translateY(110%); }
@media (max-width: 1023.98px) { body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); } }
@media (min-width: 1024px) { .mobile-cta { display: none; } }
.back-to-top { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 44; width: 46px; height: 46px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; box-shadow: var(--shadow-lift); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s, background-color .2s; }
.back-to-top.is-visible { opacity: 1; transform: none; }
.back-to-top:hover { background: var(--accent); }
@media (min-width: 1024px) { .back-to-top { bottom: 24px; right: 24px; } }

/* Reveal on scroll (progressive enhancement; JS adds .js-reveal to <html>) */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }

/* Reduced motion ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; }
  .btn:hover, .service-card:hover { transform: none; }
}

@media print {
  .site-header, .mobile-cta, .back-to-top, footer, .cta-band { display: none !important; }
}
