/* Resume page templates, shared by the live preview and printing. */
.resume-page {
  --r-ink: #1c2127;
  --r-muted: #5b6470;
  --r-rule: color-mix(in srgb, var(--r-accent) 38%, white);
  --r-tint: color-mix(in srgb, var(--r-accent) 7%, white);
  --r-gap: calc(1.15em * var(--r-space));
  --r-item-gap: calc(0.75em * var(--r-space));
  box-sizing: border-box;
  width: var(--r-page-width);
  min-height: var(--r-page-height);
  padding: var(--r-margin);
  background: #fff;
  color: var(--r-ink);
  font-family: var(--r-font);
  font-size: var(--r-size);
  line-height: 1.42;
  letter-spacing: 0;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.resume-page *, .resume-page *::before, .resume-page *::after { box-sizing: border-box; }
.resume-page h1, .resume-page h2, .resume-page h3, .resume-page p, .resume-page ul { margin: 0; padding: 0; }
.resume-page a { color: inherit; text-decoration: none; }
.resume-page strong { font-weight: 650; }

.r-header { margin-bottom: var(--r-gap); }
.r-name { font-size: 2.25em; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
.r-headline { margin-top: 0.2em; color: var(--r-accent); font-size: 1.15em; font-weight: 550; }
.r-contact { margin-top: 0.55em; color: var(--r-muted); font-size: 0.92em; }
.r-contact span + span::before { content: "·"; margin: 0 0.55em; color: var(--r-rule); }
.r-contact-stacked { list-style: none; display: grid; gap: 0.3em; overflow-wrap: anywhere; }

.r-section { margin-top: var(--r-gap); }
.r-section:first-of-type { margin-top: 0; }
.r-section-title {
  margin-bottom: 0.55em;
  color: var(--r-accent);
  font-size: 0.86em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  break-after: avoid;
}
.r-section-body { display: grid; gap: var(--r-item-gap); }

.r-entry, .r-group, .r-pair { break-inside: avoid; }
.r-entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; }
.r-entry-main { min-width: 0; }
.r-entry h3, .r-group h3 { font-size: 1.04em; font-weight: 650; }
.r-meta { color: var(--r-muted); }
.r-dates { flex: none; color: var(--r-muted); font-size: 0.92em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.r-body { margin-top: 0.3em; }
.r-section-title + .r-section-body > .r-body { margin-top: 0; }
.r-body p + p, .r-body p + ul, .r-body ul + p { margin-top: 0.3em; }
.r-body ul { padding-left: 1.15em; }
.r-body li { padding-left: 0.15em; }
.r-body li + li { margin-top: 0.18em; }
.r-body li::marker { color: var(--r-accent); }

.r-group { display: flex; gap: 0.4em; flex-wrap: wrap; align-items: baseline; }
.r-group h3::after { content: ":"; }
.r-tags { list-style: none; display: inline; }
.r-tags li { display: inline; }
.r-tags li + li::before { content: ", "; }
.r-pair { display: flex; justify-content: space-between; gap: 1em; }
.r-pair-name { font-weight: 600; }
.r-pair-detail { color: var(--r-muted); text-align: right; }
.r-layout-groups .r-section-body, .r-layout-pairs .r-section-body { gap: calc(0.35em * var(--r-space)); }

/* Classic: centred header, ruled section titles. */
.r-template-classic .r-header { text-align: center; }
.r-template-classic .r-name { letter-spacing: 0.02em; }
.r-template-classic .r-section-title { padding-bottom: 0.25em; border-bottom: 1px solid var(--r-rule); }

/* Modern: strong left-aligned header with an accent bar. */
.r-template-modern .r-header { padding-bottom: 0.9em; border-bottom: 2.5px solid var(--r-accent); }
.r-template-modern .r-name { font-size: 2.5em; font-weight: 750; letter-spacing: -0.025em; }
.r-template-modern .r-section-title { display: flex; align-items: center; gap: 0.6em; }
.r-template-modern .r-section-title::after { content: ""; flex: 1; height: 1px; background: var(--r-rule); }
.r-template-modern .r-group, .r-template-sidebar .r-group { display: block; }
.r-template-modern .r-group h3::after, .r-template-sidebar .r-group h3::after { content: none; }
.r-template-modern .r-tags, .r-template-sidebar .r-tags { display: flex; flex-wrap: wrap; gap: 0.3em; margin-top: 0.3em; }
.r-template-modern .r-tags li + li::before, .r-template-sidebar .r-tags li + li::before { content: none; }
.r-template-modern .r-tags li, .r-template-sidebar .r-tags li {
  padding: 0.12em 0.55em;
  border: 1px solid var(--r-rule);
  border-radius: 999px;
  font-size: 0.9em;
}

/* Sidebar: contacts, skills and short lists in a tinted column. */
.r-template-sidebar .r-header { padding-bottom: 0.8em; border-bottom: 1px solid var(--r-rule); }
.r-template-sidebar .r-columns { display: grid; grid-template-columns: 31% 1fr; gap: 6mm; align-items: start; }
.r-template-sidebar .r-side { padding: 4mm; border-radius: 2mm; background: var(--r-tint); font-size: 0.94em; }
.r-template-sidebar .r-side .r-section:first-child, .r-template-sidebar .r-main .r-section:first-child { margin-top: 0; }
.r-template-sidebar .r-side .r-pair { display: block; }
.r-template-sidebar .r-side .r-pair-detail { display: block; text-align: left; }
.r-template-sidebar .r-tags li { background: #fff; }

/* Compact: section titles in a left gutter for dense one-page resumes. */
.r-template-compact { line-height: 1.34; }
.r-template-compact .r-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 2em; padding-bottom: 0.7em; border-bottom: 1px solid var(--r-rule); }
.r-template-compact .r-name { font-size: 1.9em; }
.r-template-compact .r-contact { margin-top: 0; text-align: right; font-size: 0.9em; }
.r-template-compact .r-contact span { display: block; }
.r-template-compact .r-contact span + span::before { content: none; }
.r-template-compact .r-section { display: grid; grid-template-columns: 26mm 1fr; gap: 4mm; }
.r-template-compact .r-section-title { margin: 0.12em 0 0; font-size: 0.8em; }

/* Cover letters share the resume's typography and header, with a full-width body. */
.r-cover-letter { overflow-wrap: anywhere; }
.r-cover-letter .r-header { margin-bottom: calc(1.6em * var(--r-space)); }
.r-letter-date, .r-letter-recipient, .r-letter-subject, .r-letter-salutation { margin-bottom: var(--r-gap) !important; }
.r-letter-recipient { line-height: 1.5; }
.r-letter-subject { color: var(--r-accent); font-size: 1.1em; font-weight: 650; break-after: avoid; }
.r-letter-salutation { break-after: avoid; }
.r-letter-body { margin-top: 0; }
.r-letter-body p, .r-letter-body li { orphans: 2; widows: 2; }
.r-letter-body p + p, .r-letter-body p + ul, .r-letter-body ul + p { margin-top: calc(0.9em * var(--r-space)); }
.r-letter-signoff { margin-top: calc(1.6em * var(--r-space)); break-inside: avoid; }
.r-letter-signature { margin-top: 0.5em !important; font-weight: 650; }

@media print {
  .resume-page { width: auto; min-height: 0; padding: 0; }
}
