/* The ArcGIS Compendium — site stylesheet (nautical-chart identity) */
:root {
  --ground: #F4F7F8;
  --panel: #FFFFFF;
  --ink: #1D2C35;
  --ink-soft: #4A5C66;
  --water: #11708F;
  --water-tint: #E3EEF2;
  --contour: #C0702F;
  --contour-tint: #F6EBDF;
  --graticule: #D8E0E5;
  --mono-bg: #E9EFF1;
  --shadow: 0 1px 3px rgba(29, 44, 53, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0F171C;
    --panel: #16222A;
    --ink: #DDE7EC;
    --ink-soft: #9DB0BA;
    --water: #53B4D6;
    --water-tint: #14303C;
    --contour: #DE9A5C;
    --contour-tint: #33261A;
    --graticule: #263640;
    --mono-bg: #1E2E37;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

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

body {
  background: var(--ground);
  color: var(--ink);
  font-family: "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  margin: 0;
  padding: 0 1.25rem 5rem;
}

/* Site nav band */
.site-nav {
  margin: 0 -1.25rem 2rem;
  padding: 0.8rem 1.25rem;
  border-bottom: 2px solid var(--water);
  background:
    linear-gradient(var(--graticule) 1px, transparent 1px),
    linear-gradient(90deg, var(--graticule) 1px, transparent 1px);
  background-size: 3.5rem 3.5rem;
  background-position: center;
}
.site-nav .inner {
  max-width: 46rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-family: "Segoe UI Variable Display", "Segoe UI", "Avenir Next", Avenir, system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
}
.site-nav a { color: var(--water); text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* Pandoc title block */
header#title-block-header {
  max-width: 46rem;
  margin: 0 auto 2rem;
}
header#title-block-header h1.title {
  font-family: "Segoe UI Variable Display", "Segoe UI", "Avenir Next", Avenir, system-ui, sans-serif;
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 1rem 0 0;
  text-wrap: balance;
}

/* TOC */
nav#TOC {
  max-width: 46rem;
  margin: 0 auto 2.5rem;
  background: var(--panel);
  border: 1px solid var(--graticule);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.75rem;
}
nav#TOC::before {
  content: "On this page";
  display: block;
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}
nav#TOC ul { margin: 0; padding-left: 1.3rem; }
nav#TOC li { margin-bottom: 0.35rem; }
nav#TOC a { text-decoration: none; }
nav#TOC a:hover { text-decoration: underline; }

/* Content column */
body > *:not(.site-nav):not(#title-block-header):not(#TOC),
section, article {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

h1, h2, h3, h4 {
  font-family: "Segoe UI Variable Display", "Segoe UI", "Avenir Next", Avenir, system-ui, sans-serif;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: 1.9rem; font-weight: 700; margin: 3rem auto 0.5rem; }
h2 {
  font-size: 1.55rem; font-weight: 700; margin: 3.5rem auto 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--graticule);
}
h3 { font-size: 1.15rem; font-weight: 650; margin: 2.25rem auto 0.5rem; }
h4 { font-size: 1rem; font-weight: 650; margin: 1.75rem auto 0.4rem; }

p { margin: 0 auto 1rem; }
a { color: var(--water); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; }
strong { font-weight: 650; }

ul, ol { padding-left: 1.5rem; margin: 0 auto 1rem; }
li { margin-bottom: 0.45rem; }
li > ul, li > ol { margin-top: 0.45rem; }

code {
  font-family: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  background: var(--mono-bg);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}
pre {
  background: var(--mono-bg);
  border: 1px solid var(--graticule);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem auto 1.5rem;
}
pre code { background: none; padding: 0; font-size: 0.85rem; line-height: 1.55; }

/* Callout blockquotes (> **Tip:** / > **Watch out:**) */
blockquote {
  margin: 1.25rem auto 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--water-tint);
  border: none;
  border-radius: 8px;
}
blockquote p { margin-bottom: 0.6rem; }
blockquote p:last-child { margin-bottom: 0; }

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  max-width: 46rem;
  margin: 1.25rem auto 1.5rem;
  font-size: 0.95rem;
  background: var(--panel);
  border: 1px solid var(--graticule);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: block;
  overflow-x: auto;
}
th {
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--water);
}
td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--graticule);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }

hr {
  border: none;
  border-top: 1px solid var(--graticule);
  max-width: 46rem;
  margin: 3rem auto;
}

em { font-style: italic; }

.site-footer {
  max-width: 46rem;
  margin: 4rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--graticule);
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}
