/* Shared builder chrome (resume + privacy) and resume templates + four document templates + print rules.
   The documents deliberately look like resumes, not like this site: recruiters
   and ATS parsers expect conventional type and spacing, so the site's editorial
   styling stops at the paper's edge. */

.resume-app { margin: 34px 0 0; }
.rb-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; align-items: start; }

/* ---------- left: input ---------- */
.rb-side { min-width: 0; }
.rb-tabs { display: flex; gap: 4px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 16px; }
.rb-tab {
  flex: 1; border: 0; background: none; cursor: pointer; padding: 10px 14px; border-radius: 999px;
  font: inherit; font-size: 0.88rem; font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.rb-tab:hover { color: var(--ink); }
.rb-tab.active { background: var(--ink); color: var(--surface); }
.rb-tab i { font-size: 1.05rem; }

.rb-pane { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px; }
.rb-pane-lead { margin: 0 0 14px; color: var(--ink-2); font-size: 0.92rem; line-height: 1.6; }

.rb-input {
  width: 100%; font: inherit; font-size: 0.92rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.rb-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11, 11, 11, .06); }
.rb-input::placeholder { color: var(--ink-3); }
textarea.rb-input { resize: vertical; line-height: 1.6; }
#rb-ai-input { min-height: 260px; }

.rb-section { border: 0; padding: 0; margin: 0 0 26px; }
.rb-section legend {
  display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: 12px;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); font-weight: 600;
}
.rb-section legend i { font-size: 1.05rem; color: var(--ink); }

.rb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rb-full { grid-column: span 4; }
.rb-half { grid-column: span 2; }
.rb-quarter { grid-column: span 1; }
.rb-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rb-field label { font-size: 0.76rem; color: var(--ink-3); letter-spacing: .02em; }

.rb-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; background: var(--paper); }
.rb-item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rb-item-n {
  width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--surface);
  display: grid; place-items: center; font-size: 0.72rem; font-weight: 600;
}
.rb-remove { border: 0; background: none; cursor: pointer; color: var(--ink-3); padding: 4px; border-radius: 6px; display: grid; place-items: center; }
.rb-remove:hover { color: var(--ink); background: var(--line); }
.rb-add {
  display: inline-flex; align-items: center; gap: 7px; border: 1px dashed var(--line-2); background: none;
  cursor: pointer; font: inherit; font-size: 0.85rem; color: var(--ink-2);
  padding: 9px 14px; border-radius: var(--radius-sm); width: 100%; justify-content: center;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.rb-add:hover { border-color: var(--ink); color: var(--ink); }

.rb-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.rb-status { font-size: 0.84rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rb-polish-box { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 20px; }

/* ---------- right: preview ---------- */
.rb-preview-col { position: sticky; top: 88px; min-width: 0; }
.rb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.rb-swatches { display: flex; gap: 14px; }
.rb-swatch-wrap { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; }
.rb-swatch {
  cursor: pointer; border: 1px solid var(--line-2); background: #fff; border-radius: 6px;
  padding: 0; width: 78px; height: 110px; overflow: hidden; position: relative; display: block;
  transition: border-color .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
}
.rb-swatch:hover { transform: translateY(-3px); border-color: var(--ink-3); box-shadow: 0 8px 18px -12px rgba(11,11,11,.5); }
.rb-swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2.5px var(--accent); }
/* A real render of the template, scaled to thumbnail size — 78 / 794 ≈ 0.098 */
/* text-align:left is essential — <button> centres its content, which made the
   thumbnails misrepresent every left-aligned template as a centred one. */
.rb-swatch-doc { position: absolute; inset: 0; overflow: hidden; background: #fff; text-align: left; }
.rb-swatch-doc .r-doc {
  width: 794px; min-height: 1120px; transform: scale(0.0982); transform-origin: top left;
  box-shadow: none !important; pointer-events: none; padding: 34px 38px;
}
.rb-swatch-doc .r-editorial { padding: 38px 40px; }
.rb-swatch-name {
  font-size: 0.72rem; color: var(--ink-3); letter-spacing: .01em; line-height: 1;
  transition: color .22s var(--ease);
}
.rb-swatch-wrap:hover .rb-swatch-name { color: var(--ink-2); }
.rb-swatch-wrap:has(.rb-swatch.active) .rb-swatch-name { color: var(--ink); font-weight: 600; }

/* ---------- profile photo control ---------- */
.rb-photo-row { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.rb-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.rb-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.rb-toggle-track {
  width: 38px; height: 22px; border-radius: 999px; background: var(--line-2);
  position: relative; flex-shrink: 0; transition: background .22s var(--ease);
}
.rb-toggle-knob {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); transition: transform .22s var(--ease-spring);
  box-shadow: 0 1px 2px rgba(11,11,11,.25);
}
.rb-toggle input:checked + .rb-toggle-track { background: var(--ink); }
.rb-toggle input:checked + .rb-toggle-track .rb-toggle-knob { transform: translateX(16px); }
.rb-toggle input:focus-visible + .rb-toggle-track { box-shadow: 0 0 0 3px var(--accent); }
.rb-toggle-label { font-size: 0.88rem; color: var(--ink-2); }
.rb-photo-controls { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.rb-photo-thumb { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); }
.rb-photo-empty {
  width: 52px; height: 52px; border-radius: 50%; border: 1px dashed var(--line-2);
  display: grid; place-items: center; color: var(--ink-3); font-size: 1.3rem;
}
.rb-photo-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font: inherit; font-size: 0.84rem;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 8px 14px; transition: border-color .2s var(--ease), color .2s var(--ease);
}
.rb-photo-btn:hover { border-color: var(--ink); color: var(--ink); }
.rb-photo-hint { flex-basis: 100%; margin: 2px 0 0; font-size: 0.78rem; color: var(--ink-3); line-height: 1.55; }

/* ---------- sample-content notice ---------- */
.rb-sample-note {
  display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px;
  font-size: 0.82rem; color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.rb-sample-note i { color: var(--ink); font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
#rb-preview.is-sample .r-doc { opacity: .82; }

.rb-paper-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); padding: 14px; max-height: 78vh; overflow: auto; }
.rb-ats-note {
  display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px;
  font-size: 0.82rem; color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px;
}
.rb-ats-note i { color: var(--ink); font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ---------- the document ---------- */
.r-doc {
  background: #fff; color: #111; width: 100%; max-width: 794px; margin: 0 auto;
  padding: 40px 44px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 28px -18px rgba(0, 0, 0, .3);
  font-size: 10.6pt; line-height: 1.5;
}
.r-doc h1 { margin: 0; letter-spacing: -0.01em; }
.r-doc h2 {
  font-size: 9pt; text-transform: uppercase; letter-spacing: .14em; margin: 0 0 8px;
  font-family: inherit; font-weight: 700;
}
.r-doc section { margin-top: 20px; }
.r-doc section:first-of-type { margin-top: 18px; }
.r-doc p { margin: 0 0 6px; }
.r-doc ul { margin: 6px 0 0; padding-left: 16px; }
.r-doc li { margin-bottom: 3px; }
.r-item { margin-bottom: 13px; }
.r-item:last-child { margin-bottom: 0; }
.r-item-tight { margin-bottom: 5px; }
.r-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.r-strong { font-weight: 700; }
.r-dates { font-size: 9pt; color: #555; white-space: nowrap; }
.r-sub { font-size: 9.6pt; color: #444; margin-top: 1px; }
.r-headline { font-size: 11pt; color: #333; }
.r-contact { font-size: 9.2pt; color: #444; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 15px; }
.r-contact span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.r-ico { width: 1.06em; height: 1.06em; flex-shrink: 0; fill: currentColor; opacity: .62; }
.r-skills { display: flex; flex-wrap: wrap; gap: 5px 7px; }
/* scoped to beat `.r-doc ul`, which would otherwise indent this list */
.r-doc .r-plain { list-style: none; margin: 0; padding: 0; font-size: 9.2pt; }
.r-plain li { margin-bottom: 4px; display: flex; align-items: flex-start; gap: 6px; }
.r-plain li span { word-break: break-word; min-width: 0; }
.r-plain .r-ico { margin-top: .15em; }

/* Classic — serif, centred, the safest thing to put in front of a recruiter */
.r-classic { font-family: Georgia, "Times New Roman", serif; }
.r-classic .r-head { text-align: center; border-bottom: 1.5px solid #111; padding-bottom: 12px; }
.r-classic h1 { font-size: 21pt; letter-spacing: .04em; text-transform: uppercase; }
.r-classic .r-contact { justify-content: center; }
.r-classic h2 { border-bottom: 1px solid #bbb; padding-bottom: 3px; }
.r-classic .r-ico { opacity: .55; }
.r-classic .r-skills span::after { content: ","; }
.r-classic .r-skills span:last-child::after { content: ""; }

/* Modern — sans, left aligned, one accent rule */
.r-modern { font-family: "Satoshi", Helvetica, Arial, sans-serif; }
.r-modern h1 { font-size: 22pt; font-weight: 700; }
.r-modern .r-head { padding-bottom: 12px; border-bottom: 2px solid #111; }
.r-modern h2 { color: #111; position: relative; padding-left: 13px; }
.r-modern h2::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; background: #111; }
.r-modern .r-skills span { border: 1px solid #ccc; border-radius: 3px; padding: 1px 6px; font-size: 8.8pt; }

/* Editorial — display name, generous whitespace, hairline rules */
.r-editorial { font-family: "Satoshi", Helvetica, Arial, sans-serif; padding: 48px 50px; }
.r-editorial h1 { font-family: "Clash Display", "Satoshi", sans-serif; font-size: 30pt; font-weight: 600; line-height: 1.05; }
.r-editorial .r-last { color: #8a8a8d; }
.r-editorial .r-headline { margin-top: 6px; font-size: 10.5pt; letter-spacing: .04em; text-transform: uppercase; color: #555; }
.r-editorial .r-head { padding-bottom: 18px; }
.r-editorial .r-contact { margin-top: 10px; gap: 4px 17px; }
.r-editorial section { border-top: 1px solid #e0e0dd; padding-top: 14px; margin-top: 18px; }
.r-editorial h2 { color: #8a8a8d; }
.r-editorial .r-skills span::after { content: "·"; margin-left: 7px; color: #bbb; }
.r-editorial .r-skills span:last-child::after { content: ""; }

/* Compact — sidebar layout, fits more on one page */
.r-compact { font-family: "Satoshi", Helvetica, Arial, sans-serif; }
.r-compact h1 { font-size: 19pt; }
.r-compact .r-head { border-bottom: 1px solid #ddd; padding-bottom: 10px; }
.r-compact .r-cols { display: grid; grid-template-columns: 31% 1fr; gap: 26px; }
.r-compact .r-aside { border-right: 1px solid #e6e6e3; padding-right: 20px; }
.r-compact .r-aside section:first-of-type { margin-top: 16px; }
.r-compact .r-skills { flex-direction: column; gap: 3px; }
.r-compact .r-skills span { font-size: 9.2pt; }
.r-compact .r-aside .r-row { flex-direction: column; gap: 0; }
.r-compact .r-aside .r-dates { order: 2; margin-top: 1px; }
.r-compact .r-aside .r-sub { order: 1; }
.r-compact .r-aside .r-dates { white-space: normal; }

/* ---------- ghost outlines for sections not filled in yet ---------- */
.r-name-ghost { color: #c9c9c5; }
.r-ghost { opacity: .55; }
.r-ghost h2 { color: #b4b4b0; }
.r-ghost-bars { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.r-ghost-bars span { height: 7px; border-radius: 3px; background: #e8e8e4; display: block; }
.r-ghost-bars span:nth-child(1) { width: 92%; }
.r-ghost-bars span:nth-child(2) { width: 78%; }
.r-ghost-bars span:nth-child(3) { width: 55%; }
.r-compact .r-ghost-bars span { height: 6px; }

/* ---------- profile photo inside the document ---------- */
.r-photo { display: block; object-fit: cover; background: #eee; }
.r-classic .r-photo { width: 78px; height: 78px; border-radius: 50%; margin: 0 auto 12px; }
.r-modern.has-photo .r-head, .r-editorial.has-photo .r-head { display: flex; align-items: center; gap: 20px; }
.r-modern.has-photo .r-head-text, .r-editorial.has-photo .r-head-text { min-width: 0; flex: 1; }
.r-modern .r-photo { width: 76px; height: 76px; border-radius: 50%; order: 2; flex-shrink: 0; }
.r-editorial .r-photo { width: 84px; height: 100px; border-radius: 3px; order: 2; flex-shrink: 0; }
.r-compact .r-photo { width: 84px; height: 84px; border-radius: 50%; margin: 0 0 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .rb-layout { grid-template-columns: 1fr; }
  .rb-preview-col { position: static; }
  .rb-paper-wrap { max-height: none; }
  .r-doc { padding: 30px 28px; font-size: 10pt; }
}
@media (max-width: 640px) {
  .rb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-full, .rb-half { grid-column: span 2; }
  .rb-quarter { grid-column: span 1; }
  .rb-pane { padding: 16px; }
  .r-doc { padding: 22px 20px; }
  .r-compact .r-cols { grid-template-columns: 1fr; gap: 0; }
  .r-compact .r-aside { border-right: 0; padding-right: 0; border-bottom: 1px solid #e6e6e3; padding-bottom: 10px; }
  .rb-swatch { width: 40px; height: 50px; }
}

/* ---------- print: the paper, and nothing else ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body > *:not(.page-main), .site-header, .site-footer, .breadcrumbs, .tool-head,
  .tool-info, .rb-side, .rb-bar, .rb-ats-note, .rb-sample-note { display: none !important; }
  .page-main, .container, .tool-page, .resume-app, .rb-layout, .rb-preview-col, .rb-paper-wrap {
    display: block !important; margin: 0 !important; padding: 0 !important;
    max-width: none !important; width: auto !important; border: 0 !important;
    background: #fff !important; box-shadow: none !important; overflow: visible !important; max-height: none !important;
  }
  .r-doc {
    box-shadow: none !important; padding: 0 !important; max-width: none !important;
    width: 100% !important; font-size: 10.2pt; opacity: 1 !important;
  }
  /* photos are dropped by default when printing to PDF unless forced */
  .r-photo, .r-ico { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .r-ghost { display: none !important; }
  .r-doc section, .r-item { break-inside: avoid; page-break-inside: avoid; }
  .r-doc h2 { break-after: avoid; page-break-after: avoid; }
}
