/* =============================================
   CV Federico Luis Fazzio — Main Stylesheet
   ============================================= */

:root {
  --primary: #1a3a5c;
  --accent: #e8a020;
  --light-bg: #f4f7fb;
  --white: #ffffff;
  --text-dark: #1e2a38;
  --text-mid: #4a5568;
  --text-light: #718096;
  --border: #dde3ec;
  --timeline-line: #c5d0e0;
  --tag-bg: #e8f0fc;
  --tag-color: #1a3a5c;
  --shadow: 0 4px 24px rgba(26, 58, 92, 0.10);
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--light-bg);
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 15px;
}

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

/* ── Page Layout ─────────────────────────── */
.page {
  max-width: 1100px;
  margin: 36px auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto 1fr;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

/* ── Header (full-width) ──────────────────── */
.header {
  grid-column: 1 / -1;
  background: var(--primary);
  color: var(--white);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 2px;
  border: 4px solid rgba(255,255,255,0.25);
  overflow: hidden; /* ensure img is clipped to circle */
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* crop to fill the circle */
  display: block;
}

.header-info h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.header-info .title {
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.header-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  opacity: 0.9;
}

.contact-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

/* ── Sidebar ──────────────────────────────── */
.sidebar {
  background: var(--primary);
  padding: 36px 28px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.sidebar-section h2 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-section h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.15);
}

.sidebar-text {
  font-size: 0.86rem;
  line-height: 1.5;
  opacity: 0.94;
  margin-bottom: 10px;
}

.sidebar-list {
  list-style: none;
  padding-left: 0;
  font-size: 0.82rem;
}

.sidebar-list li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 6px;
  opacity: 0.94;
}

.sidebar-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-size: 0.8rem;
}

.sidebar-highlight {
  background: rgba(0, 0, 0, 0.12);
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
}

/* Skills */
.skill-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
  opacity: 0.92;
}

.skill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}

/* Education */
.edu-item {
  margin-bottom: 20px;
}

.edu-item .edu-date {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.edu-item .edu-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
}

.edu-item .edu-school {
  font-size: 0.78rem;
  opacity: 0.7;
  line-height: 1.3;
}

/* ── Main Content ─────────────────────────── */
.main {
  padding: 32px 40px 32px 44px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Profile summary */
.profile-text {
  font-size: 0.92rem;
  color: var(--text-mid);
  line-height: 1.7;
}

/* Language items */
.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.88rem;
  opacity: 0.92;
}

/* Section heading */
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--border), transparent);
}

/* ── Timeline ─────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 22px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--timeline-line);
}

.timeline-item {
  position: relative;
  margin-bottom: 22px;
}

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

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--accent);
  z-index: 1;
}

.timeline-item.current .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 160, 32, 0.2);
}

.job-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.job-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
}

.job-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--tag-bg);
  color: var(--tag-color);
  flex-shrink: 0;
}

.job-badge.leader {
  background: #fdf3e0;
  color: #b45309;
}

.job-company {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.job-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.job-date {
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

.job-date svg { width: 12px; height: 12px; }

.job-location {
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

.job-location svg { width: 12px; height: 12px; }

.job-desc {
  list-style: none;
  padding: 0;
  margin: 0;
}

.job-desc li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 4px;
  font-size: 0.84rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.job-desc li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.35;
}

.intro-text {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 18px;
}

/* ── Print ────────────────────────────────── */
@media print {
  body { background: white; }
  .page { margin: 0; box-shadow: none; border-radius: 0; max-width: 100%; }
  .timeline-item { break-inside: avoid; }
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 780px) {
  .page {
    grid-template-columns: 1fr;
    margin: 0;
    border-radius: 0;
  }

  .header {
    padding: 28px 20px;
    flex-direction: column;
    text-align: center;
  }

  .header-contacts { justify-content: center; }

  .sidebar { padding: 28px 20px; }

  .main { padding: 28px 20px; }

  .job-header { flex-direction: column; }
}

/* ── Download Button ────────────────────── */
.download-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--accent);
  color: var(--white);
  padding: 14px 24px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(232, 160, 32, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  cursor: pointer;
}

.download-btn:hover {
  background: #d49520;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232, 160, 32, 0.5);
}

.download-btn svg {
  width: 20px;
  height: 20px;
}

/* ── Company Logos ────────────────────── */
.company-logo {
  height: 28px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 10px;
  opacity: 0.9;
}

.job-company {
  display: flex;
  align-items: center;
}

/* ── PDF Compact Mode ────────────────────── */
.pdf-compact {
  font-size: 11px !important;
}

.pdf-compact .header {
  padding: 20px 28px !important;
}

.pdf-compact .header h1 {
  font-size: 22px !important;
  margin-bottom: 4px !important;
}

.pdf-compact .title {
  font-size: 13px !important;
}

.pdf-compact .sidebar {
  padding: 20px 18px !important;
}

.pdf-compact .sidebar h2 {
  font-size: 13px !important;
  margin-bottom: 6px !important;
}

.pdf-compact .sidebar-text,
.pdf-compact .sidebar-list li {
  font-size: 10px !important;
  line-height: 1.4 !important;
  margin-bottom: 3px !important;
}

.pdf-compact .edu-item {
  margin-bottom: 10px !important;
}

.pdf-compact .edu-date,
.pdf-compact .edu-title,
.pdf-compact .edu-school {
  font-size: 10px !important;
}

.pdf-compact .main {
  padding: 20px !important;
}

.pdf-compact .section-title {
  font-size: 16px !important;
  margin-bottom: 10px !important;
}

.pdf-compact .intro-text {
  font-size: 11px !important;
  line-height: 1.4 !important;
  margin-bottom: 12px !important;
}

.pdf-compact .timeline {
  padding-left: 16px !important;
}

.pdf-compact .timeline-item {
  margin-bottom: 14px !important;
}

.pdf-compact .job-title {
  font-size: 12px !important;
}

.pdf-compact .job-company,
.pdf-compact .job-date {
  font-size: 10px !important;
}

.pdf-compact .job-desc li {
  font-size: 10px !important;
  line-height: 1.3 !important;
  margin-bottom: 2px !important;
}

.pdf-compact .company-logo {
  height: 18px !important;
  max-width: 60px !important;
}

/* ── Print Styles (Para PDF) ────────────────────── */
@media print {
  body {
    background: white;
    margin: 0;
    padding: 0;
  }
  
  .page {
    max-width: 100%;
    margin: 0;
    box-shadow: none;
    page-break-after: auto;
  }
  
  .download-btn {
    display: none !important;
  }
  
  .header {
    page-break-inside: avoid;
  }
  
  .timeline-item {
    page-break-inside: avoid;
  }
  
  @page {
    size: A4;
    margin: 10mm;
  }
}
