/* =============================
   BASE
============================= */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f2f2f2;
  color: #111;
}

/* =============================
   CV WRAPPER
============================= */

.cvb-cv.cvb-simple {
  max-width: 794px;
  margin: 40px auto;
  background: #fff;
}

/* =============================
   HEADER
============================= */

.cvb-simple-header {
  text-align: center;
  padding: 30px 20px 20px;
  border-bottom: 2px solid #e5e5e5;
}

.cvb-simple-header h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 1px;
}

.cvb-simple-header h2 {
  margin-top: 6px;
  font-size: 18px;
  font-weight: normal;
}

/* =============================
   BODY LAYOUT
============================= */

.cvb-simple-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
}

/* =============================
   LEFT COLUMN
============================= */

.cvb-simple-side {
  padding: 30px 20px;
  border-right: 2px solid #3b4ddb;
}

.cvb-simple-side h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 14px;
  text-transform: uppercase;
}

.cvb-simple-side section { margin-bottom: 28px; }

.cvb-simple-side div,
.cvb-simple-side p {
  font-size: 14px;
  line-height: 1.5;
}

/* =============================
   RIGHT COLUMN
============================= */

.cvb-simple-main { padding: 30px; }

.cvb-simple-main h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 16px;
}

.cvb-simple-main section { margin-bottom: 28px; }

.cvb-simple-main p {
  margin: 0;
  line-height: 1.6;
  font-size: 14px;
}

/* =============================
   ACTIONS
============================= */

.cvb-actions {
  margin: 30px auto;
  max-width: 794px;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
}

/* =============================
   PRINT (single, deduped block)
============================= */

@media print {
  @page {
    size: A4 portrait;
    margin: 15mm; /* user may override in dialog; still helpful */
  }

  body {
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hide buttons in print */
  .cvb-actions { display: none !important; }

  /* Remove screen margins so it fits the printable page */
  .cvb-cv.cvb-simple {
    margin: 0 !important;
    max-width: none !important;
  }

  /* Prevent “header alone on page 1” where possible */
  .cvb-simple-header {
    page-break-after: avoid !important;
    break-after: avoid-page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /*
    IMPORTANT:
    Grid fragmentation is flaky in print. Switch layout ONLY for print.
    Flex keeps the look closer to your grid layout than table-cell does.
  */
  .cvb-simple-body {
    display: flex !important;
    align-items: flex-start !important;
  }

  .cvb-simple-side { width: 33% !important; }
  .cvb-simple-main { width: 67% !important; }

  /*
    Gentle (not squashed) print tuning:
    Reduce padding/spacing a bit so it fits under default margins.
  */
  .cvb-simple-header { padding: 22px 16px 14px !important; }
  .cvb-simple-header h1 { font-size: 30px !important; } /* was 34 */
  .cvb-simple-header h2 { font-size: 16px !important; } /* was 18 */

  .cvb-simple-side { padding: 18px 16px !important; }
  .cvb-simple-main { padding: 18px 18px !important; }

  .cvb-simple-side section,
  .cvb-simple-main section { margin-bottom: 18px !important; } /* was 28 */

  /* Keep readability */
  .cvb-simple-side div,
  .cvb-simple-side p,
  .cvb-simple-main p {
    font-size: 13.5px !important; /* was 14 */
    line-height: 1.5 !important;
  }

  /*
    Neutralize any global/theme forced breaks that might target this template.
    (Scoped to this CV only.)
  */
  .cvb-cv.cvb-simple,
  .cvb-cv.cvb-simple * {
    page-break-before: auto !important;
    page-break-after: auto !important;
    page-break-inside: auto !important;
    break-before: auto !important;
    break-after: auto !important;
    break-inside: auto !important;
  }

  /* Re-apply the header keep-together after the reset above */
  .cvb-simple-header {
    page-break-after: avoid !important;
    break-after: avoid-page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Avoid any wrapper “locking” height/overflow in print */
  .cvb-wrap,
  .cvb-cv,
  .cvb-simple,
  .cvb-simple-body {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
  }
}