/* =========================================================
   PRINT / PDF — A4, 2-page target
   ========================================================= */

@page {
  size: A4;
  margin: 8mm 10mm 10mm 10mm;
}

@media print {
  html, html[data-theme="dark"] {
    --bg: #ffffff;
    --bg-elev: #ffffff;
    --bg-muted: #f5f5f5;
    --text: #0a0a0a;
    --text-muted: #4a4a4a;
    --text-subtle: #6a6a6a;
    --border: #d9d9d9;
    --border-strong: #bdbdbd;
    --accent: #0a0a0a;
    --chip-bg: transparent;
    --chip-border: #d0d0d0;
  }

  body {
    background: #ffffff !important;
    color: #0a0a0a !important;
    font-size: 8pt !important;
    line-height: 1.3 !important;
  }

  /* ---- Hide chrome + non-essential sections ---- */
  .topbar, .cv-footer, .theme-toggle, .print-btn, .lang-toggle,
  #section-position,
  #section-teaching,
  .exp-note,
  .exp-desc,
  .section-kicker,
  .spoiler-hint,
  .hero-readtime {
    display: none !important;
  }

  .cv {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* ---- HERO (no photo in PDF) ---- */
  .hero-photo { display: none !important; }

  .hero {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding-bottom: 6px !important;
    margin-bottom: 8px !important;
    border-bottom: 1px solid #ccc !important;
    page-break-inside: avoid;
  }

  .hero-text h1 {
    font-size: 20pt !important;
    line-height: 1.0 !important;
    margin-bottom: 2px !important;
  }

  .hero-role   { font-size: 9.5pt !important; margin-bottom: 1px !important; }
  .hero-tagline { font-size: 7pt !important; margin-bottom: 2px !important; }
  .hero-location { font-size: 7pt !important; margin-bottom: 4px !important; }

  .hero-photo {
    width: 80px !important;
    height: 80px !important;
    border: 1px solid #ccc !important;
  }

  .contacts {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2px 6px !important;
    margin-top: 3px !important;
  }

  .contact { font-size: 7pt !important; }
  .contact .icon { width: 11px !important; height: 11px !important; }

  /* ---- SECTIONS ---- */
  .section { margin-bottom: 7pt !important; }

  .section:has(> .projects),
  .section:has(> .skills-grid) {
    page-break-inside: auto;
  }

  .section-head {
    margin-bottom: 4pt !important;
    padding-bottom: 2pt !important;
    border-bottom: 1px solid #ccc !important;
  }

  .section-title { font-size: 9.5pt !important; line-height: 1.2 !important; }

  /* ---- ABOUT ---- */
  .about p { font-size: 7.5pt !important; line-height: 1.35 !important; margin-bottom: 0 !important; }

  /* ---- EXPERIENCE ---- */
  .exp { margin-bottom: 6pt !important; }

  .exp-company { font-size: 9pt !important; margin-bottom: 1pt !important; }
  .exp-meta    { font-size: 7pt !important; margin-bottom: 2pt !important; }

  /* Limit general bullets to 2 per block */
  .exp > .bullets > li:nth-child(n+3) { display: none !important; }

  .bullets li {
    font-size: 7.5pt !important;
    line-height: 1.3 !important;
    margin-bottom: 1.5pt !important;
    padding-left: 9pt !important;
  }

  .bullets li::before { top: 5.5pt !important; }

  /* ---- PROJECTS ---- */
  .projects { gap: 4pt !important; margin-top: 3pt !important; }

  .project {
    padding: 4pt 6pt !important;
    background: #fafafa !important;
    border-color: #d9d9d9 !important;
    page-break-inside: avoid;
  }

  /* Limit project bullets to 2 */
  .project .bullets li:nth-child(n+3) { display: none !important; }

  .project-name   { font-size: 8pt !important; }
  .project-role   { font-size: 7pt !important; }
  .project-period { font-size: 6.5pt !important; }
  .project-stack  { font-size: 6.5pt !important; margin-bottom: 2pt !important; }
  .project .bullets li { font-size: 7pt !important; }

  /* ---- OWN PRODUCTS — show max 2 bullets ---- */
  #section-own-products .bullets li:nth-child(n+3) { display: none !important; }

  /* ---- ACHIEVEMENTS ---- */
  .ach-group { margin-bottom: 4pt !important; page-break-inside: avoid; }
  .ach-label { font-size: 6.5pt !important; margin-bottom: 2pt !important; }
  .ach-list li {
    font-size: 7.5pt !important;
    padding-left: 11pt !important;
    line-height: 1.3 !important;
  }

  /* ---- SKILLS: 3 columns ---- */
  .skills-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 3pt !important;
  }

  .skill-group {
    padding: 3pt 5pt !important;
    background: #fafafa !important;
    border-color: #d9d9d9 !important;
    page-break-inside: avoid;
  }

  .skill-group-label { font-size: 7.5pt !important; margin-bottom: 2pt !important; }

  .skill-chips { gap: 2pt !important; }
  .skill-chips li {
    font-size: 6pt !important;
    padding: 1pt 3pt !important;
    background: #fff !important;
    border-color: #d0d0d0 !important;
  }

  .skill-note { font-size: 6.5pt !important; margin-top: 2pt !important; }

  /* ---- EDUCATION ---- */
  .edu-list  { gap: 4pt !important; }
  .edu-item  { padding: 2pt 7pt !important; page-break-inside: avoid; }
  .edu-institution { font-size: 8pt !important; }
  .edu-degree      { font-size: 7.5pt !important; }
  .edu-meta        { font-size: 7pt !important; }

  /* ---- LANGUAGES ---- */
  .lang-list li     { font-size: 7.5pt !important; }
  .additional-block { font-size: 7pt !important; margin-top: 2pt !important; padding-top: 2pt !important; }

  /* Links — hide URLs */
  a[href]::after { content: "" !important; }
  a { text-decoration: none !important; color: inherit !important; }

  /* Force scroll-reveal elements visible in print */
  [data-anim] { opacity: 1 !important; animation: none !important; transform: none !important; }

  /* Force collapsible sections expanded in print */
  .section.collapsed > .ach-group { display: block !important; }
  .collapsible-head .section-title::after { display: none !important; }
  .collapsible-head { cursor: auto !important; }

  h1, h2, h3, h4 { page-break-after: avoid; }
  p, li { orphans: 2; widows: 2; }
}
