/* ═══════════════════════════════════════════
   CV Print Stylesheet
   Optimized for A4 PDF export via browser Print dialog
   ═══════════════════════════════════════════ */

@page {
  size: A4 portrait;
  margin: 12mm 14mm 12mm 14mm;
}

@media print {
  /* ── Color integrity ──────────────────── */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* ── Document reset ───────────────────── */
  html,
  body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif !important;
    font-size: 10pt !important;
    line-height: 1.45 !important;
    color: #1e293b !important;
    background: #fff !important;
    margin: 0;
    padding: 0;
  }

  /* ── Prevent orphaned section headers ─── */
  h2, h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* ── Section spacing ──────────────────── */
  .cv-section {
    margin-bottom: 3mm !important;
    break-inside: avoid;
  }
  .cv-section-title {
    font-size: 7.5pt !important;
    letter-spacing: 0.1em !important;
    padding-bottom: 0.15rem !important;
    border-bottom-width: 1px !important;
    margin-bottom: 2mm !important;
  }

  /* ── Header ───────────────────────────── */
  .cv-header {
    padding: 0 0 2mm !important;
    border-bottom-width: 1.5px !important;
    background: none !important;
  }
  .cv-name {
    font-size: 20pt !important;
  }
  .cv-title {
    font-size: 10.5pt !important;
  }
  .cv-contact-item {
    font-size: 8.5pt !important;
  }
  .cv-meta-badge {
    font-size: 7pt !important;
    padding: 0.1rem 0.4rem !important;
  }
  .cv-icon {
    width: 12px !important;
    height: 12px !important;
  }

  /* ── Two-column layout ────────────────── */
  .cv-columns {
    display: grid !important;
    grid-template-columns: 1fr 62mm !important;
    gap: 7mm !important;
    padding: 4mm 0 0 !important;
  }

  /* ── Timeline items ───────────────────── */
  .cv-timeline-item {
    grid-template-columns: 14mm 1fr !important;
    gap: 2.5mm !important;
    margin-bottom: 1.5mm !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cv-timeline-dot {
    width: 5px !important;
    height: 5px !important;
  }
  .cv-timeline-line {
    top: 7px !important;
    width: 1.2px !important;
  }
  .cv-timeline-period {
    font-size: 6pt !important;
  }
  .cv-timeline-title {
    font-size: 10pt !important;
  }
  .cv-timeline-subtitle {
    font-size: 8.5pt !important;
  }
  .cv-timeline-date {
    font-size: 7pt !important;
  }
  .cv-timeline-bullets {
    font-size: 8.5pt !important;
    line-height: 1.4 !important;
    margin-top: 1mm !important;
    padding-left: 0 !important;
  }
  .cv-bullet-row {
    margin-bottom: 0.3mm !important;
  }

  /* ── Tech tags ────────────────────────── */
  .cv-tech-tags {
    gap: 2mm !important;
  }
  .cv-tech-cat {
    break-inside: avoid;
  }
  .cv-tech-cat-name {
    font-size: 6.5pt !important;
    margin-bottom: 1mm !important;
  }
  .cv-tech-grid {
    gap: 1.5mm !important;
  }
  .cv-tag {
    font-size: 7pt !important;
    padding: 0.08rem 0.3rem !important;
  }

  /* ── Projects ─────────────────────────── */
  .cv-projects {
    gap: 2mm !important;
  }
  .cv-project {
    padding: 1.5mm 2mm !important;
    background: none !important;
    border: none !important;
    border-left: 2px solid var(--mc) !important;
    border-radius: 0 !important;
    break-inside: avoid;
  }
  .cv-project-title {
    font-size: 8.5pt !important;
  }
  .cv-project-context {
    font-size: 6.5pt !important;
  }
  .cv-project-desc {
    font-size: 8pt !important;
  }
  .cv-project-detail {
    font-size: 7pt !important;
  }
  .cv-project-link {
    font-size: 6.5pt !important;
  }

  /* ── References ───────────────────────── */
  .cv-references {
    gap: 2mm !important;
  }
  .cv-ref-item {
    padding: 1.5mm 2mm !important;
    background: none !important;
    border-left-width: 2px !important;
    break-inside: avoid;
  }
  .cv-ref-name {
    font-size: 8.5pt !important;
  }
  .cv-ref-role {
    font-size: 7.5pt !important;
  }
  .cv-ref-contact {
    font-size: 7.5pt !important;
  }

  /* ── Languages ────────────────────────── */
  .cv-languages {
    gap: 1.5mm !important;
  }
  .cv-lang-item {
    grid-template-columns: 12mm 1fr 10mm !important;
    gap: 2mm !important;
  }
  .cv-lang-name {
    font-size: 8pt !important;
  }
  .cv-lang-bar {
    height: 3px !important;
  }
  .cv-lang-level {
    font-size: 7pt !important;
  }

  /* ── Photo ────────────────────────────── */
  .cv-photo-frame {
    width: 72px !important;
    height: 72px !important;
    border-width: 2px !important;
  }
  .cv-header-inner {
    grid-template-columns: 72px 1fr !important;
    gap: 5mm !important;
  }

  /* ── Hide screen-only elements ────────── */
  .no-print,
  .cv-locale-switcher,
  .app-footer,
  .fab-print {
    display: none !important;
  }

  /* ── Make anchor hrefs visible ────────── */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 6.5pt;
    color: #64748b;
  }
  a[href^="mailto"]::after {
    content: "";
  }
  /* Keep links short in print — inline links only */
  .cv-project-link::after {
    content: "" !important;
  }
}