/* EarthCape documentation — layered on top of styles.css */

.doc-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 242, 237, 0.94);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.doc-header .wrap { display: flex; align-items: center; gap: 20px; height: 62px; }
.doc-header .brand img { width: 120px; height: auto; }
.doc-header .tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.doc-header nav { margin-left: auto; display: flex; gap: 22px; font-size: 14px; }
.doc-header nav > a { text-decoration: none; color: var(--body); }
.doc-header nav > a:hover { color: var(--ink); }

.doc-layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: 56px;
  align-items: start;
}

/* ---- sidebar ---- */

.doc-side {
  position: sticky;
  top: 62px;
  max-height: calc(100vh - 62px);
  overflow-y: auto;
  padding: 44px 0 60px;
  font-size: 14.5px;
}
.doc-side h4 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 26px 0 10px;
}
.doc-side h4:first-child { margin-top: 0; }
.doc-side ul { list-style: none; margin: 0 0 4px; padding: 0; }
.doc-side li { margin: 0; }
.doc-side a {
  display: block;
  text-decoration: none;
  color: var(--body);
  padding: 5px 0 5px 12px;
  border-left: 1px solid var(--line);
  line-height: 1.45;
}
.doc-side a:hover { color: var(--ink); border-left-color: var(--muted); }
.doc-side a.here { color: var(--ink); font-weight: 500; border-left-color: var(--moss); }

/* ---- article ---- */

.doc-main { padding: 44px 0 90px; min-width: 0; }
.doc-main .kicker { margin-bottom: 14px; }
.doc-main h1 { font-size: 38px; line-height: 1.2; margin: 0 0 18px; max-width: 20ch; }
.doc-main > .lede { font-size: 17.5px; line-height: 1.62; margin: 0 0 44px; max-width: 60ch; color: var(--body); }
.doc-main h2 {
  font-size: 25px;
  margin: 58px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: 26ch;
}
.doc-main h3 {
  font-family: var(--sans);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 32px 0 8px;
}
.doc-main p { max-width: 68ch; margin: 0 0 16px; }
.doc-main ul, .doc-main ol { max-width: 66ch; margin: 0 0 18px; padding-left: 20px; }
.doc-main li { margin: 6px 0; }
.doc-main a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.doc-main a:hover { text-decoration-color: var(--ink); }
.doc-main code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 1px 5px;
}

/* ---- screenshot figures ---- */

.docshot { margin: 26px 0 30px; max-width: 300px; }
.docshot .phone { max-width: 300px; }
.docshot figcaption { margin-top: 12px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.docshot figcaption b { display: block; color: var(--ink); font-weight: 500; font-size: 14px; margin-bottom: 2px; }

.docshots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; margin: 26px 0 32px; }
.docshots .docshot { margin: 0; max-width: none; }
.docshots .docshot .phone { max-width: none; }
.docshots--2 { grid-template-columns: repeat(2, 1fr); max-width: 660px; }

.docshot--wide { max-width: 100%; }
.docshot--wide .phone { max-width: 100%; }

/* text beside a shot */
.doc-split { display: grid; grid-template-columns: 1fr 300px; gap: 44px; align-items: start; margin: 26px 0 32px; }
.doc-split > :first-child > :first-child { margin-top: 0; }
.doc-split .docshot { margin: 0; }

/* ---- callouts ---- */

.note {
  border-left: 2px solid var(--moss);
  background: var(--surface);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 15px;
  max-width: 66ch;
}
.note b { color: var(--ink); font-weight: 500; }
.note p { margin: 0; max-width: none; }

/* ---- steps ---- */

.doc-steps { list-style: none; counter-reset: s; margin: 24px 0 30px; padding: 0; max-width: 66ch; }
.doc-steps li {
  counter-increment: s;
  position: relative;
  padding: 0 0 16px 40px;
  margin: 0;
}
.doc-steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---- reference table ---- */

.doc-main table.ref { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 24px 0 30px; }
.ref th, .ref td { text-align: left; padding: 11px 16px 11px 0; border-top: 1px solid var(--line); vertical-align: top; }
.ref thead th {
  border-top: 0;
  border-bottom: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 9px;
}
.ref tbody th { font-weight: 500; color: var(--ink); width: 30%; }
.ref td { color: var(--body); }

/* ---- index cards ---- */

.doc-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 44px; margin-top: 8px; }
.doc-card { border-top: 1px solid var(--line); padding: 20px 0 22px; }
.doc-card h3 { margin: 0 0 6px; font-family: var(--sans); font-size: 16.5px; font-weight: 600; }
.doc-card h3 a { text-decoration: none; color: var(--ink); }
.doc-card h3 a::after { content: " \2192"; color: var(--muted); font-weight: 400; }
.doc-card h3 a:hover { color: var(--moss); }
.doc-card p { margin: 0; font-size: 14.5px; color: var(--muted); max-width: none; }

/* ---- prev / next ---- */

.doc-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 62px;
  padding-top: 24px;
  border-top: 1px solid var(--ink);
  font-size: 14.5px;
}
.doc-nav a { text-decoration: none; color: var(--ink); font-weight: 500; }
.doc-nav a:hover { color: var(--moss); }
.doc-nav .next { margin-left: auto; }

@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; gap: 0; }
  .doc-side {
    position: static;
    max-height: none;
    padding: 26px 0 0;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 22px;
  }
  .doc-side ul { display: flex; flex-wrap: wrap; gap: 0 4px; }
  .doc-side a { border-left: 0; padding: 4px 12px 4px 0; }
  .doc-side a.here { border-left: 0; }
  .doc-main { padding-top: 34px; }
  .doc-main h1 { font-size: 31px; }
  .doc-split { grid-template-columns: 1fr; gap: 20px; }
  .docshots { grid-template-columns: repeat(2, 1fr); }
  .doc-cards { grid-template-columns: 1fr; }
  .doc-header nav > a:not(.home) { display: none; }
}

@media (max-width: 560px) {
  .docshots { grid-template-columns: 1fr; max-width: 300px; }
}
