/* =========================================================================
   doc.css · secondary pages of the elunic site: CV (screen + one A4 page),
   notice and 404. Loaded after fonts.css and tokens.css (same font, colours
   and focus ring as the start page). The markup comes from the shared
   templates (src/templates/cv.mjs, notice.mjs); the tile layout follows the
   tested CV of the other applications, in the colours of this site.
   One page in the PDF is checked by scripts/pdf.mjs (no text over a tile edge,
   sheet at most one A4 page).
   ========================================================================= */

.doc { background: var(--c-bg); color: var(--tx-1); }
.doc a { color: var(--tx-petrol); text-underline-offset: 3px; }
.doc a:hover { text-decoration-thickness: 2px; }
.no-js .js-only { display: none !important; }

/* draft builds only (npm run build): yellow note, open facts marked */
.draft-banner { margin: 0; padding: 10px 16px 8px; background: var(--hint-bg); color: var(--hint); font-size: var(--fs-sm); font-weight: var(--fw-semi); text-align: center; }
mark.todo { background: #ffe066; color: #3d3000; padding: 0 3px; border-radius: 3px; }

/* ---------- toolbar above the sheet ---------- */
.cv-toolbar { max-width: 210mm; margin: 0 auto; padding: 16px 16px 12px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; font-size: var(--fs-sm); }
.cv-toolbar__right { display: flex; gap: 6px; align-items: center; }
.doc .cv-back { display: inline-flex; align-items: center; min-height: 44px; padding: 2px 16px 0; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); background: var(--c-white); font-weight: var(--fw-bold); text-decoration: none; }
.doc .cv-back:hover { border-color: var(--c-petrol); }
.cv-print { appearance: none; min-height: 44px; padding: 2px 18px 0; border: 0; border-radius: var(--r-pill); background: var(--c-petrol); color: var(--tx-inv); font-weight: var(--fw-bold); cursor: pointer; }
.cv-print:hover { background: #00374f; }

/* ---------- sheet ---------- */
/* a sheet without a toolbar above it (404) keeps a gap to the window edge */
.doc > .cv-sheet:first-child { margin-top: 32px; }
.cv-sheet { max-width: 210mm; margin: 0 auto 32px; overflow: hidden; background: var(--sf-card); color: var(--tx-1); border-radius: var(--r-md); box-shadow: var(--sh-card); font-size: 0.9375rem; line-height: 1.45; }
.cv-top { position: relative; isolation: isolate; overflow: hidden; padding: 12mm 16mm 9mm; background: var(--grad-hero); color: var(--tx-inv); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cv-top__doc { font-size: 0.75rem; font-weight: var(--fw-black); letter-spacing: 0.12em; text-transform: uppercase; color: #8fd3f5; }
.cv-top__name { margin-top: 4px; font-size: 2.125rem; font-weight: var(--fw-bold); line-height: 1.05; letter-spacing: -0.02em; color: var(--tx-inv); }
.cv-top__target { margin-top: 4px; font-size: 1.0625rem; font-weight: var(--fw-semi); color: var(--tx-inv-2); }
.cv-body { padding: 7mm 16mm 12mm; }
.cv-head { padding: 12mm 16mm 0; }
.cv-head__doc { font-size: var(--fs-xs); font-weight: var(--fw-black); letter-spacing: 0.14em; text-transform: uppercase; color: var(--tx-petrol); }
.cv-head__name { margin-top: 6px; font-size: var(--fs-3xl); font-weight: var(--fw-bold); line-height: 1.06; letter-spacing: -0.018em; }

/* ---------- CV tiles ---------- */
.cv-sheet--tiles { background: var(--sf-sunken); box-shadow: 0 0 0 1px var(--line); }
.cv-sheet--tiles .cv-top { padding: 9mm 10mm 6mm; }
.cv-top__main { display: flex; justify-content: space-between; align-items: center; gap: 6mm; }
.cv-photo { flex: none; width: 26mm; height: 26mm; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, 0.3); }
.cv-kpis { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2mm; margin-top: 4mm; }
.cv-kpis li { padding: 2.2mm 2.8mm 1.8mm; border-radius: 10px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line-inv); }
.cv-kpis__v { display: block; font-size: 1.25rem; font-weight: var(--fw-bold); line-height: 1.15; color: var(--tx-inv); font-variant-numeric: tabular-nums; }
.cv-kpis__l { display: block; margin-top: 1px; font-size: 0.875rem; font-weight: var(--fw-semi); line-height: 1.25; color: var(--tx-inv-3); }
.cv-sheet--tiles .cv-body { padding: 5mm 10mm 4mm; display: grid; gap: 3mm; }
.cv-row { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 3mm; }
.cv-tile { min-width: 0; padding: 3mm 4.2mm 3mm; border-radius: 12px; border: 1px solid var(--line); background: var(--sf-card); -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
.cv-tile__head { display: flex; justify-content: space-between; align-items: baseline; gap: 3mm; margin-bottom: 1mm; }
.cv-tile h2 { font-size: 0.8125rem; font-weight: var(--fw-black); letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.3; color: var(--tx-petrol); }
.doc .cv-jump { display: inline-flex; align-items: center; gap: 3px; font-size: 0.875rem; font-weight: var(--fw-bold); text-decoration: none; white-space: nowrap; }
.doc .cv-jump:hover { text-decoration: underline; }
.cv-jump__icon { width: 0.72em; height: 0.72em; flex: none; }
.cv-profile, .cv-line { font-size: 0.875rem; line-height: 1.42; }
.cv-contact { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 3mm; row-gap: 0.3mm; font-size: 0.875rem; line-height: 1.42; }
.cv-contact > div { display: contents; }
.cv-contact dt { color: var(--tx-3); }
.cv-contact dd { margin: 0; }
.cv-muted { color: var(--tx-3); }
.cv-entry + .cv-entry { margin-top: 2mm; padding-top: 2mm; border-top: 1px solid var(--line); }
.cv-entry__head { display: flex; justify-content: space-between; align-items: baseline; gap: 4mm; font-size: 0.875rem; font-weight: var(--fw-reg); line-height: 1.35; }
.cv-entry__title { font-weight: var(--fw-bold); }
.cv-entry__sep { color: var(--line-strong); }
.cv-entry__when { flex: none; color: var(--tx-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-entry__when .todo { white-space: normal; }
.cv-entry__note { margin-top: 0.3mm; font-size: 0.875rem; line-height: 1.4; color: var(--tx-3); }
.cv-entry__list { margin: 0.8mm 0 0 1.05em; padding: 0; font-size: 0.875rem; line-height: 1.42; }
.cv-entry__list li { margin-top: 0.3mm; }
.cv-entry__list li::marker { color: var(--c-blue); }
.cv-entry__list strong, .cv-skills strong { font-weight: var(--fw-bold); }
.cv-tile--kv { display: grid; gap: 1.6mm; }
.cv-kv { display: grid; grid-template-columns: 30mm minmax(0, 1fr); gap: 3mm; align-items: baseline; }
.cv-kv h2 { letter-spacing: 0.06em; }
.cv-kv + .cv-kv { padding-top: 1.6mm; border-top: 1px solid var(--line); }
.cv-skills { list-style: none; display: grid; gap: 0.4mm; font-size: 0.875rem; line-height: 1.42; }

/* ---------- notice and 404 ---------- */
/* before the phone rules below, which narrow the side padding of .notice__sec */
.notice { padding-bottom: 12mm; }
.notice__sec { padding: 0 16mm; }
.notice__sec h2 { margin-top: 22px; font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: 1.3; }
.notice__sec p { max-width: 72ch; margin-top: 8px; font-size: var(--fs-md); line-height: 1.55; color: var(--tx-2); }

/* on screen the stacked contact links need room to be tapped (target size 24 px); print stays tight */
@media screen { .cv-contact { row-gap: 7px; } }

/* phones: tiles stack, key facts in two columns, long values may wrap */
@media screen and (max-width: 700px) {
  .cv-sheet { border-radius: var(--r-sm); }
  .cv-sheet--tiles .cv-top, .cv-sheet--tiles .cv-body { padding-left: 16px; padding-right: 16px; }
  .cv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cv-photo { width: 72px; height: 72px; }
  .cv-row { grid-template-columns: minmax(0, 1fr); }
  .cv-contact dd { white-space: normal; overflow-wrap: anywhere; }
  .cv-tile__head, .cv-entry__head { flex-wrap: wrap; column-gap: 4mm; row-gap: 0; }
  .cv-kv { grid-template-columns: minmax(0, 1fr); gap: 0.5mm; }
  .cv-head, .notice__sec { padding-left: 20px; padding-right: 20px; }
}

/* ---------- footer ---------- */
.foot { max-width: 210mm; margin: 0 auto; padding: 0 16px 32px; display: grid; gap: 6px; text-align: center; font-size: var(--fs-sm); color: var(--tx-3); }
.doc .foot a { color: var(--tx-3); }

/* ---------- print: the CV as one A4 page without margins ---------- */
@page { size: A4; margin: 12mm 14mm; }
@page cv { size: A4; margin: 0; }
.page-cv .cv-sheet { page: cv; }
@media print {
  html { font-size: 10pt; }
  body.doc { background: #fff; }
  .draft-banner, .cv-toolbar, .foot { display: none !important; }
  .cv-sheet { max-width: none; margin: 0; border-radius: 0; box-shadow: none; }
  .cv-sheet--tiles { box-shadow: none; }
  body.page-cv--tiles { background: var(--sf-sunken) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc a { text-decoration: none; }
  /* a little headroom below the one-page limit */
  .cv-sheet--tiles .cv-top { padding: 8mm 10mm 5.5mm; }
  .cv-sheet--tiles .cv-body { gap: 2.6mm; padding-bottom: 3mm; }
  .cv-profile, .cv-line, .cv-contact, .cv-entry__list, .cv-skills { line-height: 1.37; }
}
