/* ==========================================================
   Dr.ssa Roberta Barone Lumaga – Biologa Nutrizionista
   Foglio di stile principale
   ========================================================== */

:root {
  --verde: #4a8a2a;
  --verde-med: #6aa83a;
  --verde-light: #7ab648;
  --verde-pale: #e8f2dc;
  --verde-xpale: #f4f9ee;
  --side-bg: #e8f2dc;
  --side-txt: #2d5a1b;
  --side-sub: rgba(45,90,27,0.6);
  --side-line: rgba(45,90,27,0.12);
  --oro: #b89040;
  --testo: #1c2c14;
  --grigio: #5a6650;
  --grigio-light: #8a9880;
  --bianco: #fafbf8;
  --linea: rgba(90,143,54,0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bianco);
  color: var(--testo);
}

/* LAYOUT PRINCIPALE: sidebar + contenuto */
.cv-wrapper {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  background: var(--side-bg);
  border-right: 1px solid var(--side-line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(45,90,27,0.2); }

.profile-area { text-align: center; }

.avatar {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid rgba(122,182,72,0.35);
  box-shadow: 0 4px 16px rgba(45,90,27,0.1);
  margin: 0 auto 1.2rem;
  display: flex; align-items: center; justify-content: center;
}
.avatar img { display: block; }

.profile-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--side-txt);
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.profile-title {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--side-sub);
  font-weight: 500;
}

/* contact icon SVG wrapper */
.contact-ico svg {
  width: 15px; height: 15px;
  display: block;
  fill: currentColor;
}

/* hero nav buttons */
.cv-hero-nav {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 2.8rem;
}
.hero-nav-btn {
  padding: 0.85rem 1.9rem;
  border: 2px solid var(--verde-light);
  border-radius: 40px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--verde);
  background: white;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.hero-nav-btn:hover, .hero-nav-btn.active {
  background: var(--verde);
  color: white;
  border-color: var(--verde);
}

/* Su di me – titolo */
.cv-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 400;
  font-style: italic;
  color: var(--verde);
  line-height: 1.2;
  margin-bottom: 1.4rem;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--side-line);
  margin: 0;
}

.sidebar-section-title {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--side-sub);
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.contact-ico {
  width: 30px; height: 30px;
  background: var(--verde-med);
  color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(74,138,42,0.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-text {
  font-size: 0.78rem;
  color: var(--side-txt);
  line-height: 1.3;
}
.contact-text a { color: inherit; text-decoration: none; }
.contact-text a:hover { color: var(--verde-med); }

.servizi-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.servizio-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  background: rgba(255,255,255,0.7);
  border-radius: 4px;
  border: 1px solid var(--side-line);
  transition: background 0.2s;
}
.servizio-pill:hover { background: #ffffff; }
.sp-icon { font-size: 1rem; }
.sp-icon { flex-shrink: 0; }
.sp-text { font-size: 0.75rem; color: var(--side-txt); line-height: 1.35; }

.nav-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: auto;
}
.nav-link {
  display: block;
  padding: 0.55rem 0.9rem;
  font-size: 0.78rem;
  color: var(--side-sub);
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  font-weight: 500;
}
.nav-link:hover, .nav-link.active {
  background: #ffffff;
  color: var(--side-txt);
}

/* ===== MAIN ===== */
.main-content {
  padding: 4rem 5rem 6rem;
  max-width: 860px;
}

/* Section block */
.cv-section {
  margin-bottom: 4.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.cv-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--linea);
}
.section-header-icon {
  width: 40px; height: 40px;
  background: var(--verde-pale);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--verde);
}
.section-header .count {
  margin-left: auto;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grigio-light);
  font-weight: 500;
}

/* HERO NAME BLOCK */
.cv-hero {
  padding: 3rem 0 3rem;
  border-bottom: 2px solid var(--linea);
  margin-bottom: 4rem;
}

.cv-hero-sub {
  font-size: 0.95rem;
  color: var(--grigio);
  line-height: 1.7;
  margin-top: 1rem;
}

/* TIMELINE */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 120px;
  width: 1px;
  height: 100%;
  background: var(--linea);
}
.timeline-item:last-child::before { display: none; }

.timeline-date {
  padding-top: 4px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--grigio-light);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.timeline-dot {
  position: absolute;
  left: calc(120px + 2rem - 7px);
  top: 4px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--verde-light);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--verde-light);
}

.timeline-body {
  padding-left: 2rem;
}

.timeline-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--testo);
  margin-bottom: 0.3rem;
}
.timeline-body .org {
  font-size: 0.78rem;
  color: var(--verde-med);
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}
.timeline-body p {
  font-size: 0.83rem;
  color: var(--grigio);
  line-height: 1.7;
}

/* SERVIZI CARDS */
.rubriche-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.rubrica {
  position: relative;
  padding: 2rem 1.8rem;
  background: var(--verde-xpale);
  border: 1px dashed rgba(106,168,58,0.45);
  border-radius: 10px;
}
.rubrica-ico {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--verde-med);
  color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.rubrica-ico svg { width: 22px; height: 22px; fill: currentColor; }
.rubrica h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--testo);
  margin-bottom: 0.3rem;
}
.rubrica p {
  font-size: 0.85rem;
  color: var(--grigio);
  line-height: 1.5;
}
.soon-badge {
  position: absolute;
  top: 1.2rem; right: 1.2rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  background: #fdf0e3;
  color: #c4651a;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* FORMAZIONE – società scientifiche */
.subsection-title {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grigio-light);
  font-weight: 600;
  margin: 1rem 0 0.9rem;
}
.societa-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.societa {
  padding: 0.8rem 1.1rem;
  background: var(--verde-xpale);
  border: 1px solid var(--linea);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--grigio);
}
.societa b { color: var(--verde); margin-right: 0.35rem; }

/* SEDI */
.sedi-cv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.sede-cv {
  padding: 2rem;
  background: white;
  border: 1px solid var(--linea);
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(61,107,36,0.05);
  transition: box-shadow 0.2s;
}
.sede-cv:hover { box-shadow: 0 6px 24px rgba(61,107,36,0.1); }
.sede-cv-num {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--verde-light);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.sede-cv h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--verde);
  margin-bottom: 0.3rem;
}
.sede-cv p { font-size: 0.83rem; color: var(--grigio); line-height: 1.5; }

/* CONTATTI */
.contatti-cv {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.contatto-cv {
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--linea);
  border-radius: 6px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}
.contatto-cv:hover {
  border-color: var(--verde-light);
  transform: translateY(-2px);
}
.contatto-cv-ico {
  width: 46px; height: 46px;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  background: var(--verde-med);
  color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(74,138,42,0.25);
}
.contatto-cv-ico svg { width: 21px; height: 21px; fill: currentColor; }
.contatto-cv-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grigio-light);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.contatto-cv-val {
  font-size: 0.82rem;
  color: var(--testo);
  font-weight: 500;
}
.contatto-cv-val a { color: var(--verde-med); text-decoration: none; }
.contatto-cv-val a:hover { color: var(--verde); }

/* SEDI – nota */
.sedi-note {
  margin-top: 1.2rem;
  font-size: 0.82rem;
  color: var(--grigio-light);
  font-style: italic;
}

/* TESTO GIUSTIFICATO
   hyphens: sillabazione italiana automatica, evita i "buchi"
   tra le parole su colonne strette (cellulare) */
.cv-hero-sub,
.timeline-body p {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* PRINT */
@media print {
  .sidebar { display: none; }
  .cv-wrapper { grid-template-columns: 1fr; }
  .main-content { padding: 2rem; }
  .cv-section { opacity: 1; transform: none; }
}

/* RESPONSIVE */
@media (max-width: 920px) {
  .cv-wrapper { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main-content { padding: 2.5rem 2rem; }
  .rubriche-grid, .sedi-cv, .contatti-cv { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 80px 1fr; gap: 1rem; }
  .timeline-item::before { left: 80px; }
  .timeline-dot { left: calc(80px + 1rem - 7px); }
  .timeline-body { padding-left: 1rem; }
}
