/* A4 page base + shared section styles */
.a4-page {
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  color: #1a2332;
  font-family: var(--font-body, 'Inter'), system-ui, sans-serif;
  font-size: 10pt;
  line-height: 1.55;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  /* CSS vars defaults (overwritten by render.js) */
  --c-primary: #0066ab;
  --c-primary-light: #cce0ee;
  --c-primary-dark: #003664;
  --c-accent: #12c3f4;
  --c-fg: #1a2332;
  --c-muted: #5b6775;
  --c-line: #e3e8ee;
}

/* Shared elements */
.a4-page .avatar {
  border-radius: 50%;
  background: #e8eef4 center / cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff;
  overflow: hidden;
  flex-shrink: 0;  /* never let flex containers squash the circle into an oval */
}
.a4-page .avatar img { width: 100%; height: 100%; object-fit: cover; }
.a4-page .avatar-placeholder { background: linear-gradient(135deg, var(--c-primary), var(--c-accent)); color: #fff; }
.a4-page .avatar-sm { width: 56px; height: 56px; font-size: 18px; }
.a4-page .avatar-md { width: 84px; height: 84px; font-size: 26px; }
.a4-page .avatar-lg { width: 110px; height: 110px; font-size: 34px; }
.a4-page .avatar.ring { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--c-accent); }

.a4-page .section-title {
  font-size: 11.5pt; font-weight: 700; color: var(--c-primary-dark);
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 8px;
  break-after: avoid;
  page-break-after: avoid;
}
.a4-page .section-title .ico { color: var(--c-primary); display: inline-flex; }

.a4-page .item {
  margin-bottom: 10px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.a4-page .item-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.a4-page .item-head h4 { font-size: 10.5pt; font-weight: 700; color: var(--c-primary-dark); }
.a4-page .item-meta { font-size: 8.5pt; color: var(--c-muted); white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.a4-page .item-sub { font-size: 9.5pt; color: var(--c-primary); font-weight: 600; margin: 2px 0 4px; }
.a4-page .item-bullets { padding-left: 16px; margin-top: 4px; }
.a4-page .item-bullets li { list-style: disc; font-size: 9.5pt; margin-bottom: 2px; color: #2c3848; }
.a4-page .item-notes { font-size: 9.5pt; color: #2c3848; margin-top: 3px; }

.a4-page .summary { font-size: 10pt; color: #2c3848; }

.a4-page .contact-list { display: flex; flex-direction: column; gap: 4px; font-size: 9pt; }
.a4-page .contact-list li { display: flex; gap: 6px; align-items: center; word-break: break-all; }
.a4-page .contact-list .ico { color: var(--c-primary); display: inline-flex; flex-shrink: 0; }

.a4-page .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.a4-page .tag {
  font-size: 8.5pt; padding: 2px 7px; border-radius: 999px;
  background: var(--c-primary-light); color: var(--c-primary-dark);
}

.a4-page .hobbies { display: flex; flex-wrap: wrap; gap: 4px; }
.a4-page .hobby {
  font-size: 8.5pt;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
  border: 1px solid transparent;
}

.a4-page .cert-list { display: flex; flex-direction: column; gap: 6px; }
.a4-page .cert-list li { font-size: 9pt; }
.a4-page .cert-list strong { color: var(--c-primary-dark); font-size: 9.5pt; }
.a4-page .cert-meta { font-size: 8.5pt; color: var(--c-muted); }

.a4-page .main-sec, .a4-page .aside-sec { margin-bottom: 14px; }
.a4-page .main-sec:last-child, .a4-page .aside-sec:last-child { margin-bottom: 0; }

/* Spacer JS inserts to push items past page boundary */
.a4-page .page-spacer {
  display: block;
  width: 100%;
  break-before: page;
  page-break-before: page;
}
