/* Full CV maker (/cv-maker/full/). Uses the template's colour variables only;
   print uses the system colours Canvas and CanvasText so the CV prints dark on white. */
.fx-wide { max-width: 1320px; }
.cv-intro { padding-top: 32px; }
.cv-intro h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.2; margin: 16px 0 8px; }
.cv-intro p { max-width: 780px; }
.cv-private {
  background: var(--bg-alt); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 12px 16px;
}

/* Two columns on wide screens: the form, and a sticky preview */
.fx-app { display: grid; gap: 24px; padding-bottom: 40px; }
@media (min-width: 1040px) {
  .fx-app { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; }
  .fx-preview-col { position: sticky; top: 76px; max-height: calc(100vh - 88px); overflow: auto; }
}
.fx-form-col, .fx-preview-col { min-width: 0; }
.fx-panel { margin: 0 0 20px; }
.fx-panel h2 { font-size: 1.25rem; margin: 0 0 8px; }
.fx-sub { font-size: 1.05rem; margin: 20px 0 6px; }
.fx-panel .hint { color: var(--muted); font-size: 0.92rem; margin: 0 0 14px; }
.fx-panel .field .hint { margin: -4px 0 0; }
.fx-panel textarea, .fx-panel select {
  font: inherit; font-weight: 400; color: var(--text); background: var(--bg);
  border: 1px solid var(--muted); border-radius: 8px; padding: 10px 12px; width: 100%;
}
.fx-panel textarea { resize: vertical; }
.fx-panel .field input { border-color: var(--muted); }
.fx-panel textarea:focus, .fx-panel select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fx-design { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fx-pages { font-weight: 600; margin: 0; min-height: 1.5em; }
.fx-jump { margin: 8px 0 0; }
@media (min-width: 1040px) { .fx-jump { display: none; } }
.fx-panel .check { margin: 0 0 12px; }

.fx-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.fx-sec-tools { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.fx-sec-opts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; align-items: end; margin: 8px 0 12px; }
.fx-sec-opts .check { margin: 0 0 10px; }
@media (max-width: 520px) { .fx-sec-opts { grid-template-columns: 1fr; } }
.fx-sec.is-hidden { border-style: dashed; }
.fx-sec.is-hidden h2::after { content: " (hidden)"; color: var(--muted); font-weight: 400; font-size: 0.95rem; }
.fx-sec > .field { margin-bottom: 8px; }

.cv-entry {
  display: block; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; margin: 0 0 16px;
}
.cv-entry legend { font-weight: 600; padding: 0 6px; }
.cv-entry .fields { margin-bottom: 8px; }
.cv-wide { grid-column: 1 / -1; }
.fx-current { align-self: end; margin: 0 0 10px !important; }
.cv-entry-tools { display: flex; gap: 16px; justify-content: flex-end; }
.cv-link {
  font: inherit; font-size: 0.92rem; background: none; border: 0; padding: 4px 0;
  color: var(--accent); text-decoration: underline; cursor: pointer;
}
.cv-add { margin: 0 0 8px; }
.fx-onreq { margin-top: 8px !important; }
.fx-levels-form { display: grid; gap: 10px; margin-bottom: 14px; }
.fx-level-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 8px 12px; align-items: end; }
.fx-level-row .cv-link { margin-bottom: 8px; }
@media (max-width: 520px) { .fx-level-row { grid-template-columns: minmax(0, 1fr) auto; } .fx-level-row > .field:first-child { grid-column: 1 / -1; } }

.fx-photo-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.fx-photo-thumb { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.fx-photo-thumb[hidden], .fx-photo-row [hidden] { display: none; }
.fx-inline { min-width: 140px; }
.fx-add-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.fx-add-row .field { flex: 1 1 220px; }

.cv-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.fx-panel .btn { border: 2px solid var(--accent); padding: 10px 20px; font: inherit; font-weight: 600; cursor: pointer; }
.fx-panel .btn-outline { background: transparent; color: var(--accent); }
/* Keep full contrast on hover (the template fades buttons to 0.9) */
.fx-panel .btn:hover { opacity: 1; text-decoration: underline; }
.fx-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.cv-status { min-height: 1.5em; margin: 12px 0 0; font-weight: 600; }

.fx-preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cv-preview-title { font-size: 1.25rem; margin: 0 0 10px; }
.fx-pages-mini { margin: 0; color: var(--muted); font-size: 0.9rem; }
.fx-stage { position: relative; width: 100%; overflow: hidden; }

/* ---------- The CV paper ---------- */
.fx-paper {
  --fx-ink: var(--text); --fx-muted: var(--muted); --fx-bg: var(--bg); --fx-line: var(--border);
  --fx-acc-raw: var(--accent); --fx-acc: var(--fx-acc-raw);
  --fx-tint: color-mix(in srgb, var(--fx-acc) 6%, var(--fx-bg));
  --fx-base: 10.5pt; --fx-scale: 1;
  position: relative; box-sizing: border-box; transform-origin: top left;
  background: var(--fx-bg); color: var(--fx-ink); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: calc(var(--fx-base) * var(--fx-scale)); line-height: 1.42; overflow-wrap: anywhere;
}
.fx-paper.A-travel { --fx-acc-raw: var(--t-travel); }
.fx-paper.A-health { --fx-acc-raw: var(--t-health); }
.fx-paper.A-academy { --fx-acc-raw: var(--t-academy); }
.fx-paper.A-money { --fx-acc-raw: var(--t-money); }
.fx-paper.A-mono { --fx-acc-raw: var(--text); }
.fx-paper.S-small { --fx-base: 9.5pt; }
.fx-paper.S-large { --fx-base: 11.5pt; }
.fx-paper.F-serif { font-family: Georgia, "Times New Roman", serif; }
.fx-paper p { margin: 0; }
.fx-paper ul { margin: 0; padding: 0; }

.fx-name { font-size: 2.3em; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; }
.fx-headline { font-size: 1.15em; color: var(--fx-acc); font-weight: 600; margin-top: 0.2em !important; }
.fx-head { display: flex; gap: 1.4em; align-items: center; padding-bottom: 0.9em; border-bottom: 2px solid var(--fx-acc); margin-bottom: 0.3em; }
.fx-head-text { min-width: 0; flex: 1; }
.fx-contact { list-style: none; display: flex; flex-wrap: wrap; gap: 0.1em 1.2em; margin-top: 0.5em !important; font-size: 0.92em; }
.fx-details { color: var(--fx-muted); margin-top: 0.2em !important; }
.fx-photo { width: 7.5em; height: 7.5em; object-fit: cover; flex: none; border: 1px solid var(--fx-line); }
.fx-paper.P-round .fx-photo { border-radius: 50%; }
.fx-paper.P-square .fx-photo { border-radius: 0.4em; }

.fx-sec-out { margin-top: 1.1em; break-inside: avoid-page; }
.fx-sec-out h3 {
  font-size: 0.86em; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  color: var(--fx-acc); margin: 0 0 0.5em; padding-bottom: 0.25em; border-bottom: 1px solid var(--fx-line);
  break-after: avoid;
}
.fx-sec-body > p { margin-bottom: 0.3em; }
.fx-item { margin-bottom: 0.75em; break-inside: avoid; }
.fx-item:last-child { margin-bottom: 0; }
.fx-item-top { display: flex; justify-content: space-between; gap: 0.2em 1em; flex-wrap: wrap; }
.fx-dates { color: var(--fx-muted); font-size: 0.92em; white-space: nowrap; }
.fx-meta { color: var(--fx-muted); font-size: 0.92em; }
.fx-item ul { padding-left: 1.2em; margin-top: 0.25em; }
.fx-item li { margin: 0.1em 0; }
.fx-inline-list { color: var(--fx-ink); }

.fx-levels { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(13em, 1fr)); gap: 0.35em 1.6em; }
.fx-levels li { display: flex; justify-content: space-between; align-items: center; gap: 0.8em; }
.fx-levels.fx-plain { display: flex; flex-wrap: wrap; gap: 0.2em 0; }
.fx-levels.fx-plain li:not(:last-child)::after { content: "·"; color: var(--fx-muted); margin: 0 0.5em; }
.fx-lvl-word { color: var(--fx-muted); font-size: 0.9em; text-align: right; }
.fx-dots { display: inline-flex; gap: 0.25em; flex: none; }
.fx-dots span { width: 0.62em; height: 0.62em; border-radius: 50%; border: 1px solid var(--fx-acc); }
.fx-dots span.on { background: var(--fx-acc); }

/* Sidebar layout */
.fx-grid { display: grid; grid-template-columns: 32% minmax(0, 1fr); gap: 0 1.8em; }
.fx-side { background: var(--fx-tint); border-radius: 0.5em; padding: 1.1em 1em; align-self: stretch; }
.fx-side .fx-photo { display: block; width: 8.5em; height: 8.5em; margin: 0 auto 0.6em; }
.fx-side .fx-sec-out:first-of-type { margin-top: 0.4em; }
.fx-side .fx-levels { grid-template-columns: 1fr; }
.fx-side .fx-levels.fx-plain { display: grid; }
.fx-side .fx-levels.fx-plain li::after { content: none !important; }
.fx-contact-col { list-style: none; font-size: 0.92em; display: grid; gap: 0.2em; }
.fx-main .fx-name-block { padding-bottom: 0.7em; border-bottom: 2px solid var(--fx-acc); }

/* Modern layout: headings in a left gutter */
.fx-paper.L-modern .fx-head { border-bottom-width: 3px; }
.fx-paper.L-modern .fx-sec-out { display: grid; grid-template-columns: 22% minmax(0, 1fr); gap: 0 1.4em; }
.fx-paper.L-modern .fx-sec-out h3 { border-bottom: 0; padding-top: 0.15em; margin: 0; }
.fx-paper.L-modern .fx-sec-body { border-left: 2px solid var(--fx-line); padding-left: 1.2em; }
.fx-paper.L-modern .fx-name { font-weight: 600; }

/* Page-break marks in the preview */
.fx-break {
  position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--muted);
  pointer-events: none;
}
.fx-break span {
  position: absolute; right: 6px; top: 2px; font-size: 11px; font-family: Inter, system-ui, sans-serif;
  background: var(--bg); color: var(--muted); padding: 0 6px; border-radius: 4px;
}

/* ---------- Print only the CV ---------- */
@media print {
  html, body { color-scheme: light; background: Canvas; }
  body > *:not(main), main > *:not(.fx-app), .fx-form-col, .fx-preview-head, .fx-break { display: none !important; }
  .fx-app, .container { display: block; max-width: none; padding: 0; margin: 0; }
  .fx-preview-col { position: static; max-height: none; overflow: visible; }
  .fx-stage { height: auto !important; overflow: visible; }
  .fx-paper {
    --fx-ink: CanvasText; --fx-bg: Canvas;
    --fx-muted: color-mix(in srgb, CanvasText 72%, Canvas);
    --fx-line: color-mix(in srgb, CanvasText 28%, Canvas);
    color-scheme: light; width: auto !important; min-height: 0 !important; padding: 0 !important;
    transform: none !important; border: 0; box-shadow: none;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}
/* A dark screen theme has light accent colours: darken them for paper */
@media print and (prefers-color-scheme: dark) {
  .fx-paper { --fx-acc: color-mix(in srgb, var(--fx-acc-raw) 45%, CanvasText); }
}
