/* ============================================================
   DOCUMENT PAGE STYLES (Resume + CV)
   Shared layout for academic/professional document pages
   ============================================================ */

/* --- Document container --- */
.document {
  padding-top: var(--space-2xl, 3rem);
}

/* Tighter section variant for the download bar */
.section--tight {
  padding-top: var(--space-lg, 1.5rem);
  padding-bottom: var(--space-lg, 1.5rem);
}

/* --- Download bar --- */
.document__download-bar {
  background: var(--color-surface-warm, #faf6ee);
  border-top: 1px solid var(--color-rule, rgba(0,0,0,0.08));
  border-bottom: 1px solid var(--color-rule, rgba(0,0,0,0.08));
}

.document__download-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md, 1rem);
  flex-wrap: wrap;
}

.document__download-bar-text {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--color-text-muted, #6b6258);
  margin: 0;
  font-size: var(--text-base);
}

@media (max-width: 640px) {
  .document__download-bar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- Definition lists (Education) --- */
.document__list {
  margin: 0 0 var(--space-md, 1rem) 0;
}

.document__list dt {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-text, #2a2520);
  margin-top: var(--space-sm, 0.75rem);
  font-size: var(--text-base);
}

.document__list dt:first-child {
  margin-top: 0;
}

.document__list dd {
  margin-left: 0;
  margin-bottom: var(--space-xs, 0.5rem);
  color: var(--color-text, #2a2520);
  font-size: var(--text-base);
  padding-left: var(--space-md, 1rem);
  border-left: 2px solid var(--color-accent, #c9a84c);
}

.document__detail {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--color-text-muted, #6b6258);
  font-size: var(--text-sm);
  font-style: italic;
}

/* --- Role blocks (Appointments) --- */
.document__role {
  margin-bottom: var(--space-xl, 2rem);
}

.document__role:last-child {
  margin-bottom: 0;
}

.document__role-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-text, #2a2520);
  margin-bottom: var(--space-xs, 0.5rem);
  letter-spacing: var(--tracking-tight, -0.01em);
}

.document__role-meta {
  font-family: var(--font-body);
  color: var(--color-text-muted, #6b6258);
  margin-bottom: var(--space-sm, 0.75rem);
  font-size: var(--text-base);
  font-style: italic;
}

/* --- Bulleted lists --- */
.document__bullets {
  list-style: none;
  padding-left: 0;
  margin: 0 0 var(--space-md, 1rem) 0;
}

.document__bullets li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text, #2a2520);
  line-height: var(--leading-normal, 1.6);
  font-size: var(--text-base);
}

.document__bullets li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent, #c9a84c);
}

/* --- Subheads --- */
.document__subhead {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text, #2a2520);
  margin-top: var(--space-lg, 1.5rem);
  margin-bottom: var(--space-xs, 0.5rem);
  letter-spacing: var(--tracking-tight, -0.01em);
}

.document__subhead:first-child {
  margin-top: 0;
}

/* --- Lede paragraph --- */
.document__lede {
  font-family: var(--font-accent);
  font-size: var(--text-lg);
  color: var(--color-text-muted, #6b6258);
  margin-bottom: var(--space-md, 1rem);
}

/* --- Pillared / inline list --- */
.document__pillared {
  font-size: var(--text-base);
  color: var(--color-text, #2a2520);
  margin-bottom: var(--space-sm, 0.75rem);
  line-height: var(--leading-relaxed, 1.7);
}

.document__pillared:last-child {
  margin-bottom: 0;
}

/* --- Minor heading (inside a role block) --- */
.document__minor-head {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide, 0.08em);
  text-transform: uppercase;
  color: var(--color-text-muted, #6b6258);
  margin: var(--space-md, 1rem) 0 var(--space-xs, 0.5rem);
}

/* --- Dated list: entry on the left, year on the right --- */
.document__dated {
  list-style: none;
  padding-left: 0;
  margin: 0 0 var(--space-md, 1rem) 0;
}

.document__dated li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-md, 1rem);
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--color-border, rgba(0,0,0,0.08));
  font-size: var(--text-base);
  line-height: var(--leading-normal, 1.6);
  color: var(--color-text, #2a2520);
}

.document__dated li:last-child {
  border-bottom: 0;
}

.document__dated-when {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted, #6b6258);
  white-space: nowrap;
  text-align: right;
}

/* --- Roles table (Complete CV) --- */
.document__table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-sm, 0.75rem);
  font-size: var(--text-sm);
}

.document__table th {
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted, #6b6258);
  border-bottom: 1px solid var(--color-accent, #c9a84c);
  padding: 0.4rem 0.5rem 0.4rem 0;
}

.document__table td {
  padding: 0.4rem 0.5rem 0.4rem 0;
  border-bottom: 1px solid var(--color-border, rgba(0,0,0,0.08));
  vertical-align: top;
  color: var(--color-text, #2a2520);
}

.document__table td:last-child,
.document__table th:last-child {
  text-align: right;
  white-space: nowrap;
  padding-right: 0;
}

@media (max-width: 640px) {
  .document__table th:nth-child(3),
  .document__table td:nth-child(3) {
    display: none;
  }
}

/* --- Three-column name lists --- */
.document__columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md, 1rem);
}

@media (min-width: 768px) {
  .document__columns {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Print-only header (name + contact for the PDF) --- */
.document__print-header {
  display: none;
}

/* --- Print styles --- */
@media print {
  @page {
    size: letter;
    margin: 0.6in 0.7in;
  }

  .site-header,
  .site-footer,
  .page-hero,
  .document__download-bar,
  .bio-cta,
  .skip-link {
    display: none;
  }

  .document__print-header {
    display: block;
    text-align: center;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1.5px solid var(--color-accent, #c9a84c);
  }

  .document .document__print-name {
    font-family: var(--font-display);
    font-size: 22pt;
    margin: 0;
    color: #000;
  }

  .document .document__print-sub {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 12pt;
    margin: 0;
    color: #444;
  }

  .document .document__print-contact {
    font-size: 9.5pt;
    margin: 0.2rem 0 0;
    color: #444;
  }

  /* Scroll-reveal content must always be visible on paper */
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .document {
    padding-top: 0;
    font-size: 10pt;
  }

  /* Use the full printable width and paper-sized type */
  .document .container,
  .document .container--narrow,
  .document .bio-section__content {
    max-width: none;
    padding-inline: 0;
  }

  .document p,
  .document li {
    max-width: none;
  }

  .document p,
  .document li,
  .document dd,
  .document__pillared,
  .document__dated li,
  .document__bullets li,
  .document__list dt,
  .document__list dd {
    font-size: 10pt;
    line-height: 1.4;
  }

  .document__bullets li {
    margin-bottom: 0.1rem;
    padding-left: 1rem;
  }

  .document__bullets li::before {
    left: 0.1rem;
    top: 0.55em;
    width: 4px;
    height: 4px;
  }

  .document p,
  .document__pillared {
    margin-top: 0;
    margin-bottom: 0.25rem;
  }

  .document__bullets,
  .document__dated,
  .document__list {
    margin-bottom: 0.3rem;
  }

  .document__dated li {
    padding: 0.15rem 0;
  }

  .document__print-header p {
    max-width: none;
  }

  .bio-section {
    padding: 0.35rem 0;
    background: none !important;
  }

  /* Keep headings with what follows: an invisible spacer must also fit on the
     page, otherwise the heading moves to the next page (Chrome ignores
     break-after: avoid). The negative margin cancels the spacer's height. */
  .bio-section__header,
  .document__subhead,
  .document__minor-head,
  .document__role-title {
    break-inside: avoid;
  }

  .bio-section__header::after {
    content: "";
    display: block;
    height: 1.1in;
    margin-bottom: -1.1in;
  }

  .document__subhead::after,
  .document__role-title::after {
    content: "";
    display: block;
    height: 0.7in;
    margin-bottom: -0.7in;
  }

  /* Very long role blocks (with course lists) may split across pages */
  .document__role:has(.document__minor-head) {
    break-inside: auto;
  }

  /* Keep each section heading with the first lines of its content */
  .bio-section__content {
    break-before: avoid;
  }

  .bio-section__content > :first-child,
  .document__subhead + *,
  .document__minor-head + *,
  .document__role-meta + * {
    break-before: avoid;
  }

  .document__table {
    font-size: 9.5pt;
  }

  .document__table th,
  .document__table td {
    padding: 0.15rem 0.5rem 0.15rem 0;
  }

  .document__table thead {
    display: table-header-group;
  }

  .bio-section__header {
    break-after: avoid;
    margin-bottom: 0.3rem;
  }

  .bio-section__header h2 {
    font-size: 14pt;
    margin: 0;
  }

  .bio-section__header .gold-rule {
    margin: 0.2rem 0 0;
  }

  .document__role {
    margin-bottom: 0.6rem;
  }

  .document__role-title {
    font-size: 11.5pt;
    margin-bottom: 0.1rem;
  }

  .document__role-meta {
    font-size: 10pt;
    margin-bottom: 0.25rem;
  }

  .document__subhead {
    font-size: 11pt;
    margin-top: 0.5rem;
    margin-bottom: 0.15rem;
  }

  .document__list dt {
    margin-top: 0.3rem;
  }

  .document__list dd {
    margin-bottom: 0.2rem;
  }

  .document__role,
  .document__dated li,
  .document__table tr,
  .document__list dt {
    break-inside: avoid;
  }

  .document__subhead,
  .document__minor-head {
    break-after: avoid;
  }

  body {
    background: #fff;
    color: #000;
  }
}
