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

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ================= HEADER & NAVBAR ================= */
.header {
  background-color: #ffffff;
  border-bottom: 1px solid #eef2f6;
  position: relative;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  text-decoration: none;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.nav-menu {
  display: flex;
  gap: 1.6rem;
  align-items: center;
}

.nav-menu a {
  text-decoration: none;
  color: #64748b;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: #1e293b;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.btn-contatti {
  background-color: #2563eb;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.45rem 1.6rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.btn-contatti:hover {
  background-color: #1d4ed8;
}

.btn-portale {
  background-color: #2563eb;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1.2rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: background-color 0.2s ease;
}

.btn-portale:hover {
  background-color: #1d4ed8;
}

/* ================= LAYOUT PRINCIPALE ================= */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.layout-grid {
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 3.5rem;
  align-items: flex-start;
}

/* ================= COLONNA SINISTRA (SCHEDA CV) ================= */
/* Anteprima rettangolare cliccabile */
.cv-preview-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
}

.cv-preview-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.414; /* Rapporto A4 rettangolare perfetto */
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.2rem;
  background-color: #f1f5f9;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cv-preview-link:hover .cv-preview-wrap {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cv-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* Overlay visivo al passaggio del mouse sull'anteprima */
.cv-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(2px);
}

.cv-preview-link:hover .cv-preview-overlay {
  opacity: 1;
}

/* Gruppo pulsanti azione CV */
.cv-actions-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn-view-cv,
.btn-download-cv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-view-cv {
  background-color: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
}

.btn-view-cv:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

.btn-download-cv {
  background-color: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

.btn-download-cv:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

/* ================= COLONNA DESTRA (TIMELINE FORMAZIONE) ================= */
.section-title-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.title-icon-badge {
  width: 32px;
  height: 32px;
  background-color: #e0f2fe;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
}

.timeline {
  position: relative;
  padding-left: 1.2rem;
}

/* Linea verticale grigia continua */
.timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 5px;
  width: 2px;
  background-color: #cbd5e1;
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1.8rem;
}

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

/* Pallino sul timeline */
.timeline-dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ffffff;
  transform: translateX(-50%);
  z-index: 2;
}

.timeline-dot.dot-blue {
  border: 3px solid #2563eb;
}

.timeline-dot.dot-gray {
  border: 3px solid #94a3b8;
}

.entry-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.entry-subtitle {
  font-size: 0.95rem;
  color: #475569;
  font-style: italic;
}

.entry-meta {
  font-size: 0.92rem;
  color: #475569;
  font-style: italic;
  margin-bottom: 0.15rem;
}

/* ================= 2. ABILITAZIONI PROFESSIONALI (BADGES) ================= */
.badges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.badge-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.check-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-content {
  display: flex;
  flex-direction: column;
}

.badge-content strong {
  font-size: 0.95rem;
  color: #0f172a;
  font-weight: 700;
}

.badge-content span {
  font-size: 0.88rem;
  color: #334155;
}

/* ================= 3. APPROFONDIMENTI EMERGENTI (FULL SECTION) ================= */
.projects-section {
  margin-top: 4.5rem;
}

.projects-main-heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.5rem;
}

.project-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
}

.project-box-wide {
  grid-column: 2 / 3;
}

.project-box h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.project-box p {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.55;
  margin-bottom: 0.8rem;
}

.project-box p:last-child {
  margin-bottom: 0;
}

.box-sub {
  font-size: 0.88rem;
  color: #475569;
  margin-bottom: 0.8rem !important;
}

.bullet-list {
  padding-left: 1.2rem;
}

.bullet-list li {
  font-size: 0.92rem;
  color: #334155;
  margin-bottom: 0.8rem;
  line-height: 1.55;
}

.bullet-list li:last-child {
  margin-bottom: 0;
}

.bullet-list em {
  font-style: italic;
  font-weight: 600;
  color: #1e293b;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .layout-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .project-box-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1.2rem;
    align-items: flex-start;
  }

  .nav-menu {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .header-actions {
    align-items: flex-start;
    flex-direction: row;
  }

  .badges-grid {
    grid-template-columns: 1fr;
  }
}