/* ==========================================================================
   nicolaspieper.com - CV page (/cv/ and /fr/cv/)
   Loaded AFTER site.css. Single centered column, paper-like document,
   Print styles are also used to generate the versioned A4 PDF files.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Layout: no sidebar, one centered column
   -------------------------------------------------------------------------- */
/* Le tiroir (aside.sidebar) n'existe que pour la navigation mobile : sur
   desktop la nav du header suffit et le CV garde sa colonne unique. */
@media (min-width: 981px) {
  .page-cv .sidebar { display: none; }
}

.cv-layout {
  max-width: 50rem;
  margin: 0 auto;
  padding: calc(var(--header-offset) + 36px) clamp(16px, 4vw, 40px) 40px;
  padding-left: max(clamp(16px, 4vw, 40px), var(--safe-left));
  padding-right: max(clamp(16px, 4vw, 40px), var(--safe-right));
  padding-bottom: max(40px, var(--safe-bottom));
}

/* Action bar above the document */
.cv-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

/* Compact scan path for the long screen version. The language choice already
   lives in the global header, so this row is reserved for document sections. */
.cv-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0 0 22px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
}
.cv-section-nav a {
  color: var(--muted);
  padding: 6px 0;
}
.cv-section-nav a:hover { color: var(--accent-ink); }

/* --------------------------------------------------------------------------
   The document card
   -------------------------------------------------------------------------- */
.cv-doc {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(26px, 5vw, 56px);
  box-shadow: var(--shadow-1);
}

/* Document header */
.cv-head {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 28px);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 20px;
  margin-bottom: 8px;
}
.cv-head-text { flex: 1 1 auto; min-width: 0; }
.cv-photo {
  flex: none;
  width: clamp(84px, 16vw, 112px);
  height: auto;
  aspect-ratio: 585 / 700;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}
.cv-head h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.5rem);
  margin: 0 0 2px;
}
.cv-role {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-ink);
  margin: 0 0 10px;
}
.cv-contact {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}
/* Souligné discret : sans lui, rien ne distingue ces liens du texte voisin
   (le @media print les remet en texte simple pour le PDF). */
.cv-contact a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.cv-contact a:hover { color: var(--accent-ink); }
.cv-contact .dot { margin: 0 6px; opacity: 0.5; }

/* Section kickers */
.cv-section { margin-top: 2.1rem; }
.cv-section > h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  /* Pas de font-variant-caps ici : JetBrains Mono n'a pas de vraies petites
     capitales, le navigateur les synthétisait à ~70 % de la taille déclarée. */
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-ink);
  margin: 0 0 1rem;
}
.cv-section > h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}
.cv-section p { font-size: 0.95rem; }

/* Experience entries */
.cv-entry { margin-bottom: 1.7rem; }
.cv-entry:last-child { margin-bottom: 0.4rem; }
.cv-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  flex-wrap: wrap;
}
.cv-entry h3 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.005em;
}
.cv-org {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 1px 0 0;
}
.cv-period {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  white-space: nowrap;
}
.cv-entry ul {
  margin: 0.55rem 0 0;
  padding-left: 1.25rem;
}
.cv-entry li {
  font-size: 0.92rem;
  margin: 0.28rem 0;
}

/* Skills */
.cv-skills { margin: 0; display: grid; gap: 14px; }
.cv-skills > div {
  display: grid;
  grid-template-columns: minmax(160px, 200px) 1fr;
  gap: 4px 20px;
  align-items: baseline;
}
.cv-skills dt {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink);
}
.cv-skills dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
@media (max-width: 560px) {
  .cv-section-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 18px;
  }
  .cv-skills > div { grid-template-columns: 1fr; }
}

/* Education */
.cv-edu { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cv-edu li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 18px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 0.92rem;
}
.cv-edu .cv-org { display: inline; }

/* Languages */
.cv-langs { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px 28px; flex-wrap: wrap; }
.cv-langs li { margin: 0; font-size: 0.92rem; }

/* --------------------------------------------------------------------------
   Print - this IS the PDF
   -------------------------------------------------------------------------- */
@page {
  size: A4;
  margin: 11mm;
}

@media print {
  /* Force light, ink-on-paper palette regardless of theme */
  :root,
  :root[data-theme="dark"],
  :root[data-theme="light"] {
    --bg: #FFFFFF;
    --bg-raised: #FFFFFF;
    --bg-inset: #FFFFFF;
    --ink: #000000;
    --ink-soft: #1F1F1E;
    --muted: #4A4943;
    --border: #D8D6CC;
    --border-strong: #B9B6A9;
    --accent: #9A4A26;
    --accent-ink: #9A4A26;
    --accent-soft: #FFFFFF;
    --accent-glow: transparent;
    color-scheme: light;
  }

  html { scroll-behavior: auto; }
  body {
    background: #FFFFFF;
    color: #000000;
    font-size: 9.5pt;
    line-height: 1.4;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Chrome only: the document itself */
  .site-header,
  .sidebar,
  .breadcrumb,
  .cv-actions,
  .cv-section-nav,
  .page-next,
  .site-footer,
  .backdrop,
  .skip-link { display: none !important; }

  .cv-layout {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .cv-doc {
    background: #FFFFFF;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  /* Keep roles and compact blocks together. */
  .cv-entry,
  .cv-head,
  .cv-skills > div,
  .cv-edu li,
  .cv-langs {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cv-section > h2 {
    break-after: avoid;
    page-break-after: avoid;
  }
  .cv-entry-head {
    break-inside: avoid;
    page-break-inside: avoid;
    break-after: avoid;
    page-break-after: avoid;
  }
  .cv-entry li {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cv-entry li:nth-last-child(2) {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Links as plain text, no href expansion */
  a, a:visited { color: inherit; text-decoration: none; }
  a[href]::after { content: none !important; }

  .cv-section { margin-top: 1.2rem; }
  .cv-section > h2 { margin-bottom: 0.75rem; }
  .cv-section p { font-size: 9.5pt; }
  .cv-entry { margin-bottom: 0.85rem; }
  .cv-entry h3 { font-size: 10.5pt; }
  .cv-entry ul { margin-top: 0.35rem; }
  .cv-entry li,
  .cv-skills dt,
  .cv-skills dd,
  .cv-edu li,
  .cv-langs li { font-size: 9.25pt; }
  .cv-entry li { margin: 0.15rem 0; }
  .cv-org { font-size: 9pt; }
  .cv-skills { gap: 10px; }
  .cv-edu { gap: 7px; }
}
