/* =============================================================
   ResumeCraft — resume.css
   A4 preview sheet · 4 Templates · Print styles
   ============================================================= */

/* ---------------------------------------------------------------
   A4 SHEET BASE
   --------------------------------------------------------------- */
.r-sheet {
  width: 794px;       /* A4 @ 96dpi = 210mm */
  min-height: 1123px; /* A4 @ 96dpi = 297mm */
  background: #FFFFFF;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1A1A18;
  position: relative;
  box-shadow: var(--shadow-resume);
  overflow: hidden;
  line-height: 1.5;
}

/* A4 page sizing for print */
@page { size: A4; margin: 0; }

/* ---------------------------------------------------------------
   SHARED RESUME UTILITIES
   --------------------------------------------------------------- */
.r-name        { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.r-title       { font-size: 12px; font-weight: 500; letter-spacing: 0.02em; }
.r-section-hd  { font-size: 9px;  font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.r-job-title   { font-size: 11px; font-weight: 600; line-height: 1.3; }
.r-company     { font-size: 10px; color: #6B6B63; }
.r-dates       { font-size: 9px;  color: #9B9B93; }
.r-body-text   { font-size: 9.5px; line-height: 1.55; color: #3D3D3A; }
.r-contact-txt { font-size: 9px;  color: #6B6B63; }

.r-entry { margin-bottom: 10px; page-break-inside: avoid; }
.r-entry:last-child { margin-bottom: 0; }

.r-entry-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3px; }

.r-bullets { padding-left: 12px; margin-top: 4px; }
.r-bullets li {
  list-style: disc;
  font-size: 9.5px;
  color: #3D3D3A;
  line-height: 1.55;
  margin-bottom: 2px;
}

.r-skill-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 500;
  margin: 2px 2px 2px 0;
}

/* ---------------------------------------------------------------
   TEMPLATE 1 — CLASSIC
   Two-column: sidebar (left 30%) + main (right 70%)
   --------------------------------------------------------------- */
.t-classic {
  display: grid;
  grid-template-rows: auto 1fr;
}

.t-classic-header {
  padding: 28px 32px 22px;
  border-bottom: 2px solid #1A1A18;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.t-classic-name-block .r-name  { color: #1A1A18; margin-bottom: 4px; }
.t-classic-name-block .r-title { color: #6B6B63; }

.t-classic-contact {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.t-classic-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
}

.t-classic-sidebar {
  background: #F8F8F7;
  padding: 20px 18px;
  border-right: 1px solid #E5E5E3;
}

.t-classic-main {
  padding: 20px 24px;
}

.t-classic-sidebar .r-section-hd {
  color: var(--r-accent, #2563EB);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #E5E5E3;
}

.t-classic-main .r-section-hd {
  color: var(--r-accent, #2563EB);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--r-accent, #2563EB);
  display: block;
}

.t-classic-section { margin-bottom: 16px; }
.t-classic-section:last-child { margin-bottom: 0; }

/* Classic skills: vertical list */
.t-classic-skill {
  font-size: 9.5px;
  padding: 3px 0;
  border-bottom: 1px solid #E5E5E3;
  color: #3D3D3A;
}
.t-classic-skill:last-child { border-bottom: none; }

/* Classic summary */
.t-classic-summary {
  font-size: 10px;
  color: #3D3D3A;
  line-height: 1.6;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #E5E5E3;
}

/* ---------------------------------------------------------------
   TEMPLATE 2 — MODERN
   Left accent bar · Single column · Clean contrast
   --------------------------------------------------------------- */
.t-modern {
  display: flex;
}

.t-modern-accent-bar {
  width: 5px;
  background: var(--r-accent, #2563EB);
  flex-shrink: 0;
}

.t-modern-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.t-modern-header {
  background: var(--r-accent, #2563EB);
  padding: 28px 28px 22px;
  color: white;
}

.t-modern-header .r-name  { color: white; margin-bottom: 4px; }
.t-modern-header .r-title { color: rgba(255,255,255,0.8); margin-bottom: 12px; }

.t-modern-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.t-modern-contact-item {
  font-size: 9px;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  gap: 4px;
}

.t-modern-body { padding: 20px 28px; flex: 1; }

.t-modern .r-section-hd {
  color: var(--r-accent, #2563EB);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #E5E5E3;
  display: block;
}

.t-modern-section { margin-bottom: 18px; page-break-inside: avoid; }

/* Modern skills: inline tags */
.t-modern .r-skill-tag {
  background: rgba(37,99,235,0.08);
  color: #1E40AF;
  border: 1px solid rgba(37,99,235,0.15);
}

.t-modern-summary {
  font-size: 10px;
  color: #3D3D3A;
  line-height: 1.65;
  padding: 10px 12px;
  background: #F8FAFE;
  border-left: 3px solid var(--r-accent, #2563EB);
  border-radius: 0 4px 4px 0;
  margin-bottom: 16px;
}

/* ---------------------------------------------------------------
   TEMPLATE 3 — MINIMAL
   Centred header · extreme whitespace · ultra clean
   --------------------------------------------------------------- */
.t-minimal {
  padding: 36px 44px;
}

.t-minimal-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #E5E5E3;
}

.t-minimal-header .r-name  { font-size: 26px; font-weight: 300; letter-spacing: -0.03em; margin-bottom: 5px; }
.t-minimal-header .r-title { font-size: 12px; color: #9B9B93; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }

.t-minimal-contact {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.t-minimal-contact-item {
  font-size: 9px;
  color: #9B9B93;
  padding: 0 8px;
  border-right: 1px solid #D0D0CC;
}
.t-minimal-contact-item:last-child { border-right: none; }

.t-minimal-section {
  margin-bottom: 18px;
}

.t-minimal .r-section-hd {
  color: #1A1A18;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 0.5px solid #D0D0CC;
  display: block;
}

.t-minimal-summary {
  font-size: 10px;
  color: #6B6B63;
  line-height: 1.7;
  text-align: center;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 0.5px solid #E5E5E3;
}

.t-minimal .r-entry-header {
  border-bottom: none;
}

.t-minimal .r-company { font-weight: 500; }

/* Minimal skills: dots separator */
.t-minimal-skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.t-minimal-skill {
  font-size: 9.5px;
  color: #6B6B63;
  padding: 2px 8px;
  border-right: 1px solid #D0D0CC;
}
.t-minimal-skill:last-child { border-right: none; }

/* ---------------------------------------------------------------
   TEMPLATE 4 — EXECUTIVE
   Dark header block · premium corporate feel · elegant dividers
   --------------------------------------------------------------- */
.t-executive {
  display: flex;
  flex-direction: column;
}

.t-executive-header {
  background: #1A1A18;
  padding: 32px 36px 26px;
  color: white;
}

.t-executive-header .r-name {
  color: white;
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}

.t-executive-title {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.t-executive-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.t-executive-contact-item {
  font-size: 9px;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 4px;
}

.t-executive-accent-strip {
  height: 4px;
  background: var(--r-accent, #2563EB);
}

.t-executive-body {
  padding: 22px 36px;
  flex: 1;
}

.t-executive .r-section-hd {
  color: #1A1A18;
  font-size: 8px;
  letter-spacing: 0.16em;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 0.5px solid #1A1A18;
  display: block;
}

.t-executive-section { margin-bottom: 18px; page-break-inside: avoid; }

.t-executive-summary {
  font-size: 10px;
  color: #3D3D3A;
  line-height: 1.7;
  margin-bottom: 18px;
}

.t-executive .r-job-title {
  font-size: 11px;
  font-weight: 600;
  color: #1A1A18;
}

.t-executive .r-company {
  font-size: 10px;
  color: var(--r-accent, #2563EB);
  font-weight: 500;
}

/* Executive skills: compact pill row */
.t-executive .r-skill-tag {
  background: #F4F4F2;
  color: #3D3D3A;
  border: 1px solid #E5E5E3;
  font-size: 8.5px;
}

/* ---------------------------------------------------------------
   MINI TEMPLATE THUMBNAILS (for selector in builder/templates page)
   These are very small rendered versions inside .template-card-preview
   ------------------------------------------------------------ */
.thumb-classic  { background: #FAFAF9; }
.thumb-modern   { background: #EFF6FF; }
.thumb-minimal  { background: #FFFFFF; }
.thumb-executive { background: #1A1A18; }

.thumb-content {
  padding: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.thumb-bar       { height: 2px; border-radius: 1px; }
.thumb-bar.full  { width: 100%; }
.thumb-bar.w-3-4 { width: 75%; }
.thumb-bar.w-1-2 { width: 50%; }
.thumb-bar.w-2-3 { width: 66%; }
.thumb-bar.w-1-3 { width: 33%; }
.thumb-name      { height: 4px; width: 50%; border-radius: 2px; }
.thumb-title     { height: 3px; width: 35%; border-radius: 2px; }
.thumb-section   { height: 2px; width: 30%; border-radius: 1px; margin-top: 4px; }
.thumb-accent    { background: var(--accent); }
.thumb-dark      { background: #1A1A18; }
.thumb-light     { background: #D0D0CC; }
.thumb-lighter   { background: #E5E5E3; }
.thumb-white     { background: rgba(255,255,255,0.5); }

/* ---------------------------------------------------------------
   PRINT STYLES
   --------------------------------------------------------------- */
#print-resume {
  display: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  visibility: hidden;
}

@media print {
  /* Hide everything */
  body > #app,
  body > #toast-container,
  body > #modal-overlay {
    display: none !important;
    visibility: hidden !important;
  }

  /* Show only the print resume */
  body > #print-resume {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    z-index: auto !important;
    background: white;
  }

  #print-resume .r-sheet {
    width: 100%;
    min-height: 100vh;
    box-shadow: none;
    transform: none !important;
    margin: 0;
    padding: 0;
    page-break-after: always;
  }

  /* Ensure page breaks work well */
  .r-entry       { page-break-inside: avoid; }
  .r-section     { page-break-inside: avoid; }
  h2, h3         { page-break-after: avoid; }

  @page {
    size: A4;
    margin: 0;
  }
}
