/* ============================================================
   Castle Rock Plumbing Pros — Ember Ridge (Design 5)
   Primary #3730A3 · Dark #1e1b4b · Accent #F97316
   System font stack — no web fonts
   ============================================================ */

/* --- Variables --- */
:root {
  --primary:      #3730A3;
  --primary-dark: #1e1b4b;
  --accent:       #F97316;
  --accent-dark:  #ea6900;
  --white:        #ffffff;
  --bg-light:     #f9fafb;
  --bg-subtle:    #f3f4f6;
  --border:       #e5e7eb;
  --text:         #1f2937;
  --text-muted:   #6b7280;
  --radius:       8px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); line-height: 1.65; background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); transition: color .15s; }
a:hover { color: var(--accent); }
p { margin: 0 0 1.25rem; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.5rem; margin: 0 0 1.25rem; }
li { margin-bottom: .4rem; }
strong { font-weight: 700; }

/* --- Skip link --- */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--primary-dark); color: var(--white);
  padding: .5rem 1rem; border-radius: 0 0 var(--radius) var(--radius);
  font-size: .875rem; font-weight: 600; z-index: 9999; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* --- Container --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
@media (max-width: 479px) { .container { padding: 0 1rem; } }

/* --- Headings --- */
h1, h2, h3, h4 { color: var(--primary-dark); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.85rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.2rem); font-weight: 600; }
h4 { font-size: 1rem; }

/* --- Utility --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.max-prose { max-width: 65ch; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 500;
  background: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 1rem;
}

/* Logo */
.nav-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; flex-shrink: 0; }
.logo-bar { width: 6px; height: 30px; background: var(--accent); border-radius: 2px; flex-shrink: 0; }
.logo-text { font-size: .9375rem; font-weight: 700; color: var(--white); letter-spacing: -.01em; line-height: 1.1; }
.logo-sub { display: block; font-size: .6875rem; font-weight: 400; color: #a5b4fc; }

/* Nav menu */
.nav-menu { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: flex; align-items: center; gap: .25rem;
  padding: 0 .85rem; height: 60px;
  color: #a5b4fc; text-decoration: none;
  font-size: .8125rem; font-weight: 500; white-space: nowrap;
}
.nav-menu > li > a:hover,
.nav-menu > li > a[aria-expanded="true"] { color: var(--white); }
.caret { font-size: .625rem; opacity: .7; }

/* Dropdown */
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  min-width: 230px; background: var(--white);
  border: .5px solid var(--border); border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 600; list-style: none; padding: .4rem 0;
}
.nav-menu > li:hover .dropdown-menu,
.nav-menu > li > a[aria-expanded="true"] + .dropdown-menu { display: block; }
.dropdown-menu li a {
  display: block; padding: .55rem 1.1rem;
  font-size: .8125rem; color: var(--text); text-decoration: none; white-space: nowrap;
}
.dropdown-menu li a:hover { background: var(--bg-subtle); color: var(--primary); }
.dropdown-divider { border-top: .5px solid var(--border); margin: .3rem 0; }
.dropdown-viewall a { color: var(--primary); font-weight: 700; }

/* Phone CTA */
.nav-phone {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; background: var(--accent); color: var(--white);
  border-radius: var(--radius); text-decoration: none;
  font-weight: 700; font-size: .875rem; min-height: 44px;
  flex-shrink: 0; transition: background .15s;
}
.nav-phone:hover { background: var(--accent-dark); color: var(--white); }
.nav-phone-icon { font-size: 1rem; line-height: 1; }
@media (max-width: 767px) {
  .nav-phone-label { display: none; }
  .nav-phone { min-width: 44px; padding: .6rem; justify-content: center; }
}

/* Hamburger */
.nav-toggle {
  display: none; background: transparent;
  border: .5px solid #4f46e5; border-radius: var(--radius);
  padding: .5rem; cursor: pointer; color: var(--white);
  font-size: 1.25rem; min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
@media (max-width: 1023px) {
  .nav-toggle { display: flex; }
  .nav-menu { display: none; }
  .nav-menu.is-open {
    display: flex; flex-direction: column;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--primary-dark); z-index: 490;
    padding: .4rem 0 1rem;
    box-shadow: 0 8px 16px rgba(0,0,0,.35);
  }
  .nav-menu.is-open > li { width: 100%; }
  .nav-menu.is-open > li > a { height: auto; padding: .7rem 1.5rem; border-bottom: .5px solid #2d2a6e; }
  .nav-menu.is-open .dropdown-menu {
    display: block; position: static;
    box-shadow: none; background: #2d2a6e;
    border: none; border-radius: 0; padding: 0;
  }
  .nav-menu.is-open .dropdown-menu li a { color: #c7d2fe; padding: .55rem 2.75rem; }
  .nav-menu.is-open .dropdown-menu li a:hover { background: var(--primary); color: var(--white); }
  .nav-menu.is-open .dropdown-divider { border-color: #3730A3; }
  .nav-menu.is-open .dropdown-viewall a { color: #fbbf24; }
}

/* ============================================================
   HERO (Ember Ridge: orange bg, split grid)
   ============================================================ */
.hero {
  background: var(--accent);
  padding: 3.5rem 0 3rem;
}
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2.5rem; align-items: center;
}
.hero-eyebrow {
  font-size: .75rem; color: #fff7ed;
  text-transform: uppercase; letter-spacing: .08em;
  font-weight: 600; margin-bottom: .9rem;
}
.hero h1 { color: var(--white); margin-bottom: 1rem; }
.hero-subhead { font-size: 1rem; color: #fff7ed; line-height: 1.65; margin-bottom: 1.75rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.hero-trust { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.hero-trust span {
  font-size: .8125rem; color: #fff7ed;
  display: flex; align-items: center; gap: .35rem;
}
.hero-trust span::before { content: '✓'; font-weight: 700; color: var(--primary-dark); }
@media (max-width: 767px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .75rem 1.5rem; border-radius: var(--radius);
  font-size: .9375rem; font-weight: 700; text-decoration: none;
  min-height: 44px; transition: opacity .15s, background .15s;
  border: none; cursor: pointer;
}
.btn:hover { opacity: .9; }
.btn-dark  { background: var(--primary-dark); color: var(--white); }
.btn-dark:hover  { color: var(--white); opacity: .92; }
.btn-white-outline { background: transparent; border: 2px solid var(--white); color: var(--white); }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-accent  { background: var(--accent); color: var(--white); }
.btn-sm { padding: .55rem 1.1rem; font-size: .875rem; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section       { padding: 3.5rem 0; }
.section-sm    { padding: 2.25rem 0; }
.section-alt   { background: var(--bg-light); }
.section-dark  { background: var(--primary-dark); }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark p { color: #a5b4fc; }
.section-dark a { color: #c7d2fe; }
.section-dark a:hover { color: var(--white); }

.section-header { margin-bottom: 2rem; }
.section-header h2 { margin-bottom: .6rem; }
.section-intro { font-size: 1rem; color: var(--text-muted); max-width: 58ch; }

/* ============================================================
   SERVICE CARDS
   ============================================================ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.service-card {
  background: var(--white); border: .5px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.1rem; display: flex; flex-direction: column;
  transition: border-left-color .15s;
}
.service-card:hover { border-left-color: var(--accent); }
.service-card h3 { font-size: .875rem; color: var(--primary-dark); margin-bottom: .35rem; }
.service-card p  { font-size: .8125rem; color: var(--text-muted); margin: 0 0 .75rem; flex: 1; line-height: 1.5; }
.service-card a  { font-size: .8125rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.service-card a:hover { color: var(--accent); }
.service-card.hero-svc { border-left-color: var(--accent); }

/* ============================================================
   LOCATION CARDS
   ============================================================ */
.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
}
.location-card {
  background: var(--white); border: .5px solid var(--border);
  border-radius: var(--radius); padding: .85rem 1rem;
  text-decoration: none; display: block;
  transition: border-color .15s, background .15s;
}
.location-card:hover { border-color: var(--primary); background: var(--bg-subtle); }
.location-name { font-size: .875rem; font-weight: 600; color: var(--primary-dark); display: block; }
.location-region { font-size: .75rem; color: var(--text-muted); }

/* ============================================================
   BLOG CARDS
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.blog-card {
  background: var(--white); border: .5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.blog-card-body { padding: 1rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.blog-card h3 { font-size: .9375rem; margin-bottom: .5rem; }
.blog-card p { font-size: .8125rem; color: var(--text-muted); flex: 1; }
.blog-card-link { font-size: .8125rem; font-weight: 700; color: var(--primary); text-decoration: none; margin-top: .75rem; display: inline-block; }
.blog-card-link:hover { color: var(--accent); }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { display: flex; flex-direction: column; }
.faq-item { border-top: .5px solid var(--border); }
.faq-item:last-child { border-bottom: .5px solid var(--border); }
.faq-q {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 0; cursor: pointer; width: 100%; text-align: left;
  background: none; border: none; gap: 1rem;
  font-size: .9375rem; font-weight: 600; color: var(--primary-dark);
  font-family: var(--font);
}
.faq-q:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
.faq-icon { font-size: 1.25rem; color: var(--accent); flex-shrink: 0; transition: transform .2s; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a { display: none; font-size: .9375rem; color: var(--text); line-height: 1.7; padding-bottom: 1rem; }
.faq-item.open .faq-a { display: block; }

/* ============================================================
   LINK BLOCKS (Related Services / Areas / Blog)
   ============================================================ */
.link-block { background: var(--bg-subtle); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.link-block h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .75rem; font-weight: 700; }
.link-block ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.link-block li a {
  font-size: .8125rem; color: var(--primary); text-decoration: none;
  background: var(--white); border: .5px solid var(--border);
  padding: .3rem .75rem; border-radius: 20px; display: inline-block;
}
.link-block li a:hover { border-color: var(--primary); color: var(--primary); }
.link-blocks-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-top: 2.5rem; }

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta-section { background: var(--primary-dark); padding: 3.5rem 0; text-align: center; }
.cta-section h2 { color: var(--white); margin-bottom: .75rem; }
.cta-section p { color: #a5b4fc; margin-bottom: 1.75rem; max-width: 50ch; margin-left: auto; margin-right: auto; }
.cta-phone-link { font-size: 1.625rem; font-weight: 700; color: var(--accent); text-decoration: none; display: inline-block; margin-bottom: 1.25rem; }
.cta-phone-link:hover { color: var(--white); }
.cta-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--primary-dark);
  color: #a5b4fc;
  padding: 3rem 0 1.5rem;
  font-size: .875rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand .footer-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; margin-bottom: .75rem; }
.footer-brand .logo-text { color: var(--white); font-size: .9375rem; }
.footer-brand p { font-size: .8125rem; line-height: 1.6; }
.footer-phone { display: block; color: var(--accent); font-weight: 700; font-size: .9375rem; text-decoration: none; margin-top: .5rem; }
.footer-phone:hover { color: var(--white); }
.site-footer h3 { color: var(--accent); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .9rem; font-weight: 700; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .45rem; }
.footer-links li a { color: #a5b4fc; text-decoration: none; font-size: .8125rem; }
.footer-links li a:hover { color: var(--white); }
.footer-bottom {
  border-top: .5px solid #2d2a6e; padding-top: 1rem;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  font-size: .75rem; color: #4b5563;
}
.footer-bottom a { color: #4b5563; }
.footer-bottom a:hover { color: #a5b4fc; }
@media (max-width: 767px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 479px) { .footer-grid { grid-template-columns: 1fr; } }

/* ============================================================
   MOBILE STICKY CTA BAR
   ============================================================ */
.mobile-cta-bar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--primary-dark);
  border-top: 2px solid var(--accent);
  z-index: 800;
}
.mobile-cta-bar a {
  display: flex; align-items: center; justify-content: center;
  gap: .6rem; padding: .85rem 1rem;
  font-size: .9375rem; font-weight: 700;
  color: var(--white); text-decoration: none; min-height: 52px;
}
.mobile-cta-bar .cta-number { color: var(--accent); }
@media (max-width: 1023px) {
  .mobile-cta-bar { display: block; }
  body { padding-bottom: 56px; }
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb { font-size: .8125rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.bc-sep { margin: 0 .35rem; color: var(--text-muted); }

/* ============================================================
   SERVICE PAGE
   ============================================================ */
.svc-hero { background: var(--primary-dark); padding: 2.75rem 0 2.25rem; }
.svc-hero h1 { color: var(--white); margin-bottom: .75rem; }
.svc-hero p  { color: #a5b4fc; }
.svc-hero .breadcrumb, .svc-hero .breadcrumb a { color: #6b7280; }
.svc-hero .breadcrumb a:hover { color: #a5b4fc; }

.svc-layout { display: grid; grid-template-columns: 1fr 300px; gap: 3rem; align-items: start; }
.svc-sidebar { position: sticky; top: 76px; }
@media (max-width: 1023px) { .svc-layout { grid-template-columns: 1fr; } .svc-sidebar { position: static; } }

.sidebar-cta-box { background: var(--primary-dark); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem; }
.sidebar-cta-box h3 { color: var(--accent); font-size: .9375rem; margin-bottom: .75rem; text-transform: none; letter-spacing: 0; }
.sidebar-cta-box .s-phone { display: block; font-size: 1.1rem; font-weight: 700; color: var(--white); text-decoration: none; margin-bottom: .5rem; }
.sidebar-cta-box p { font-size: .8125rem; color: #a5b4fc; margin: 0; }
.sidebar-box { background: var(--bg-subtle); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.sidebar-box h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .75rem; font-weight: 700; }
.sidebar-box ul { list-style: none; padding: 0; margin: 0; }
.sidebar-box li { margin-bottom: .4rem; }
.sidebar-box li a { font-size: .8125rem; color: var(--primary); text-decoration: none; }
.sidebar-box li a:hover { color: var(--accent); }

/* Pricing table */
.price-table { border-collapse: collapse; width: 100%; font-size: .875rem; }
.price-table th { background: var(--primary-dark); color: var(--white); padding: .6rem .85rem; text-align: left; font-weight: 600; }
.price-table td { padding: .6rem .85rem; border-bottom: .5px solid var(--border); }
.price-table tr:nth-child(even) td { background: var(--bg-subtle); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }

/* ============================================================
   LOCATION PAGE
   ============================================================ */
.loc-hero { background: var(--accent); padding: 2.75rem 0 2.25rem; }
.loc-hero h1 { color: var(--white); margin-bottom: .75rem; }
.loc-hero p  { color: #fff7ed; }
.loc-hero .breadcrumb, .loc-hero .breadcrumb a { color: #fff7ed; opacity: .85; }

/* ============================================================
   BLOG POST
   ============================================================ */
.blog-hero { background: var(--bg-light); padding: 2.5rem 0 2rem; border-bottom: .5px solid var(--border); }
.blog-hero h1 { margin-bottom: .75rem; }
.blog-meta { font-size: .8125rem; color: var(--text-muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.blog-body { max-width: 72ch; }
.blog-body h2 { margin: 2rem 0 .75rem; }
.blog-body h3 { margin: 1.5rem 0 .6rem; }
.blog-body .table-wrap { margin: 1.25rem 0; }

/* ============================================================
   STANDARD PAGES (about, contact, privacy)
   ============================================================ */
.std-hero { background: var(--primary-dark); padding: 2.5rem 0; }
.std-hero h1 { color: var(--white); margin-bottom: .5rem; }
.std-hero p  { color: #a5b4fc; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
@media (max-width: 767px) { .contact-grid { grid-template-columns: 1fr; } }

/* ============================================================
   404
   ============================================================ */
.error-wrap { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4rem 1.5rem; }
.error-num { font-size: 6rem; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 1rem; }

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 1023px) {
  .section { padding: 2.75rem 0; }
  .hero { padding: 2.75rem 0 2.25rem; }
}
@media (max-width: 767px) {
  .section { padding: 2.25rem 0; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  .hero { padding: 2rem 0 1.75rem; }
  .cta-phone-link { font-size: 1.25rem; }
  .blog-grid { grid-template-columns: 1fr; }
}
@media (max-width: 479px) {
  .service-grid { grid-template-columns: 1fr; }
  .location-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .mobile-cta-bar, .nav-toggle { display: none; }
  body { padding-bottom: 0; color: #000; }
  a { color: #000; }
}
