/* =============================================================================
   Global header & footer — Nevada Integrity
   Loaded on EVERY page (see tofu_enqueue_assets() in functions.php), because the
   header and footer are now global template parts rather than per-page patterns.

   These rules used to live in homepage.css, which only loaded on the two NI
   templates. Moving them out means a page using any template gets the correct
   chrome without pulling in the 16 KB homepage grid stylesheet.

   The --ni-* tokens are declared on :root here and consumed by homepage.css
   too, so this file must load first — homepage.css declares it as a dependency.
   ============================================================================= */

/* ── Tokens ───────────────────────────────────────────────────────────────── */
:root {
  --ni-red:       #b1121c;
  --ni-red-dark:  #8a0d15;
  --ni-navy:      #1b2a4a;
  --ni-navy-deep: #0b1730;
  --ni-cream:     #f7f3ea;
  --ni-sand:      #f5f0e8;
  --ni-gold:      #c9a227;
  --ni-gold-soft: #ffd7a1;
  --ni-rule:      #d9d3c4;
  --ni-muted:     #5b6777;
  --ni-gutter:    28px;
}

/* ── Header (logo only — the site has no navigation menu) ─────────────────── */
.ni-header {
  /* white rather than cream: the logo artwork carries its own white field, and
     a cream band would show a visible rectangle behind it */
  background: #fff;
  border-bottom: 1px solid var(--ni-rule);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}
.ni-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px var(--ni-gutter);
  display: flex;
  justify-content: center;
  align-items: center;
}
/* .ni-brand is the Site Logo block wrapper, so target the img inside it rather
   than assuming a <figure>/<a> structure — core's markup differs from the old
   hand-rolled image block this replaced. */
.ni-header .ni-brand {
  display: block;
  line-height: 0;
  margin: 0;
}
.ni-header .ni-brand img {
  height: 86px;
  /* core prints width/height attributes on the logo; override both so the
     aspect ratio is driven by the height above */
  width: auto;
  max-width: 100%;
  transition: opacity .2s;
}
.ni-header .ni-brand a:hover img { opacity: .85; }

/* The stripe base lives in theme.css; only the accent colour differs here. */
.ni-top-stripe .star { color: var(--ni-gold); }
.ni-top-stripe p { overflow-wrap: break-word; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.ni-footer {
  background: var(--ni-navy-deep);
  color: var(--ni-cream);
  text-align: center;
  padding: 54px var(--ni-gutter);
  border-top: 4px solid var(--ni-red);
}
.ni-footer .ni-footer-logo {
  margin: 0 auto 22px;
  line-height: 0;
}
.ni-footer .ni-footer-logo img {
  height: 66px;
  width: auto;
  margin: 0 auto;
  /* the mark is navy-on-white; give it a matching plate on the dark footer */
  background: #fff;
  padding: 12px 18px;
}
.ni-footer .ni-footer-contact {
  font-size: .95rem;
  margin: 0 0 18px;
}
.ni-footer .ni-footer-contact a {
  color: var(--ni-gold-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 215, 161, .4);
}
.ni-footer .ni-footer-contact a:hover { border-bottom-color: var(--ni-gold-soft); }

/* Campaign-finance disclaimer. Ruled off in a box to match the printed mail
   pieces, where the "paid for / not authorized" notice is always boxed.
   The max-width is deliberate — it breaks the line into two, as on the mail
   piece, instead of running as one long strip. */
.ni-footer .ni-disclaimer {
  width: fit-content;
  max-width: 350px !important;
  margin: 0 auto 16px;
  padding: 9px 16px;
  border: 1px solid rgba(247, 243, 234, .5);
}
.ni-footer .ni-disclaimer-text {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1.55;
  text-transform: uppercase;
  color: var(--ni-cream);
  margin: 0;
}
.ni-footer .ni-footer-address {
  font-size: .85rem;
  color: rgba(247, 243, 234, .7);
  margin: 0 0 8px;
}
.ni-footer .tofu-footer-disclaimer {
  font-size: .85rem;
  color: rgba(247, 243, 234, .7);
  margin: 0;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 782px) {
  .ni-header .ni-brand img { height: 54px; }
  .ni-footer .ni-footer-logo img { height: 52px; }
  /* the stripe is a single unbroken uppercase line with no break
     opportunities — tighten its tracking so it fits a phone */
  .ni-top-stripe p {
    font-size: 11px;
    letter-spacing: .08em;
  }
  .ni-top-stripe .star { margin: 0 6px; }
}

@media (max-width: 480px) {
  .ni-header .ni-brand img { height: 44px; }
}
