/* ==========================================================================
   Folio — CV templates

   One CV, many looks. Every template shows the same draft data on one A4
   page; a template only changes the layout and the look.

   How to add a template:
   1. Add it to window.FOLIO_TEMPLATES in js/templates-data.js
      (id, name, description, bestFor, tags).
   2. Add a block below: `:where(.cv-page[data-template="<id>"])`.
      Set the --cv-* variables, then style only what differs from the base.
      Use --cv-accent, --cv-chip, --cv-font and --cv-space so the Design
      options (colour, font, spacing) work. Don't use position: relative
      or absolute on text: positioned text comes last in the PDF.
   3. Raise the ?v= number in the .html pages (editor, templates, home...).

   Template selectors for elements inside the page use :where() so they are
   no stronger than the base rules. The template's own page-level block
   (variables, padding, font size) uses a plain .cv-page[data-template="..."]
   selector, because :where() would make it weaker than the base .cv-page.
   The "states" block at the end (placeholders, empty notes) must always
   win, so it stays last and uses a stronger selector.

   The sections sit in two groups: .cv-page__main (about, education,
   experience, projects, volunteering, certificates) and .cv-page__side
   (skills, languages, hobbies). Most templates ignore the groups
   (display: contents); Split puts them in two columns. Each section has
   data-cv-section="<name>" for styling one section.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base: every template
   -------------------------------------------------------------------------- */

.cv-page {
  /* A CV is white paper, also in dark mode: the light colours from colors.css */
  --bg-surface: #ffffff;
  --bg-selected: #e8f0ff;
  --text-strong: #0e1830;
  --text-primary: #17233b;
  --text-secondary: #4f6080;
  --border-decorative: #e2e9f6;
  --border-subtle: #c3d3f2;
  --action-primary: #1a5ff0;
  color-scheme: light;

  /* Template variables (each template sets its own) */
  --cv-accent: var(--action-primary);
  --cv-ink: var(--text-strong);
  --cv-text: var(--text-primary);
  --cv-muted: var(--text-secondary);
  --cv-line: var(--border-decorative);
  --cv-chip: var(--bg-selected);
  --cv-placeholder: var(--border-subtle);
  --cv-band: var(--brand-gradient);
  --cv-font: inherit;
  --cv-space: 1; /* spacing between blocks; Design > Spacing changes it */

  position: absolute;
  top: 0;
  left: 0;
  width: 794px; /* A4: 210 mm at 96 dpi */
  height: 1123px; /* A4: 297 mm at 96 dpi */
  padding: 64px 72px;
  overflow: hidden;
  overflow-wrap: anywhere; /* very long words wrap instead of running off the page */
  background: var(--bg-surface);
  box-shadow: 0 0 0 1px var(--border-decorative), 0 20px 48px -24px var(--shadow-tint);
  color: var(--cv-text);
  font-family: var(--cv-font);
  font-size: 15px;
  transform-origin: top left;
}

.cv-page__name {
  color: var(--cv-ink);
}

/* The two groups only matter for Split (see there) */
.cv-page__main,
.cv-page__side {
  display: contents;
}

/* An extra section that isn't added (or a template rule must not show it) */
.cv-page .cv-page__section[hidden] {
  display: none;
}

.cv-page__about {
  color: var(--cv-text);
  white-space: pre-line;
}

.cv-page__contact {
  padding: 0;
  list-style: none;
}

.cv-page__skills {
  padding: 0;
  list-style: none;
}

.cv-page__entries {
  display: grid;
}

.cv-entry__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.cv-entry__title {
  color: var(--cv-ink);
}

.cv-entry__dates {
  flex: none;
}

.cv-entry__desc {
  color: var(--cv-text);
  white-space: pre-line;
}

.cv-entry__bullets {
  color: var(--cv-text);
}

/* --------------------------------------------------------------------------
   Template: Modern
   Gradient band on top, blue accents, skills as chips.
   -------------------------------------------------------------------------- */

:where(.cv-page[data-template="modern"])::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background: var(--cv-band);
}

:where(.cv-page[data-template="modern"]) .cv-page__head {
  padding-bottom: calc(24px * var(--cv-space));
  border-bottom: 2px solid var(--cv-line);
}

:where(.cv-page[data-template="modern"]) .cv-page__name {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

:where(.cv-page[data-template="modern"]) .cv-page__role {
  margin-top: 6px;
  font-size: 18px;
  color: var(--cv-accent);
}

:where(.cv-page[data-template="modern"]) .cv-page__about {
  line-height: 1.6;
}

:where(.cv-page[data-template="modern"]) .cv-page__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 14px;
  color: var(--cv-muted);
  font-size: 14px;
}

:where(.cv-page[data-template="modern"]) .cv-page__section {
  margin-top: calc(32px * var(--cv-space));
}

:where(.cv-page[data-template="modern"]) .cv-page__heading {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cv-accent);
}

:where(.cv-page[data-template="modern"]) .cv-page__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

:where(.cv-page[data-template="modern"]) .cv-page__skill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--cv-chip);
  color: var(--cv-ink);
  font-weight: 500;
}

:where(.cv-page[data-template="modern"]) .cv-page__level {
  color: var(--cv-muted);
  font-size: 13px;
  font-weight: 400;
}

:where(.cv-page[data-template="modern"]) .cv-page__entries {
  gap: calc(18px * var(--cv-space));
}

:where(.cv-page[data-template="modern"]) .cv-entry__title {
  font-size: 17px;
  font-weight: 600;
}

:where(.cv-page[data-template="modern"]) .cv-entry__dates {
  font-size: 13px;
  color: var(--cv-muted);
}

:where(.cv-page[data-template="modern"]) .cv-entry__sub {
  margin-top: 2px;
  color: var(--cv-accent);
  font-weight: 500;
}

:where(.cv-page[data-template="modern"]) .cv-entry__desc {
  margin-top: 6px;
}

:where(.cv-page[data-template="modern"]) .cv-entry__bullets {
  margin: 6px 0 0;
  padding-left: 18px;
}

:where(.cv-page[data-template="modern"]) .cv-entry__bullets li + li {
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Template: Classic
   Traditional and calm: serif type, centred header, thin rules, no colour.
   Suits law, finance, government and other formal fields.
   -------------------------------------------------------------------------- */

/* Page-level settings need real specificity to beat the base .cv-page rule */
.cv-page[data-template="classic"] {
  --cv-accent: #111827; /* same as the ink: no colour unless one is chosen */
  --cv-ink: #111827;
  --cv-text: #1f2933;
  --cv-muted: #4b5563;
  --cv-line: #9aa3ae;
  --cv-placeholder: #c7ccd3;
  --cv-font: Georgia, "Times New Roman", Times, serif;

  padding: 60px 76px;
  font-size: 14.5px;
  line-height: 1.5;
}

:where(.cv-page[data-template="classic"]) .cv-page__head {
  padding-bottom: calc(18px * var(--cv-space));
  border-bottom: 1.5px solid var(--cv-accent);
  text-align: center;
}

:where(.cv-page[data-template="classic"]) .cv-page__name {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:where(.cv-page[data-template="classic"]) .cv-page__role {
  margin-top: 6px;
  color: var(--cv-muted);
  font-size: 16px;
  font-style: italic;
}

:where(.cv-page[data-template="classic"]) .cv-page__contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
  color: var(--cv-muted);
  font-size: 13.5px;
}

/* Contact details separated by a middle dot */
:where(.cv-page[data-template="classic"]) .cv-page__contact li + li::before {
  content: "\00b7";
  margin: 0 10px;
}

:where(.cv-page[data-template="classic"]) .cv-page__section {
  margin-top: calc(26px * var(--cv-space));
}

:where(.cv-page[data-template="classic"]) .cv-page__heading {
  margin-bottom: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--cv-line);
  color: var(--cv-accent);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

:where(.cv-page[data-template="classic"]) .cv-page__about {
  line-height: 1.6;
}

:where(.cv-page[data-template="classic"]) .cv-page__entries {
  gap: calc(16px * var(--cv-space));
}

:where(.cv-page[data-template="classic"]) .cv-entry__title {
  font-size: 15.5px;
  font-weight: 700;
}

:where(.cv-page[data-template="classic"]) .cv-entry__dates {
  color: var(--cv-muted);
  font-size: 13.5px;
  font-style: italic;
}

:where(.cv-page[data-template="classic"]) .cv-entry__sub {
  margin-top: 1px;
  color: var(--cv-muted);
  font-style: italic;
}

:where(.cv-page[data-template="classic"]) .cv-entry__desc {
  margin-top: 4px;
}

:where(.cv-page[data-template="classic"]) .cv-entry__bullets {
  margin: 4px 0 0;
  padding-left: 20px;
}

/* Skills as one comma-separated line: "Figma (Advanced), HTML & CSS, ..." */
:where(.cv-page[data-template="classic"]) .cv-page__skills {
  display: block;
}

:where(.cv-page[data-template="classic"]) .cv-page__skill {
  display: inline;
}

:where(.cv-page[data-template="classic"]) .cv-page__skill + .cv-page__skill::before {
  content: ", ";
}

:where(.cv-page[data-template="classic"]) .cv-page__level {
  margin-left: 4px;
  color: var(--cv-muted);
  font-style: italic;
}

:where(.cv-page[data-template="classic"]) .cv-page__level::before {
  content: "(";
}

:where(.cv-page[data-template="classic"]) .cv-page__level::after {
  content: ")";
}

/* --------------------------------------------------------------------------
   Template: Minimal
   Lots of white space, section names in a narrow left column, plain text
   with one short accent line under the name.
   -------------------------------------------------------------------------- */

/* Page-level settings need real specificity to beat the base .cv-page rule */
.cv-page[data-template="minimal"] {
  --cv-accent: var(--action-primary);
  --cv-ink: #111827;
  --cv-text: #374151;
  --cv-muted: #6b7280;
  --cv-line: #e5e7eb;
  --cv-placeholder: #d1d5db;

  padding: 76px 80px;
  font-size: 14px;
  line-height: 1.55;
}

/* The one accent: a short line under the name block. Not positioned, so
   the name stays first in the PDF's text order (CV scanners read it). */
:where(.cv-page[data-template="minimal"]) .cv-page__head::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: calc(25px * var(--cv-space));
  background: var(--cv-accent);
}

:where(.cv-page[data-template="minimal"]) .cv-page__name {
  font-size: 34px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

:where(.cv-page[data-template="minimal"]) .cv-page__role {
  margin-top: 4px;
  color: var(--cv-muted);
  font-size: 16px;
}

:where(.cv-page[data-template="minimal"]) .cv-page__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin-top: 14px;
  color: var(--cv-muted);
  font-size: 13px;
}

/* Two columns per section: name on the left, content on the right */
:where(.cv-page[data-template="minimal"]) .cv-page__section {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  column-gap: 28px;
  margin-top: calc(30px * var(--cv-space));
}

:where(.cv-page[data-template="minimal"]) .cv-page__section > * {
  grid-column: 2;
}

:where(.cv-page[data-template="minimal"]) .cv-page__section > .cv-page__heading {
  grid-column: 1;
  grid-row: 1 / span 3;
  padding-top: 2px;
  color: var(--cv-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

:where(.cv-page[data-template="minimal"]) .cv-page__entries {
  gap: calc(18px * var(--cv-space));
}

:where(.cv-page[data-template="minimal"]) .cv-entry__title {
  font-size: 15px;
  font-weight: 600;
}

:where(.cv-page[data-template="minimal"]) .cv-entry__dates {
  color: var(--cv-muted);
  font-size: 12.5px;
}

:where(.cv-page[data-template="minimal"]) .cv-entry__sub {
  margin-top: 1px;
  color: var(--cv-muted);
}

:where(.cv-page[data-template="minimal"]) .cv-entry__desc {
  margin-top: 6px;
}

:where(.cv-page[data-template="minimal"]) .cv-entry__bullets {
  margin: 6px 0 0;
  padding-left: 16px;
}

:where(.cv-page[data-template="minimal"]) .cv-page__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}

:where(.cv-page[data-template="minimal"]) .cv-page__skill {
  color: var(--cv-ink);
}

:where(.cv-page[data-template="minimal"]) .cv-page__level {
  margin-left: 6px;
  color: var(--cv-muted);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   Template: Split
   Coloured header across the top, then two columns: skills in a tinted
   column on the left, the rest on the right. The HTML order stays the same
   (skills last), so CV scanners read it in the normal order.
   -------------------------------------------------------------------------- */

.cv-page[data-template="split"] {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  align-content: start;
  column-gap: 52px;
  row-gap: calc(28px * var(--cv-space));
  /* The header pulls itself up over the top padding; the padding is there
     so page 2 of a too-long CV (in the PDF) gets space at the top too. */
  padding: 48px 60px 64px 36px;
  /* Tinted left column: 36px padding + 196px column + half the gap */
  background: linear-gradient(90deg, var(--cv-chip) 0 258px, var(--bg-surface) 258px);
  font-size: 14px;
  line-height: 1.5;
}

:where(.cv-page[data-template="split"]) .cv-page__head {
  --cv-placeholder: rgba(255, 255, 255, 0.6); /* "Your name" on the colour */
  grid-column: 1 / -1;
  margin: -48px -60px 0 -36px;
  padding: 52px 60px calc(32px * var(--cv-space)) 36px;
  background: var(--cv-accent);
  color: #fff;
}

:where(.cv-page[data-template="split"]) .cv-page__name {
  color: #fff;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

:where(.cv-page[data-template="split"]) .cv-page__role {
  margin-top: 4px;
  font-size: 17px;
}

:where(.cv-page[data-template="split"]) .cv-page__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 14px;
  font-size: 13.5px;
}

/* Two columns: skills, languages and hobbies on the left, the rest right */
:where(.cv-page[data-template="split"]) .cv-page__main,
:where(.cv-page[data-template="split"]) .cv-page__side {
  display: grid;
  align-content: start;
  row-gap: calc(28px * var(--cv-space));
  grid-row: 2;
}

:where(.cv-page[data-template="split"]) .cv-page__main { grid-column: 2; }
:where(.cv-page[data-template="split"]) .cv-page__side { grid-column: 1; }

:where(.cv-page[data-template="split"]) .cv-page__heading {
  margin-bottom: 12px;
  color: var(--cv-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

:where(.cv-page[data-template="split"]) .cv-page__about {
  line-height: 1.6;
}

:where(.cv-page[data-template="split"]) .cv-page__entries {
  gap: calc(18px * var(--cv-space));
}

:where(.cv-page[data-template="split"]) .cv-entry__title {
  font-size: 15.5px;
  font-weight: 600;
}

:where(.cv-page[data-template="split"]) .cv-entry__dates {
  color: var(--cv-muted);
  font-size: 12.5px;
}

:where(.cv-page[data-template="split"]) .cv-entry__sub {
  margin-top: 2px;
  color: var(--cv-accent);
  font-weight: 500;
}

:where(.cv-page[data-template="split"]) .cv-entry__desc {
  margin-top: 6px;
}

:where(.cv-page[data-template="split"]) .cv-entry__bullets {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* Skills: one per line in the left column, level underneath */
:where(.cv-page[data-template="split"]) .cv-page__skills {
  display: grid;
  gap: 10px;
}

:where(.cv-page[data-template="split"]) .cv-page__skill {
  color: var(--cv-ink);
  font-weight: 500;
}

:where(.cv-page[data-template="split"]) .cv-page__level {
  display: block;
  color: var(--cv-muted);
  font-size: 12.5px;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Template: Timeline
   Education and experience on a vertical line with a dot per entry. The
   line and dot are backgrounds, not positioned elements, so the PDF text
   stays in reading order.
   -------------------------------------------------------------------------- */

.cv-page[data-template="timeline"] {
  padding: 64px 72px;
  font-size: 14.5px;
  line-height: 1.5;
}

:where(.cv-page[data-template="timeline"]) .cv-page__head {
  padding-bottom: calc(8px * var(--cv-space));
}

:where(.cv-page[data-template="timeline"]) .cv-page__name {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

:where(.cv-page[data-template="timeline"]) .cv-page__role {
  margin-top: 4px;
  color: var(--cv-accent);
  font-size: 17px;
  font-weight: 500;
}

:where(.cv-page[data-template="timeline"]) .cv-page__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 12px;
  color: var(--cv-muted);
  font-size: 13.5px;
}

:where(.cv-page[data-template="timeline"]) .cv-page__section {
  margin-top: calc(28px * var(--cv-space));
}

/* Section title with a short accent bar in front */
:where(.cv-page[data-template="timeline"]) .cv-page__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--cv-ink);
  font-size: 15px;
  font-weight: 700;
}

:where(.cv-page[data-template="timeline"]) .cv-page__heading::before {
  content: "";
  flex: none;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--cv-accent);
}

:where(.cv-page[data-template="timeline"]) .cv-page__about {
  line-height: 1.6;
}

:where(.cv-page[data-template="timeline"]) .cv-page__entries {
  gap: 0;
}

:where(.cv-page[data-template="timeline"]) .cv-entry {
  padding: 0 0 calc(18px * var(--cv-space)) 26px;
  background-image:
    radial-gradient(circle at 5px 10px, var(--cv-accent) 0 4.5px, transparent 5px),
    linear-gradient(var(--cv-line), var(--cv-line));
  background-position: 0 0, 4px 0;
  background-size: 100% 100%, 2px 100%;
  background-repeat: no-repeat;
}

:where(.cv-page[data-template="timeline"]) .cv-entry:last-child {
  padding-bottom: 0;
}

:where(.cv-page[data-template="timeline"]) .cv-entry__title {
  font-size: 15.5px;
  font-weight: 600;
}

:where(.cv-page[data-template="timeline"]) .cv-entry__dates {
  color: var(--cv-accent);
  font-size: 12.5px;
  font-weight: 600;
}

:where(.cv-page[data-template="timeline"]) .cv-entry__sub {
  margin-top: 1px;
  color: var(--cv-muted);
}

:where(.cv-page[data-template="timeline"]) .cv-entry__desc {
  margin-top: 6px;
}

:where(.cv-page[data-template="timeline"]) .cv-entry__bullets {
  margin: 6px 0 0;
  padding-left: 18px;
}

:where(.cv-page[data-template="timeline"]) .cv-page__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

:where(.cv-page[data-template="timeline"]) .cv-page__skill {
  padding: 4px 10px;
  border: 1px solid var(--cv-line);
  border-radius: 6px;
  color: var(--cv-ink);
}

:where(.cv-page[data-template="timeline"]) .cv-page__level {
  margin-left: 6px;
  color: var(--cv-muted);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   Template: Concise
   Smaller type and tight spacing: fits the most on one page. Contact
   details sit to the right of the name; skills in three columns.
   -------------------------------------------------------------------------- */

.cv-page[data-template="concise"] {
  padding: 48px 56px;
  font-size: 13px;
  line-height: 1.45;
}

:where(.cv-page[data-template="concise"]) .cv-page__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 24px;
  padding-bottom: calc(14px * var(--cv-space));
  border-bottom: 2px solid var(--cv-ink);
}

/* Name and job title stay together, however tall the contact column is */
:where(.cv-page[data-template="concise"]) .cv-page__name {
  align-self: end;
  grid-column: 1;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
}

:where(.cv-page[data-template="concise"]) .cv-page__role {
  align-self: start;
  grid-column: 1;
  margin-top: 2px;
  color: var(--cv-accent);
  font-size: 15px;
  font-weight: 500;
}

:where(.cv-page[data-template="concise"]) .cv-page__contact {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-items: end;
  gap: 1px;
  color: var(--cv-muted);
  font-size: 12px;
  text-align: right;
}

:where(.cv-page[data-template="concise"]) .cv-page__section {
  margin-top: calc(16px * var(--cv-space));
}

/* Section title followed by a thin line to the right edge */
:where(.cv-page[data-template="concise"]) .cv-page__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--cv-accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:where(.cv-page[data-template="concise"]) .cv-page__heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--cv-line);
}

:where(.cv-page[data-template="concise"]) .cv-page__entries {
  gap: calc(10px * var(--cv-space));
}

:where(.cv-page[data-template="concise"]) .cv-entry__title {
  font-size: 13.5px;
  font-weight: 600;
}

:where(.cv-page[data-template="concise"]) .cv-entry__dates {
  color: var(--cv-muted);
  font-size: 12px;
}

:where(.cv-page[data-template="concise"]) .cv-entry__sub {
  color: var(--cv-muted);
}

:where(.cv-page[data-template="concise"]) .cv-entry__desc {
  margin-top: 3px;
}

:where(.cv-page[data-template="concise"]) .cv-entry__bullets {
  margin: 3px 0 0;
  padding-left: 16px;
}

:where(.cv-page[data-template="concise"]) .cv-page__skills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px 16px;
}

:where(.cv-page[data-template="concise"]) .cv-page__skill {
  color: var(--cv-ink);
}

:where(.cv-page[data-template="concise"]) .cv-page__level {
  margin-left: 4px;
  color: var(--cv-muted);
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   Design options: every template (editor > Design). Set on the page as
   data-color, data-font and data-spacing; no attribute = the template's own.
   These come after the templates so they win over their variables. Every
   accent colour has at least 4.5:1 contrast on white.
   -------------------------------------------------------------------------- */

.cv-page[data-color="teal"] {
  --cv-accent: #0f766e;
  --cv-chip: #e3f4f1;
  --cv-band: linear-gradient(90deg, #0f766e, #2dd4bf);
}

.cv-page[data-color="green"] {
  --cv-accent: #15803d;
  --cv-chip: #e6f4ea;
  --cv-band: linear-gradient(90deg, #15803d, #4ade80);
}

.cv-page[data-color="purple"] {
  --cv-accent: #6d28d9;
  --cv-chip: #efe9fc;
  --cv-band: linear-gradient(90deg, #6d28d9, #a78bfa);
}

.cv-page[data-color="berry"] {
  --cv-accent: #be185d;
  --cv-chip: #fbe7f0;
  --cv-band: linear-gradient(90deg, #be185d, #f472b6);
}

.cv-page[data-color="orange"] {
  --cv-accent: #c2410c;
  --cv-chip: #fcece3;
  --cv-band: linear-gradient(90deg, #c2410c, #fb923c);
}

.cv-page[data-color="charcoal"] {
  --cv-accent: #1f2937;
  --cv-chip: #eceef1;
  --cv-band: linear-gradient(90deg, #1f2937, #6b7280);
}

.cv-page[data-font="inter"] {
  --cv-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.cv-page[data-font="georgia"] {
  --cv-font: Georgia, "Times New Roman", Times, serif;
}

.cv-page[data-font="arial"] {
  --cv-font: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

.cv-page[data-spacing="compact"] {
  --cv-space: 0.65;
}

.cv-page[data-spacing="roomy"] {
  --cv-space: 1.3;
}

/* --------------------------------------------------------------------------
   Photo (optional): top right of the header, round or square (Design >
   Photo). Classic puts it centred above the name, Split in the coloured
   band, Concise a bit smaller. It is an image, so it never changes the
   order of the text in the PDF.
   -------------------------------------------------------------------------- */

.cv-page__photo {
  position: absolute;
  top: 0;
  right: 0;
  display: block;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
}

.cv-page[data-photo="square"] .cv-page__photo {
  border-radius: 10px;
}

/* Room for the photo next to the name and contact details */
.cv-page__head:has(> .cv-page__photo:not([hidden])) {
  position: relative;
  min-height: 112px;
  padding-right: 140px;
}

:where(.cv-page[data-template="classic"]) .cv-page__head:has(> .cv-page__photo:not([hidden])) {
  min-height: auto;
  padding-right: 0;
}

:where(.cv-page[data-template="classic"]) .cv-page__photo {
  position: static;
  margin: 0 auto 16px;
}

:where(.cv-page[data-template="split"]) .cv-page__head:has(> .cv-page__photo:not([hidden])) {
  min-height: auto; /* never 0: in the Split grid the header row could then be squeezed */
  padding-right: 200px;
}

:where(.cv-page[data-template="split"]) .cv-page__photo {
  top: 40px;
  right: 60px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85);
}

:where(.cv-page[data-template="concise"]) .cv-page__head:has(> .cv-page__photo:not([hidden])) {
  min-height: 84px;
  padding-right: 108px;
}

:where(.cv-page[data-template="concise"]) .cv-page__photo {
  width: 84px;
  height: 84px;
}

/* --------------------------------------------------------------------------
   States: every template. Keep last; these must win over template rules.
   -------------------------------------------------------------------------- */

.cv-page .is-placeholder,
.cv-page .cv-page__empty {
  color: var(--cv-placeholder);
}
