/* Site-wide accessibility rules shared by every page (VAR-162). */

.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 8px;
  background: #08213e;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #2376c7;
  outline-offset: 2px;
}

/* Citation superscripts stay visually small but get a 24px tap area. */
sup.cite a::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
}

main {
  scroll-margin-top: 80px;
}

/* Inline urgent-care panel shown by /assets/urgent-panel.js. */
.urgent-panel {
  margin: 14px 0 4px;
  padding: 14px 16px;
  border-left: 5px solid #b42318;
  border-radius: 10px;
  background: #fff4f2;
  color: #5c1610;
}

.urgent-panel strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.urgent-panel p {
  margin: 0;
  color: #5c1610;
  font-size: 15px;
  line-height: 1.45;
}

/* Site-wide header, breadcrumbs, and footer (VAR-163). Markup lives in scripts/chrome/. */
.pp-wrap {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.pp-header {
  position: relative;
  top: auto;
  z-index: 30;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #dfeaf5;
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.pp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.pp-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.pp-brand img {
  display: block;
  width: 170px;
  height: auto;
}

.pp-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pp-links {
  display: flex;
  gap: 4px;
}

.pp-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: #08213e;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.pp-nav a:hover {
  background: #f0f5fb;
}

.pp-nav a[aria-current] {
  color: #0b356a;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.pp-menu {
  display: none;
  position: relative;
}

.pp-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #c9d8e8;
  border-radius: 8px;
  color: #08213e;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.pp-menu summary::-webkit-details-marker {
  display: none;
}

.pp-menu summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.pp-menu[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.pp-menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  padding: 8px;
  border: 1px solid #dfeaf5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px -20px rgba(13, 37, 61, .35);
}

.pp-menu a {
  display: flex;
  width: 100%;
}

@media (max-width: 960px) {
  .pp-links {
    display: none;
  }

  .pp-menu {
    display: block;
  }

  .pp-brand img {
    width: 150px;
  }
}

@media (min-width: 761px) {
  .pp-header {
    position: sticky;
    top: 0;
  }
}

.pp-breadcrumbs {
  border-bottom: 1px solid #eef3f8;
  background: #fbfdff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
}

.pp-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  padding: 8px 0;
  margin-top: 0;
  margin-bottom: 0;
  list-style: none;
}

.pp-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  color: #4a5d73;
}

.pp-breadcrumbs li + li::before {
  content: "›";
  margin: 0 8px;
  color: #8193a8;
}

.pp-breadcrumbs a {
  color: #0b356a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pp-breadcrumbs [aria-current] {
  color: #4a5d73;
}

.pp-footer {
  margin-top: 48px;
  padding: 40px 0 28px;
  border-top: 1px solid #dfeaf5;
  background: #f7fafd;
  color: #2c3e55;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
}

.pp-footer-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
}

.pp-footer h2 {
  margin: 0 0 10px;
  color: #08213e;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.pp-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pp-footer li + li {
  margin-top: 4px;
}

.pp-footer a {
  display: inline-block;
  padding: 3px 0;
  color: #0b356a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pp-footer-note {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid #dfeaf5;
  color: #4a5d73;
  font-size: 14px;
}

@media (max-width: 960px) {
  .pp-footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .pp-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  .pp-header,
  .pp-breadcrumbs,
  .pp-footer,
  .skip-link {
    display: none !important;
  }
}

/* Plain trust pages: about, editorial policy, terms, accessibility (VAR-163). */
.trust-section {
  padding: 8px 0 18px;
  font-size: 18px;
  line-height: 1.6;
}

.trust-section h2 {
  margin: 18px 0 10px;
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.2;
}

.trust-section p,
.trust-section li {
  color: #21344a;
}

.trust-section ul {
  padding-left: 22px;
}

.trust-section li + li {
  margin-top: 6px;
}

.trust-section a {
  color: #0b356a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-group-title {
  margin: 28px 0 12px;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.2;
}

section:has(> .trust-section) {
  padding-top: 4px;
  padding-bottom: 4px;
}

/* Schematic procedure diagrams on the pillar pages (VAR-164). */
.pp-diagram {
  margin: 24px 0 28px;
}

.pp-diagram-frame {
  border: 1px solid #dfeaf5;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbf8f6 0%, #f4f7fb 100%);
  padding: 10px;
}

.pp-diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

.pp-diagram-single .pp-diagram-frame svg {
  max-width: 540px;
  margin: 0 auto;
}

.pp-diagram-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pp-diagram-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pp-diagram-steps p {
  margin: 10px 0 0;
  color: #21344a;
  font-size: 16px;
  line-height: 1.5;
}

.pp-diagram figcaption {
  margin-top: 12px;
  color: #4a5d73;
  font-size: 15px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .pp-diagram-steps,
  .pp-diagram-pair {
    grid-template-columns: 1fr;
  }

  .pp-diagram-steps .pp-diagram-frame svg {
    max-width: 360px;
    margin: 0 auto;
  }

  /* Labelled single figures run edge to edge on phones so the text stays readable. */
  .pp-diagram-single .pp-diagram-frame {
    width: calc(100vw - 16px);
    margin-left: calc(50% - 50vw + 8px);
    padding: 6px 0;
    border-radius: 12px;
  }
}

/* Rendered pillar heroes and imaging schematics (VAR-202). */
.pp-figure {
  margin: 22px 0 26px;
}

.pp-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #dfeaf5;
  border-radius: 14px;
  background: #f4f7fb;
}

.pp-figure figcaption {
  margin-top: 10px;
  color: #4a5d73;
  font-size: 15px;
  line-height: 1.5;
}

.pp-figure-hero {
  max-width: 760px;
  margin-bottom: 0;
}

.pp-figure-hub,
.pp-figure-schematic {
  max-width: 820px;
}

.pp-figure-hub {
  margin: 0 0 28px;
}

.pp-figure-zoom {
  display: block;
  cursor: zoom-in;
}

/* Labeled schematics run edge to edge on phones, and tap through to the full-size PNG. */
@media (max-width: 760px) {
  .pp-figure-schematic {
    width: calc(100vw - 16px);
    max-width: none;
    margin-left: calc(50% - 50vw + 8px);
  }

  .pp-figure-schematic figcaption {
    padding: 0 12px;
  }
}

.section-intro a,
.artifact-subcopy a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Source back-links get a 24px tap area too (VAR-164). */
.sources .src-back {
  display: inline-block;
  min-width: 24px;
  min-height: 24px;
  line-height: 24px;
  text-align: center;
}

.hero-copy a,
.answer-first a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* VAR-204: "at a glance" comparison table on the options pages. Scrolls inside its own
   box on narrow screens so the page never scrolls sideways. */
.options-table-wrap {
  margin: 0 0 28px;
  overflow-x: auto;
  border: 1px solid rgba(15, 42, 68, 0.14);
  border-radius: 12px;
  background: #fff;
}
/* Inside an article the grid column must be allowed to shrink, or the table's min-width
   widens the whole page on phones. */
.article-layout > .article-body {
  min-width: 0;
}
.article-body .options-table {
  min-width: 680px;
}
.options-table-wrap:focus-visible {
  outline: 3px solid #1f6feb;
  outline-offset: 2px;
}
.options-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}
.options-table-title {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.5;
  color: #3a4b5f;
}
.options-table-title strong {
  color: #0f2a44;
}
/* The visible title sits outside the scroll box; the caption names the table for screen readers. */
.options-table-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.options-table thead th {
  border-top: 0;
}
.options-table th,
.options-table td {
  padding: 10px 12px;
  border-top: 1px solid rgba(15, 42, 68, 0.1);
  text-align: left;
  vertical-align: top;
}
.options-table thead th {
  background: #f4f7fb;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3a4b5f;
}
.options-table tbody th {
  font-weight: 700;
  color: #0f2a44;
}
