/* ── CV page ── */
body {
  background-color: #FFF7F6;
  color: black;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.dark-theme {
  background-color: black;
  color: #FFF7F6;
}

/* ── Layout ── */
.cv-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  max-width: 11.5in;
  margin: 1.25rem auto 3rem;
  padding: 0 1.5rem;
}

.cv-sidebar {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 80px;
}

.cv-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(145, 121, 235, 0.08);
  border: 1px solid rgba(145, 121, 235, 0.2);
  border-radius: 8px;
}

.download-pdf-button {
  flex: 1 1 auto;
  padding: 8px 12px;
  background-color: #9179eb;
  color: var(--ai-color);
  border: none;
  border-radius: 4px;
  font-family: 'Signika', sans-serif;
  cursor: pointer;
}
.download-pdf-button:hover {
  background-color: var(--darkest);
}

/* ── TOC ── */
.cv-toc {
  padding: 1rem;
  background: rgba(145, 121, 235, 0.08);
  border: 1px solid rgba(145, 121, 235, 0.2);
  border-radius: 8px;
}
.cv-toc h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cv-toc ul { list-style: none; padding: 0; margin: 0; }
.cv-toc li { margin-bottom: 0.35rem; line-height: 1.3; }
.cv-toc a { color: inherit; text-decoration: none; }
.cv-toc a:hover { text-decoration: underline; }
.cv-toc .toc-level-h2 { padding-left: 0.75rem; }
.cv-toc .toc-level-h3 { padding-left: 1.5rem; font-size: 0.92rem; }

/* ── Content area ── */
#cv-content {
  max-width: 8.27in;
  width: 100%;
  margin: 0.5rem auto 0;
  padding: 0 15px;
  line-height: 1.45;
}
#cv-content h1:first-child,
#cv-content h2:first-child { margin-top: 0.25rem; }
#cv-content h1, #cv-content h2, #cv-content h3,
#cv-content h4, #cv-content h5, #cv-content h6 {
  break-after: avoid-page;
  page-break-after: avoid;
}
#cv-content p, #cv-content ul, #cv-content ol,
#cv-content li, #cv-content blockquote {
  break-inside: avoid;
  page-break-inside: avoid;
}
#cv-content ul, #cv-content ol { padding-left: 1.2rem; }
#cv-content li + li { margin-top: 0.3rem; }

.cv-subsection {
  margin-bottom: 1.5rem;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* ── Responsive ── */
@media (max-width: 992px) {
  .cv-layout {
    flex-direction: column;
    gap: 1.5rem;
    padding: 0 1rem;
  }
  .cv-sidebar { position: static; width: 100%; }
  .cv-actions { flex-wrap: wrap; gap: 0.5rem; }
  #cv-content { margin: 0; }
}

/* ── Print ── */
@media print {
  .cv-layout { display: block; max-width: 8.27in; margin: 0 auto; padding: 0; }
  .cv-sidebar, .cv-toc { display: none !important; }
}
