/* ============================================================================
   resume-core.css — THE box model for every themed template.
   Scoped to .resume-page.rc (the shellClass RenderCore registers).

   This file owns ALL geometry: margins, padding, line-heights, font sizes,
   flex rows. It is written once and measured once. A themed template
   (css/template-N.css) may ONLY set the --rc-* custom properties below.

   THAT IS THE WHOLE RULE:
     core owns boxes  →  themes own tokens

   The moment a theme sets a margin/padding/line-height directly, it invents
   geometry the pagination engine has never measured, and you are back to
   hand-calibrating that template. Don't. If a theme genuinely needs a new box,
   add a token here so EVERY theme gets it.

   Defaults below reproduce template-1 (Modern Blue).
   ============================================================================ */

.resume-page.rc {
  /* ── Colour tokens ────────────────────────────────────────────────────── */
  --rc-accent:        #0077b6;   /* headings, name, rules */
  --rc-accent-2:      #00b4d8;   /* section-title underline */
  --rc-text:          #1f2937;   /* body copy */
  --rc-muted:         #6b7280;   /* dates, locations, subtitles */
  --rc-contact:       #374151;
  --rc-sep:           #d1d5db;

  /* ── Type tokens ──────────────────────────────────────────────────────── */
  --rc-font:          'Inter','Segoe UI',Arial,sans-serif;
  --rc-font-head:     var(--rc-font);
  --rc-size-base:     10pt;
  --rc-size-name:     28pt;
  --rc-size-title:    13pt;   /* section titles */
  --rc-size-item:     11pt;   /* company / school / cert name */
  --rc-size-small:    9pt;    /* dates, locations */
  --rc-leading:       1.4;
  --rc-leading-prose: 1.5;

  --rc-title-transform:  uppercase;
  --rc-title-spacing:    0.5pt;
  --rc-title-weight:     700;
  --rc-name-spacing:    -0.5pt;
  --rc-subtitle-style:   italic;

  /* ── Rule tokens ──────────────────────────────────────────────────────── */
  --rc-header-rule:   2pt solid var(--rc-accent);
  --rc-title-rule:    1pt solid var(--rc-accent-2);

  /* ── Spacing tokens (the ONLY geometry a theme may touch) ─────────────── */
  --rc-gap-section:   10pt;   /* between sections */
  --rc-gap-item:      9pt;    /* between jobs / schools / certs */
  --rc-gap-title:     6pt;    /* under a section title */
  --rc-gap-line:      3pt;    /* between bullets */
  --rc-bullet-indent: 18pt;
}

/* ── Page ─────────────────────────────────────────────────────────────────── */
.resume-page.rc .page-content {
  font-family: var(--rc-font);
  font-size:   var(--rc-size-base);
  line-height: var(--rc-leading);
  color:       var(--rc-text);
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.resume-page.rc .resume-header {
  margin-bottom:  var(--rc-gap-section);
  padding-bottom: 6pt;
  border-bottom:  var(--rc-header-rule);
}
.resume-page.rc .resume-header h1 {
  font-family:    var(--rc-font-head);
  font-size:      var(--rc-size-name);
  font-weight:    700;
  color:          var(--rc-accent);
  line-height:    1.1;
  letter-spacing: var(--rc-name-spacing);
  margin-bottom:  5pt;
}
/* contact line: inline text with real spaces between items, so every PDF reader keeps them apart */
.resume-page.rc .contact-info {
  font-size:   var(--rc-size-base);
  color:       var(--rc-contact);
  line-height: 1.5;
}
.resume-page.rc .contact-info span { white-space: nowrap; }
.resume-page.rc .contact-sep { color: var(--rc-sep); margin: 0 11pt; }

/* ── Sections ─────────────────────────────────────────────────────────────── */
/* margin-top only — avoids collapse ambiguity at page boundaries */
.resume-page.rc .section { margin-top: var(--rc-gap-section); margin-bottom: 0; }

.resume-page.rc .section-title {
  font-family:     var(--rc-font-head);
  font-size:       var(--rc-size-title);
  font-weight:     var(--rc-title-weight);
  line-height:     1.2;
  margin-bottom:   var(--rc-gap-title);
  padding-bottom:  3pt;
  border-bottom:   var(--rc-title-rule);
  color:           var(--rc-accent);
  text-transform:  var(--rc-title-transform);
  letter-spacing:  var(--rc-title-spacing);
}

/* ── Entries ──────────────────────────────────────────────────────────────── */
.resume-page.rc .experience-item,
.resume-page.rc .education-item,
.resume-page.rc .certification-item { margin-bottom: var(--rc-gap-item); }

.resume-page.rc .item-header {
  display:         flex;
  justify-content: space-between;
  align-items:     baseline;
  margin-bottom:   2pt;
  width:           100%;
  box-sizing:      border-box;
}
.resume-page.rc .item-header > div:first-child { flex: 1; min-width: 0; }

.resume-page.rc .company-name,
.resume-page.rc .school-name,
.resume-page.rc .cert-name {
  font-size: var(--rc-size-item); font-weight: 700;
  color: var(--rc-text); line-height: 1.2;
}
.resume-page.rc .job-location,
.resume-page.rc .school-location {
  font-size: var(--rc-size-small); color: var(--rc-muted); font-weight: 500;
}
.resume-page.rc .job-title,
.resume-page.rc .degree,
.resume-page.rc .cert-org {
  font-size: var(--rc-size-base); font-weight: 600; color: var(--rc-muted);
  font-style: var(--rc-subtitle-style); line-height: 1.3; margin-bottom: 3pt;
}
.resume-page.rc .date-range {
  font-size: var(--rc-size-small); color: var(--rc-muted);
  white-space: nowrap; font-weight: 600; flex-shrink: 0; margin-left: 8pt;
}
.resume-page.rc .credential-id {
  font-size: var(--rc-size-small); color: var(--rc-muted); margin-top: 2pt;
}

/* ── Bullets ──────────────────────────────────────────────────────────────── */
.resume-page.rc .achievement-list {
  margin: var(--rc-gap-line) 0 0 0;
  padding: 0 0 0 var(--rc-bullet-indent);
  list-style-type: disc;
}
.resume-page.rc .achievement-list li {
  font-size: var(--rc-size-base); line-height: var(--rc-leading);
  color: var(--rc-text); margin-bottom: var(--rc-gap-line); padding-left: 4pt;
}

/* ── Prose ────────────────────────────────────────────────────────────────── */
.resume-page.rc .summary-text {
  font-size: var(--rc-size-base); line-height: var(--rc-leading-prose);
  color: var(--rc-text); margin: 0;
}
.resume-page.rc p.summary-text + p.summary-text { margin-top: 4pt; }
.resume-page.rc .edu-details { margin-top: 3pt; }
.resume-page.rc .skill-items {
  font-size: var(--rc-size-base); line-height: 1.6;
  color: var(--rc-text); margin-top: 3pt;
}
.resume-page.rc .bullet-line {
  padding-left: 12pt; text-indent: -12pt; margin-bottom: 4pt;
  font-size: var(--rc-size-base); line-height: var(--rc-leading); color: var(--rc-text);
}

/* ── Languages ────────────────────────────────────────────────────────────── */
.resume-page.rc .language-item {
  font-size: var(--rc-size-base); margin-bottom: 4pt; line-height: 1.6;
}
.resume-page.rc .language-item strong { color: var(--rc-accent); }

@media print {
  .resume-page.rc { overflow: hidden !important; break-after: page; }
}

/* The builder's preview shows only once js/preview-watermark.js has looked at the page (data-wm):
   blocking that file in devtools gives a blank preview, not a clean resume. Only the builder's
   <body class="wm-gate">: the PDF is made from a copy in a plain <body>, so this never touches it. */
body.wm-gate #previewContainer .resume-page:not([data-wm]) > .page-content,
body.wm-gate .tp-doc .resume-page:not([data-wm]) > .page-content { visibility: hidden !important; }
body.wm-gate #previewContainer .resume-page:not([data-wm])::after { content: "Loading the preview… If it stays blank, refresh the page."; position: absolute; top: 40%; left: 0; right: 0; padding: 0 24px; text-align: center; font: 500 15px/1.5 Geist, Inter, system-ui, sans-serif; color: #667085; background: none; }
