/* ============================================================
   Marco De Toffol — styles.css
   Palette: blu polveroso + verde salvia
   Tipografia: Lora (headings) + Source Sans 3 (body)
   ============================================================ */

:root {
  --bg:            #f5f4f1;
  --bg-soft:       #edecea;
  --bg-strong:     #e4e2de;
  --surface:       rgba(255, 255, 253, 0.82);
  --text:          #1a1916;
  --text-soft:     #4a4740;
  --text-muted:    #7a7670;
  --primary:       #3d5c70;       /* blu polveroso strutturale */
  --primary-deep:  #2e4a5c;
  --primary-light: #5a7a8e;
  --brass:         #4a6b55;       /* verde salvia scuro — accento */
  --brass-light:   #618f70;
  --brass-subtle:  rgba(74, 107, 85, 0.10);
  --white:         #ffffff;
  --container:     1140px;
  --reading:       740px;
  --radius:        4px;
  --radius-lg:     8px;
  --shadow-soft:   0 2px 16px rgba(26, 25, 22, 0.07);
  --shadow-card:   0 1px 6px rgba(26, 25, 22, 0.06);
  --border:        rgba(26, 25, 22, 0.10);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: "Source Sans 3", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--primary-deep);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--brass);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

img {
  max-width: 100%;
  display: block;
}

svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
  fill: currentColor;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  width: min(calc(100% - 3rem), var(--container));
  margin: 0 auto;
}

.reading-width {
  max-width: var(--reading);
}

.section {
  padding: 5.5rem 0;
}

.first-section {
  padding-top: 7.5rem;
}

.muted-section {
  background: var(--bg-soft);
}

.strong-section {
  background: var(--bg-strong);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 244, 241, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  flex: 0 0 auto;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.main-nav a:hover {
  color: var(--brass);
  text-decoration: none;
}

.nav-cv-link {
  color: var(--brass) !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}

.nav-cv-link:hover {
  color: var(--brass-light) !important;
}

.header-social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: var(--text-muted);
  transition: color 0.18s ease;
}

.social-link:hover {
  color: var(--brass);
  text-decoration: none;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--text);
}

h1 {
  font-family: "Lora", Georgia, serif;
  font-size: clamp(2.8rem, 5.5vw, 4.8rem);
  font-weight: 600;
  margin-bottom: 1rem;
}

h2 {
  font-family: "Lora", Georgia, serif;
  font-size: clamp(1.85rem, 2.8vw, 2.6rem);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.65rem;
  position: relative;
}

h2::after {
  content: "";
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2.4rem;
  height: 2px;
  background: var(--brass);
  border-radius: 2px;
}

/* h2 inside section-heading: more bottom margin for layout */
.section-heading h2 {
  margin-bottom: 0;
}

h3 {
  font-size: 1.22rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
}

p {
  margin: 0 0 0.95rem;
  font-size: 1.12rem;
  color: var(--text-soft);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  color: var(--text);
  font-weight: 600;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  background: linear-gradient(160deg, var(--bg-soft) 0%, var(--bg) 60%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 1.1rem;
  color: var(--brass);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.hero-lead {
  font-size: 1.28rem;
  max-width: 640px;
  color: var(--text-soft);
  margin-bottom: 0;
}

.hero-actions {
  margin-top: 2rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--primary-deep);
  font-size: 1rem;
}

.text-link::after {
  content: "→";
  transition: transform 0.18s ease;
  display: inline-block;
}

.text-link:hover {
  color: var(--brass);
  text-decoration: none;
}

.text-link:hover::after {
  transform: translateX(3px);
}

/* ============================================================
   CHI SONO
   ============================================================ */

.bio-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 3.5rem 3.5rem;
  align-items: start;
}

.bio-text p + p {
  margin-top: 0.75rem;
}

.bio-transition {
  font-size: 1.18rem;
  color: var(--primary);
  font-style: italic;
  border-left: 3px solid var(--brass);
  padding-left: 1.1rem;
  margin-top: 1.5rem !important;
  margin-bottom: 0 !important;
}

.bio-photo {
  position: static;
}

.bio-photo img {
  width: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  filter: grayscale(8%);
  display: block;
}

/* attività/incarichi sotto la bio */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 3rem;
}

/* ============================================================
   CARDS — shared
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.6rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.card h3 {
  margin-bottom: 0.65rem;
}

/* ============================================================
   PLAIN LIST
   ============================================================ */

.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.plain-list li {
  font-size: 1.05rem;
  color: var(--text-soft);
  padding-left: 1rem;
  position: relative;
}

.plain-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--brass);
}

/* ============================================================
   TWO-COLUMN GRID (heading + content)
   ============================================================ */

.two-column-grid {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 2rem 4.5rem;
  align-items: start;
}

.stacked-sections {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ============================================================
   ATTIVITÀ CLINICA
   ============================================================ */

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.activity-item {
  padding: 1.35rem 1.6rem 1.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary-light);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow-card);
}

.activity-item p {
  margin: 0;
  font-size: 1.05rem;
}

/* ============================================================
   CHIP (editoriali, solo bordo ottone)
   ============================================================ */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.85rem;
  border: 1.5px solid var(--brass);
  border-radius: 2px;
  color: var(--brass);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

a.chip:hover {
  background: var(--brass-subtle);
  color: var(--brass);
  text-decoration: none;
}

/* ============================================================
   INTERVENTI E PARTECIPAZIONI
   ============================================================ */

.intervento-item {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.intervento-item:first-child {
  border-top: 1px solid var(--border);
}

.intervento-item .intervento-title {
  font-weight: 600;
  color: var(--text);
  font-size: 1.05rem;
  font-style: italic;
  margin-bottom: 0.2rem;
}

.intervento-item .intervento-desc {
  font-size: 1rem;
  color: var(--text-soft);
  margin: 0;
}

.intervento-item a {
  font-size: 0.92rem;
  color: var(--brass);
  font-weight: 500;
}

.intervento-item a:hover {
  color: var(--brass-light);
}

/* ============================================================
   INTERESSI PROFESSIONALI
   ============================================================ */

.interessi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.interesse-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.95rem;
  color: var(--text-soft);
  background: var(--surface);
}

/* ============================================================
   CURRICULUM IN SINTESI
   ============================================================ */

.cv-sintesi {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cv-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0 2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.cv-row:first-child {
  border-top: 1px solid var(--border);
}

.cv-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brass);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 0.1rem;
}

.cv-content {
  font-size: 1.05rem;
  color: var(--text-soft);
}

.cv-content p {
  font-size: 1.05rem;
  margin: 0;
}

.cv-link-wrap {
  margin-top: 2rem;
}

/* ============================================================
   DOVE RICEVO — SEDI
   ============================================================ */

.location-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.location-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.location-card h3 {
  color: var(--primary);
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.location-card p {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.map-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brass);
  letter-spacing: 0.02em;
}

.map-link svg {
  width: 0.9rem;
  height: 0.9rem;
}

.map-link:hover {
  color: var(--brass-light);
  text-decoration: none;
}

/* ============================================================
   CONTATTI
   ============================================================ */

.contact-links {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 500;
  font-size: 1.05rem;
}

.contact-links a:hover {
  color: var(--brass);
  text-decoration: none;
}

.icon-circle {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: rgba(61, 92, 112, 0.09);
  flex: 0 0 auto;
  transition: background 0.18s ease, color 0.18s ease;
}

.contact-links a:hover .icon-circle {
  background: var(--brass-subtle);
  color: var(--brass);
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background: var(--primary-deep);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-wrap {
  padding: 2.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-wrap p {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(245, 244, 241, 0.65);
  line-height: 1.5;
}

.footer-wrap p:first-child {
  color: rgba(245, 244, 241, 0.9);
  font-weight: 500;
}

/* ============================================================
   CV PAGE — specifics
   ============================================================ */

.cv-page-header {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.cv-page-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.cv-page-header .back-link::before {
  content: "←";
}

.cv-page-header .back-link:hover {
  color: var(--brass);
  text-decoration: none;
}

.cv-page-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.25rem;
}

.cv-page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
}

.cv-section {
  margin-bottom: 3.5rem;
}

.cv-section-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--brass);
  margin: 0 0 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.cv-entry {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.3rem 2rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(26,25,22,0.05);
  align-items: baseline;
}

.cv-entry:last-child {
  border-bottom: none;
}

.cv-entry-year {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 0.05rem;
}

.cv-entry-body {
  font-size: 1rem;
  color: var(--text-soft);
}

.cv-entry-body strong {
  color: var(--text);
  font-weight: 600;
}

.cv-entry-body a {
  color: var(--primary-deep);
  font-size: 0.92rem;
}

.cv-entry-body a:hover {
  color: var(--brass);
}

.cv-sub-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cv-sub-list li {
  font-size: 0.97rem;
  color: var(--text-soft);
  padding-left: 1rem;
  position: relative;
}

.cv-sub-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--brass);
  font-weight: 700;
}

/* ============================================================
   HAMBURGER MENU
   ============================================================ */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
  transform-origin: center;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1060px) {
  .two-column-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .section-heading h2 {
    margin-bottom: 0.25rem;
  }
}

@media (max-width: 900px) {
  .bio-grid {
    grid-template-columns: 1fr;
  }
  .bio-photo {
    position: static;
    max-width: 180px;
    margin: 0 auto;
  }
  .location-grid {
    grid-template-columns: 1fr;
  }
  .roles-grid {
    grid-template-columns: 1fr;
  }
  .cv-entry {
    grid-template-columns: 120px 1fr;
  }
}

@media (max-width: 760px) {
  .section {
    padding: 4rem 0;
  }
  .first-section {
    padding-top: 6rem;
  }
  .container {
    width: min(calc(100% - 2rem), var(--container));
  }

  /* Hamburger menu activation */
  .hamburger {
    display: flex;
    margin-left: auto;
    order: 3;
  }

  .header-social {
    display: none;
  }

  .nav-wrap {
    flex-wrap: wrap;
    min-height: auto;
    padding: 0.75rem 0;
    gap: 0.5rem;
    align-items: center;
  }

  .brand {
    order: 1;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    order: 4;
    background: rgba(245, 244, 241, 0.98);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0 0.75rem;
    margin: 0 -1rem;
    padding-left: 1rem;
  }

  .main-nav.nav-open {
    display: flex;
  }

  .main-nav a {
    font-size: 1rem;
    padding: 0.55rem 0;
    width: 100%;
    border-bottom: 1px solid rgba(26,25,22,0.05);
  }

  .main-nav a:last-child {
    border-bottom: none;
  }

  h1 {
    font-size: 2.5rem;
  }
  .hero-lead {
    font-size: 1.12rem;
  }
  .cv-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .cv-entry {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .cv-entry-year {
    font-size: 0.82rem;
  }
}
