/* Field Notes: technical reports, sharing the Field Manual's layout */

.doc-figure {
  margin: 1.6em 0 2em;
  padding: 12px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.doc-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.doc-figure figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notes-list li {
  margin: 0 0 22px;
  padding: 18px 22px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.notes-list .note-date {
  font-family: var(--font-tech);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
}

.notes-list h3 {
  margin: 6px 0 8px;
}

/* ---------------------------------------------------------------
   Paper typography (FNS-1 section 8a). Scoped to Field Notes only.
   --------------------------------------------------------------- */

/* Hero: proportional dek, balanced lines */
.doc-hero h1,
.doc-hero h2 {
  text-wrap: balance;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.doc-hero h2 {
  font-family: var(--font-main);
  letter-spacing: 0;
  line-height: 1.45;
  font-weight: 400;
}

/* Reading measure and rhythm */
.doc-content {
  max-width: 72ch;
  font-size: 1.06rem;
  line-height: 1.72;
  color: #b9c7bd;
  hyphens: auto;
  font-variant-numeric: oldstyle-nums proportional-nums;
}

.doc-content p {
  margin: 0 0 1.05em;
  text-wrap: pretty;
}

.doc-content h2 {
  margin: 2.6em 0 0.6em;
  line-height: 1.25;
  padding-top: 0.6em;
  border-top: 1px solid var(--border-color);
  scroll-margin-top: 24px;
}

.doc-content > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.doc-content h3 {
  margin: 1.8em 0 0.4em;
  line-height: 1.3;
}

.doc-content h2 + p,
.doc-content h3 + p {
  margin-top: 0;
}

.doc-content li {
  margin-bottom: 0.45em;
}

.doc-content li > p {
  margin: 0;
}

/* Inline code: no rhythm break */
.doc-content code {
  padding: 0 0.3em;
  font-size: 0.86em;
  line-height: 1;
  border-color: rgba(42, 66, 50, 0.7);
  white-space: nowrap;
}

.doc-content pre code {
  white-space: pre;
  line-height: 1.5;
}

/* Wide elements may exceed the measure */
.doc-content pre,
.doc-content .doc-figure,
.doc-content .table-wrap,
.doc-content table {
  max-width: min(100%, 92ch);
}

/* Figures: caption under the frame, clearly a caption */
.doc-figure {
  margin: 1.8em 0 2.2em;
}

.doc-figure pre {
  margin: 0;
}

.doc-figure figcaption {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  font-size: 0.86rem;
  line-height: 1.55;
  color: #a3b5a8;
}

/* Table caption paragraph: any paragraph that starts "Table N." */
.doc-content p.table-caption,
.doc-content caption {
  font-size: 0.86rem;
  line-height: 1.55;
  color: #a3b5a8;
  margin: 1.8em 0 0.5em;
  caption-side: top;
  text-align: left;
}

/* Booktabs tables */
.doc-content table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0.4em 0 2em;
  font-variant-numeric: lining-nums tabular-nums;
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
}

.doc-content th,
.doc-content td {
  border: 0;
  padding: 7px 12px;
}

.doc-content thead th {
  font-family: var(--font-main);
  font-weight: 600;
  background: transparent;
  color: var(--text-main);
  border-bottom: 1px solid var(--accent);
  white-space: nowrap;
  vertical-align: bottom;
}

.doc-content tr:nth-child(even) td {
  background: rgba(23, 42, 31, 0.35);
}

.doc-content td.num,
.doc-content th.num {
  text-align: right;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

/* TOC: clearer item separation, wrapped lines hang */
.doc-toc li {
  margin: 0;
  padding: 5px 0 5px 10px;
  border-left: 2px solid transparent;
  line-height: 1.35;
}

.doc-toc li:hover {
  border-left-color: var(--accent);
}

/* Sources list */
.doc-content h2#sources ~ ul li {
  font-size: 0.94rem;
}

@media (max-width: 900px) {
  .doc-content {
    max-width: none;
    font-size: 1rem;
  }
  .doc-content table {
    display: block;
    overflow-x: auto;
  }
  .doc-content thead th {
    white-space: normal;
  }
}

@media print {
  .doc-hero,
  .doc-toc,
  .doc-pager,
  footer {
    display: none;
  }
  .doc-content {
    max-width: none;
    color: #111;
    font-size: 11pt;
  }
}

.sw-links {
  font-family: var(--font-tech);
  font-size: 0.85rem;
}
