/* ==========================================================================
   SRC_CV — Daniel Guillén del Rey
   Implemented from Figma: src_cv_03 (763 × 1080 px, A4 ratio)
    Fonts: Everett (Light 300 / Regular 400 / Medium 500) in /font
   To adapt the CV to a job offer: edit the text in index.html.
   The page is contenteditable: click any text and type.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Everett';
  src: url('../font/Everett-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Everett';
  src: url('../font/Everett-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Everett';
  src: url('../font/Everett-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens (from Figma) ---------- */
:root {
  --c-blue: #012ffe;   /* brand blue — titles, bands, blocks        */
  --c-light: #efefef;  /* header bg / Teaching box / text on blue   */
  --c-gray: #d9d9d9;   /* Work Experience / Languages boxes         */
  --c-col: #a2a2a2;    /* right-column content boxes                */
  --c-page: #bbbbbb;   /* page background                           */
  --c-text: #171717;   /* main text                                 */
  --c-muted: #4e4e4e;  /* secondary text (charges, labels, numbers) */

  --font: 'Everett', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Everett Mono', 'Courier New', ui-monospace, monospace;

  --page-w: 763px;
  --page-h: 1080px;
  --pad: 20px;          /* page side padding                         */
  --head-h: 127px;      /* header height                             */
  --band-h: 18px;       /* contact band height                       */
  --tab-h: 18px;        /* blue tab under the band                   */
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }
img { display: block; }

body {
  background: #8e8e8e;
  font-family: var(--font);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  padding: 24px;
}

/* ==========================================================================
   PAGE
   ========================================================================== */
.cv {
  position: relative;
  width: var(--page-w);
  min-height: var(--page-h);            /* grows with content */
  margin: 0 auto;
  background: var(--c-page);
  overflow: hidden;
  outline: none;
}

.cv:focus { outline: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   HEADER  (y 0 – 127)
   ========================================================================== */
.header {
  position: relative;
  height: var(--head-h);
  background: var(--c-light);
}

.header__logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 65px;
}

.header__name {
  position: absolute;
  top: 28px;
  left: 59px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.32;
}

.header__birth {
  position: absolute;
  top: 57px;
  left: 215px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.header__role {
  position: absolute;
  bottom: 2px;
  left: var(--pad);
  font-size: 15px;
  line-height: 1.33;
}

/* blue block sitting on the header's bottom edge (x 203 – 422) */
.header__role-block {
  position: absolute;
  bottom: 0;
  left: 203px;
  width: 219px;
  height: 25px;
  background: var(--c-blue);
}

/* ==========================================================================
   CONTACT BAND  (y 127 – 145)  +  blue tab (y 145 – 163)
   ========================================================================== */
.band {
  position: relative;
  z-index: 2;                           /* keep links above the right column */
  height: var(--band-h);
  background: var(--c-blue);
  color: var(--c-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
}

.band__link {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.band__tab {
  width: 83px;
  height: var(--tab-h);
  background: var(--c-blue);
}

/* ==========================================================================
   BODY — two columns
   left 352 px (x 20) · gutter 20 px · right 371 px (x 392)
   ========================================================================== */
.body {
  display: flex;
  gap: var(--pad);
  min-height: calc(var(--page-h) - var(--head-h) - var(--band-h) - var(--tab-h));
  padding: 24px var(--pad) 0;
  align-items: stretch;
}

.column--left {
  width: 352px;
  flex: none;
  display: flex;
  flex-direction: column;
}

.column--right {
  width: 371px;
  flex: none;
  position: relative;
  z-index: 1;
  background: var(--c-blue);
  margin-top: -60px;                    /* column blue starts at y = 127     */
  padding-top: 0;
}

/* ==========================================================================
   LEFT COLUMN SECTIONS
   Boxes bleed 20 px into the page padding on both sides (Figma x 0 – 392).
   ========================================================================== */
.section__title {
  color: var(--c-blue);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.32;
  margin-bottom: 7px;
}

.column--left .section { padding-left: 24px; }   /* content indent (x 44) */

/* boxed sections: background reaches the column edges */
.column--left .bg-gray,
.column--left .bg-light {
  margin-left: calc(-1 * var(--pad));
  margin-right: calc(-1 * var(--pad));
  padding: 4px var(--pad) 19px;
}
.column--left .bg-gray  { background: var(--c-gray); }
.column--left .bg-light { background: var(--c-light); }

/* boxed section content keeps the 24 px indent (items at x 44) */
.column--left .bg-gray .item,
.column--left .bg-light .item,
.column--left .bg-gray .lang-list,
.column--left .bg-light .lang-list { margin-left: 24px; }

#education { padding-bottom: 10px; }    /* sits directly on the page bg */

/* Languages box stretches to the bottom edge of the page */
.section--last {
  flex: 1;
  margin-bottom: -24px;
  padding-bottom: 24px;
}

/* ==========================================================================
   EXPERIENCE ITEMS  (Education / Work Experience / Teaching)
   Add/remove <article class="item"> blocks freely.
   ========================================================================== */
.item + .item { margin-top: 6px; }

.item__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.item__position { max-width: 171px; }

.item__index {
  display: block;
  font-size: 6px;
  font-weight: 300;
  line-height: 1.32;
  color: var(--c-muted);
  margin-bottom: 1px;
}

.item__title {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.32;
}

/* --- date range: stacked label over mono value, "/" in between --- */
.item__date {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  margin-top: 4px;
  margin-right: 23px;                   /* date block right edge at x 349 */
}

.item__date-part { display: flex; flex-direction: column; }

.item__date-label {
  font-size: 6px;
  font-weight: 300;
  line-height: 1.32;
  color: var(--c-muted);
}

.item__date-value {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.32;
  font-variant-numeric: tabular-nums;
}

.item__date-value--current { font-family: var(--font); font-weight: 500; }

.item__date-sep {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 200;
  line-height: 1.32;
}

/* --- body: organisation left / company type + charges right --- */
.item__body {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 4px;
}

.item__org-block { width: 171px; flex: none; }

/* charge lines under the org block may extend past it (up to x 308) */
.item__org-block .charges { width: 264px; }

.item__org {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.3;
}

.item__note {
  font-size: 10px;
  font-weight: 300;
  line-height: 1.3;
  margin-top: 2px;
}

.item__org-type {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.3;
  min-width: 128px;
}

/* "/ charge" responsibility lines */
.charges { margin-top: 6px; }

.charges li {
  font-size: 10px;
  font-weight: 300;
  line-height: 1.3;
  color: var(--c-muted);
  padding: 2px 0 2px 26px;
}
.charges li::before { content: '/ '; }

.item__side .charges { margin-top: 4px; }
.item__side .charges li { padding-left: 24px; }

/* ==========================================================================
   LANGUAGES
   ========================================================================== */
.lang-list { padding-top: 9px; }

.lang-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 3px 0;
}

.lang-list__name { font-size: 13px; }

.lang-list__level {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   RIGHT COLUMN
   Blue column; each section = gray title chip + gray content box,
   the blue shows through in the 23 px gaps and beside the chips.
   ========================================================================== */

/* Core skills — white "/ " list on blue, block inset 30 px from the left */
.core-skills {
  margin: -107px 0 0 30px;              /* block top edge at y = 20 */
  width: 341px;
  padding-bottom: 21px;                 /* block bottom edge at y = 145 */
  background: var(--c-blue);
  color: var(--c-light);
}

.core-skills li {
  font-size: 15px;
  line-height: 1.33;
  padding: 3px 0;
}
.core-skills li::before { content: '/ '; }

/* --- right-column sections --- */
.column--right { display: flex; flex-direction: column; }

.section--right { margin-top: 23px; }   /* blue gap band between sections */
.core-skills + .section--right { margin-top: 42px; }  /* blue strip under core skills */

/* last section's gray box stretches to the bottom edge of the page */
.section--right:last-of-type {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.section--right:last-of-type .plain-list { flex: 1; }

.section--right .section__title {
  display: inline-block;
  background: var(--c-col);
  padding: 0 24px 12px 0;               /* gray chip behind the title */
  margin-bottom: 0;
}

.section--right .skills,
.section--right .plain-list {
  background: var(--c-col);
  padding: 0 0 8px 30px;                /* content indent (x 422) */
}

/* Skill groups */
.skill-group + .skill-group { margin-top: 6px; }

.skill-group__title {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.31;
  margin-bottom: 3px;
}

.tag-list li {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.33;
  padding: 1px 0 1px 33px;              /* slash at +24, text at +33 */
}
.tag-list li::before {
  content: '/';
  display: inline-block;
  width: 9px;
  margin-left: -9px;
  color: var(--c-light);                /* light slash marker, as in Figma */
}

/* Plain lists (AI proficiencies / Soft skills) */
.plain-list li {
  font-size: 13px;
  line-height: 1.31;
  padding: 3px 0;
}

/* ==========================================================================
   MD LOADER FALLBACK (shown when cv.md can't be fetched, e.g. file://)
   ========================================================================== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 23, 23, 0.55);
  font-family: var(--font);
}
.loader[hidden] { display: none; }

.loader__card {
  background: var(--c-light);
  border-top: 18px solid var(--c-blue);
  padding: 28px 32px;
  max-width: 420px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-text);
}
.loader__title { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.loader__card code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--c-gray);
  padding: 1px 4px;
}
.loader__card input[type="file"] { margin-top: 14px; font-size: 12px; }

/* ==========================================================================
   RESPONSIVE — stack columns on narrow screens
   ========================================================================== */
@media screen and (max-width: 800px) {
  body { padding: 0; }
  .cv { width: 100%; min-height: 0; overflow: visible; }
  .body { flex-direction: column; min-height: 0; }
  .column--left, .column--right { width: 100%; }
  .column--right { margin-top: 0; }
  .core-skills { margin: 0; width: auto; }
  .section--right:first-of-type { margin-top: 23px; }
  .section--last { margin-bottom: 0; }
}

/* ==========================================================================
   PRINT — one page with the layout's own proportions (763 × 1080 px).
   The page height is adjusted to the content by js/app.js (#page-size),
   so everything always fits on a single page.
   ========================================================================== */
@page { size: 763px 1080px; margin: 0; }

@media print {
  body { background: none; padding: 0; margin: 0; }
  .cv {
    margin: 0;
    overflow: visible;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
