/* Hospital price site. One stylesheet, no framework.
   Fonts: Public Sans (text) and Barlow Condensed (headlines and prices), both SIL Open Font License. */

@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/public-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/public-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --paper: #ffffff;
  --ink: #17352e;       /* spruce: text, rules, outlines */
  --ink-soft: #4e6660;  /* secondary text, 6.2:1 on white */
  --rule: #d5ded9;
  --wash: #eef4f1;
  --tag: #ffd23f;       /* shelf-tag yellow: the lowest price, and nothing else loud */
  --bar: #2e7a65;       /* price bars, 5.1:1 on white */
  --text: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --page: 66rem;
  --gutter: 1.5rem;
  --measure: 40rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.55;
  font-variant-numeric: lining-nums;
}

a { color: var(--ink); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; z-index: 10; padding: 0.5rem 0.875rem; background: var(--ink); color: var(--paper); }
.skip:focus { left: 0.5rem; top: 0.5rem; }

.banner { margin: 0; padding: 0.625rem var(--gutter); background: var(--ink); color: var(--paper); font-size: 0.875rem; line-height: 1.45; }

main {
  width: 100%;
  max-width: var(--page);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
/* the header and footer rules line up with the text, not the page edge */
.masthead, .foot {
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--page) - 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
}

/* header */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--ink);
}
.wordmark { font-family: var(--display); font-weight: 700; font-size: 1.75rem; line-height: 1; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 1rem; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; }

main { padding-top: 0.5rem; padding-bottom: 4rem; }

/* type */
h1, h2 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.05; }
h1 { font-size: 3rem; max-width: 26ch; }
h2 { font-size: 2.25rem; margin-top: 3rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.3125rem; line-height: 1.25; margin: 2rem 0 0.5rem; }
p { margin: 0 0 1rem; }
.lead { max-width: var(--measure); font-size: 1.3125rem; line-height: 1.5; }
.muted, .sub, .table-note, .fine, .code, .crumbs, .none { color: var(--ink-soft); }

/* home hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2rem 3.5rem;
  align-items: start;
  padding: 3rem 0 1rem;
}
.hero h1 { font-size: 3.75rem; max-width: 15ch; margin-bottom: 1.25rem; }
.hero .lead { margin-bottom: 0; }
.compare-title { margin-bottom: 0.875rem; font-size: 1rem; font-weight: 600; }
.tags { display: flex; flex-direction: column; align-items: flex-start; gap: 0.875rem; }
.compare-link { margin: 1.25rem 0 0; font-size: 1rem; }

/* the price tag */
.tag {
  --notch: 1.6rem;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  min-width: 16rem;
  max-width: 100%;
  padding: 0.75rem 1.5rem 0.875rem calc(var(--notch) + 1.35rem);
  background: var(--tag);
  color: var(--ink);
  border-radius: 0 0.375rem 0.375rem 0;
  clip-path: polygon(var(--notch) 0, 100% 0, 100% 100%, var(--notch) 100%, 0 50%);
}
.tag::before {
  content: "";
  position: absolute;
  left: calc(var(--notch) - 0.3rem);
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: -0.35rem;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px rgba(23, 53, 46, 0.28);
}
.tag-quiet { background: var(--wash); }
.tag-price { font-family: var(--display); font-weight: 700; font-size: 3.75rem; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.tag-note { margin-top: 0.25rem; font-size: 0.875rem; font-weight: 600; }
.tag-label { max-width: 22rem; margin-top: 0.25rem; font-size: 1rem; line-height: 1.35; }

/* page heads */
.crumbs { margin: 1.5rem 0 0.75rem; font-size: 0.875rem; }
.page-head { margin: 2rem 0 1.25rem; }
.crumbs + .page-head { margin-top: 0; }
.code { margin: 0.5rem 0 0; font-size: 1rem; }
.summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem 3rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.summary .lead { margin: 0; }

/* price tables */
.prices { width: 100%; margin: 1.5rem 0 0.75rem; border-collapse: collapse; font-size: 1rem; line-height: 1.4; }
.prices caption { caption-side: top; padding-bottom: 0.5rem; text-align: left; font-size: 0.875rem; color: var(--ink-soft); }
.prices th { padding: 0.5rem 0.75rem; text-align: left; vertical-align: bottom; font-size: 0.875rem; font-weight: 600; border-bottom: 2px solid var(--ink); }
.prices td { padding: 0.875rem 0.75rem; vertical-align: top; border-bottom: 1px solid var(--rule); }
.prices th:first-child, .prices td:first-child { padding-left: 0; }
.prices th:last-child, .prices td:last-child { padding-right: 0; }
.cell-name { width: 34%; }
.cell-name > a, .plain-name { font-weight: 600; }
.hospitals-table .cell-name { width: 45%; }
.figure { display: block; font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; }
.figure-quiet { font-weight: 600; font-size: 1.3125rem; }
.sub { display: block; margin-top: 0.125rem; font-size: 0.875rem; }
.none { font-size: 0.875rem; }
.date { white-space: nowrap; }
.bar { display: block; width: var(--w); max-width: 100%; height: 0.375rem; margin-top: 0.5rem; background: var(--bar); border-radius: 0 0.25rem 0.25rem 0; }
.table-note { max-width: var(--measure); font-size: 0.875rem; }
.sub-flag { font-style: italic; }

/* each plan behind an insurance rate */
.plans { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.4; }
.plans summary { cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.plans[open] summary { margin-bottom: 0.25rem; }
.plan-list { margin: 0 0 0.5rem; padding: 0; list-style: none; }
.plan-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.75rem; padding: 0.35rem 0; border-top: 1px solid var(--rule); }
.plan-name { overflow-wrap: anywhere; }
.plan-rate { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.plan-how { grid-column: 1 / -1; color: var(--ink-soft); }
.plan-group { margin: 0.75rem 0 0.25rem; font-weight: 600; }
.plan-group .muted { font-weight: 400; }

/* home: services */
.finder { max-width: 32rem; margin: 1rem 0 1.5rem; }
.finder label { display: block; margin-bottom: 0.375rem; font-size: 1rem; font-weight: 600; }
.finder input, .alerts input[type="email"] {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 0.375rem;
}
.finder-empty { margin: 0.75rem 0 0; font-size: 1rem; }
.category h3 { margin-top: 1.75rem; }
.service-list { max-width: 44rem; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.service-list li { border-bottom: 1px solid var(--rule); }
.service-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.5rem; padding: 0.75rem 0; text-decoration: none; }
.service-name { font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.service-list a:hover .service-name { text-decoration-thickness: 2px; }
.service-price { text-align: right; font-family: var(--display); font-weight: 700; font-size: 1.3125rem; line-height: 1.2; font-variant-numeric: tabular-nums lining-nums; }
.service-meta { grid-column: 1 / -1; font-size: 0.875rem; color: var(--ink-soft); }
.county-soon { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.5rem; padding: 0.75rem 0; color: var(--ink-soft); }
.county-soon .service-name { text-decoration: none; font-weight: 600; }
.county-soon .service-price { font-family: var(--text); font-weight: 400; font-size: 1rem; }
.compare-list { max-width: 44rem; margin: 0.5rem 0 0; padding: 0; list-style: none; columns: 2 18rem; column-gap: 2.5rem; }
.compare-list li { margin-bottom: 0.5rem; break-inside: avoid; }
.lowest-list { max-width: 44rem; padding-left: 1.5rem; }
.lowest-list li { margin-bottom: 0.4rem; }

/* definitions */
.terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2.5rem; margin: 1rem 0 1.25rem; }
.terms dt { margin-bottom: 0.375rem; font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1.1; }
.terms dd { margin: 0; font-size: 1rem; }
.terms-stacked { grid-template-columns: 1fr; max-width: var(--measure); }

.employers-cta { margin-top: 3.5rem; border-top: 2px solid var(--ink); }
.employers-cta h2 { margin-top: 1.5rem; }

/* running text */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.5rem; }
.prose ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }

.related ul { margin: 0; padding: 0; list-style: none; columns: 2 18rem; column-gap: 2.5rem; }
.related li { margin-bottom: 0.5rem; break-inside: avoid; }

.alerts { max-width: var(--measure); margin-top: 3rem; padding: 1.25rem 1.5rem 0.5rem; background: var(--wash); border-radius: 0.375rem; }
.alerts h2 { margin-top: 0; font-size: 2rem; }
.alerts label { display: block; margin-bottom: 0.375rem; font-size: 1rem; font-weight: 600; }
.alerts-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.alerts-row input[type="email"] { flex: 1 1 14rem; width: auto; }
.alerts input[type="text"] { width: 100%; max-width: 16rem; padding: 0.625rem 0.875rem; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 0.375rem; }
.area-signup > p:first-of-type { margin-top: 0.5rem; }
.fine { font-size: 0.875rem; }

button, .button {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--tag);
  border: 2px solid var(--ink);
  border-radius: 0.375rem;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: #ffde70; }
.cta { margin-top: 2rem; }

.ad { margin: 2.5rem 0; min-height: 6rem; }

/* footer */
.foot {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1rem 3rem;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  border-top: 2px solid var(--ink);
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.foot-text { max-width: var(--measure); }
.foot-nav { display: flex; flex-direction: column; gap: 0.375rem; }

/* phones */
@media (max-width: 760px) {
  :root { --gutter: 1.125rem; }
  h1 { font-size: 2.25rem; }
  h2 { font-size: 2rem; }
  .hero { grid-template-columns: 1fr; padding-top: 2rem; }
  .hero h1 { font-size: 3rem; }
  .tag { min-width: 0; width: 100%; }
  .tag-price { font-size: 3rem; }
  .summary, .terms, .foot { grid-template-columns: 1fr; }

  .prices thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .prices, .prices tbody, .prices tr, .prices caption { display: block; width: 100%; }
  .prices tr { padding: 0.875rem 0; border-bottom: 1px solid var(--rule); }
  .prices td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.3rem 0; border: 0; }
  .prices td::before { content: attr(data-label); padding-top: 0.25rem; font-size: 0.875rem; color: var(--ink-soft); }
  .prices td.cell-name { display: block; width: auto; padding-bottom: 0.5rem; }
  .prices td.cell-name::before { content: none; }
}

@media print {
  .nav, .finder, .ad, .alerts, .skip, .banner { display: none; }
  .tag { clip-path: none; border: 2px solid var(--ink); }
}
