/* Mayo Pressure Washing: service pages, town pages, hubs, 404, and the
 * nav / footer additions (dropdowns, phone menu groups, footer columns).
 *
 * Built on Jake's styles.css: same tokens, cards, buttons, bands and type.
 * Everything here is scoped to classes these pages add (pg-*, dd-*,
 * menu-group, foot-*), so it never restyles Jake's own sections.
 *
 * Section grounds: light, a warm alternate and an occasional deep green
 * band, read from tokens with fallbacks so the final palette in styles.css
 * takes over when it lands: var(--ground-alt) and var(--ground-deep).
 */

/* ---------- Header call button (styled for real in styles.css) ----------
 * Zero-specificity fallback only, so the header grid is never disturbed
 * before the shared styles arrive: an icon pill beside the menu button on
 * phones, hidden on desktop where the nav already shows the number. */
:where(.header-row) { position: relative; }
:where(.hdr-call) { position: absolute; top: 50%; left: calc(var(--gutter) + 40px); translate: 0 -50%;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 40px; height: 40px;
  border-radius: 999px; color: inherit; }
:where(.hdr-call) b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 1024px) { :where(.hdr-call) { display: none; } }

/* ---------- Desktop dropdowns: Services and Areas ----------
 * Hover opens on a mouse; the caret button opens it from the keyboard or a
 * touch screen (pages.js). White card, ink text, whatever the header is. */
.nav .dd { position: relative; display: flex; align-items: center; gap: 2px; }
.nav .dd-btn { display: inline-grid; place-items: center; width: 22px; height: 48px; padding: 0; border: 0; background: none;
  color: inherit; cursor: pointer; }
.nav .dd-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: rotate .2s var(--ease); }
.nav .dd-panel { position: absolute; top: calc(100% + 6px); left: -18px; z-index: 5; min-width: 270px; padding: var(--s2);
  background: var(--paper); color: var(--ink); border: 1px solid var(--hair); border-radius: var(--radius);
  box-shadow: 0 28px 56px -28px oklch(21% .06 254 / .55);
  opacity: 0; visibility: hidden; translate: 0 6px; transition: opacity .18s var(--ease), translate .18s var(--ease), visibility .18s; }
.nav .dd-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; } /* hover bridge */
.nav .dd-end .dd-panel { left: auto; right: -18px; }
.nav .dd-panel-wide { width: 420px; }
.dd-cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s1); }
@media (hover: hover) { .nav .dd:hover .dd-panel { opacity: 1; visibility: visible; translate: 0 0; } }
.nav .dd[data-open="true"] .dd-panel { opacity: 1; visibility: visible; translate: 0 0; }
.nav .dd[data-open="true"] .dd-btn svg { rotate: 180deg; }
.nav .dd-panel a { display: flex; align-items: center; gap: var(--s2); height: auto; min-height: 40px; padding: 8px 12px; border-radius: 7px;
  font-size: 15px; font-weight: 500; line-height: 1.3; letter-spacing: 0; text-transform: none; white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease); }
.nav .dd-panel a:hover, .nav .dd-panel a:focus-visible, .nav .dd-panel a[aria-current="page"] { background: oklch(91% .05 238 / .6); color: var(--royal); }
.nav .dd-panel a.dd-all { margin-top: var(--s1); padding-top: 12px; border-top: 1px solid var(--hair); border-radius: 0 0 7px 7px;
  color: var(--royal); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
@media (prefers-reduced-motion: reduce) { .nav .dd-panel { transition: none; } }

/* ---------- Phone menu: Services and Service areas fold open ---------- */
.menu-links .menu-group { border-bottom: 1px solid var(--hair); }
.menu-group summary { display: flex; align-items: center; justify-content: space-between; min-height: 56px; cursor: pointer; list-style: none;
  font-family: var(--display); font-weight: 700; font-size: 26px; text-transform: uppercase; letter-spacing: .02em; }
.menu-group summary::-webkit-details-marker { display: none; }
.menu-group summary::after { content: ""; width: 11px; height: 11px; margin-right: 6px; border: solid var(--royal); border-width: 0 2px 2px 0;
  rotate: 45deg; translate: 0 -3px; transition: rotate .2s var(--ease), translate .2s var(--ease); }
.menu-group[open] summary::after { rotate: -135deg; translate: 0 3px; }
.menu-links .menu-group ul { display: grid; padding: 0 0 var(--s3); }
.menu-links .menu-group .menu-cols { grid-template-columns: 1fr 1fr; column-gap: var(--s3); }
.menu-links .menu-group a { min-height: 44px; border-bottom: 0; font-family: var(--font); font-weight: 500; font-size: 17px;
  text-transform: none; letter-spacing: 0; color: var(--ink); }
.menu-links .menu-group a[aria-current="page"] { color: var(--royal); }

/* ---------- Footer: every service and every town ---------- */
.footer h2 a { color: inherit; }
.foot-towns { display: grid; grid-template-columns: repeat(2, auto); column-gap: var(--s6); justify-content: start; }
.footer .foot-hours { font-size: 14px; color: oklch(100% 0 0 / .62); white-space: nowrap; }
.footer .foot-hours span { color: oklch(100% 0 0 / .8); }
.footer .foot-hours:first-of-type { margin-top: var(--s3); }
@media (max-width: 899px) {
  .pg-foot-grid .foot-areas { grid-column: span 2; order: 5; }
  .pg-foot-grid > div:last-child { order: 4; }
}
@media (min-width: 900px) { .pg-foot-grid { flex-wrap: wrap; column-gap: var(--s10); row-gap: var(--s6); } }

/* ---------- Grounds ---------- */
.pg-alt { background: var(--ground-alt, #f4f1ea); --ground: var(--paper); }
.pg-alt .card { box-shadow: 0 1px 0 var(--hair), 0 10px 28px -22px oklch(26% .07 254 / .35); }
@media (hover: hover) { .pg-alt .lift-card:hover { box-shadow: var(--lift-light); } }
.pg-alt .svc-link .more { color: var(--royal); }
.pg-green { background: var(--ground-deep, #12302a); color: var(--light);
  --ground: oklch(100% 0 0 / .06); --hair: oklch(100% 0 0 / .16); --muted: oklch(92% .02 160 / .78); }
.pg-green .card { box-shadow: 0 24px 60px -34px oklch(10% .03 160 / .9); }
@media (hover: hover) { .pg-green .lift-card:hover { border-color: oklch(84% .16 86 / .5); } }
.pg-green .also a { color: var(--gold); }
.pg-green .towns li { color: var(--light); }

/* ---------- Inner hero on the new pages ---------- */
.pg-hero .hero-media img { object-position: 50% 50%; }
.pg-hero .eyebrow { flex-wrap: wrap; row-gap: var(--s1); }
.pg-hero .hero-lede { max-width: 46ch; }
@media (max-width: 639px) {
  .pg-hero .hero-title-inner { font-size: 52px; }
  .pg-hero .hero-lede { font-size: 16px; }
  .pg-hero .hero-content { gap: 16px; }
}

/* ---------- Layout pieces ---------- */
.pg-split { display: grid; gap: var(--s8); align-items: center; }
@media (min-width: 900px) { .pg-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s12); } }
.pg-split-top { align-items: start; }
.pg-copy .lede { max-width: 46ch; margin-bottom: var(--s4); }
.pg-copy .body-muted { max-width: 58ch; }
.pg-sub { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 24px; line-height: 1; letter-spacing: .01em;
  margin: var(--s6) 0 var(--s4); }
.pg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s6); }
.pg-actions .btn { white-space: normal; text-align: center; max-width: 100%; }
.svc-detail-copy .pg-actions { margin-top: 0; gap: var(--s5); }
.svc-detail-copy .pg-actions .more { margin-top: 0; }
@media (max-width: 639px) { .pg-actions .btn { flex: 1 1 100%; } }

.pg-ba { margin: 0; }
.pg-ba figcaption, .pg-photo figcaption { margin-top: var(--s2); font-size: 14px; color: var(--muted); text-align: center; }
.pg-side { display: grid; gap: var(--s5); }
.pg-photo { margin: 0; }
.pg-photo picture { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius);
  background: oklch(91% .05 238 / .6); box-shadow: 0 1px 0 var(--hair), 0 18px 40px -30px oklch(26% .07 254 / .45); }
.pg-photo img { width: 100%; height: 100%; object-fit: cover; }
.pg-note .card-name { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 22px; line-height: 1.05; letter-spacing: .01em; }

/* Real job photos, linked to the gallery. */
.pg-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
@media (min-width: 1024px) { .pg-shots { gap: var(--s5); } }
.pg-shot { display: block; overflow: hidden; border-radius: var(--radius); background: oklch(91% .05 238 / .6); }
.pg-shot img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: scale .3s var(--ease); }
@media (hover: hover) { .pg-shot:hover img { scale: 1.04; } }

/* Town chips that link. The pin stays on the chip, the link fills the rest. */
.pg-towns { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); }
.pg-towns li { padding: 0 0 0 var(--s3); gap: 0; }
.pg-towns li::before { margin-right: var(--s2); }
.pg-towns a { display: flex; align-items: center; align-self: stretch; padding-right: var(--s4); }
.pg-towns li:has(a[aria-current="page"]) { border-color: var(--gold); }
.ground-light .pg-towns a { color: var(--ink); }
@media (hover: hover) { .ground-light .pg-towns a:hover { color: var(--royal); } }

/* Facts under the local paragraph. */
.pg-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4) var(--s6); margin: var(--s6) 0 0; padding-top: var(--s5); border-top: 1px solid var(--hair); }
.pg-facts dt { font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s1); }
.pg-facts dd { margin: 0; font-weight: 500; font-size: 15px; line-height: 1.45; }
.pg-facts a { color: var(--royal); }

/* The map mount (map.js fills [data-area-map]). */
.pg-map { position: relative; display: flex; flex-direction: column; min-height: 360px; border-radius: var(--radius); overflow: hidden;
  background: oklch(91% .05 238 / .6); box-shadow: 0 1px 0 var(--hair), 0 18px 40px -30px oklch(26% .07 254 / .45); }
.pg-split > .pg-map { align-self: stretch; }
@media (min-width: 900px) { .pg-split > .pg-map { min-height: 440px; } }
:where(.pg-map > .area-map) { flex: 1; width: 100%; min-height: 360px; }

/* "Before we get there" */
.pg-prep { counter-reset: prep; display: grid; gap: var(--s3); }
.pg-prep li { counter-increment: prep; position: relative; padding: var(--s4) var(--s5) var(--s4) 64px; min-height: 64px;
  background: var(--paper); border: 1px solid var(--hair); border-radius: var(--radius); font-size: 16px; line-height: 1.5;
  box-shadow: 0 1px 0 var(--hair), 0 10px 28px -22px oklch(26% .07 254 / .35); }
.pg-prep li::before { content: counter(prep); position: absolute; left: 16px; top: 14px; display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: var(--radius); background: var(--navy-deep); color: var(--gold); font-family: var(--display); font-weight: 700; font-size: 19px; }

.pg-rating { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s4); font-weight: 500; font-size: 15px; }
.pg-star { color: var(--gold); font-size: 20px; line-height: 1; text-shadow: 0 0 1px oklch(48% .12 86); }

/* Areas hub: distances, nearest first. */
.pg-dist { display: grid; gap: 0 var(--s8); max-width: 1000px; margin: 0 auto; }
@media (min-width: 640px) { .pg-dist { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .pg-dist { grid-template-columns: repeat(3, 1fr); } }
.pg-dist a { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); min-height: 52px; border-bottom: 1px solid var(--hair);
  font-weight: 500; transition: color .2s var(--ease); }
.pg-dist a:hover { color: var(--royal); }
.pg-dist-mi { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Town links inside the county cards on the areas hub. */
.county .pg-towns { justify-content: flex-start; }

/* Service cards on town pages: two up on a tablet. */
@media (min-width: 640px) and (max-width: 1023px) { .pg-svc-cards { grid-template-columns: 1fr 1fr; } }

/* ---------- 404 ---------- */
.pg-plain { padding-top: var(--head); }
.pg-404 { max-width: 900px; }
.pg-404-eyebrow { color: var(--royal); margin-bottom: var(--s5); }
.pg-404 .lede { max-width: 46ch; }
.pg-404-links { display: grid; gap: var(--s8); margin-top: var(--s12); }
@media (min-width: 900px) { .pg-404-links { grid-template-columns: 1fr 1.4fr; } }
.pg-404-links .pg-sub { margin-top: 0; }
.pg-404-links .pg-towns { justify-content: flex-start; }
.pg-linklist { display: grid; gap: var(--s2); }
.pg-linklist a { color: var(--royal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
