:root {
  --resume-primary: #0d6efd;
  --resume-text: #212529;
  --resume-muted: #6c757d;
  --resume-border: #dee2e6;
}

body {
  margin: 0;
  background: #f3f5f7;
  color: var(--resume-text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.resume-toolbar {
  padding: 16px 0;
}

.resume-page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 40px;
  padding: 15mm;
  background: #fff;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
}

.resume-header {
  padding-bottom: 18px;
  border-bottom: 2px solid var(--resume-primary);
}

.resume-header h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.resume-headline {
  margin: 6px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--resume-primary);
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
}

.resume-contact a {
  color: inherit;
  text-decoration: none;
}

.resume-contact a:hover {
  text-decoration: underline;
}

.resume-meta {
  margin-top: 10px;
  display: flex;
  gap: 15px;
  font-size: 11px;
  color: var(--resume-muted);
}

.resume-section {
  margin-top: 22px;
}

.resume-section h2 {
  margin-bottom: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--resume-border);
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.resume-section p {
  margin-bottom: 8px;
  font-size: 13px;
}

.skill-box {
  height: 100%;
}

.skill-box h3 {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
}

.skill-box p {
  margin: 0;
  color: var(--resume-muted);
}

.resume-item {
  margin-bottom: 16px;
}

.resume-item:last-child {
  margin-bottom: 0;
}

.resume-item-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.resume-item h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.resume-item .position {
  margin: 2px 0;
  font-size: 13px;
  font-weight: 600;
}

.resume-item .period {
  white-space: nowrap;
  font-size: 12px;
  color: var(--resume-muted);
}

.resume-item .note {
  font-size: 12px;
  color: var(--resume-muted);
}

.resume-footer {
  margin-top: 25px;
  padding-top: 10px;
  border-top: 1px solid var(--resume-border);
  text-align: center;
  font-size: 11px;
  color: var(--resume-muted);
}

.resume-footer a {
  color: inherit;
}

.resume-bullets {
  margin: 7px 0 0;
  padding-left: 18px;
}

.resume-bullets li {
  margin-bottom: 4px;
  font-size: 12.5px;
  line-height: 1.45;
}

.resume-action-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  margin-top: 3px;

  font-size: 12px;
  font-weight: 600;

  color: var(--resume-primary);
  text-decoration: none;
}

.resume-action-link:hover {
  text-decoration: underline;
}

.resume-action-link i {
  font-size: 10px;
}

.project-link:hover {
  text-decoration: underline;
}

.certification-list {
  margin: 0;
  padding-left: 18px;
}

.certification-list li {
  margin-bottom: 5px;
  font-size: 12.5px;
}

@page {
  size: A4;
  margin: 0;
}

@media print {

  body {
    background: #fff;
    font-size: 11pt;
  }

  .no-print {
    display: none !important;
  }

  .resume-page {
    width: 210mm;
    min-height: auto;
    margin: 0;
    padding: 10mm 13mm;
    box-shadow: none;
  }

  a {
    color: inherit !important;
    text-decoration: none !important;
  }

  /* ให้แต่ละงาน / การศึกษา / Project
     ไม่ถูกตัดครึ่งกลางหน้า */
  .resume-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* หัวข้อไม่ควรค้างอยู่ท้ายหน้าเพียงบรรทัดเดียว */
  .resume-section h2 {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* บังคับ Projects เริ่มหน้า 2 */
  .print-page-2 {
    break-before: page;
    page-break-before: always;
  }

  /* ลดระยะเพื่อให้หน้าแรกไม่ล้นง่าย */
  .resume-section {
    margin-top: 16px;
  }

  .resume-section h2 {
    margin-bottom: 8px;
    padding-bottom: 4px;
  }

  .resume-item {
    margin-bottom: 11px;
  }

  .resume-bullets {
    margin-top: 5px;
  }

  .resume-bullets li {
    margin-bottom: 2px;
    line-height: 1.35;
  }

  .resume-header {
    padding-bottom: 12px;
  }

  .resume-footer {
    margin-top: 16px;
  }
}

@media (max-width: 768px) {

  .resume-page {
    width: 100%;
    min-height: auto;
    margin: 0;
    padding: 24px 18px;
    box-shadow: none;
  }

  .resume-header h1 {
    font-size: 26px;
  }

  .resume-item-header {
    display: block;
  }

  .resume-item .period {
    margin-top: 3px;
  }
}