/* ============================================================
   Scalable CV stylesheet
   - Uses CSS variables (design tokens) so colors/fonts/spacing
     can be changed in ONE place without touching markup.
   - Layout is built from repeatable, self-contained blocks
     (.entry, .skill-group, .lang-pill, .cert-list li) so new
     jobs / skills / certificates can be added by copy-pasting
     an existing block in index.html — no CSS changes needed.
   - Includes a dedicated @media print block so the page always
     exports cleanly to PDF (Ctrl+P → Save as PDF).
   ============================================================ */

:root {
  /* ---- Design tokens: change these to re-theme the whole CV ---- */
  --color-primary: #1a4d8f;      /* accent color (headings, links) */
  --color-text: #222;
  --color-muted: #5a5a5a;
  --color-border: #d9dee5;
  --color-bg: #ffffff;
  --color-pill-bg: #eef3fa;

  --font-main: 'Segoe UI', Arial, sans-serif;
  --font-size-base: 15px;

  --page-max-width: 850px;
  --spacing-unit: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: #f2f4f7;
  line-height: 1.5;
}

.page {
  max-width: var(--page-max-width);
  margin: calc(var(--spacing-unit) * 4) auto;
  background: var(--color-bg);
  padding: calc(var(--spacing-unit) * 5);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.cv-nav {
  margin: 0 0 calc(var(--spacing-unit) * 2);
  font-size: 0.85rem;
}
.cv-nav a { color: var(--color-primary); text-decoration: none; }
.cv-nav a:hover { text-decoration: underline; }
@media print { .cv-nav { display: none; } }

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 3);
  border-bottom: 3px solid var(--color-primary);
  padding-bottom: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

/* ---------- Header photo ---------- */
.header-photo {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
}

.header-photo img {
  width: 200px;
  height: 200px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

.photo-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 6px;
  border: 2px dashed var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-muted);
  padding: 4px;
}

/* ---------- Header text (name/role + contact), sits right of photo ---------- */
.header-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(var(--spacing-unit) * 2);
}

.header-main h1 {
  margin: 0;
  font-size: 1.9rem;
  color: var(--color-primary);
}

.header-main .role {
  margin: 4px 0 0;
  font-size: 1.05rem;
  color: var(--color-muted);
  font-weight: 600;
}

.contact {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.contact li { margin-bottom: 4px; }
.contact a { color: var(--color-primary); text-decoration: none; }
.contact a:hover { text-decoration: underline; }

/* ---------- Sections ---------- */
.section {
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.section h2 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 4px;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.summary { margin: 0; color: var(--color-text); }

/* ---------- Repeatable "entry" block (jobs / education) ---------- */
.entry { margin-bottom: calc(var(--spacing-unit) * 2.5); }
.entry:last-child { margin-bottom: 0; }

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.entry-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
}

.entry-date {
  font-size: 0.85rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.entry-sub {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 2px 0 6px;
}

.entry-list {
  margin: 0;
  padding-left: 1.1rem;
}

.entry-list li { margin-bottom: 3px; }

/* ---------- Certifications ---------- */
.cert-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cert-list li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.92rem;
}

.cert-list li:last-child { border-bottom: none; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: calc(var(--spacing-unit) * 2);
}

.skill-group h4 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  color: var(--color-text);
}

.skill-group p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-muted);
}

/* ---------- Languages ---------- */
.languages {
  display: flex;
  gap: calc(var(--spacing-unit) * 1.5);
  flex-wrap: wrap;
}

.lang-pill {
  background: var(--color-pill-bg);
  color: var(--color-primary);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Print / PDF export ---------- */
@media print {
  body { background: #fff; }
  .page {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
    padding: 20px 32px;
    overflow: visible;
  }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .header { flex-direction: column; }
  .contact { text-align: left; }
  .entry-head { flex-direction: column; align-items: flex-start; }
}
