:root {
  --bg: #FAF6F0;
  --bg-alt: #F1E9DC;
  --sage: #8B9D77;
  --sage-dark: #6B7D5A;
  --terracotta: #C97B5A;
  --terracotta-dark: #B4603F;
  --text: #3A3630;
  --text-light: #6B6560;
  --border: #E4DACB;
  --white: #FFFFFF;
  --font-heading: "Fraunces", serif;
  --font-body: "Nunito Sans", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text);
  line-height: 1.25;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

a { color: var(--sage-dark); text-decoration: none; }

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(250, 246, 240, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  padding: 1rem 1.5rem 1rem 0.5rem;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.2;
  white-space: nowrap;
}

.logo-icon {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  color: var(--white);
  background: var(--sage);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.nav-links a:hover { background: var(--sage-dark); }

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--terracotta-dark);
  color: var(--white);
  box-shadow: 0 10px 24px -10px rgba(180, 96, 63, 0.6);
}

.btn-primary:hover { box-shadow: 0 14px 30px -10px rgba(180, 96, 63, 0.7); }

.cta-band {
  background: var(--sage);
  padding: 2.75rem 1.5rem;
  text-align: center;
}

.cta-band-text {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--white);
  margin: 0 0 1.5rem;
}

.cta-band .btn-primary {
  background: var(--white);
  color: var(--terracotta-dark);
  box-shadow: none;
}

.cta-band .btn-primary:hover { background: var(--bg); }

.btn-secondary {
  background: transparent;
  color: var(--sage-dark);
  border: 2px solid var(--sage);
}

.btn-nav {
  background: var(--sage);
  color: var(--white);
  padding: 0.5rem 1.25rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  display: block;
}

/* Hero */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: right bottom;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(58, 54, 48, 0.82) 0%, rgba(58, 54, 48, 0.62) 40%, rgba(139, 157, 119, 0.35) 100%);
}

.hero-content {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 1.5rem;
  width: 100%;
}

.hero-text { max-width: 640px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  font-weight: 700;
  color: #E9E2D3;
  margin: 0 0 2rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 0 0 1.25rem;
  color: var(--white);
}

@media (max-width: 800px) {
  .hero { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.9rem; }
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero .btn-secondary {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 760px) {
  .hero {
    min-height: 70vh;
    background-size: contain;
    background-position: top center;
    background-repeat: no-repeat;
    background-color: var(--text);
  }
  .hero-content { padding: 4rem 1.25rem; }
}

/* Sections */
.section { padding: 5rem 1.5rem; }
.section.alt { background: var(--bg-alt); }

#chi-sono.chi-sono-bg {
  background-image: linear-gradient(rgba(250, 246, 240, 0.9), rgba(250, 246, 240, 0.9)), url('assets/img/klimt-bacio.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#esperienza.esperienza-bg {
  background-image: linear-gradient(rgba(241, 233, 220, 0.9), rgba(241, 233, 220, 0.9)), url('assets/img/klimt-albero-vita.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#aree.aree-bg {
  background-image: linear-gradient(rgba(250, 246, 240, 0.9), rgba(250, 246, 240, 0.9)), url('assets/img/klimt-tre-eta.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-inner.narrow { max-width: 720px; }

.section-intro {
  text-align: center;
  color: var(--text-light);
  max-width: 620px;
  margin: -0.5rem auto 2.5rem;
}

.text-left { text-align: left; }

/* Quote */
.quote {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--sage-dark);
  text-align: center;
  max-width: 780px;
  margin: 0 auto 3.5rem;
  line-height: 1.5;
  border: none;
}

/* Split layout (Chi sono) */
.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.split-reverse .split-image { order: 2; }

.split-image img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 20px 40px -20px rgba(58, 54, 48, 0.25);
}

.split-image p { font-style: italic; }

.chi-sono-list {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.chi-sono-list li { margin-bottom: 0.5rem; }
.chi-sono-list li:last-child { margin-bottom: 0; }

@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
}

/* Gallery (Lo studio) */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.gallery img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 12px 24px -16px rgba(58, 54, 48, 0.3);
}

@media (max-width: 800px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery img { height: 220px; }
}

/* Timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--sage);
}

.timeline li {
  display: flex;
  gap: 1.5rem;
  padding: 0 0 2rem 1.5rem;
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--terracotta);
}

.timeline-year {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--sage-dark);
  min-width: 110px;
}

.timeline h3 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.timeline p { margin: 0; color: var(--text-light); }

/* Publications */
.publications {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.publications-title { font-size: 1.1rem; margin-bottom: 1rem; }

.publications-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-light);
}

.publications-list li { margin-bottom: 0.75rem; }

.novita-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.locandina-convenzioni {
  display: block;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 2rem;
}

.card-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

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

.card-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.card h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.card p { margin: 0; color: var(--text-light); }
.card p + p,
.card p + .card-subheading,
.card .card-subheading + p,
.card ol + p,
.card p + ul,
.card ul + p { margin-top: 0.75rem; }

.card-subheading {
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.card-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-light);
}

.card-steps li { margin-bottom: 0.5rem; text-align: justify; }
.card-steps li:last-child { margin-bottom: 0; }

.card-news { position: relative; }

.card-news-logo {
  display: block;
  height: 40px;
  max-width: 140px;
  object-fit: contain;
  object-position: left;
  margin-bottom: 1rem;
}

.card-news-brochure {
  width: 100%;
  border-radius: 12px;
  margin-top: 1rem;
  box-shadow: 0 8px 20px -12px rgba(58, 54, 48, 0.35);
}

.text-justify { text-align: justify; }

.badge {
  display: inline-block;
  background: var(--sage);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 700;
  color: var(--terracotta-dark);
}

@media (max-width: 800px) {
  .novita-layout { gap: 1.5rem; }
  .card-stack { gap: 1rem; }
}

@media (max-width: 640px) {
  .novita-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .locandina-convenzioni { position: static; }
}

/* Card with photo (aree d'intervento) */
.card-photo { padding: 0; overflow: hidden; }

.card-photo img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.card-photo-body { padding: 1.5rem 2rem 2rem; }
.card-photo-body h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.card-photo-body p { margin: 0; color: var(--text-light); }
.card-photo-body p + img { margin-top: 0.75rem; }

.card-photo-body .card-emdr-logo {
  display: block;
  height: 64px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

/* Hours table */
.hours-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.hours-table td {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.hours-table td:first-child { font-weight: 700; }
.hours-table td:last-child { text-align: right; color: var(--text-light); }

.note { color: var(--text-light); font-size: 0.95rem; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
  align-items: start;
}

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

.contact-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.05rem;
}

.contact-icon { font-size: 1.25rem; }

.contact-map iframe {
  border-radius: 16px;
  width: 100%;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9rem;
}

.site-footer a { color: var(--bg); text-decoration: underline; }
.site-footer p { margin: 0.35rem 0; }

/* Responsive */
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border);
    display: none;
  }

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