/* Final editorial, consent and form polish for the static launch build. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.local-story h2 {
  max-width: 16ch;
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 0.98;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.local-story-copy {
  min-width: 0;
}

.local-scenario-grid li {
  padding-inline: clamp(16px, 2vw, 24px);
}

.local-cta-card {
  padding: clamp(28px, 4.4vw, 52px);
}

.local-cta-card .section-kicker {
  margin-bottom: 13px;
}

.local-cta-card h2 {
  max-width: 18ch;
  text-wrap: balance;
}

.legal-intro h1 {
  max-width: 100%;
  font-size: clamp(44px, 4.8vw, 64px);
  line-height: 0.98;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.legal-intro > p:last-child {
  max-width: 30ch;
}

.legal-content {
  width: 100%;
}

.category-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  border: 0;
}

.category-fieldset legend {
  padding: 0;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 500;
}

.category-help {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.category-pill {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.category-pill input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.category-pill span {
  min-height: 44px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--input);
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.2;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.category-pill span::before {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex: none;
  content: "+";
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
}

.category-pill input:checked + span {
  color: var(--paper-strong);
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 8px 22px #25324924;
}

.category-pill input:checked + span::before {
  content: "✓";
  color: var(--black);
  background: var(--gold);
  border-color: var(--gold);
}

.category-pill input:focus-visible + span,
.consent-checkbox:focus-visible,
.footer-consent-button:focus-visible,
.consent-banner button:focus-visible,
.consent-dialog button:focus-visible,
.consent-option-toggle input:focus-visible + .consent-option-switch {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.category-fieldset[aria-invalid="true"] .category-pills {
  padding: 7px;
  border: 1px solid #253249;
  border-radius: 14px;
}

.form-error {
  color: #253249;
}

.consent-row {
  grid-template-columns: 24px minmax(0, 1fr);
}

.consent-checkbox {
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  color: var(--black);
  background: var(--paper);
  border: 1px solid var(--input);
  border-radius: 5px;
  cursor: pointer;
}

.consent-checkbox::after {
  content: "✓";
  opacity: 0;
  font-size: 14px;
  font-weight: 700;
  transform: scale(0.7);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.consent-checkbox:checked {
  background: var(--gold);
  border-color: var(--gold-ink);
}

.consent-checkbox:checked::after {
  opacity: 1;
  transform: scale(1);
}

.footer-consent-button {
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  color: var(--muted-dark);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 14px;
}

.footer-consent-button:hover {
  color: var(--gold);
}

.consent-banner {
  position: fixed;
  z-index: 110;
  right: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(1120px, calc(100vw - 28px));
  padding: clamp(20px, 3vw, 30px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  align-items: end;
  gap: clamp(22px, 4vw, 48px);
  color: var(--paper-strong);
  background: #253249f7;
  border: 1px solid #f3bc4859;
  border-radius: 18px;
  box-shadow: 0 28px 80px #25324970;
  transform: translateX(50%);
  backdrop-filter: blur(16px);
}

.consent-eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
}

.consent-banner h2,
.consent-dialog h2 {
  margin: 0 0 10px;
  color: var(--paper-strong);
  letter-spacing: -0.035em;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.consent-banner-copy > p:not(.consent-eyebrow),
.consent-dialog-intro {
  max-width: 700px;
  margin: 0;
  color: #ffffffcc;
  font-size: 14px;
  line-height: 1.65;
}

.consent-privacy-link {
  width: fit-content;
  margin-top: 12px;
  display: inline-flex;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 13px;
}

.consent-banner-actions,
.consent-dialog-actions {
  display: grid;
  gap: 9px;
}

.consent-banner-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.consent-banner-actions [data-consent-accept] {
  grid-column: 1 / -1;
}

.consent-button {
  min-height: 48px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--paper-strong);
  background: transparent;
  border: 1px solid #ffffff42;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.consent-button-primary {
  color: var(--black);
  background: var(--gold);
  border-color: var(--gold);
}

.consent-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
}

.consent-backdrop {
  position: absolute;
  inset: 0;
  background: #253249cf;
  backdrop-filter: blur(6px);
}

.consent-dialog {
  position: relative;
  width: min(680px, 100%);
  max-height: min(760px, calc(100dvh - 40px));
  padding: clamp(24px, 4vw, 38px);
  overflow-y: auto;
  color: var(--paper-strong);
  background: var(--black-soft);
  border: 1px solid #f3bc4859;
  border-radius: 18px;
  box-shadow: 0 34px 100px #25324985;
}

.consent-dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--paper-strong);
  background: transparent;
  border: 1px solid #ffffff2e;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
}

.consent-options {
  min-width: 0;
  margin: 26px 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 10px;
}

.consent-option {
  min-width: 0;
  padding: 17px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  background: #ffffff08;
  border: 1px solid #ffffff1f;
  border-radius: 12px;
}

.consent-option strong {
  display: block;
  color: var(--paper-strong);
  font-size: 15px;
}

.consent-option p {
  margin: 5px 0 0;
  color: var(--muted-dark);
  font-size: 13px;
  line-height: 1.55;
}

.consent-option-status {
  color: var(--gold);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.consent-option-toggle {
  cursor: pointer;
}

.consent-option-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.consent-option-switch {
  position: relative;
  width: 48px;
  height: 28px;
  display: block;
  background: #253249b3;
  border: 1px solid #ffffff38;
  border-radius: 999px;
  transition: background 0.18s ease;
}

.consent-option-switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  content: "";
  background: var(--paper-strong);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.consent-option-toggle input:checked + .consent-option-switch {
  background: var(--gold-ink);
}

.consent-option-toggle input:checked + .consent-option-switch::after {
  transform: translateX(20px);
}

body.consent-dialog-open {
  overflow: hidden;
}

@media (width >= 880px) {
  .local-story-grid {
    grid-template-columns: minmax(330px, 0.86fr) minmax(0, 1.14fr);
    gap: clamp(54px, 7vw, 84px);
  }

  .legal-layout {
    grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
    gap: clamp(44px, 6vw, 70px);
  }
}

@media (width < 760px) {
  .consent-banner {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .consent-banner-actions {
    grid-template-columns: 1fr;
  }

  .consent-banner-actions [data-consent-accept] {
    grid-column: auto;
  }

  .consent-dialog-actions {
    grid-template-columns: 1fr;
  }
}

@media (width < 480px) {
  .category-pills {
    gap: 8px;
  }

  .category-pill span {
    min-height: 42px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .consent-modal {
    padding: 10px;
  }

  .consent-dialog {
    max-height: calc(100dvh - 20px);
    border-radius: 14px;
  }

  .consent-option {
    padding: 14px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .category-pill:hover span {
    border-color: var(--gold-ink);
    transform: translateY(-1px);
  }

  .consent-button:hover {
    border-color: var(--gold);
  }

  .consent-button-primary:hover {
    background: var(--gold-bright);
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-pill span,
  .consent-option-switch,
  .consent-option-switch::after,
  .consent-checkbox::after {
    transition: none;
  }
}
