/**
 * officials.css — the Elected Officials directory.
 *
 * A NOTE ON THE PALETTE AND TYPE.
 *
 * BUILD.md section 10 names navy #0A1E3F, cream #EFEAE0/#F6F2E9, red #B02034,
 * gold #C8892B and Libre Franklin. This file uses the site's existing tokens
 * instead - --navy-800 (#0e2147), --paper-warm (#f7f5f1), --red-600 (#c2202c),
 * --gold-500 (#c7a233), --font-display (Archivo) and --font-body (Hanken
 * Grotesk).
 *
 * The two palettes are the same intent within a few points of each other, and
 * section 8 says reuse the existing CSS architecture rather than rewrite it.
 * Hard-coding a second navy and loading a fifth webfont for one page would
 * give BTRDO two design languages and a slower page, which is a worse outcome
 * than a navy that differs by a shade nobody can name. Recorded as a
 * deliberate deviation in the handoff document.
 *
 * GRID: 4 / 3 / 2 / 1 columns at 1440 / 1024 / 768 / 390 (section 10).
 */

.off-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ---------------------------------------------------------------- hero -- */

.off-hero {
  background: var(--navy-800);
  color: var(--white);
  padding: clamp(40px, 7vw, 84px) 0 clamp(32px, 5vw, 60px);
  /* The star motif from the mockup, as a background rather than an <img>:
     it is decoration and must never be announced or block the text. */
  background-image:
    radial-gradient(circle at 12% 22%, rgba(199, 162, 51, .16) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 68%, rgba(199, 162, 51, .12) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 14%, rgba(255, 255, 255, .07) 0 1.5px, transparent 3px);
}

.off-hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  text-wrap: balance;
  margin: 0 0 .5em;
}

.off-hero__intro {
  font-size: clamp(1.02rem, .97rem + .3vw, 1.2rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, .86);
  max-width: 60ch;
  margin: 0;
}

/* ------------------------------------------------------------- filters -- */

.off-page { background: var(--paper-warm); padding-bottom: clamp(48px, 7vw, 96px); }

.off-filters {
  margin: clamp(24px, 3.5vw, 40px) 0 clamp(20px, 3vw, 32px);
}

.off-filters__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.off-filter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.off-filter__label {
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.off-filter__select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  /* 44px minimum target (BUILD.md section 12, line 27). */
  min-height: 44px;
  padding: 10px 14px;
  max-width: 100%;
}

.off-filter__select:focus-visible,
.off-filters__go:focus-visible,
.off-filters__reset:focus-visible,
.off-card__name a:focus-visible,
.off-card__cta:focus-visible,
.off-empty__reset:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
}

.off-filters__go {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  min-height: 44px;
  padding: 10px 20px;
  color: var(--white);
  background: var(--navy-800);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.off-filters__reset {
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 4px;
  color: var(--blue-600);
}

.off-filters__count {
  margin: 12px 0 0;
  font-size: .92rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- grid -- */

.off-grid {
  display: grid;
  gap: clamp(18px, 2.2vw, 28px);
  grid-template-columns: 1fr;                 /* 390px and below: one card */
}

@media (min-width: 768px)  { .off-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .off-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1440px) { .off-grid { grid-template-columns: repeat(4, 1fr); } }

.off-grid__cell { display: flex; min-width: 0; }

/* ---------------------------------------------------------------- card -- */

.off-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}

.off-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

@media (prefers-reduced-motion: reduce) {
  .off-card { transition: none; }
  .off-card:hover { transform: none; }
}

.off-card__media {
  display: block;
  aspect-ratio: 4 / 5;
  background: var(--blue-050);
  overflow: hidden;
}

.off-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }

.off-card__noimg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--line-strong);
}

.off-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 18px 20px;
  flex: 1;
}

.off-card__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 2px 0 0;
  text-wrap: balance;
}

.off-card__name a { color: var(--navy-800); text-decoration: none; }
.off-card__name a:hover { text-decoration: underline; }

.off-card__office   { margin: 0; font-weight: 600; color: var(--ink-soft); }
.off-card__district { margin: 0; font-size: .92rem; color: var(--muted); }
.off-card__tagline  { margin: 4px 0 0; font-size: .95rem; line-height: 1.5; color: var(--ink-soft); }

.off-card__cta {
  margin-top: auto;
  padding-top: 14px;
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--red-600);
  text-decoration: none;
  /* 44px target without pushing the cards apart. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.off-card__cta:hover { text-decoration: underline; }
.off-card__cta span { transition: transform .16s ease; display: inline-block; margin-left: .4em; }
.off-card__cta:hover span { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
  .off-card__cta span { transition: none; }
  .off-card__cta:hover span { transform: none; }
}

/* --------------------------------------------------------------- badge -- */
/* Icon AND text, never colour alone (BUILD.md section 8). The colour is the
   third signal, after the shape and the word. */

.off-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.off-badge__icon { flex: 0 0 auto; }

.off-badge--endorsed    { background: var(--gold-100); color: #6f5510; border-color: var(--gold-400); }
.off-badge--democratic  { background: var(--blue-100); color: var(--blue-600); border-color: var(--blue-400); }
.off-badge--information { background: var(--paper);    color: var(--muted);    border-color: var(--line-strong); }

/* --------------------------------------------------------------- empty -- */

.off-empty {
  background: var(--white);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(32px, 6vw, 64px) 24px;
  text-align: center;
}

.off-empty__text { margin: 0 0 16px; font-size: 1.05rem; color: var(--ink-soft); }

.off-empty__reset {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 22px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--white);
  background: var(--navy-800);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

/* ----------------------------------------------------- homepage strip -- */
/* Rendered by includes/home-featured-officials.php, which prints nothing at
   all when there is nobody to show - so these rules never style an empty
   section. */

.off-home {
  background: var(--paper-warm);
  padding: clamp(48px, 7vw, 96px) 0;
}

.off-home__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(28px, 4vw, 48px);
}

.off-home__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.6rem);
  line-height: 1.12;
  color: var(--navy-800);
  margin: 0 0 .38em;
  text-wrap: balance;
}

.off-home__sub {
  margin: 0;
  font-size: clamp(1rem, .96rem + .28vw, 1.14rem);
  color: var(--muted);
  line-height: 1.55;
}

/* The homepage shows at most four, so it never needs the directory's fourth
   breakpoint - three across is the widest useful arrangement here. */
@media (min-width: 1440px) {
  .off-grid--home { grid-template-columns: repeat(4, 1fr); }
}

.off-home__more { text-align: center; margin: clamp(28px, 4vw, 44px) 0 0; }

.off-home__cta {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  min-height: 52px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .07em;
  color: var(--white);
  background: var(--navy-800);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.off-home__cta:hover { background: var(--navy-700); }
.off-home__cta:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }
.off-home__cta span { transition: transform .16s ease; }
.off-home__cta:hover span { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
  .off-home__cta span { transition: none; }
  .off-home__cta:hover span { transform: none; }
}

/* The home card drops the tagline (see candidate-card.php), so its body needs
   less room and the cards sit shorter than the directory's. */
.off-card--home .off-card__media { aspect-ratio: 1 / 1; }
