/* =========================================================
   shared.css — theme-independent base styles + print rules
   Applied to all tailored resumes; per-theme CSS extends this.

   Design notes (post-review):
   - Semibold (600) headings base; themes override h1 to bold
   - Small-caps treatment for h2 lives in themes (classic = small-caps serif,
     modern/builder = uppercase sans)
   - `body.compact` is the escape hatch for content overflow (spec §4.8)
   - Print rules lock @page to Letter @ 0.6in
   ========================================================= */

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  color: #1a1a1a;
  line-height: 1.22;
  max-width: 8.5in;
  width: 100%;
  margin: 0 auto;
  padding: 0.6in;
}

@media screen {
  body {
    -webkit-font-smoothing: antialiased;
  }
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: 1.15;
  color: inherit;
}

h1 {
  font-size: 20pt;
  font-weight: 700;
  margin-bottom: 0;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 10.5pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 0.75pt solid #888;
  padding-bottom: 2pt;
  margin-top: 9pt;
  margin-bottom: 4pt;
  orphans: 3;
  widows: 3;
}

h3 {
  font-size: 10.5pt;
  font-weight: 700;
  margin-top: 5pt;
  margin-bottom: 0;
}

h4 {
  font-size: 10pt;
  font-weight: 600;
  margin-top: 3pt;
  margin-bottom: 0;
}

p.tagline {
  font-size: 9.5pt;
  color: #555;
  font-weight: 400;
  margin: 0 0 3pt 0;
  letter-spacing: 0.01em;
}

p.portfolio-cta {
  font-size: 10pt;
  color: #1a1a1a;
  margin: 3pt 0 0 0;
  letter-spacing: 0.01em;
}
p.portfolio-cta strong {
  font-weight: 600;
}
p.portfolio-cta a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

p {
  margin: 0 0 3pt 0;
  font-size: 10.5pt;
}

p:last-child {
  margin-bottom: 0;
}

p.meta {
  font-size: 9.5pt;
  color: #444;
  margin-bottom: 2pt;
}

p.dates {
  font-size: 9.5pt;
  color: #555;
  margin-bottom: 2pt;
  font-variant-numeric: tabular-nums;
}

p.meta + ul,
p.dates + ul,
p.meta + .role,
.role + .role {
  margin-top: 3pt;
}

ul {
  margin: 2pt 0 0 0;
  padding-left: 12pt;
  list-style-type: disc;
}

li {
  font-size: 10.5pt;
  margin-bottom: 3pt;
  orphans: 2;
  widows: 2;
}

li::marker {
  color: #999;
}

header {
  margin-bottom: 8pt;
}

address {
  font-style: normal;
  font-size: 9.5pt;
  color: #333;
}

address a {
  color: inherit;
  text-decoration: none;
}

address .sep {
  margin: 0 4pt;
  color: #888;
  vertical-align: 0.05em;
}

section {
  margin-bottom: 0;
  break-inside: auto;
}

section:last-child {
  margin-bottom: 0;
}

article {
  margin-bottom: 2pt;
  break-inside: avoid;
  page-break-inside: avoid;
}

.role {
  margin-top: 2pt;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Screen-only link affordances */
@media screen {
  article a:hover,
  article a:focus,
  address a:hover,
  address a:focus {
    text-decoration: underline;
    text-underline-offset: 2px;
    outline: none;
  }
  article li a[href^="http"] {
    text-decoration: underline;
    text-decoration-color: #ccc;
    text-underline-offset: 2px;
  }
}

/* Compact escape hatch for content overflow (spec §4.8) */
body.compact {
  font-size: 10pt;
  line-height: 1.18;
}
body.compact p,
body.compact li {
  font-size: 10pt;
}
body.compact h3 {
  margin-top: 4pt;
}
body.compact h4 {
  margin-top: 2pt;
}
body.compact h2 {
  margin-top: 5pt;
  margin-bottom: 2pt;
}
body.compact .role {
  margin-top: 0;
}
body.compact p.tagline {
  margin-bottom: 2pt;
}
body.compact li {
  margin-bottom: 2pt;
}
body.compact article {
  margin-bottom: 1pt;
}

/* PRINT — locks @page size and pagination behavior */
@page {
  size: letter;
  margin: 0.6in;
}

@media print {
  body {
    padding: 0;
    max-width: none;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  /* Keep link affordance on in-bullet URLs — readers on paper need to notice them */
  article li a[href^="http"] {
    text-decoration: underline;
    text-decoration-skip-ink: auto;
    text-underline-offset: 2px;
  }
  li, article, .role {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  h2, h3, h4 {
    break-after: avoid;
    page-break-after: avoid;
  }
}
