/* =============================================================
   CONCORD PLUMBING & HEATING — base.css
   Design tokens, reset, layout primitives, header, footer.
   Direct port of the source site's styles.css :root + nav + footer.
   ============================================================= */

:root {
  /* Surfaces */
  --cph-bg:      #FBFBFD;
  --cph-bg-2:    #F5F5F7;
  --cph-bg-3:    #EDEDEF;
  --cph-black:   #000000;
  --cph-black-2: #0A0A0C;

  /* Text */
  --cph-ink:     #1D1D1F;
  --cph-ink-2:   #424245;
  --cph-mute:    #6E6E73;
  --cph-mute-2:  #86868B;
  --cph-hair:    #D2D2D7;
  --cph-paper:   #F5F5F7;
  --cph-paper-d: #A1A1A6;

  /* Accents */
  --cph-blue:    #0071E3;
  --cph-blue-h:  #0077ED;
  --cph-blue-d:  #2997FF;
  --cph-green:   #34D158;

  /* Type & motion */
  --cph-sans:     -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
                  'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --cph-ease:     cubic-bezier(0.32, 0.72, 0, 1);
  --cph-ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Shape */
  --cph-r-card: 22px;
  --cph-r-pill: 980px;
}

/* ============ RESET ============ */
body.cph-singular *, body.cph-singular *::before, body.cph-singular *::after,
body[class*="single-cph_project"] *, body[class*="single-cph_project"] *::before, body[class*="single-cph_project"] *::after {
  box-sizing: border-box;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--cph-sans);
  font-weight: 400;
  color: var(--cph-ink);
  background: var(--cph-bg);
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

button { font: inherit; cursor: pointer; }

/* Skip link */
.skip-link.screen-reader-text {
  position: absolute;
  left: -10000px; top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
.skip-link.screen-reader-text:focus {
  left: 6px; top: 6px;
  width: auto; height: auto;
  z-index: 10000;
  padding: 12px 18px;
  background: var(--cph-ink);
  color: #fff;
  border-radius: 8px;
}

.cph-main { display: block; }

/* ============ ELEMENTOR PAGE TEMPLATES ============ */
/* Full-width: theme header/footer kept, content edge-to-edge, no title. */
.cph-fullwidth-content {
  width: 100%;
  margin: 0;
  padding: 0;
}
.cph-fullwidth-content > .elementor {
  width: 100%;
}

/* Canvas: no header/footer at all — the page is pure Elementor. */
body.cph-elementor-canvas {
  margin: 0;
  padding: 0;
}
body.cph-elementor-canvas .cph-fullwidth-content { width: 100%; }

/* ============ CONTAINERS ============ */
.cph-wrap      { width: 100%; max-width: 1024px; margin: 0 auto; padding: 0 22px; }
.cph-wrap-wide { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 22px; }

/* ============ TYPE ============ */
.cph-display-2 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.035em;
  color: var(--cph-ink);
}
.cph-display-2 .light { font-weight: 400; color: var(--cph-mute); }

.cph-lede {
  font-size: clamp(19px, 1.6vw, 23px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.012em;
  color: var(--cph-ink-2);
}

.cph-eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--cph-blue);
  margin-bottom: 18px;
}
.cph-eyebrow.dark { color: var(--cph-blue-d); }

/* ============ BUTTONS ============ */
.cph-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--cph-r-pill);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.018em;
  transition: all 0.3s var(--cph-ease);
  border: none;
  cursor: pointer;
}
.cph-btn-primary { background: var(--cph-blue); color: #fff; }
.cph-btn-primary:hover { background: var(--cph-blue-h); transform: translateY(-1px); }
.cph-btn-primary.dark { background: var(--cph-blue-d); }

.cph-btn-link {
  color: var(--cph-blue);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.022em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cph-btn-link.dark { color: var(--cph-blue-d); }
.cph-btn-link::after {
  content: '›';
  font-size: 1.2em;
  line-height: 0.9;
  margin-left: 2px;
  transition: transform 0.25s var(--cph-ease);
  display: inline-block;
}
.cph-btn-link:hover::after { transform: translateX(4px); }
.cph-btn-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Header CTA pill (matches source nav-cta) — apply by adding class cph-pill */
.cph-pill, a.cph-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 16px;
  border-radius: var(--cph-r-pill);
  background: rgba(0,0,0,0.04);
  color: var(--cph-ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.012em;
  transition: all 0.25s var(--cph-ease);
}
.cph-pill:hover {
  background: var(--cph-ink);
  color: #fff;
}

/* ============ REVEAL ============ */
.cph-reveal,
.cph-stat-band-cell,
.cph-sec-card,
.cph-hero-meta-item {
  /* baseline; overridden by .rv classes when explicitly applied */
}

.rv {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 1.1s var(--cph-ease), transform 1.1s var(--cph-ease);
}
.rv.in {
  opacity: 1;
  transform: translateY(0);
}

.rv-stagger > * {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1s var(--cph-ease), transform 1s var(--cph-ease);
}
.rv-stagger.in > * { opacity: 1; transform: translateY(0); }
.rv-stagger.in > *:nth-child(1) { transition-delay: 0.05s; }
.rv-stagger.in > *:nth-child(2) { transition-delay: 0.15s; }
.rv-stagger.in > *:nth-child(3) { transition-delay: 0.25s; }
.rv-stagger.in > *:nth-child(4) { transition-delay: 0.35s; }
.rv-stagger.in > *:nth-child(5) { transition-delay: 0.45s; }
.rv-stagger.in > *:nth-child(6) { transition-delay: 0.55s; }

.rv-scale {
  opacity: 0;
  transform: translateY(40px) scale(0.96);
  transition: opacity 1.1s var(--cph-ease), transform 1.1s var(--cph-ease);
}
.rv-scale.in { opacity: 1; transform: translateY(0) scale(1); }

/* ============ HEADER NAV ============ */
.cph-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 48px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background 0.4s ease, border-color 0.4s ease;
}
.cph-nav.cph-nav-scrolled {
  background: rgba(251, 251, 253, 0.78);
  border-bottom-color: rgba(0,0,0,0.06);
}
.cph-nav-inner {
  height: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cph-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.018em;
  color: #fff;
  flex-shrink: 0;
  transition: color 0.4s;
}
.cph-nav.cph-nav-scrolled .cph-brand { color: var(--cph-ink); }

.cph-brand-mark {
  width: 22px; height: 22px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding-right: 1px;
}

.cph-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.cph-nav-links a,
.cph-nav-cta {
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  opacity: 0.86;
  transition: opacity 0.2s, color 0.4s;
  letter-spacing: -0.005em;
}
.cph-nav.cph-nav-scrolled .cph-nav-links a,
.cph-nav.cph-nav-scrolled .cph-nav-links span,
.cph-nav.cph-nav-scrolled .cph-nav-cta { color: var(--cph-ink); }
.cph-nav-links a:hover,
.cph-nav-cta:hover { opacity: 1; }

/* Sectors dropdown — matches source .has-dropdown */
.cph-nav-links .has-dropdown {
  position: relative;
  display: inline-block;
}
.cph-nav-links .has-dropdown > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.cph-nav-links .has-dropdown > a::after {
  content: '';
  width: 5px; height: 5px;
  border-right: 1.2px solid currentColor;
  border-bottom: 1.2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  margin-left: 2px;
  transition: transform 0.3s var(--cph-ease);
  opacity: 0.6;
}
.cph-nav-links .has-dropdown:hover > a::after {
  transform: rotate(225deg);
  margin-top: 2px;
}

.cph-nav-links .dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 240px;
  padding: 10px;
  background: rgba(251, 251, 253, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  box-shadow: 0 24px 50px -20px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--cph-ease), transform 0.3s var(--cph-ease), visibility 0s 0.3s;
  display: flex;
  flex-direction: column;
}
.cph-nav-links .has-dropdown:hover .dropdown,
.cph-nav-links .has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.3s var(--cph-ease), transform 0.3s var(--cph-ease), visibility 0s;
}
.cph-nav-links .dropdown a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--cph-ink);
  letter-spacing: -0.01em;
  border-radius: 10px;
  opacity: 1;
  transition: background 0.2s, color 0.2s;
}
.cph-nav-links .dropdown a::after {
  content: '›';
  font-size: 1.1em;
  color: var(--cph-mute);
  transition: transform 0.25s var(--cph-ease), color 0.2s;
}
.cph-nav-links .dropdown a:hover { background: var(--cph-bg-2); }
.cph-nav-links .dropdown a:hover::after { transform: translateX(3px); color: var(--cph-blue); }
.cph-nav-links .dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: rgba(251, 251, 253, 0.92);
  border-left: 1px solid rgba(0,0,0,0.06);
  border-top: 1px solid rgba(0,0,0,0.06);
}

.cph-nav-cta {
  display: inline-flex;
  align-items: center;
}

.cph-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 28px; height: 28px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
}
.cph-menu-btn span {
  width: 18px; height: 1.5px;
  background: #fff;
  transition: 0.3s;
  display: block;
}
.cph-nav.cph-nav-scrolled .cph-menu-btn span { background: var(--cph-ink); }
.cph-menu-btn.is-open span:nth-child(1) { transform: translateY(2.7px) rotate(45deg); }
.cph-menu-btn.is-open span:nth-child(2) { transform: translateY(-2.7px) rotate(-45deg); }

.cph-nav-mobile {
  position: absolute;
  top: 48px; left: 0; right: 0;
  background: rgba(251, 251, 253, 0.96);
  backdrop-filter: blur(20px);
  padding: 16px 22px 24px;
  display: none;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.cph-nav-mobile.is-open { display: flex; }
.cph-nav-mobile a,
.cph-nav-mobile .cph-nav-mobile-list a,
.cph-nav-mobile .menu-item a {
  font-size: 17px;
  font-weight: 500;
  padding: 14px 0;
  letter-spacing: -0.018em;
  color: var(--cph-ink);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.cph-nav-mobile ul { list-style: none; margin: 0; padding: 0; }

@media (max-width: 800px) {
  .cph-nav-links, .cph-nav-cta { display: none; }
  .cph-menu-btn { display: flex; }
}

/* Push first section below the fixed nav when nav is solid (inner pages).
 * The hero modes handle their own top padding when nav overlays. */
body.cph-singular .cph-main > section:first-child:not(.cph-hero-full) {
  /* No global push — hero modes set their own padding. */
}

/* ============ FOOTER ============ */
.cph-footer {
  background: var(--cph-bg-2);
  color: var(--cph-mute);
  padding: 56px 0 28px;
  font-size: 12px;
  line-height: 1.5;
  border-top: 1px solid var(--cph-hair);
}
.cph-footer-disc {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cph-hair);
  margin-bottom: 16px;
}
.cph-footer-disc strong { color: var(--cph-ink-2); font-weight: 500; }

.cph-f-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--cph-hair);
  margin-bottom: 16px;
}
.cph-f-grid h6 {
  font-size: 12px;
  color: var(--cph-ink);
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.005em;
}
.cph-f-grid ul,
.cph-footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cph-f-grid li,
.cph-footer-menu li { margin-bottom: 8px; }
.cph-f-grid a,
.cph-footer-menu a { color: var(--cph-mute); transition: color 0.2s; }
.cph-f-grid a:hover,
.cph-footer-menu a:hover { color: var(--cph-ink); }

.cph-f-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 768px) {
  .cph-f-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

/* ============ BASIC PAGE STRUCTURE FALLBACKS ============ */
.cph-page-head { padding: 80px 0 24px; }
.cph-page-title {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--cph-ink);
  margin: 0 0 12px;
}
.cph-entry { padding: 24px 0 80px; font-size: 17px; line-height: 1.6; color: var(--cph-ink-2); }
.cph-entry p { margin-bottom: 1em; }
.cph-archive,
.cph-search-results,
.cph-404 { padding: 100px 0 80px; }
.cph-empty { color: var(--cph-mute); font-size: 16px; padding: 40px 0; }

.cph-archive-item,
.cph-search-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--cph-hair);
}
.cph-archive-item h2,
.cph-search-item h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0 0 8px;
}

/* Search form */
.cph-search-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}
.cph-search-input {
  height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  border: 1px solid var(--cph-hair);
  background: var(--cph-bg);
  font: inherit;
  min-width: 240px;
}
.cph-search-submit {
  height: 44px;
  padding: 0 20px;
  border-radius: 22px;
  background: var(--cph-blue);
  color: #fff;
  border: none;
  font-weight: 500;
}

/* ============ a11y ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
