/* ============================================================
   phbeks document style — print-first, professional, US Letter.
   Derived from resume.phbeks.com/resume-print.html, generalized
   for prose/policy documents (headings, lists, tables).
   Reusable: link this stylesheet from any standalone doc page.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: light;
  --ink:        #14181f;
  --ink-soft:   #3a414b;
  --ink-mute:   #6b7280;
  --rule:       #c8cdd4;
  --rule-soft:  #e4e7eb;
  --accent:     #0f4c4c;     /* deep teal — prints as legible dark gray */
  --accent-soft:#e6efee;
  --paper:      #ffffff;
  --paper-tint: #f7f8f9;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

@page { size: letter; margin: 0.55in 0.6in; }

html { background: #eef0f2; }

body {
  background: #eef0f2;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11pt;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Page container (a "paper" sheet on screen, untouched in print) ── */
.sheet {
  background: var(--paper);
  max-width: 8.5in;
  margin: 24px auto;
  padding: 0.7in 0.75in;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
  border-radius: 2px;
}

/* ── On-screen toolbar ── */
.toolbar {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 50;
}
.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 9px 14px;
  border-radius: 6px;
  font: 600 12px/1 var(--sans);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transition: transform .12s ease, background .12s ease;
}
.tb-btn:hover { transform: translateY(-1px); background: var(--accent); }
.tb-btn.secondary {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.tb-btn.secondary:hover { background: var(--paper-tint); color: var(--ink); }

/* ── Document header ── */
.doc-head {
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 18px;
}
.doc-head h1 {
  font-size: 24pt;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  border: none;
}
.doc-meta {
  font-size: 9.5pt;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-top: 8px;
}
.doc-meta .label { color: var(--ink-mute); font-family: var(--mono); font-size: 8.5pt; }

/* ── Section headings ── */
h2 {
  font-size: 11pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule);
  margin: 24px 0 10px;
}
h3 {
  font-size: 11pt;
  font-weight: 600;
  color: var(--ink);
  margin: 16px 0 6px;
}

/* ── Prose ── */
p { margin: 0 0 10px; color: var(--ink-soft); }
strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { margin: 0 0 10px; padding-left: 22px; color: var(--ink-soft); }
li { margin: 4px 0; line-height: 1.5; }
li > ul, li > ol { margin: 4px 0; }

code {
  font-family: var(--mono);
  font-size: 9.5pt;
  background: var(--paper-tint);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  padding: 1px 4px;
  color: var(--ink);
}

hr { border: none; border-top: 1px solid var(--rule-soft); margin: 16px 0; }

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 10pt;
}
thead th {
  text-align: left;
  font-size: 8.5pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  border-bottom: 2px solid var(--rule);
  padding: 6px 10px;
}
td {
  border-bottom: 1px solid var(--rule-soft);
  padding: 7px 10px;
  color: var(--ink-soft);
  vertical-align: top;
  line-height: 1.45;
}
tbody tr:nth-child(even) { background: var(--paper-tint); }

/* ── Footer ── */
.doc-foot {
  text-align: center;
  margin-top: 22px;
  padding-top: 10px;
  border-top: 1px solid var(--rule-soft);
  font-size: 8.5pt;
  color: var(--ink-mute);
  font-family: var(--mono);
}

/* ============================================================
   PRINT RULES
   ============================================================ */
@media print {
  html, body { background: #fff !important; }
  body { font-size: 10.5pt; }
  .sheet {
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
    max-width: none;
  }
  .toolbar { display: none !important; }

  /* Strip link color; append URLs so the printed page stays useful */
  a { color: var(--ink) !important; text-decoration: none; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: var(--ink-mute);
    font-family: var(--mono);
    word-break: break-all;
  }

  h2, h3 { break-after: avoid; page-break-after: avoid; }
  table, tr { break-inside: avoid; page-break-inside: avoid; }
}

/* ============================================================
   SCREEN ON SMALL VIEWPORTS
   ============================================================ */
@media (max-width: 720px) {
  .sheet { padding: 0.5in 0.45in; margin: 12px; }
  .toolbar { position: static; justify-content: flex-end; padding: 12px 12px 0; }
  table { font-size: 9.5pt; }
  thead th, td { padding: 6px 7px; }
}
