/* ============================================================
   CV Optimizer — hoja de estilos de plantilla (referencia nueva)
   Reproduce las previews de la maqueta como CV real (tamaño A4).
   Se parametriza con variables por tema (ver themes.css) y con
   una clase de layout en el contenedor .cv:
     .cv--classic  .cv--band  .cv--sidebar
   ============================================================ */

/* The typeface ships with the document. It used to come from Google Fonts,
   fetched at print time over file:// — so on a host without outbound access
   the PDF came out in a fallback face and nothing reported it. Two subsets,
   49 KB, copied next to the CV by cv_html_theme.copy_theme_assets. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/PlusJakartaSans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/PlusJakartaSans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
                 U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --accent: #2b7de9;
  --bg:     #ffffff;
  --ink:    #1a2338;
  --line:   #e9edf5;
  --muted:  #8a93a6;
  --on-accent:  #ffffff;
  --cv-font: "Plus Jakarta Sans", system-ui, "Segoe UI", Arial, sans-serif;
  /* Display face. Only Slate Gray & Lime overrides it, and only for the
     name and the section headings. */
  --display-font: var(--cv-font);

  /* Type scale. Every font-size in this sheet and in cv_app_hooks.css is
     written at the size the design chose and multiplied by this, so the whole
     document tightens or loosens on one number and the hierarchy the design
     set up survives the change intact.

     0.8 is "a CV is not four pages". Generated CVs were running past three:
     the model writes four or five bullets per role and there is no trimming
     it down at print time, so the type carries it. Body text lands at 10.8px
     — about 8pt on A4, which is an ordinary CV body size and roughly a page
     less over a full career — and the name, the section rules and the chips
     come down with it in proportion.

     Line heights are unitless and the spacing between blocks is not scaled,
     so the document gets denser in the text and keeps its rhythm.

     On :root rather than on .cv, like --cv-font above: a document written
     before the reference template may not carry the .cv class at all, and a
     size that resolved to nothing there would fall back to the browser's
     default — 16px, larger than what it replaced. */
  --cv-type-scale: .8;
}

* { box-sizing: border-box; }

/* Tokens derived from --accent are declared here, on .cv, and not on :root.
   A var() inside a custom property is substituted where that property is
   declared, so a --chip-fill written on :root computes against :root's own
   --accent — the default blue — and keeps that blue when it inherits down.
   The theme sets --accent on .cv (themes.css uses .cv[data-theme="…"]), so
   the derived values have to be declared on the same element to see it.
   The theme rules are the more specific selector, so the four themes that
   set their own chip tints still win.

     --accent-ink  the accent moved until it reads as text; the fallback for
                   a document with a layout but no theme.
     --chip-*      secondary chip tints. */
.cv {
  --accent-ink: var(--accent);
  --chip-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --chip-fill: color-mix(in srgb, var(--accent) 10%, transparent);
  --chip-edge: color-mix(in srgb, var(--accent) 32%, transparent);
  font-family: var(--cv-font);
  max-width: 820px;
  margin: 24px auto;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

/* --- shared pieces --- */
/* Type scale. The document used to be a 30px name over a flat 13-14px
   everything: no rhythm, and nothing to look at first. The steps below are
   the hierarchy — name, section, company, role, dates, body — and the
   numbers in a right-aligned column are tabular so they line up. */
.cv-head      { padding: 36px 40px 0; }
.cv-accentbar { height: 6px; width: 56px; background: var(--accent); border-radius: 3px; margin-bottom: 16px; }
.cv-name      {
  font-family: var(--display-font);
  font-size: calc(35px * var(--cv-type-scale)); font-weight: 800; margin: 0;
  line-height: 1.02; letter-spacing: -.5px;
  text-shadow: var(--name-glow, none);
}
.cv-role      { color: var(--accent-ink); font-weight: 600; margin: 7px 0 0; font-size: calc(14.5px * var(--cv-type-scale)); }
.cv-contact   {
  color: var(--ink); opacity: .72;
  font-size: calc(12.5px * var(--cv-type-scale)); margin: 11px 0 0; letter-spacing: .1px;
  font-variant-numeric: tabular-nums;
}

.cv-body { padding: 30px 40px 38px; }

.cv section { margin-bottom: 24px; }
.cv h2 {
  font-family: var(--display-font);
  font-size: calc(11.5px * var(--cv-type-scale)); text-transform: uppercase; letter-spacing: 1.3px; font-weight: 800;
  color: var(--accent-ink); margin: 0 0 12px; padding-bottom: 5px;
  border-bottom: 2px solid var(--accent);
  /* Cyberpunk lights the heading itself. A box-shadow here would outline the
     whole heading box instead, which reads as a border, not a glow. */
  text-shadow: var(--rule-glow, none);
}
.cv p { margin: 0; line-height: 1.6; font-size: calc(13.5px * var(--cv-type-scale)); }

.cv-item { margin-bottom: 15px; }
.cv-item-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; font-size: calc(14.5px * var(--cv-type-scale));
}
.cv-item-head strong { font-weight: 700; }
.cv-item-head span {
  color: var(--muted); white-space: nowrap;
  font-size: calc(12px * var(--cv-type-scale)); font-variant-numeric: tabular-nums;
}
.cv-item p { color: var(--muted); font-size: calc(13px * var(--cv-type-scale)); margin-top: 3px; }

.cv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* Chips are a tint, not a slab: filled accent chips were the loudest thing
   on the page and pulled the eye to Skills instead of Experience. */
.cv-chips span {
  background: var(--chip-fill); color: var(--accent-ink);
  border: 1px solid var(--chip-edge);
  border-radius: 999px; padding: 3px 11px; font-size: calc(12px * var(--cv-type-scale)); font-weight: 600;
}
.cv-chips span.soft { background: transparent; color: var(--muted); border-color: var(--line); }

.cv-photo { width: 92px; height: 92px; border-radius: 50%; background: rgba(255,255,255,.28); }

/* The logo of the company a tailored CV was written for. Hidden until one is
   uploaded, so an untailored CV has no empty box where it would sit. It reads
   as a mark on a letterhead, not a second portrait: contained rather than
   cropped, so a wide wordmark is not cut in half.

   Placement is a grid cell in the header rather than an absolute inset, and
   it sits on the same row as the portrait, immediately to its left: the two
   marks read as one letterhead that way. Given a row of its own below the
   photo, which is where it started, it floated in the white space under the
   header looking like something that had come loose. */
.cv-company-logo[hidden] { display: none; }
/* A caption sits above the mark ("Prepared for Acme"), so the box is a stack
   rather than a fixed rectangle and the size moved onto the image itself. */
.cv-company-logo {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.cv-company-logo img {
  display: block; width: 104px; height: 42px;
  object-fit: contain; object-position: center;
}
.cv-company-for {
  font-size: calc(9.5px * var(--cv-type-scale)); font-weight: 600; letter-spacing: .4px;
  text-transform: uppercase; line-height: 1.25; text-align: end;
  opacity: .78; max-width: 150px;
}
.cv-company-for strong { font-weight: 800; }
.cv-head .cv-company-logo {
  grid-column: 2;
  grid-row: 1 / span 99;
  align-self: start;
  justify-self: end;
  margin-inline-end: 18px;
}
/* The portrait moves over to make room; when there is no logo the column
   collapses and the header is exactly as it was. */
.cv-head:has(.cv-company-logo:not([hidden])) { grid-template-columns: 1fr auto auto; }
.cv-head:has(.cv-company-logo:not([hidden])) .cv-photo-head { grid-column: 3; }
/* A band header is a field of accent colour, and a logo is usually a dark
   mark on a transparent background, so on a band it gets a plate to sit on.
   The plate is on the image alone — the caption above it belongs to the band
   and reads in the band's own text colour. */
.cv--band .cv-company-logo img {
  background: #fff; border-radius: 8px; padding: 6px 9px;
  width: 112px; height: 48px;
}
/* The sidebar layout hides .cv-head entirely, so its copy rides with the name
   block in the main column, top-right of it. */
.cv--sidebar .cv-main-name { position: relative; padding-inline-end: 164px; }
.cv--sidebar .cv-main-name .cv-company-logo {
  position: absolute; top: 0; inset-inline-end: 0; margin: 0;
}

/* pieces that only appear in some layouts */
.cv-side       { display: none; }
.cv-main-name  { display: none; }

/* ============================================================
   LAYOUT: CLASSIC  (columna única, barra de acento)
   Temas: Modern Blue, Crimson Classic, Minimal B&W,
          Monochrome Silver, Golden Sunrise, Forest Green
   ============================================================ */
/* usa los estilos base tal cual */

/* ============================================================
   LAYOUT: BAND  (banda superior de color, nombre en blanco)
   Temas: Midnight Navy, Royal Blue Gradient, Sunset Orange,
          Emerald Flat, Warm Sandstone, Rose Quartz
   ============================================================ */
/* --band-fill lets a theme make the band something other than flat colour
   (Royal Blue Gradient). --on-accent is the ink that reads on it: white
   where white passes 4.5:1, a near-black of the same hue where it does not
   (Rose Quartz, Sunset Orange, Emerald Flat). */
.cv--band .cv-head      { background: var(--band-fill, var(--accent)); color: var(--on-accent); padding: 36px 40px; }
.cv--band .cv-accentbar { display: none; }
.cv--band .cv-name      { color: var(--on-accent); }
.cv--band .cv-role      { color: var(--on-accent); opacity: .92; }
/* Full strength: --on-accent is chosen to clear 4.5:1 on the band, and any
   opacity spends exactly that margin. The contact line is separated by size
   and weight instead. */
.cv--band .cv-contact   { color: var(--on-accent); opacity: 1; font-weight: 500; }

/* ============================================================
   LAYOUT: SIDEBAR  (barra lateral de color con foto + contacto)
   Temas: Ocean Teal, Elegant Charcoal, Violet Tech,
          Slate Gray & Lime, Dark Elegant, Cyberpunk Neon
   ============================================================ */
.cv--sidebar .cv-head        { display: none; }
.cv--sidebar .cv-body        { display: flex; padding: 0; }
.cv--sidebar .cv-side        { display: block; width: 34%; background: var(--accent); color: var(--on-accent); padding: 34px 28px; }
.cv--sidebar .cv-side h3     { font-size: calc(12px * var(--cv-type-scale)); text-transform: uppercase; letter-spacing: .6px; opacity: .85; margin: 0 0 10px; }
.cv--sidebar .cv-side ul     { list-style: none; padding: 0; margin: 0 0 24px; font-size: calc(13px * var(--cv-type-scale)); line-height: 1.9; }
.cv--sidebar .cv-side .cv-chips span {
  background: color-mix(in srgb, var(--on-accent) 14%, transparent);
  color: var(--on-accent);
  border-color: color-mix(in srgb, var(--on-accent) 30%, transparent);
}
.cv--sidebar .cv-main        { flex: 1; padding: 36px 36px; }
.cv--sidebar .cv-main-name   { display: block; margin-bottom: 22px; }
.cv--sidebar .cv-main-name .cv-name { font-size: calc(30px * var(--cv-type-scale)); }
.cv--sidebar .cv-inline-skills { display: none; }

@media print {
  .cv { border: 0; border-radius: 0; margin: 0; max-width: none; }
}
