/* Shared presentation for the legacy reference pages linked from the FAQ. */

:root {
  --reference-page: #f4f7f8;
  --reference-surface: #fffefa;
  --reference-text: #243540;
  --reference-navy: #0b2438;
  --reference-link: #096b91;
  --reference-border: #cad7dc;
  --reference-border-subtle: #dde6e9;
  --reference-table-head: #e7f1f4;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--reference-page);
  scroll-behavior: smooth;
}

/* This stylesheet is loaded only by standalone reference pages, so a plain
   body selector lets it support their varied legacy body markup. */
body {
  width: min(100%, 960px);
  min-width: 0;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 4.5rem) clamp(1.25rem, 4vw, 4.5rem);
  border-top: 5px solid #087b78;
  background: var(--reference-surface);
  color: var(--reference-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1rem, 0.97rem + 0.12vw, 1.0625rem);
  line-height: 1.68;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
}

body font {
  font-family: inherit;
}

.reference-header {
  max-width: 78ch;
  margin: 0 auto clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--reference-border);
  text-align: center;
}

.reference-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  color: #087b78;
  font-size: 0.8rem;
  font-weight: 720;
  letter-spacing: 0.055em;
  text-decoration: none;
  text-transform: uppercase;
}

.reference-breadcrumb::before {
  content: "\2190";
  font-size: 1rem;
  line-height: 1;
}

.reference-breadcrumb:hover {
  text-decoration: underline;
}

.reference-header h1 {
  margin-bottom: 1rem;
}

.reference-byline {
  max-width: 60ch;
  margin: 0 auto;
  color: #5c6d76;
  font-size: 0.94rem;
  line-height: 1.5;
}

body h1,
body h2,
body h3,
body h4 {
  color: var(--reference-navy);
  font-family: inherit;
  line-height: 1.22;
}

body h1 {
  max-width: 24ch;
  margin: 0 auto 1.5rem;
  font-size: clamp(1.9rem, 1.5rem + 1.8vw, 3.2rem);
  letter-spacing: -0.03em;
  text-align: center;
}

body h2 {
  margin: 3.5rem 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--reference-border);
  font-size: clamp(1.45rem, 1.3rem + 0.5vw, 1.9rem);
}

body h3 {
  margin: 2.5rem 0 0.75rem;
  font-size: clamp(1.2rem, 1.1rem + 0.3vw, 1.45rem);
}

body h4 {
  margin: 2rem 0 0.5rem;
  font-size: 1.08rem;
}

body p,
body ul,
body ol {
  max-width: 78ch;
}

body p {
  margin: 0 0 1rem;
}

body p[align="justify"] {
  text-align: left;
}

body li + li {
  margin-top: 0.5rem;
}

body center {
  max-width: 78ch;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

body a {
  color: var(--reference-link);
  text-decoration-thickness: 0.075em;
  text-underline-offset: 0.16em;
}

body a:hover {
  color: #075574;
  text-decoration-thickness: 0.12em;
}

body a:focus-visible {
  outline: 2px solid #197ea3;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(25, 126, 163, 0.3);
}

body img {
  max-width: 100%;
  height: auto;
}

body table {
  width: 100%;
  max-width: 100%;
  margin: 1.5rem 0 2rem;
  border-collapse: collapse;
  font-size: 0.94rem;
  line-height: 1.48;
}

body th,
body td {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--reference-border-subtle);
  vertical-align: top;
}

body th {
  background: var(--reference-table-head);
  color: var(--reference-navy);
  font-weight: 700;
}

body hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--reference-border);
}

body .equation {
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 600px) {
  body {
    padding: 1.25rem 1rem 3rem;
  }

  body h2 {
    margin-top: 2.5rem;
  }

  body table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  html {
    background: white;
  }

  body {
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: white;
  }
}
