/**
 * components.css — reusable UI patterns (buttons, cards, nav, forms, panels).
 * Interactive states support WCAG 2.4.7 (focus visible) and 1.4.11 (non-text contrast for UI components).
 */

/* —— Site identity: official PA state logo (PNG); name for SR on link aria-label only —— */
.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
  border-radius: var(--radius-md);
}

/* Official masthead logo: readable size; do not crush. Future: optional mobile lockup asset if design approves. */
.site-logo__img {
  display: block;
  width: auto;
  height: auto;
  max-height: clamp(3.35rem, 9vw, 5.5rem);
  max-width: min(100%, 17.5rem);
}

/* Header plaque trim around the real logo (no text inside the image). */
.site-header a.site-logo {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--color-accent-subtle) 0%, var(--color-bg-elevated) 65%);
  box-shadow: inset 0 3px 0 0 var(--color-brand-gold);
}

/* —— Primary navigation —— */
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
}

/* Nav uses ul/li but is not prose; reset global li margins (Directive #34). */
.site-nav ul > li {
  margin-bottom: 0;
  line-height: var(--line-height-body);
}

.site-nav a {
  display: inline-block;
  padding: var(--space-2) var(--space-2);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-step--1);
  text-decoration: none;
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
}

.site-nav a:hover {
  color: var(--color-primary);
  background: var(--color-surface-subtle);
}

.site-nav a[aria-current="page"] {
  color: var(--color-primary);
  background: var(--color-info-bg);
  border-bottom: 2px solid var(--color-primary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--color-surface-subtle);
}

.nav-toggle:active {
  background: var(--color-surface-muted);
}

.nav-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 47.99rem) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-basis: 100%;
    padding-top: var(--space-3);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav a {
    padding: var(--space-3);
    border-radius: var(--radius-md);
  }
}

/* —— Section header pattern (eyebrow + title + intro) —— */
.section-header {
  margin-bottom: var(--space-6);
  max-width: 48rem;
}

.section-header__eyebrow {
  display: block;
  font-size: var(--text-step--1);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
  padding-left: var(--space-3);
  border-left: 4px solid var(--color-brand-gold);
}

.section-header h2 {
  margin: 0 0 var(--space-3);
}

.section-header p {
  margin: 0;
  font-size: var(--text-step-1);
  color: var(--color-text-muted);
  max-width: 42rem;
}

/* —— Home: text-first location finder (PA plate–inspired navy + gold *decoration*; no gold body copy) —— */
.location-picker__heading {
  font-size: var(--text-step-2);
  font-weight: var(--font-weight-bold);
  margin: 0 0 var(--space-2);
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.location-picker__intro {
  margin: 0 0 var(--space-5);
  font-size: var(--text-step-0);
  line-height: var(--line-height-snug);
  color: var(--color-text-muted);
  max-width: 40rem;
}

/* 1 column mobile → 2×2 tablet/desktop (no four-across) */
.location-picker__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
  align-items: stretch;
}

@media (min-width: 40rem) {
  .location-picker__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.location-picker__list > li {
  display: flex;
  min-width: 0;
  min-height: 100%;
}

.location-picker__link {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  min-height: 7.75rem;
  padding: var(--space-4) var(--space-5);
  text-decoration: none;
  color: var(--color-text);
  /* “Plate” surface: white with inset gold top band (decorative, not text). */
  background: var(--color-bg-elevated);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: inset 0 4px 0 0 var(--color-brand-gold-bright), 0 1px 3px rgba(8, 47, 81, 0.1);
  transition: border-color var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

.location-picker__link:hover {
  border-color: var(--color-primary-active);
  background: #ffffff;
  box-shadow: inset 0 4px 0 0 var(--color-brand-gold), 0 2px 8px rgba(8, 47, 81, 0.12);
}

.location-picker__link:active {
  background: var(--color-accent-subtle);
}

.location-picker__link:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-color: var(--color-primary);
  box-shadow: inset 0 4px 0 0 var(--color-brand-gold), 0 0 0 2px var(--color-info-border);
}

/* Keep tile copy colors stable when link is :visited. */
.location-picker__link:visited .location-picker__name,
.location-picker__link:visited .location-picker__action {
  color: var(--color-primary);
}

.location-picker__text {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-2);
  min-width: 0;
  text-align: left;
}

.location-picker__name {
  display: block;
  font-size: var(--text-step-1);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.location-picker__place {
  display: block;
  font-size: var(--text-step--1);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-snug);
  color: var(--color-text-muted);
}

/* Action: navy (AA on white) + small gold left rule — gold is chrome only. */
.location-picker__action {
  display: block;
  margin-top: auto;
  padding: var(--space-3) 0 0 var(--space-3);
  font-size: var(--text-step--1);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-snug);
  color: var(--color-primary);
  border-top: 1px solid rgba(10, 61, 102, 0.2);
  border-left: 3px solid var(--color-brand-gold);
}

.location-picker__link:hover .location-picker__action {
  color: var(--color-primary-hover);
  text-decoration: underline;
  text-decoration-color: var(--color-brand-gold);
  text-underline-offset: 0.2em;
}

/* Secondary: separated from grid; full descriptive link text, no trailing orphan copy. */
.location-picker__footer {
  margin: var(--space-5) 0 0;
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--color-border);
  max-width: 40rem;
}

.location-picker__jump {
  display: inline-block;
  font-size: var(--text-step--1);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-snug);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--color-brand-gold);
  color: var(--color-primary);
}

.location-picker__jump:hover {
  color: var(--color-primary-hover);
  text-decoration-color: var(--color-brand-gold);
}

.location-picker__jump:visited {
  color: var(--color-link-visited);
}

/* —— Buttons ——
 * .button--primary on dark hero uses lighter fill for contrast balance.
 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-step--1);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  line-height: 1.25;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

.button:disabled,
.button[aria-disabled="true"] {
  background: var(--color-primary-disabled);
  color: var(--color-text-inverse);
  cursor: not-allowed;
  opacity: 0.85;
}

.button--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.button--primary:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.button--primary:active:not(:disabled):not([aria-disabled="true"]) {
  background: var(--color-primary-active);
  border-color: var(--color-primary-active);
}

/* Hero: gold accent button remains legible and distinct from primary navy CTA */
.button--on-dark {
  background: var(--color-text-inverse);
  color: var(--color-primary);
  border-color: var(--color-text-inverse);
}

.button--on-dark:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--color-surface-subtle);
  border-color: var(--color-surface-subtle);
}

.button--on-dark:active:not(:disabled):not([aria-disabled="true"]) {
  background: var(--color-surface-muted);
}

.button--secondary {
  background: transparent;
  color: var(--color-text-inverse);
  border-color: rgba(255, 255, 255, 0.65);
}

a.button--secondary:visited {
  color: var(--color-text-inverse);
}

a.button--on-dark:visited {
  color: var(--color-primary);
}

.button--secondary:hover:not(:disabled):not([aria-disabled="true"]) {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-text-inverse);
}

.button--ghost {
  background: var(--color-bg-elevated);
  color: var(--color-primary);
  border-color: var(--color-border-strong);
}

.button--ghost:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--color-surface-subtle);
  border-color: var(--color-primary);
}

/* Primary text-style CTA used in content areas (same visual as submit). */
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-step--1);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: 2px solid var(--color-primary);
  transition: background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.button-link:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-text-inverse);
}

.button-link:active {
  background: var(--color-primary-active);
  border-color: var(--color-primary-active);
}

/* —— Cards —— */
.card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  height: 100%;
  transition: box-shadow var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

/* Homepage location cards: storefront photo strip + plaque body (text never sits on raw photo). */
.card--location {
  --location-photo-fallback: var(--color-primary-active);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-height: clamp(17.5rem, 48vw, 22.5rem);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  box-shadow: inset 0 4px 0 0 var(--color-brand-gold), var(--shadow-sm);
}

.card--location:hover {
  border-color: var(--color-primary-hover);
  box-shadow: inset 0 4px 0 0 var(--color-brand-gold-bright), var(--shadow-md);
}

/* Decorative office exterior (see assets/img/locations/README.md). Storefront glimpse: fixed band ratio, not a hero. */
.card__photo-strip {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 2.1 / 1;
  min-height: 5.25rem;
  max-height: 8.5rem;
}

.card__photo-backdrop {
  position: absolute;
  inset: 0;
  background-color: var(--location-photo-fallback);
  background-size: cover;
  /* Vertical % biases crop toward building / signage (reduces “dead sky” in top-heavy shots). Tune per office if source differs. */
  background-position: center 70%;
}

.card--location-pennsburg .card__photo-backdrop {
  background-image: url("../img/locations/office-pennsburg-fast-tag-bg.jpg");
  background-position: center 66%;
}

.card--location-herb-boyertown .card__photo-backdrop {
  background-image: url("../img/locations/office-herb-auto-tag-boyertown-bg.jpg");
  background-position: center 64%;
}

.card--location-emmaus .card__photo-backdrop {
  background-image: url("../img/locations/office-pa-title-tag-emmaus-bg.jpg");
  background-position: center 68%;
}

.card--location-harleysville .card__photo-backdrop {
  background-image: url("../img/locations/office-pa-title-tag-harleysville-bg.jpg");
  background-position: center 70%;
}

/* Optional wash via tokens (Directive #26: default transparent — photos stay clean). */
.card__photo-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--location-photo-scrim-top) 0%,
    var(--location-photo-scrim-bottom) 100%
  );
}

/* Frosted panel: all meaningful copy stays on high-contrast surface (WCAG 1.4.3 / 1.4.11). */
.card__location-body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  margin-top: auto;
  background: rgba(247, 249, 252, 0.96);
  border-top: 3px solid var(--color-brand-gold);
  box-shadow: 0 -6px 18px rgba(21, 32, 43, 0.08);
}

@supports (backdrop-filter: blur(6px)) {
  .card__location-body {
    background: rgba(247, 249, 252, 0.88);
    backdrop-filter: blur(8px);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .card__location-body {
    background: var(--color-bg-elevated);
    backdrop-filter: none;
  }
}

.card--location .card__brand {
  position: relative;
  z-index: 1;
  margin: 0 0 var(--space-1);
  padding: var(--space-3);
  background: var(--color-info-bg);
  border: 2px solid rgba(10, 61, 102, 0.12);
  border-radius: var(--radius-sm);
  box-shadow: 0 3px 12px rgba(21, 32, 43, 0.1);
}

.card--location .card__office-logo {
  max-height: clamp(3.75rem, 10.5vw, 5.5rem);
}

.card__office-logo {
  display: block;
  width: auto;
  max-height: clamp(3.5rem, 10vw, 5.25rem);
  height: auto;
}

.card--location .card__title {
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.02em;
  color: var(--color-primary);
}

.card--location .card__link a {
  font-weight: var(--font-weight-medium);
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.card--location .card__link a:hover {
  color: var(--color-link-hover);
}

.card--location .card__link a:visited {
  color: var(--color-link-visited);
}

.card__title {
  font-size: var(--text-step-1);
  margin: 0;
}

/* Location page: office mark above H1; heading stays the accessible name. */
.location-page-brand {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px dashed var(--color-border-strong);
}

.location-page-brand__mark {
  display: block;
  width: auto;
  max-height: clamp(3.75rem, 11vw, 5.75rem);
  height: auto;
}

/* Location hero: plaque frame echoing counter signage (all office pages). */
.page-header.page-header--with-office-brand {
  margin-bottom: var(--space-7);
  padding: var(--space-6);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--color-surface-subtle) 0%, var(--color-bg-elevated) 38%);
  box-shadow: inset 0 5px 0 0 var(--color-brand-gold), 0 2px 10px rgba(10, 61, 102, 0.07);
}

.page-header--with-office-brand h1 {
  color: var(--color-primary);
}

/* Location pages: compact exterior band (decorative; same aspect family as homepage strip).
   If the JPEG is missing, the backdrop’s solid navy shows through until the file exists. */
.location-photo-context {
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-strong);
  aspect-ratio: 2.1 / 1;
  min-height: 6.5rem;
  max-height: 12rem;
  box-shadow: var(--shadow-sm);
}

.location-photo-context__backdrop {
  position: absolute;
  inset: 0;
  background-color: var(--color-primary-active);
  background-size: cover;
  background-position: center 70%;
}

/* Match homepage card crop per office (same source files). */
.location-photo-context__backdrop--pennsburg {
  background-image: url("../img/locations/office-pennsburg-fast-tag-bg.jpg");
  background-position: center 66%;
}

.location-photo-context__backdrop--herb-boyertown {
  background-image: url("../img/locations/office-herb-auto-tag-boyertown-bg.jpg");
  background-position: center 64%;
}

.location-photo-context__backdrop--emmaus {
  background-image: url("../img/locations/office-pa-title-tag-emmaus-bg.jpg");
  background-position: center 68%;
}

.location-photo-context__backdrop--harleysville {
  background-image: url("../img/locations/office-pa-title-tag-harleysville-bg.jpg");
  background-position: center 70%;
}

/* Same token pair as card strip; transparent default (Directive #26). */
.location-photo-context__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--location-photo-scrim-top) 0%,
    var(--location-photo-scrim-bottom) 100%
  );
}


.card__meta {
  font-size: var(--text-step--1);
  color: var(--color-text-muted);
  margin: 0;
}

.card__link {
  margin-top: auto;
  font-weight: var(--font-weight-medium);
}

.card__link a {
  text-decoration: none;
}

.card__link a:hover {
  text-decoration: underline;
}

.card__footer-meta {
  margin-top: auto;
  font-size: var(--text-step--1);
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* —— Office detail list (dl) —— */
.office-detail-list {
  margin: 0;
  display: grid;
  gap: var(--space-4);
}

.office-detail-list dt {
  font-size: var(--text-step--1);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  margin: 0;
}

.office-detail-list dd {
  margin: var(--space-1) 0 0;
  font-size: var(--text-step-0);
  color: var(--color-text);
}

.office-detail-list a {
  font-weight: var(--font-weight-medium);
}
.office-detail-list .office-social-link {
  color: var(--color-link);
}

.office-detail-list .office-social-link:hover {
  color: var(--color-link-hover);
}

.office-detail-list .office-social-link:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Hours nested in office detail dd: keep list semantics without duplicate bullets */
.office-hours-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: none;
}

.office-hours-list li {
  margin-bottom: var(--space-1);
}

.office-hours-list li:last-child {
  margin-bottom: 0;
}

/* —— Checklist block (semantic ul in HTML) —— */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-5);
  max-width: var(--max-width-prose);
}

.checklist li {
  position: relative;
  padding-left: var(--space-6);
  margin-bottom: var(--space-3);
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 1.1em;
  height: 1.1em;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
}

/* Decorative marker only; list semantics remain list (SR announces list). */

/* —— Alert / info panels —— */
.panel {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  max-width: var(--max-width-prose);
}

/* Keep in-panel headings visually subordinate to page H1 while staying real H2s for outline. */
.panel > h2:first-child {
  font-size: var(--text-step-1);
  margin-top: 0;
}

.panel p:last-child {
  margin-bottom: 0;
}

.panel--info {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
}

.panel--success {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-text);
}

.panel--warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}

.panel--danger {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger-text);
}

.panel__title {
  font-size: var(--text-step-1);
  margin: 0 0 var(--space-2);
  font-weight: var(--font-weight-bold);
}

/* —— Download resource row —— */
.download-item {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  margin-bottom: var(--space-4);
}

.download-item:last-child {
  margin-bottom: 0;
}

/* Vertical rhythm between section intro and first resource card */
.download-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.section-header + .download-stack {
  margin-top: var(--space-5);
}

/* Visible status for resources (not color-alone: includes text label). */
.status-badge {
  display: inline-block;
  font-size: var(--text-step--1);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.03em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface-subtle);
  color: var(--color-text);
}

.status-badge--pending {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: #5c4200;
}

.download-item h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-step-1);
}

.download-item p {
  max-width: none;
}

/* Launch / editorial: how this resource is distributed (HTML-only vs hosted PDF vs PennDOT canonical). */
.download-strategy {
  font-size: var(--text-step--1);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-subtle);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-primary);
  max-width: none;
}

.download-strategy .strategy-label {
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.85em;
}

.dist-legend-list {
  max-width: none;
  margin-bottom: 0;
}

.download-item .file-link {
  font-weight: var(--font-weight-medium);
}

.alt-block {
  margin-top: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface-subtle);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-primary);
}

.alt-block h4 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-step--1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.alt-block p,
.alt-block ul {
  margin: 0;
  font-size: var(--text-step--1);
  max-width: none;
}

/* —— Forms —— */
.form-field {
  margin-bottom: var(--space-5);
}

.form-field label,
.form-fieldset legend {
  display: block;
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-2);
  color: var(--color-text);
  font-size: var(--text-step--1);
}

.form-field .hint,
p .hint,
span.hint {
  font-weight: var(--font-weight-normal);
  color: var(--color-text-muted);
  font-size: var(--text-step--1);
}

.form-field .hint {
  margin-top: var(--space-1);
}

.required-mark {
  color: var(--color-danger-text);
  font-weight: var(--font-weight-bold);
}

.form-fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin: 0 0 var(--space-6);
  background: var(--color-bg-elevated);
}

.form-fieldset legend {
  padding: 0 var(--space-2);
  font-size: var(--text-step-1);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  max-width: 32rem;
  padding: var(--space-3) var(--space-3);
  font: inherit;
  color: var(--color-text);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

select {
  width: 100%;
  max-width: 100%;
  padding: var(--space-3) var(--space-3);
  font: inherit;
  color: var(--color-text);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--color-text-muted);
}

input:active,
textarea:active,
select:active {
  border-color: var(--color-primary);
}

input:disabled,
textarea:disabled,
select:disabled {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.85;
}

#form-errors {
  color: var(--color-danger-text);
  margin-bottom: var(--space-4);
  font-weight: var(--font-weight-medium);
}

#form-errors .form-error-list {
  margin: var(--space-3) 0 0;
  padding-left: 1.25em;
  max-width: none;
}

#form-errors .form-error-list a {
  color: inherit;
  font-weight: var(--font-weight-medium);
}

button[type="submit"] {
  display: inline-flex;
  align-items: center;
  padding: var(--space-3) var(--space-6);
  font: inherit;
  font-weight: var(--font-weight-medium);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

button[type="submit"]:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

button[type="submit"]:active:not(:disabled) {
  background: var(--color-primary-active);
  border-color: var(--color-primary-active);
}

button[type="submit"]:disabled {
  background: var(--color-primary-disabled);
  border-color: var(--color-primary-disabled);
  cursor: not-allowed;
}

/* —— Page intro (location + inner pages) —— */
.page-header {
  margin-bottom: var(--space-7);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
  margin-bottom: var(--space-2);
}

.page-header .location-tagline {
  font-size: var(--text-step-1);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
  margin: 0 0 var(--space-4);
}

.page-header .intro-lead {
  font-size: var(--text-step-1);
  color: var(--color-text);
  max-width: 42rem;
  margin: 0;
}

/* Contact: info panel directly under page title */
.page-header + .page-header-aside {
  margin-bottom: var(--space-6);
}

/* Footer navigation list (semantic ul) */
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav li {
  margin-bottom: var(--space-2);
}

.footer-nav a {
  text-decoration: none;
  font-size: var(--text-step--1);
}

.footer-nav a:hover {
  text-decoration: underline;
}

/* —— Directive #28R — In-house SVG / graphic enrichment (no new photography) ——
 * Decorative marks: aria-hidden on wrappers; headings stay the accessible names.
 * Icons use currentColor / inverse on navy badges for AA-friendly contrast.
 */
.enrichment-svg {
  display: block;
  width: 2.75rem;
  height: auto;
  color: var(--color-primary);
}

.enrichment-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

@media (min-width: 40rem) {
  .enrichment-header {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-5);
  }
}

.enrichment-header__icon {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--color-bg-elevated) 0%, var(--color-surface-subtle) 100%);
  border: 1px solid var(--color-border-strong);
  box-shadow: inset 0 3px 0 0 var(--color-brand-gold);
}

.enrichment-header__icon .enrichment-svg {
  width: 2rem;
  height: 2rem;
}

.enrichment-header .section-header {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.card__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-primary);
  border-bottom: 3px solid var(--color-brand-gold);
}

.card__mark .enrichment-svg {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--color-text-inverse);
}

.enrichment-plate-rule {
  height: 0.3125rem;
  max-width: 14rem;
  margin: var(--space-2) 0 var(--space-5);
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    var(--color-primary) 40%,
    var(--color-brand-gold) 40%,
    var(--color-brand-gold) 60%,
    var(--color-primary) 60%,
    var(--color-primary) 100%
  );
}

.panel--with-enrichment {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: none;
}

@media (min-width: 40rem) {
  .panel--with-enrichment {
    flex-direction: row;
    align-items: flex-start;
  }
}

.panel__enrichment-icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-info-border);
  box-shadow: inset 0 3px 0 0 var(--color-brand-gold);
}

.panel__enrichment-icon .enrichment-svg {
  width: 1.65rem;
  height: 1.65rem;
}

.panel__enrichment-body {
  flex: 1;
  min-width: 0;
}

.panel__enrichment-body .panel__title {
  margin-top: 0;
}

/* Services page: category badge + heading row */
.page-header--services {
  padding-bottom: var(--space-6);
}

.page-header__rule--plate {
  margin-top: var(--space-5);
  height: 0.25rem;
  max-width: min(100%, 28rem);
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-brand-gold) 20%,
    var(--color-primary) 50%,
    var(--color-brand-gold) 80%,
    transparent 100%
  );
  opacity: 0.85;
}

.service-section__heading-row {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  margin-bottom: var(--space-4);
}

.service-section__badge {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  border-bottom: 3px solid var(--color-brand-gold);
}

.service-section__badge .enrichment-svg {
  width: 1.65rem;
  height: 1.65rem;
  color: var(--color-text-inverse);
}

.service-section__intro h2 {
  margin: 0 0 var(--space-2);
}

.service-section__intro > p {
  margin: 0;
  max-width: 42rem;
  color: var(--color-text-muted);
}

.service-section .service-section__heading-row + h3 {
  margin-top: var(--space-5);
}

/* Office pages: subordinate motif row (no text; decorative only) */
.office-page-accent {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-4);
  margin: 0 0 var(--space-5);
  padding: var(--space-3) 0;
  max-width: 16rem;
  border-bottom: 1px solid var(--color-border);
}

.office-page-accent .enrichment-svg {
  width: 1.75rem;
  height: 1.75rem;
  opacity: 0.88;
}

/* —— Header utility + site-wide social link (Directive #39) —— */
.header-utility {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.header-inner .header-utility {
  flex-shrink: 0;
}

.site-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  text-decoration: none;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
}

.site-social-link:hover {
  color: var(--color-primary);
  background: var(--color-surface-subtle);
  border-color: var(--color-border-strong);
}

.site-social-link:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: 3px;
  color: var(--color-primary);
}

.site-social-link--on-dark {
  color: #dce8f7;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.site-social-link--on-dark:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

.site-social-link--on-dark:focus-visible {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.site-social-link__icon {
  display: block;
}

@media (max-width: 47.99rem) {
  .header-inner .header-utility {
    order: 2;
  }

  .header-inner .nav-toggle {
    order: 3;
  }

  .header-inner .site-nav {
    order: 4;
  }
}