/* Internetforce 1995–1996 — shared presentation stylesheet
   Static, framework-free, system fonts only. */

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #1c1c1a;
  --ink-soft: #565650;
  --line: #d9d6cd;
  --line-strong: #b9b5a8;
  --accent: #7a1f1a;        /* understated historic red */
  --accent-ink: #6a1a16;
  --cfg-bg: #f1efe9;
  --cfg-line: #cec9bc;
  --assoc-bg: #f3f1ea;
  --assoc-line: #ddd8cb;
  --radius: 6px;
  --wrap: 62rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.15rem; }

a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* Header */
.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.head-inner {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem;
  align-items: baseline; justify-content: space-between;
  padding-top: .7rem; padding-bottom: .7rem;
}
.brand { margin: 0; font-weight: 700; letter-spacing: .01em; }
.brand a { color: var(--ink); text-decoration: none; }
.brand .years { color: var(--ink-soft); font-weight: 400; }
.lang { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.lang .current { font-weight: 700; color: var(--ink); }
.lang .sep { color: var(--line-strong); }
.site-head .sep { color: var(--line-strong); }

/* Main */
main { padding-top: 1.6rem; padding-bottom: 3rem; }

.eyebrow {
  margin: 0 0 .25rem;
  text-transform: uppercase; letter-spacing: .09em;
  font-size: .74rem; color: var(--ink-soft);
}
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 .5rem; line-height: 1.15; }
h1 .host { color: var(--ink-soft); font-weight: 400; font-size: .62em; }
h2 { font-size: 1.22rem; margin: 2rem 0 .6rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.03rem; margin: 1.3rem 0 .4rem; }
.lede { font-size: 1.08rem; color: #2c2c28; margin: .2rem 0 1.4rem; }
.muted { color: var(--ink-soft); font-size: .94rem; }
.note { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
        border-radius: var(--radius); padding: .7rem .9rem; font-size: .94rem; color: #33332e; }

/* Figures */
figure.system { margin: 0 0 1.4rem; }
figure.system img {
  max-width: 100%; height: auto; display: block;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
figcaption { margin-top: .45rem; font-size: .84rem; color: var(--ink-soft); }
.policy-img { max-width: 100%; height: auto; }

/* Identity list */
.identity {
  margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem 1rem; font-size: .96rem;
}
.identity dt { font-weight: 600; color: var(--ink-soft); }
.identity dd { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
       font-size: .88em; background: #efede7; padding: .05em .35em; border-radius: 3px; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: .4rem 0 .8rem; }
table { border-collapse: collapse; width: 100%; min-width: 44rem; background: var(--surface); font-size: .93rem; }
caption { text-align: left; }
th, td { border: 1px solid var(--line); padding: .5rem .6rem; text-align: left; vertical-align: top; }
thead th { background: #efece4; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tbody th[scope="row"] { font-weight: 600; white-space: nowrap; }
.col-cfg, .col-doc { word-break: break-word; }

/* Config links: monospace "chip"; doc links: plain text link.
   Distinction is structural (font + border), not colour-only. */
a.cfg {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .84em; white-space: nowrap;
  background: var(--cfg-bg); border: 1px solid var(--cfg-line); border-radius: 4px;
  padding: .06em .4em; text-decoration: none;
}
a.cfg::before { content: "⌗ "; color: var(--ink-soft); }
a.cfg:hover { border-color: var(--line-strong); background: #eae7df; }
a.doc { text-decoration: underline; text-decoration-thickness: 1px; }
a.doc::before { content: "§ "; color: var(--ink-soft); }  /* markers are textual, not colour-only */
.sep { color: var(--line-strong); }

/* Associated material block */
.associated {
  background: var(--assoc-bg); border: 1px solid var(--assoc-line);
  border-radius: var(--radius); padding: .4rem 1rem 1rem; margin-top: 2rem;
}
.associated h2 { border-bottom-color: var(--assoc-line); }

/* Call to action (global: host pages and landing page) */
.button {
  display: inline-block; background: var(--accent-ink); color: #fff;
  text-decoration: none; font-weight: 600; padding: .6rem 1rem; border-radius: var(--radius);
}
.button:hover { background: var(--accent); color: #fff; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: .86rem; }
.site-foot p { margin: 0; padding: .9rem 0; }

/* Viewer nav + file path */
.viewer-nav { margin: 0; font-size: .95rem; }
.viewer-nav .backlink { text-decoration: none; font-weight: 600; }
.viewer-nav .backlink:hover { text-decoration: underline; }
#filepath { text-transform: none; letter-spacing: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }

/* Rendered Markdown (details.html) */
.md-body { overflow-x: auto; }
.md-body > :first-child { margin-top: 0; }
.md-body h1 { font-size: clamp(1.5rem, 3.4vw, 2rem); }
.md-body h2 { margin-top: 1.8rem; }
.md-body h3 { margin-top: 1.3rem; }
.md-body p, .md-body li { line-height: 1.65; }
.md-body ul, .md-body ol { padding-left: 1.4rem; }
.md-body li { margin: .2rem 0; }
.md-body img { max-width: 100%; height: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.md-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.6rem 0; }
.md-body blockquote {
  margin: 1rem 0; padding: .4rem 1rem; color: #33332e;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: var(--radius);
}
.md-body blockquote p { margin: .4rem 0; }
.md-body pre {
  background: #efede7; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem 1rem; overflow-x: auto; font-size: .86rem; line-height: 1.5;
}
.md-body pre code { background: none; padding: 0; font-size: 1em; }
.md-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.md-body table { min-width: 0; width: auto; max-width: 100%; font-size: .9rem; }
.md-body table th, .md-body table td { padding: .35rem .55rem; }
.md-body a { text-underline-offset: 2px; }

.md-body .rawlink { margin: .3rem 0 .9rem; font-size: .92rem; }
.md-body .rawlink::before { content: "↗ "; color: var(--ink-soft); }
.md-body .doc-title { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: clamp(1.3rem, 3vw, 1.7rem); }

/* Viewer error state */
.viewer-error {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin: .5rem 0;
}
.viewer-error h1 { font-size: 1.25rem; margin: 0 0 .4rem; }

/* Secondary landing-page links (historical/cultural context) */
.secondary { margin-top: 2.2rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.secondary h2 { font-size: 1.05rem; }
.secondary ul { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .95rem; color: #33332e; }
.secondary li { margin: .2rem 0; }

/* Interactive maps */
.map-wrap {
  position: relative; margin: 1rem 0 .4rem; line-height: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  overflow: hidden; background: var(--surface);
}
.map-wrap img { display: block; width: 100%; height: auto; }
.map-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.hotspot { cursor: pointer; outline: none; }
.hotspot rect { fill: transparent; stroke: transparent; stroke-width: 2; transition: fill .12s ease, stroke .12s ease; }
.hotspot:hover rect { fill: rgba(122, 31, 26, .12); stroke: rgba(122, 31, 26, .75); }
.hotspot:focus { outline: none; }
.hotspot:focus rect,
.hotspot:focus-visible rect { fill: rgba(122, 31, 26, .18); stroke: var(--accent); stroke-width: 3; }
.map-overlay.debug .hotspot rect { fill: rgba(10, 88, 168, .18); stroke: #0a58a8; stroke-width: 2; }
.debug-label { font: 600 18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; fill: #0a58a8; pointer-events: none; }
.interaction-note { font-size: .95rem; color: var(--ink-soft); margin: .2rem 0 .8rem; }
.map-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: 1.4rem;
           border-top: 1px solid var(--line); padding-top: .9rem; font-size: .95rem; }
.legend p { font-size: .95rem; color: #33332e; }

/* Reverse links ("On the maps") in host pages */
.maps .maplinks { list-style: none; padding: 0; margin: .2rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }

/* Landing page map cards */
.map-cards { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: 1rem;
             grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.map-cards a { display: block; background: var(--surface); border: 1px solid var(--line);
               border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; }
.map-cards a:hover { border-color: var(--line-strong); }
.map-cards a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.map-cards img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--line); }
.map-cards .cardbody { display: block; padding: .6rem .8rem; }
.map-cards strong { display: block; }
.map-cards small { display: block; color: var(--ink-soft); line-height: 1.4; margin-top: .2rem; }

/* Narrow screens */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .identity { grid-template-columns: 1fr; gap: 0; }
  .identity dt { margin-top: .5rem; }
  .identity dd { margin-bottom: .2rem; }
  table { min-width: 40rem; }
}
