/* ===========================================================================
   Tide — Greater Seacoast NH Indivisible
   Direction chosen on issue #24: coastal, hopeful, photographic.
   Navy + seacoast teal carry the page; Indivisible red is reserved for the
   single most important action. Palette is the client's real brand colors.
   =========================================================================== */

:root {
  --navy: #194379;
  --navy-deep: #0f2c52;
  /* --red is the safe default — clears WCAG AA 4.5:1 against #ffffff — and is
     what every button, nav pill, or small red text (`(required)` hint, error
     text) picks up automatically. --red-brand is the pale client brand red
     that fails AA at 4.28:1 and is reserved for decorative non-text uses
     (large icon backgrounds, box-shadow tints). Post-#56 audit. */
  --red: #c81c1d;
  --red-brand: #ee2324;
  --teal: #57c6d7;
  --teal-soft: #a9e3ec;
  --sand: #f6f1e7;
  --ink: #11243c;
  --paper: #fbfaf6;
  --display: "Fraunces", Georgia, serif;
  --body: "Public Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- header: transparent overlay (home, over the hero) ---------- */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.bar .logo img {
  /* Enlarged from 46px per #49 (blannan55: 1.5–2x). 78px is ~1.7x and stays
     inside the 22px header padding without the bar visibly growing. */
  height: 78px;
  width: auto;
  display: block;
}
nav.main-nav {
  display: flex;
  gap: 30px;
  align-items: center;
}
nav.main-nav a {
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  color: #fff;
  opacity: 0.92;
  letter-spacing: 0.01em;
}
nav.main-nav a:hover {
  opacity: 1;
}
.nav-cta {
  background: var(--red);
  color: #fff !important;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
}

/* ---------- header: solid variant (inner pages, no hero) ---------- */
.site-header.solid {
  position: static;
  background: var(--navy);
}
.site-header.solid .bar {
  padding: 22px 0;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  background:
    linear-gradient(
      180deg,
      rgba(15, 44, 82, 0.78) 0%,
      rgba(25, 67, 121, 0.42) 38%,
      rgba(87, 198, 215, 0.3) 100%
    ),
    url("../img/hero-north-hampton-beach.f5362b06ee84.jpg") center 38% / cover no-repeat;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 54px;
  align-items: center;
  width: 100%;
  padding: 120px 0 90px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--teal-soft);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 22px;
  /* Scrim for readability over the hero photo — matches the h1/lede treatment.
     Without it, teal-soft over the seawall drops below 3:1 (#56 incomplete). */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.eyebrow a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--teal);
}
.hero h1 {
  font-family: var(--display);
  color: #fff;
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.hero h1 em {
  font-style: italic;
  color: var(--teal-soft);
}
/* .lede is a <div> wrapper whose body is a nested <p> emitted by the snippet
   tag — the prior selector .hero p.lede did not match the DOM, so the color
   silently fell through to --ink (#11243c), rendering as near-black navy
   over the hero photo (#51). Every declaration here inherits into the nested
   <p>; the child rule only needs to zero the browser's default block margin. */
.hero .lede,
.hero .lede p {
  /* Both selectors set color: sanitized snippet bodies pass <p> through with
     any inline attributes intact, so defending the child p keeps the text
     white even if an editor pastes styled prose (#55). */
  color: #ffffff;
}
.hero .lede {
  font-size: 1.18rem;
  max-width: 34ch;
  margin-top: 22px;
  font-weight: 500;
  /* Two-layer shadow: crisp 1px offset for immediate contrast + a soft glow
     that behaves like a per-text scrim over the hero photo (#55). */
  text-shadow:
    0 1px 4px rgba(0, 0, 0, 0.7),
    0 0 18px rgba(0, 0, 0, 0.35);
}
.hero .lede p {
  margin: 0;
}
.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  border: none;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1.02rem;
  padding: 16px 30px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 12px 30px -8px rgba(200, 28, 29, 0.6);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px -8px rgba(200, 28, 29, 0.7);
}
.btn-ghost {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 3px;
}

/* ---------- signup card ---------- */
.signup-card {
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(8px);
  border-radius: 22px;
  padding: 34px 32px;
  box-shadow: 0 30px 70px -24px rgba(15, 44, 82, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.signup-card h2 {
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--navy);
  font-weight: 600;
  line-height: 1.1;
}
.signup-card .sub {
  font-size: 0.95rem;
  color: #48586b;
  margin: 8px 0 22px;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.field label em {
  color: var(--red);
  font-style: normal;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d6dde6;
  border-radius: 11px;
  font-family: var(--body);
  font-size: 0.98rem;
  background: #fff;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(87, 198, 215, 0.22);
}
.field input.has-error {
  border-color: var(--red);
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.signup-card button {
  width: 100%;
  margin-top: 10px;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 15px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.signup-card button:hover {
  background: var(--navy-deep);
}
.reassure {
  text-align: center;
  font-size: 0.78rem;
  color: #7a8696;
  margin-top: 12px;
}
.errorlist {
  list-style: none;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 600;
  margin: 4px 0 0;
}
.form-banner {
  background: rgba(238, 35, 36, 0.08);
  border: 1px solid rgba(238, 35, 36, 0.35);
  color: #a01a1b;
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 18px;
}
/* honeypot — kept out of the layout and off-screen for humans */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- wave divider ---------- */
.wave {
  display: block;
  width: 100%;
  height: 70px;
  color: var(--navy);
}

/* ---------- values ---------- */
.values {
  padding: 90px 0 70px;
  background: var(--paper);
}
.values .kicker {
  font-family: var(--display);
  font-style: italic;
  color: var(--red);
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.values h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.9rem);
  color: var(--navy);
  font-weight: 600;
  max-width: 18ch;
  line-height: 1.05;
  margin-bottom: 48px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.card {
  background: #fff;
  border-radius: 18px;
  padding: 30px 26px;
  border: 1px solid #ece6d8;
  box-shadow: 0 8px 24px -16px rgba(15, 44, 82, 0.3);
  transition: transform 0.18s ease;
}
.card:hover {
  transform: translateY(-4px);
}
.card .ico {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: var(--teal);
  color: var(--navy-deep);
}
.card:nth-child(2) .ico {
  /* Decorative icon background — brand red is fine here; the icon is a
     large-scale SVG rendered white, not body text. */
  background: var(--red-brand);
  color: #fff;
}
.card:nth-child(3) .ico {
  background: var(--navy);
  color: #fff;
}
.card .ico svg {
  width: 24px;
  height: 24px;
}
.card h3 {
  font-size: 1.18rem;
  color: var(--navy);
  margin-bottom: 8px;
}
.card p {
  font-size: 0.96rem;
  color: #54616f;
}

/* ---------- inner-page content (about / thanks) ---------- */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 70px 28px 90px;
}
.page h1,
.page h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: var(--navy);
  font-weight: 600;
  line-height: 1.08;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.page p {
  font-size: 1.05rem;
  color: #44535f;
  margin-bottom: 16px;
}
.page a {
  color: var(--navy);
  font-weight: 600;
}

/* ---------- resources page ---------- */
.page .towns-list {
  columns: 2;
  column-gap: 32px;
  list-style: disc inside;
  margin: 0 0 18px;
  padding: 0;
}
.page .towns-list li {
  font-size: 1.02rem;
  color: #44535f;
  padding: 2px 0;
  break-inside: avoid;
}
@media (min-width: 720px) {
  .page .towns-list {
    columns: 3;
  }
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: #cdd9e7;
  padding: 54px 0 40px;
}
.foot-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
.site-footer img {
  /* Bumped from 40px per #50 — footer group agreed it should be more visible
     but noted footers are less prominent than headers, so kept modest. */
  height: 60px;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-weight: 600;
  font-size: 0.92rem;
}
.foot-links a {
  /* 44×44 tap target — WCAG 2.5.8 (AA in 2.2). Prior 27×24 / 42×24 sizes
     failed the min and had no clean 24×24 exception given the side-by-side
     layout. Inline-flex so the anchor grows to the padded box, not the text. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 6px;
  text-decoration: none;
  opacity: 0.85;
}
.foot-links a:hover {
  opacity: 1;
  color: var(--teal);
}
.foot-note {
  margin-top: 30px;
  font-size: 0.8rem;
  /* Explicit color (not opacity) — the prior opacity: 0.6 on #cdd9e7 over
     the navy-deep footer computed to #8194ab, failing AA at 4.49:1 (#56).
     #a6b6c9 clears 4.5:1 without changing perceived weight. */
  color: #a6b6c9;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    /* Extra breathing room under the header so the eyebrow doesn't butt up
       against the logo (#55 top-cramping). Desktop still uses the 120/90
       block from the base rule; mobile needs slightly more since the header
       + eyebrow line share the same narrow column. */
    padding-top: 148px;
  }
  nav.main-nav a:not(.nav-cta) {
    display: none;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .bar .logo img {
    /* Shrink the 78px logo on mobile — at 375px it dominates the bar and
       leaves the eyebrow line pressed against the underside (#55). */
    height: 56px;
  }
  .hero h1 {
    /* Strengthen the shadow so the headline stays legible against the
       lighter middle of the hero gradient on portrait mobile (#55). */
    text-shadow:
      0 2px 8px rgba(0, 0, 0, 0.55),
      0 0 24px rgba(0, 0, 0, 0.35);
  }
  .hero .lede,
  .hero .lede p {
    /* Explicit white on both the wrapper AND the snippet-emitted <p>: the
       snippet body is sanitized on save but preserves inline attributes on
       tags, so a stray editor-added color on the <p> would win over the
       .hero .lede rule. Also re-scrim on mobile where the hero photo shows
       through more brightly (#55). */
    color: #ffffff;
    text-shadow:
      0 1px 6px rgba(0, 0, 0, 0.75),
      0 0 20px rgba(0, 0, 0, 0.4);
  }
  .btn-ghost {
    /* WCAG 2.5.8: btn-ghost renders 117×31 without this. Grow via padding
       rather than a flex min-height so the border-bottom underline stays
       anchored to the text baseline (the base rule keeps padding-bottom
       at 3px; centering the text inside a 44px flex box would float the
       underline ~10px below the type). Primary button already exceeds
       44px from its own padding — no override needed (#55). */
    padding-top: 13px;
    padding-bottom: 3px;
  }
}

@media (min-width: 861px) {
  .hero-actions {
    display: none;
  }
}
