/* Mesh networking link directory — print-friendly (US Letter, 1" margins) */

:root {
  --text: #111;
  --muted: #444;
  --rule: #ddd;
  --link: #0645ad;
  --bg: #fff;
}

* { box-sizing: border-box; }

html, body {
  padding: 0;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.45;
}

.container {
  max-width: 980px;
  padding: 24px;
  margin: 0 auto;
}

.header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 6px 0;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.toc {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 16px 0 18px 0;
}

.toc h2 {
  font-size: 1.05rem;
  margin: 0 0 8px 0;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
}

.toc li {
  margin: 4px 0;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.topic {
  margin: 18px 0 22px 0;
  padding-top: 6px;
  border-top: 1px solid var(--rule);
}

.topic:first-of-type {
  border-top: none;
  padding-top: 0;
}

h2 {
  font-size: 1.25rem;
  margin: 0 0 10px 0;
}

.resource {
  padding: 10px 0 12px 0;
  border-top: 1px dashed var(--rule);
}

.resource:first-of-type {
  border-top: none;
}

h3 {
  font-size: 1.05rem;
  margin: 0 0 6px 0;
}

.meta {
  margin: 0 0 8px 0;
  color: var(--muted);
}

.label {
  font-weight: 600;
  color: var(--text);
}

.url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.verified {
  margin-left: 10px;
  font-size: 0.92em;
  color: var(--muted);
}

.desc {
  margin: 0;
}

.footer {
  border-top: 1px solid var(--rule);
  margin-top: 22px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.95em;
}

@media print {
  @page {
    size: Letter;
    margin: 1in;
  }

  .container {
    max-width: 6.5in; /* Letter width (8.5) minus 2" margins = 6.5" */
    padding: 0;
  }

  .toc {
    break-inside: avoid;
  }

  .topic, .resource {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  /* Keep full URLs readable on paper */
  .url {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
