/* =========================================================================
   Advoke CV — Resume document base
   The paper. Shared by every template, every preview mode, and print.
   ========================================================================= */

.cv-doc {
  --cv-accent: #1c2740;
  --cv-accent-soft: #e4e8f1;
  --cv-ink: #0b1220;
  --cv-ink-soft: #3d4a6b;
  --cv-muted: #7a86a8;
  --cv-rule: #c9d0e0;
  --cv-surface: #ffffff;
  --cv-heading-font: 'Georgia', 'Iowan Old Style', 'Times New Roman', Times, serif;
  --cv-body-font: 'Georgia', 'Iowan Old Style', 'Times New Roman', Times, serif;
  --cv-heading-weight: 700;
  --cv-heading-transform: none;
  --cv-heading-tracking: -0.01em;
  --cv-section-gap: 1.1rem;
  --cv-entry-gap: 0.85rem;
  --cv-line-height: 1.45;
  --cv-font-scale: 1;
  --cv-rule-width: 1px;
  --cv-photo-size: 84px;
  --cv-photo-radius: 6px;
  --cv-photo-shape: square;

  position: relative;
  width: 100%;
  background: var(--cv-surface);
  color: var(--cv-ink);
  font-family: var(--cv-body-font);
  font-size: calc(10.5pt * var(--cv-font-scale));
  line-height: var(--cv-line-height);
  padding: 46px 54px;
  box-sizing: border-box;
  overflow: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------------------
   Typographic scale — anchored to pt so print and screen match closely
   ------------------------------------------------------------------------- */

.cv-doc,
.cv-doc * {
  box-sizing: border-box;
}

.cv-doc h1,
.cv-doc h2,
.cv-doc h3,
.cv-doc h4,
.cv-doc h5,
.cv-doc h6 {
  font-family: var(--cv-heading-font);
  color: var(--cv-ink);
  font-weight: var(--cv-heading-weight);
  line-height: 1.15;
  letter-spacing: var(--cv-heading-tracking);
  text-transform: var(--cv-heading-transform);
  margin: 0;
  padding: 0;
}

.cv-doc p {
  margin: 0;
  max-width: none;
}

.cv-doc ul,
.cv-doc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cv-doc a {
  color: inherit;
  text-decoration: none;
}

.cv-doc strong,
.cv-doc b {
  font-weight: 700;
  color: var(--cv-ink);
}

.cv-doc em,
.cv-doc i {
  font-style: italic;
}

.cv-doc hr {
  border: none;
  border-top: var(--cv-rule-width) solid var(--cv-rule);
  margin: 0;
}

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

.cv-header {
  margin-bottom: calc(var(--cv-section-gap) * 1.4);
}

.cv-name {
  font-size: 26pt;
  font-weight: var(--cv-heading-weight);
  letter-spacing: -0.015em;
  line-height: 1.05;
  color: var(--cv-ink);
  margin-bottom: 4px;
  overflow-wrap: break-word;
}

.cv-title {
  font-size: 11.5pt;
  font-weight: 500;
  color: var(--cv-accent);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 9.5pt;
  color: var(--cv-ink-soft);
  line-height: 1.5;
}

.cv-contact__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.cv-contact__sep {
  color: var(--cv-rule);
  user-select: none;
}

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

/* Photo frame */
.cv-photo {
  width: var(--cv-photo-size);
  height: var(--cv-photo-size);
  border-radius: var(--cv-photo-radius);
  object-fit: cover;
  background: var(--cv-accent-soft);
  border: 2px solid var(--cv-surface);
  box-shadow: 0 0 0 1px var(--cv-rule);
  display: block;
}

.cv-photo[data-shape="circle"] {
  border-radius: 50%;
}

.cv-photo[data-shape="square"] {
  border-radius: 4px;
}

.cv-photo[data-shape="rounded"] {
  border-radius: 10px;
}

.cv-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cv-accent-soft);
  color: var(--cv-accent);
  font-family: var(--cv-heading-font);
  font-weight: 700;
  font-size: 22pt;
  letter-spacing: 0.02em;
  user-select: none;
}

/* =========================================================================
   SECTIONS
   ========================================================================= */

.cv-section {
  margin-top: var(--cv-section-gap);
}

.cv-section:first-child {
  margin-top: 0;
}

.cv-section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: calc(var(--cv-section-gap) * 0.55);
}

.cv-section__title {
  font-size: 11pt;
  font-weight: var(--cv-heading-weight);
  text-transform: var(--cv-heading-transform);
  letter-spacing: var(--cv-heading-tracking);
  color: var(--cv-ink);
  margin: 0;
  flex-shrink: 0;
}

.cv-section__rule {
  flex: 1 1 auto;
  height: var(--cv-rule-width);
  background: var(--cv-rule);
}

.cv-section__rule--accent {
  background: var(--cv-accent);
}

/* =========================================================================
   ENTRIES
   ========================================================================= */

.cv-entry {
  margin-top: var(--cv-entry-gap);
  break-inside: avoid;
  page-break-inside: avoid;
}

.cv-entry:first-child {
  margin-top: 0;
}

.cv-entry__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.cv-entry__title {
  font-size: 10.5pt;
  font-weight: 700;
  color: var(--cv-ink);
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.cv-entry__subtitle {
  font-size: 10pt;
  font-weight: 500;
  color: var(--cv-ink-soft);
  line-height: 1.3;
}

.cv-entry__meta {
  font-size: 9pt;
  color: var(--cv-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.cv-entry__meta--accent {
  color: var(--cv-accent);
  font-weight: 600;
}

.cv-entry__summary {
  font-size: 10pt;
  color: var(--cv-ink-soft);
  margin-top: 3px;
  line-height: 1.5;
}

.cv-entry__bullets {
  margin-top: 4px;
  padding: 0;
}

.cv-entry__bullets li {
  position: relative;
  padding-left: 14px;
  margin-top: 2px;
  font-size: 10pt;
  color: var(--cv-ink-soft);
  line-height: 1.5;
}

.cv-entry__bullets li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cv-accent);
}

.cv-entry__bullets--dash li::before {
  width: 6px;
  height: 1px;
  border-radius: 0;
  top: 0.75em;
}

.cv-entry__bullets--square li::before {
  border-radius: 1px;
}

/* =========================================================================
   SKILLS
   ========================================================================= */

.cv-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
}

.cv-skill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: 9.5pt;
  color: var(--cv-ink);
  background: var(--cv-accent-soft);
  border-radius: 3px;
  line-height: 1.5;
  white-space: nowrap;
}

.cv-skill--plain {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.cv-skill--bar {
  display: block;
  padding: 0;
  background: transparent;
  width: 100%;
  white-space: normal;
}

.cv-skill__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 9.5pt;
  margin-bottom: 3px;
  color: var(--cv-ink);
}

.cv-skill__level {
  font-size: 8.5pt;
  color: var(--cv-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cv-skill__track {
  height: 4px;
  border-radius: 2px;
  background: var(--cv-accent-soft);
  overflow: hidden;
}

.cv-skill__fill {
  height: 100%;
  background: var(--cv-accent);
  border-radius: 2px;
}

.cv-skill__fill[data-level="expert"] { width: 100%; }
.cv-skill__fill[data-level="advanced"] { width: 85%; }
.cv-skill__fill[data-level="proficient"] { width: 65%; }
.cv-skill__fill[data-level="familiar"] { width: 45%; }

/* =========================================================================
   LISTS (simple inline lists)
   ========================================================================= */

.cv-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 9.5pt;
  color: var(--cv-ink-soft);
}

.cv-inline-list li {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.cv-inline-list__label {
  font-weight: 600;
  color: var(--cv-ink);
}

.cv-inline-list__divider {
  color: var(--cv-rule);
}

/* =========================================================================
   SUMMARY
   ========================================================================= */

.cv-summary {
  font-size: 10pt;
  color: var(--cv-ink-soft);
  line-height: 1.55;
  max-width: none;
}

/* =========================================================================
   PUBLICATIONS
   ========================================================================= */

.cv-publication {
  padding-left: 18px;
  text-indent: -18px;
  font-size: 9.5pt;
  color: var(--cv-ink-soft);
  line-height: 1.5;
  margin-top: 4px;
  break-inside: avoid;
}

.cv-publication:first-child { margin-top: 0; }

.cv-publication__title {
  font-weight: 600;
  color: var(--cv-ink);
}

.cv-publication__venue {
  font-style: italic;
}

/* =========================================================================
   PAGE BREAK HELPERS
   ========================================================================= */

.cv-avoid-break {
  break-inside: avoid;
  page-break-inside: avoid;
}

.cv-break-before {
  break-before: page;
  page-break-before: always;
}

.cv-break-after {
  break-after: page;
  page-break-after: always;
}

/* =========================================================================
   PREVIEW MODES
   ========================================================================= */

/* Thumbnail preview: full-size resume scaled with CSS transform inside a frame */
.cv-frame {
  position: relative;
  width: 100%;
  background: #ffffff;
  overflow: hidden;
}

.cv-frame--a4 { aspect-ratio: 210 / 297; }
.cv-frame--letter { aspect-ratio: 8.5 / 11; }

.cv-frame__inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  background: #ffffff;
}

/* Inline preview (editor): scaled to fit container width */
.cv-viewport {
  position: relative;
  width: 100%;
  background: #e4e8f1;
  padding: 24px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.cv-viewport__page {
  position: relative;
  width: 794px;
  min-height: 1123px;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(11, 18, 32, 0.14), 0 4px 12px rgba(11, 18, 32, 0.08);
}

.cv-viewport__page--letter {
  width: 816px;
  min-height: 1056px;
}

/* =========================================================================
   EMPTY STATE (used in the editor preview when resume is blank)
   ========================================================================= */

.cv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 320px;
  padding: 40px 24px;
  text-align: center;
  color: var(--cv-muted);
  font-size: 10pt;
}

.cv-empty__title {
  font-family: var(--cv-heading-font);
  font-size: 12pt;
  color: var(--cv-ink);
}