/*
 * Pricing, coverage and sources pages (WP3). Layout only: colors, type, radii and shadows come from the tokens in site.css.
 */

/* ------------------------------------------------------------ page shell */

/* The first section of a page starts one hero space under the header, as
   on every page (site.css), so the product (plans, counties, sources) is
   in the first screen. */
.data-top > .section-head {
  margin-bottom: var(--space-6);
}

/* One note or error under a page head, centred at reading width. */
.data-notice {
  display: flex;
  justify-content: center;
  margin: 0 auto var(--space-6);
}

.data-notice > * {
  max-width: var(--prose);
  margin: 0;
}

/* The close of a page: one line, one button, centred. */
.data-closing {
  text-align: center;
}

/* Straight after the page's first section the two share one gap. */
.data-top + .data-closing {
  padding-top: 0;
}

.data-line {
  max-width: none;
  margin: 0 0 var(--space-5);
  color: var(--muted);
  font-size: var(--text-lg);
  line-height: 1.45;
}

.data-closing > .fine-print {
  max-width: none;
  margin: var(--space-5) 0 0;
}

/* --------------------------------------------------------------- pricing */

/* The price cards in a row: one on a phone, two across from a tablet up. */
.plan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-grid > li {
  max-width: none;
}

@media (min-width: 640px) {
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Two cards: the free data and the letters. Held to a reading width and
   centred, so a wide screen does not stretch them. */
.plan-pair {
  max-width: 880px;
  margin-inline: auto;
}

/* The ways to mail a letter, one a row: the name, then its price. */
.price-list {
  display: grid;
  margin: 0 0 var(--space-4);
  padding: 0;
  border-top: 1px solid var(--line);
}

.price-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}

.price-list dt {
  font-weight: 500;
}

.price-list dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plan-grid > .tier {
  position: relative;
}

.plan-grid .tier-price small {
  margin-left: 2px;
}

/* Why this card is the marked one, on the card's top edge. Out of the flow,
   so the two headings stay on one line. */
.tier-flag {
  position: absolute;
  top: 0;
  left: var(--space-5);
  max-width: calc(100% - 2 * var(--space-5));
  height: 24px;
  margin: 0;
  padding: 0 var(--space-3);
  overflow: hidden;
  transform: translateY(-50%);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-alt .faq-item {
  border-color: var(--line-strong);
}

.faq-list {
  max-width: var(--prose);
  margin-inline: auto;
}

.faq-list p {
  max-width: none;
}

.plan-next .button-row {
  margin-top: var(--space-6);
}

/* -------------------------------------------------------------- coverage */

.coverage-county {
  display: flex;
  flex-direction: column;
}

.coverage-county-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.coverage-county-head > .badge {
  margin-top: 1px;
}

.coverage-county-head > h2 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* The one number on the card. */
.coverage-count {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.coverage-count > strong {
  display: block;
  color: var(--text);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Florida's date line runs to two lines. Every card holds two, so the rows
   under it line up across the grid. */
/* One line under the count where a county holds every parcel. */
.coverage-scope {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 20px;
}

.coverage-date {
  min-height: 42px;
  min-height: 2lh;
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.coverage-checks {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-3) 0 0;
  padding: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  list-style: none;
}

.coverage-checks > li::before {
  display: inline-block;
  width: 1.5em;
  font-weight: 600;
}

.coverage-checks > .is-yes::before {
  color: var(--link);
  content: "\2713";
}

.coverage-checks > .is-no {
  color: var(--muted);
}

.coverage-checks > .is-no::before {
  content: "\2013";
}

.coverage-source {
  margin: var(--space-2) 0;
  font-size: var(--text-sm);
}

.coverage-source > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Everything else about a county, one tap away at the foot of its card. */
.coverage-more {
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.coverage-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 48px;
  margin-bottom: calc(-1 * var(--space-3));
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  list-style: none;
}

.coverage-more[open] > summary {
  margin-bottom: 0;
}

.coverage-more > summary::-webkit-details-marker {
  display: none;
}

.coverage-more > summary::after {
  flex: none;
  color: var(--muted);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1;
  content: "+";
  transition: transform var(--fast) var(--ease);
}

.coverage-more[open] > summary::after {
  transform: rotate(45deg);
}

.coverage-more > h3 {
  margin: var(--space-5) 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.coverage-fields {
  margin: 0;
}

.coverage-fields > div {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.coverage-fields dt {
  color: var(--muted);
}

.coverage-fields dd {
  max-width: none;
  margin: 0;
}

.coverage-own-fields,
.coverage-limits {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.coverage-own-fields > .badge {
  margin: 0 var(--space-1) var(--space-1) 0;
}

.coverage-limits {
  display: grid;
  gap: var(--space-2);
  padding-left: var(--space-4);
}

.coverage-limits > li {
  max-width: none;
}

.coverage-note {
  max-width: var(--prose);
  margin: var(--space-7) auto 0;
}

.coverage-note > p {
  max-width: none;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.coverage-coming {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.coverage-coming > li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: none;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 500;
}

/* --------------------------------------------------------------- sources */

.sources-list {
  max-width: 800px;
  margin-inline: auto;
}

.sources-notices {
  margin-top: var(--space-6);
}

.sources-notice-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  list-style: none;
}

.sources-notice-list > li {
  max-width: none;
}

.sources-notice-list strong {
  color: var(--text);
}

/* Change, keep, never return: three short answers side by side, centred
   like every other section of the page. */
.sources-rules {
  display: grid;
  gap: var(--space-6);
  margin: 0;
  text-align: center;
}

@media (min-width: 900px) {
  .sources-rules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-7);
  }
}

.sources-rules dt {
  margin-bottom: var(--space-2);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.sources-rules dd {
  max-width: 44ch;
  margin: 0 auto;
  color: var(--muted);
}

/* What we never return: one short list, one item a line, no bullets. */
.sources-never {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Coverage: request a county. A dot for every county; live and requested
   ones stand out. The form works with scripts off. */
.ask {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.ask-figure,
.ask-panel {
  min-width: 0;
}

.ask-map {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  touch-action: manipulation;
}

.ask-dots {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 3;
  stroke-linecap: round;
}

/* The marked counties keep a stroke that does not shrink with the map, so
   they can still be seen when the map is phone-sized. */
.ask-asked circle {
  fill: var(--highlight);
  stroke: var(--accent);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

.ask-live circle {
  fill: var(--accent);
  stroke: var(--accent);
  stroke-width: 5px;
  vector-effect: non-scaling-stroke;
}

.ask-picked {
  fill: none;
  stroke: var(--text);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.ask-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ask-key {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
}

.ask-key.is-live {
  background: var(--accent);
}

.ask-key.is-asked {
  margin-left: var(--space-3);
  border: 1px solid var(--accent);
  background: var(--highlight);
}

.ask-form {
  position: relative;
  margin: 0;
}

.ask-form > label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.ask-field {
  display: flex;
  gap: var(--space-2);
}

.ask-field > input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 0 var(--space-4);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  /* 16px or more, so a phone does not zoom the page on focus. */
  font-size: 16px;
}

.ask-field > .button {
  flex: 0 0 auto;
  min-height: 48px;
}

.ask-list {
  position: absolute;
  z-index: 5;
  right: 0;
  left: 0;
  margin: var(--space-1) 0 0;
  padding: var(--space-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(13 31 24 / 12%);
  list-style: none;
}

.ask-list > li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-3);
  border-radius: var(--radius-code);
  cursor: pointer;
}

.ask-list > li:hover,
.ask-list > li.is-active {
  background: var(--accent-soft);
}

.ask-note,
.ask-votes {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.ask-status {
  min-height: 24px;
  margin: var(--space-3) 0 0;
  color: var(--text);
}

.ask-heading {
  margin: var(--space-5) 0 var(--space-2);
  font-size: var(--text-base);
}

.ask-empty {
  margin: 0;
  color: var(--muted);
}

.ask-top {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ask-top > li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  border-top: 1px solid var(--line-strong);
}

.ask-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}

.ask-top .button {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
}

@media (min-width: 960px) {
  .ask {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: var(--space-8);
  }
}
