/* ════════════════════════════════════════════════════════════════════
   RESUME TEMPLATES — SHARED DESIGN SYSTEM
   ════════════════════════════════════════════════════════════════════
   Reusable primitives for all 40 resume template designs.
   All templates render inside a .rt-page wrapper at 600px width.
   Gallery cards scale this down by 0.467 to fit a 280px window.
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Spacing scale (8pt-ish grid, tuned for 600px page) ── */
  --rt-space-xs:  4px;
  --rt-space-sm:  6px;
  --rt-space-md:  10px;
  --rt-space-lg:  14px;
  --rt-space-xl:  20px;
  --rt-space-2xl: 28px;
  --rt-space-3xl: 40px;

  /* ── Typography scale (base 10px, scales up to name) ── */
  --rt-font-xs:   8px;    /* tiny labels, divider text                      */
  --rt-font-sm:   9px;    /* secondary meta — dates, location, footnotes    */
  --rt-font-base: 10px;   /* body text, bullets, paragraphs                 */
  --rt-font-md:   11px;   /* job titles, role names, section item titles    */
  --rt-font-lg:   13px;   /* subtitle / role line under name                */
  --rt-font-xl:   18px;   /* secondary section headers (when large)         */
  --rt-font-2xl:  24px;   /* small name / title-card                        */
  --rt-font-3xl:  32px;   /* hero name in modern templates                  */

  /* ── Font families ── */
  --rt-font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --rt-font-serif: Georgia, 'Times New Roman', Times, serif;
  --rt-font-mono:  'Courier New', Courier, monospace;
  --rt-font-display: 'Arial Black', Arial, sans-serif;

  /* ── Line heights ── */
  --rt-leading-tight:   1.2;
  --rt-leading-normal:  1.4;
  --rt-leading-relaxed: 1.55;

  /* ── Accent color palette (8 swatches templates can pick from) ── */
  --rt-blue:      #2563eb;
  --rt-blue-dk:   #1d4ed8;
  --rt-navy:      #1e3a5f;
  --rt-teal:      #0f766e;
  --rt-green:     #166534;
  --rt-burgundy:  #7b2d42;
  --rt-gold:      #a16207;
  --rt-slate:     #475569;
  --rt-charcoal:  #2d3748;

  /* ── Neutral palette ── */
  --rt-ink:       #0f172a;  /* darkest text                                  */
  --rt-text:      #1e293b;  /* body text                                     */
  --rt-muted:     #64748b;  /* secondary text — dates, locations             */
  --rt-light:     #94a3b8;  /* very light — captions, dividers in light bg   */
  --rt-divider:   #e2e8f0;  /* horizontal rules, subtle borders              */
  --rt-paper:     #ffffff;  /* page background                               */
  --rt-paper-alt: #fafaf8;  /* off-white for executive feel                  */

  /* ── Active accent (overridable per template) ──
     Templates can reference --rt-accent for the user's picked color,
     --rt-accent-soft for a pale wash (~92% lightness, low saturation),
     and --rt-accent-dark for a deeper shade (~55% of the picked lightness).
     The customize page's JS derives the soft/dark variants from --rt-accent
     via HSL math on every color-swatch click. The defaults below are tuned
     for the default blue (#2563eb) so a template renders sensibly even
     when no JS has run. */
  --rt-accent:      var(--rt-blue);
  --rt-accent-soft: #dbeafe;
  --rt-accent-dark: #1e3a8a;
  --rt-accent-ink:  #ffffff;
  /* Phase E3: 4th palette color used by Aurora-style multi-stop gradients
     and similar chrome. Single-color picks don't set --rt-accent-extra
     explicitly, so it falls back to --rt-accent-soft and the gradient
     stays monochromatic. Palette picks set all 4 vars and the gradient
     reads as a true three-color blend. */
  --rt-accent-extra: var(--rt-accent-soft);
  /* Phase E3 final: two-tier soft. `--rt-accent-soft` stays the high-
     contrast partner used by gradient stops (designer-y multi-hue look).
     `--rt-accent-soft-block` is the TONAL sibling of accent used by
     sidebar/page backgrounds that need to harmonize, not contrast.
     Falls back to --rt-accent-soft for non-palette state. */
  --rt-accent-soft-block: var(--rt-accent-soft);
}

/* ══════════════════════════════════════════════════════════════════
   PAGE WRAPPER  —  every template starts with .rt-page
   600px wide letter-page-shaped surface
   ══════════════════════════════════════════════════════════════════ */
.rt-page {
  width: 600px;
  min-height: 776px;     /* 600 * 11/8.5 — letter ratio                     */
  background: var(--rt-paper);
  color: var(--rt-text);
  font-family: var(--rt-font-sans);
  font-size: var(--rt-font-base);
  line-height: var(--rt-leading-normal);
  box-sizing: border-box;
  overflow: hidden;
}
.rt-page * { box-sizing: border-box; }

/* ══════════════════════════════════════════════════════════════════
   LAYOUT PRIMITIVES
   ══════════════════════════════════════════════════════════════════ */

/* Single-column body, content padded equally */
.resume-single-col {
  padding: var(--rt-space-xl) var(--rt-space-2xl);
}

/* Sidebar left — fixed 36% sidebar + flexible main */
.resume-two-col-sidebar-left {
  display: grid;
  grid-template-columns: 36% 1fr;
  min-height: 100%;
}
.resume-two-col-sidebar-left > .rt-sidebar {
  padding: var(--rt-space-xl) var(--rt-space-lg);
  background: var(--rt-accent);
  color: #fff;
}
.resume-two-col-sidebar-left > .rt-main {
  padding: var(--rt-space-xl) var(--rt-space-xl);
}

/* Sidebar right — mirror of left */
.resume-two-col-sidebar-right {
  display: grid;
  grid-template-columns: 1fr 36%;
  min-height: 100%;
}
.resume-two-col-sidebar-right > .rt-main {
  padding: var(--rt-space-xl) var(--rt-space-xl);
}
.resume-two-col-sidebar-right > .rt-sidebar {
  padding: var(--rt-space-xl) var(--rt-space-lg);
  background: var(--rt-accent);
  color: #fff;
}

/* Two-col equal — symmetrical 50/50 */
.resume-two-col-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--rt-space-xl);
  padding: var(--rt-space-xl) var(--rt-space-2xl);
}

/* ══════════════════════════════════════════════════════════════════
   HEADER PATTERNS
   ══════════════════════════════════════════════════════════════════ */

/* Banner — solid accent strip with name */
.resume-header-banner {
  background: var(--rt-accent);
  color: #fff;
  padding: var(--rt-space-xl) var(--rt-space-2xl);
}
.resume-header-banner .rt-name {
  font-size: var(--rt-font-3xl);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: var(--rt-leading-tight);
}
.resume-header-banner .rt-role {
  font-size: var(--rt-font-lg);
  opacity: 0.9;
  margin-top: 4px;
  font-weight: 400;
}
.resume-header-banner .rt-contact {
  font-size: var(--rt-font-sm);
  opacity: 0.75;
  margin-top: 6px;
}

/* Centered — classic look */
.resume-header-centered {
  text-align: center;
  padding: var(--rt-space-xl) var(--rt-space-2xl) var(--rt-space-lg);
  border-bottom: 2px solid var(--rt-ink);
}
.resume-header-centered .rt-name {
  font-size: var(--rt-font-2xl);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rt-ink);
}
.resume-header-centered .rt-role {
  font-size: var(--rt-font-md);
  color: var(--rt-muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
}
.resume-header-centered .rt-contact {
  font-size: var(--rt-font-sm);
  color: var(--rt-muted);
  margin-top: 6px;
}

/* Split — name on left, contact on right */
.resume-header-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: var(--rt-space-xl) var(--rt-space-2xl) var(--rt-space-lg);
  border-bottom: 3px solid var(--rt-ink);
}
.resume-header-split .rt-name {
  font-size: var(--rt-font-2xl);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--rt-ink);
}
.resume-header-split .rt-role {
  font-size: var(--rt-font-md);
  color: var(--rt-muted);
  margin-top: 3px;
}
.resume-header-split .rt-contact {
  font-size: var(--rt-font-sm);
  color: var(--rt-muted);
  text-align: right;
  line-height: var(--rt-leading-relaxed);
}

/* ══════════════════════════════════════════════════════════════════
   SECTION COMPONENTS
   ══════════════════════════════════════════════════════════════════ */

.resume-section { margin-bottom: var(--rt-space-lg); }
.resume-section:last-child { margin-bottom: 0; }

/* Section titles — four variants */
.resume-section-title {
  font-size: var(--rt-font-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--rt-space-md);
  color: var(--rt-ink);
}

.resume-section-title-underline {
  font-size: var(--rt-font-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--rt-accent);
  border-bottom: 1.5px solid var(--rt-accent);
  padding-bottom: 3px;
  margin-bottom: var(--rt-space-md);
}

.resume-section-title-uppercase {
  font-size: var(--rt-font-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--rt-ink);
  margin-bottom: var(--rt-space-md);
}

.resume-section-title-boxed {
  display: inline-block;
  font-size: var(--rt-font-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: var(--rt-ink);
  color: #fff;
  padding: 4px 10px;
  margin-bottom: var(--rt-space-md);
}

.resume-section-title-accent-line {
  font-size: var(--rt-font-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--rt-ink);
  border-left: 3px solid var(--rt-accent);
  padding-left: 8px;
  margin-bottom: var(--rt-space-md);
}

/* Sidebar versions (light text on accent bg) */
.rt-sidebar .resume-section-title,
.rt-sidebar .resume-section-title-underline,
.rt-sidebar .resume-section-title-uppercase {
  color: rgba(255,255,255,0.85);
  border-bottom-color: rgba(255,255,255,0.3);
}

/* ══════════════════════════════════════════════════════════════════
   ENTRY BLOCKS (experience, education entries)
   ══════════════════════════════════════════════════════════════════ */
.resume-entry { margin-bottom: var(--rt-space-md); }
.resume-entry:last-child { margin-bottom: 0; }

.resume-entry-title {
  font-size: var(--rt-font-md);
  font-weight: 700;
  color: var(--rt-ink);
  margin-bottom: 1px;
}
.resume-entry-meta {
  font-size: var(--rt-font-sm);
  color: var(--rt-muted);
  margin-bottom: 4px;
}
.resume-entry-meta-italic {
  font-size: var(--rt-font-sm);
  color: var(--rt-muted);
  font-style: italic;
  margin-bottom: 4px;
}

.rt-sidebar .resume-entry-title { color: #fff; }
.rt-sidebar .resume-entry-meta  { color: rgba(255,255,255,0.7); }

/* ══════════════════════════════════════════════════════════════════
   BULLET LISTS
   ══════════════════════════════════════════════════════════════════ */
.resume-bullet-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--rt-font-base);
  line-height: var(--rt-leading-relaxed);
  color: var(--rt-text);
}
.resume-bullet-list li {
  padding-left: 12px;
  position: relative;
  margin-bottom: 2px;
}
.resume-bullet-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--rt-accent);
}

.rt-sidebar .resume-bullet-list { color: rgba(255,255,255,0.85); }
.rt-sidebar .resume-bullet-list li::before { color: rgba(255,255,255,0.7); }

/* Inline bullet list — dot separated */
.resume-bullet-inline {
  font-size: var(--rt-font-base);
  line-height: var(--rt-leading-relaxed);
  color: var(--rt-text);
}

/* ══════════════════════════════════════════════════════════════════
   SKILLS — multiple display variants
   ══════════════════════════════════════════════════════════════════ */

/* Pill cluster */
.resume-skill-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.resume-skill-pill {
  display: inline-block;
  background: var(--rt-accent-soft);
  color: var(--rt-accent);
  font-size: var(--rt-font-xs);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
}
.rt-sidebar .resume-skill-pill {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Bar — proficiency indicator */
.resume-skill-bar {
  margin-bottom: 6px;
}
.resume-skill-bar-label {
  font-size: var(--rt-font-sm);
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--rt-text);
}
.resume-skill-bar-track {
  height: 4px;
  background: var(--rt-divider);
  border-radius: 2px;
  overflow: hidden;
}
.resume-skill-bar-fill {
  height: 100%;
  background: var(--rt-accent);
  border-radius: 2px;
}
.rt-sidebar .resume-skill-bar-label { color: #fff; }
.rt-sidebar .resume-skill-bar-track { background: rgba(255,255,255,0.2); }
.rt-sidebar .resume-skill-bar-fill  { background: #fff; }

/* Skill column list (sidebar use) */
.resume-skill-list {
  font-size: var(--rt-font-sm);
  line-height: 1.75;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════════
   PHOTO — circular avatar
   ══════════════════════════════════════════════════════════════════ */
.resume-photo-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #64748b;
  border: 3px solid #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.resume-photo-circle img { width: 100%; height: 100%; object-fit: cover; }

.resume-photo-circle-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #64748b;
  border: 4px solid #fff;
  overflow: hidden;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════
   UTILITY HELPERS
   ══════════════════════════════════════════════════════════════════ */
.rt-divider-line {
  height: 1px;
  background: var(--rt-divider);
  border: 0;
  margin: var(--rt-space-md) 0;
}
.rt-divider-accent {
  height: 2px;
  background: var(--rt-accent);
  border: 0;
  margin: var(--rt-space-md) 0;
}
.rt-text-muted     { color: var(--rt-muted); }
.rt-text-accent    { color: var(--rt-accent); }
.rt-text-uppercase { text-transform: uppercase; letter-spacing: 1px; }
.rt-text-center    { text-align: center; }

/* ══════════════════════════════════════════════════════════════════
   ACCENT COLOR HELPER CLASSES
   Apply to .rt-page to switch the whole template's accent at once.
   ══════════════════════════════════════════════════════════════════ */
.rt-accent-blue     { --rt-accent: var(--rt-blue);     --rt-accent-soft: #dbeafe; }
.rt-accent-navy     { --rt-accent: var(--rt-navy);     --rt-accent-soft: #cfdbed; }
.rt-accent-teal     { --rt-accent: var(--rt-teal);     --rt-accent-soft: #ccfbf1; }
.rt-accent-green    { --rt-accent: var(--rt-green);    --rt-accent-soft: #dcfce7; }
.rt-accent-burgundy { --rt-accent: var(--rt-burgundy); --rt-accent-soft: #f5d6dd; }
.rt-accent-gold     { --rt-accent: var(--rt-gold);     --rt-accent-soft: #fef3c7; }
.rt-accent-slate    { --rt-accent: var(--rt-slate);    --rt-accent-soft: #e2e8f0; }
.rt-accent-charcoal { --rt-accent: var(--rt-charcoal); --rt-accent-soft: #e5e7eb; }

/* ══════════════════════════════════════════════════════════════════
   FULL-HEIGHT SIDEBAR STRIP for two-column sidebar templates
   ══════════════════════════════════════════════════════════════════

   Templates like Professional, Corporate, Linear, Spectrum use the
   `.resume-two-col-sidebar-{left,right}` grid. The accent strip was
   previously painted on `.rt-sidebar` itself — which stops where the
   sidebar's content stops, leaving a visible gap when the main column
   is taller than the sidebar.

   The fix below paints the strip as a `::before` pseudo-element on
   `.rt-page`, positioned absolutely from `top:0` to `bottom:0`. That
   guarantees the accent column extends the full page height regardless
   of how many grid rows the children occupy. `.rt-sidebar` then drops
   its own background (it would double-paint on top of the pseudo).

   `.rt-page` already has `overflow: hidden`, which keeps the pseudo
   clipped to the page rectangle.

   Extras (Interests/Availability/custom sections) are no longer
   placed here as a third grid child — they render inside `.rt-main`
   after the last regular section. The `extras_main` Jinja macro in
   `resume_template_previews_partial.html` handles that placement.

   Affected templates: Professional, Corporate, Linear, Spectrum.
   Single-column templates are not matched. PDFs are not touched. */
.resume-two-col-sidebar-left,
.resume-two-col-sidebar-right {
  position: relative;
}
.resume-two-col-sidebar-left::before,
.resume-two-col-sidebar-right::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36%;
  background: var(--rt-accent);
  z-index: 0;
}
.resume-two-col-sidebar-left::before  { left: 0; }
.resume-two-col-sidebar-right::before { right: 0; }

/* Stack children above the pseudo strip, and drop the sidebar's own
   solid background since the strip now provides it. */
.resume-two-col-sidebar-left > *,
.resume-two-col-sidebar-right > * {
  position: relative;
  z-index: 1;
}
.resume-two-col-sidebar-left  > .rt-sidebar,
.resume-two-col-sidebar-right > .rt-sidebar {
  background: transparent;
}
