/* ==========================================================================
   SLCI Site Shell v5 — Portland-format finishing pass (CSS polish only)
   Branch: preview/portland-format-v5-2026-09-01

   v5 changes from v4 (per William's review - tightly controlled CSS
   finishing pass, not a redesign; V4 structure/cards/content/category
   links/colors/typography/page order are locked):
     - Desktop header/nav: single row, no wrap, vertically centered,
       wordmark left edge aligned with hero content's left edge (same
       .wrap-style max-width + padding pattern on both), header height
       68px -> 76px, nav font-size/padding/gap tightened so the row fits
       inside the shared 900px max-width container, with a further
       narrow-desktop tightening tier before the existing mobile dropdown
       breakpoint (860px, unchanged) ever needs to engage.
     - Hero: vertical padding reduced (~60px shorter); hero-inner now
       shares the header's own max-width/padding pattern instead of a
       separate 620px/no-padding box, so the two left edges line up.
       Headline, paragraph, buttons, gradient, wording and horizontal
       alignment are unchanged.
     - Search/town bar: outer padding tightened, plus new (previously
       absent) padding overrides on .hero-search / .hero-search-input /
       .town-pill so the compaction actually reaches the input and pills,
       not just the outer bar. Search functionality, IDs, wording and
       links are unchanged.
     - New: a compact community-trust strip (recovered Code Enforcement
       Officer testimonial + a 3-supporter preview row linking to the
       full Local Supporters page), sized to the ~250-300px desktop
       budget. Contractor cards, category links and all other pages are
       untouched.

   v4 changes from v3 (per William's review - "compact category-card
   direction is approved and locked", homepage rebuilt to a deliberately
   simple 6-section order, and 5 real v3 bugs fixed):

     1. Clipped wordmark: `.brand` had `flex-shrink: 1`, so on narrower
        desktop widths the nav could squeeze the brand text until its own
        `text-overflow: ellipsis` kicked in and clipped it. `.brand` is now
        `flex-shrink: 0` - the nav wraps/shrinks first, the wordmark never
        does.
     2. Floating green navigation block: each page's own embedded
        stylesheet still had a *bare* `nav { background: var(--pine);
        position: sticky; top: 0; z-index: 100; ... }` type-selector rule
        left over from before the migration. Our new `<nav class=
        "primary-nav" id="primaryNav">` is still a `<nav>` element, so it
        matched that old rule for every property our own `.primary-nav`
        class never set (background/position/z-index, plus padding/
        height/box-shadow on the contractor-page template) - rendering as
        a second, redundant pine-green sticky bar. Fixed once, centrally,
        with an explicit `.site-header .primary-nav` override that beats
        the old bare-element rule on every property it was leaking,
        instead of editing each page's own stylesheet.
     3. White/invisible hero: v3's `.hero` rule set the gradient via the
        `background:` shorthand and then, on the very next line, set
        `background-image: none` - silently cancelling the gradient it
        had just set. The hero rendered with no background at all.
        Removed that stray line.
     4. Invisible button: a direct casualty of #3 - `.btn-secondary`
        ("Browse all categories") is a translucent white-on-dark style
        that only reads on a dark hero. Fixed automatically once the
        gradient background itself is fixed.
     5. Oversized hero: padding is tightened to sit close to Portland's
        own measured hero proportions, and - since the search bar and
        town pills no longer live inside it - the hero is naturally much
        shorter besides.

   SCOPE — never touched here: .contractor-card / .contractor-card__* (the
   locked V2 paid-listing molds, owned by contractor-cards.css).
   ========================================================================== */

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Site header / nav (white) ---------- */
.skip-link {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  background: var(--pine);
  color: var(--white);
  padding: 0.7rem 1.1rem;
  z-index: 300;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  width: auto; height: auto;
  overflow: visible;
  clip: auto;
  top: 0; left: 0;
  white-space: normal;
}

.site-header {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(26, 58, 42, 0.06);
}
.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 76px;
}
/* Neutralize each page's own leftover bare `nav{...}` selector (pre-
   migration CSS), which still matches our `<nav class="primary-nav">`
   element and would otherwise leak a second sticky pine-green bar. */
.site-header .primary-nav,
.site-header nav {
  background: none;
  position: static;
  top: auto;
  z-index: auto;
  padding: 0;
  height: auto;
  box-shadow: none;
  border-bottom: 0;
}
.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-decoration: none;
  min-width: 0;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--serif);
  font-size: 1.12rem;
  color: var(--pine);
  white-space: nowrap;
}
.brand-tagline {
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--text-lt);
  font-weight: 400;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--pine);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 1.15rem;
  cursor: pointer;
  flex-shrink: 0;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
}
.primary-nav a {
  color: var(--text-md);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.5rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.primary-nav a:hover,
.primary-nav a:focus-visible,
.primary-nav a[aria-current="page"],
.primary-nav a.active { color: var(--pine); background: var(--stone); }
.primary-nav a.cta {
  background: var(--gold);
  color: var(--pine);
  font-weight: 700;
  margin-left: 0.25rem;
}
.primary-nav a.cta:hover { background: #daa835; color: var(--pine); }

/* Narrower desktop: reduce nav gaps/font further before the mobile
   dropdown (below) ever needs to engage. */
@media (max-width: 1080px) and (min-width: 861px) {
  .site-header .header-inner { gap: 0.5rem; }
  .primary-nav { gap: 0.12rem; }
  .primary-nav a { font-size: 0.72rem; padding: 0.42rem 0.4rem; }
  .primary-nav a.cta { margin-left: 0.18rem; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .primary-nav { display: none; }
  /* Scoped to .site-header .primary-nav.open (3-class specificity) so this
     beats `.site-header .primary-nav, .site-header nav { position: static;
     background: none; padding: 0; box-shadow: none; top: auto; ... }`
     above (2-class specificity), which was silently winning regardless of
     source order and left the open mobile menu stuck at position:static -
     the confirmed pre-existing bug. All values below are unchanged from
     before; only the selector's scope changed. */
  .site-header .primary-nav.open {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    top: 76px;
    background: var(--white);
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1.25rem 1.25rem;
    box-shadow: 0 12px 30px rgba(26, 58, 42, 0.12);
  }
  .primary-nav a { width: 100%; text-align: left; padding: 0.75rem 0.6rem; border-radius: 8px; }
  .primary-nav a.cta { margin-left: 0; margin-top: 0.35rem; text-align: center; }
}

/* ---------- Hero (homepage) — compact, left-aligned, strong gradient ---------- */
.hero {
  background: linear-gradient(120deg, var(--lake) 0%, var(--pine-mid) 55%, var(--pine) 100%);
  padding: 1.25rem 0 0.75rem;
  text-align: left;
  overflow: hidden;
}
.hero::before { content: none; }
.hero .hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  text-align: left;
}
.hero-actions { justify-content: flex-start; margin-bottom: 0; }
.hero-tagline { margin: 0 0 1.25rem; }
/* .hero-inner's own box widened (above) so the wordmark and hero content
   share one left edge, but the headline itself must keep wrapping exactly
   as it did in v4 - cap it at v4's old 620px column so the wider box
   doesn't let it reflow onto fewer lines and shrink the hero further than
   the requested padding-only reduction. */
.hero h1 { max-width: 620px; }

/* ---------- Compact search + service-area bar (below hero) ---------- */
.search-bar {
  background: var(--stone);
  border-bottom: 1px solid var(--border);
  padding: 0.625rem 1.5rem;
}
.search-bar-inner { max-width: var(--max); margin: 0 auto; }
.search-bar .hero-search {
  margin: 0 auto 0.5rem;
  max-width: 560px;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(26, 58, 42, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.search-bar .hero-search-input {
  padding: 0.55rem 1rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
}
.search-bar .hero-towns { justify-content: center; }
.search-bar .town-pill {
  /* Padding intentionally left at each page's original size: shrinking it
     let the pill row collapse from 2 lines to 1 at wide desktop widths,
     which swung the search-bar's height reduction from the requested
     ~30-40px up to ~78px at 1920px (verified by rendering both versions).
     Leaving pill sizing untouched keeps the row count - and the height
     reduction - stable and predictable across desktop widths. */
  background: var(--white);
  color: var(--text-md);
  border: 1px solid var(--border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ---------- Hero (category / contractor page — dark gradient, breadcrumb inside) ---------- */
.hero.category,
.page-header {
  background: linear-gradient(160deg, var(--pine) 0%, var(--pine-mid) 60%, var(--pine-lt) 130%);
  color: var(--white);
  padding: 0;
}
.hero.category .hero-inner,
.page-header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 2.75rem) 1.5rem clamp(2.25rem, 5vw, 3rem);
}
.page-header .breadcrumb {
  /* Neutralize each page's own pale/stone breadcrumb-strip styling now
     that the breadcrumb lives inside the dark gradient banner. */
  background: none;
  border-bottom: 0;
  padding: 0;
  font-size: 0.82rem;
  margin: 0 0 0.9rem;
  color: rgba(255,255,255,0.7);
}
.page-header .breadcrumb-inner {
  max-width: none;
  margin: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
.page-header .breadcrumb a { color: rgba(255,255,255,0.78); text-decoration: none; }
.page-header .breadcrumb a:hover { color: var(--white); text-decoration: underline; }
.page-header .breadcrumb-sep { color: rgba(255,255,255,0.55); }
.page-header .page-eyebrow {
  color: var(--gold-lt);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
}
.page-header h1 {
  font-family: var(--serif);
  color: var(--white);
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  margin: 0 0 0.75rem;
}
.page-header > .page-header-inner > p:not([class]) {
  color: rgba(255,255,255,0.88);
  max-width: 64ch;
  font-size: 1.02rem;
}
.header-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.header-tag {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  color: var(--white);
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

/* ---------- Section rhythm ---------- */
.section { padding: clamp(2.5rem, 6vw, 3.75rem) 1.5rem; }
.section-inner { max-width: var(--max); margin: 0 auto; }

/* ---------- Category browse grid ("Browse Services", Portland-style boxed cards) ---------- */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}
.cat-section.group-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(26,58,42,0.06);
}
.cat-section.group-card .cat-heading {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.cat-section.group-card .cat-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cat-section.group-card .cat-link {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  font-size: 0.88rem;
}
/* First, highlighted group: emergency help (Portland's "danger" group-card variant) */
.group-card--emergency {
  background: var(--red-lt);
  border-color: var(--red-bd);
  scroll-margin-top: 84px;
}
.group-card--emergency .cat-heading { color: var(--red); }
.group-card--emergency .cat-link:hover { background: var(--white); color: var(--red); }
.group-card--emergency .storm-note {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  font-size: 0.78rem;
}

/* ---------- Compact community-trust strip (v5) ----------
   Recovered Code Enforcement Officer testimonial (exact wording/
   attribution, verified against the pre-v4 homepage) + a 3-supporter
   preview row linking to the full Local Supporters page. No image logo
   files exist in the repo for these supporters (confirmed against
   local-supporters.html and /images) - the text-initial badges below
   reuse that page's own existing visual treatment rather than
   inventing or downloading anything. Sized to stay within an
   approximately 250-300px combined desktop height budget. */
.trust-strip {
  padding-top: clamp(1.5rem, 4vw, 2rem);
  padding-bottom: clamp(1.5rem, 4vw, 2rem);
}
.trust-strip .section-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.testimonial-compact {
  background: #f9f5eb;
  border: 1px solid #e2d5b0;
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
}
.testimonial-compact__quote {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-md);
  font-style: italic;
  margin: 0 0 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.testimonial-compact__attribution {
  font-size: 0.78rem;
  color: var(--text-lt);
  margin: 0;
}
.testimonial-compact__attribution strong { color: var(--pine); font-weight: 600; }

.supporters-preview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding: 0.6rem 0 0;
  border-top: 1px solid var(--border);
}
.supporters-preview__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-lt);
  white-space: nowrap;
}
.supporters-preview__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex: 1 1 auto;
}
.supporters-preview__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.supporters-preview__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--stone);
  color: var(--pine);
  border: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}
.supporters-preview__name {
  font-size: 0.78rem;
  color: var(--text-md);
  white-space: nowrap;
}
.supporters-preview__link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pine);
  text-decoration: none;
  margin-left: auto;
  white-space: nowrap;
}
.supporters-preview__link:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .supporters-preview { flex-direction: column; align-items: flex-start; }
  .supporters-preview__list { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .supporters-preview__name { white-space: normal; }
  .supporters-preview__link { margin-left: 0; }
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-secondary {
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* ---------- Footer ---------- */
footer { padding: clamp(2.25rem, 5vw, 2.75rem) 1.5rem 1.75rem; }
.footer-brand-box {
  display: inline-flex;
  flex-direction: column;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.75rem;
}
.footer-brand-box .footer-brand-name {
  font-family: var(--serif);
  color: var(--white);
  font-size: 1.05rem;
}
.footer-brand-box .footer-brand-tagline {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  margin-top: 0.15rem;
}
.footer-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.14);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
