/* ==========================================================
   Studio di Psicoterapia - stile pubblico
   Palette ispirata alla natura: verde salvia, terra, sabbia
   ========================================================== */

:root {
  --color-sage-900: #1d2a21;
  --color-sage-700: #3f5a44;
  --color-sage-600: #4f6e53;
  --color-sage-500: #6b8a6e;
  --color-sage-100: #cedeca;
  --color-sand-100: #f6f2ea;
  --color-sand-200: #efe7d8;
  --color-clay-500: #a9835f;
  --color-clay-600: #8f6c49;
  --color-text: #2b3229;
  --color-text-muted: #667065;
  --color-white: #ffffff;

  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Jost', 'Segoe UI', sans-serif;

  --radius: 0;
  --shadow-soft: 0 12px 30px -14px rgba(29, 42, 33, 0.25);
  --max-width: 1140px;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-sand-100);
  line-height: 1.65;
  font-weight: 300;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-sage-900);
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
p { margin: 0 0 1em; }

a { color: var(--color-sage-700); text-decoration: none; }
a:hover { color: var(--color-clay-600); }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.narrow { max-width: 760px; }
.center { text-align: center; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--color-clay-600);
  margin-bottom: 0.75rem;
}
.center-eyebrow { display: block; text-align: center; }
.section-title.center { text-align: center; }

.muted { color: var(--color-text-muted); }
.lead { font-size: 1.6rem; line-height: 1.5; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* Di default (sottopagine) l'header ha una banda bianca fissa sotto al quale
     campeggia il logo nei colori originali: solo la home (.on-hero) parte trasparente */
  background: var(--color-sand-100);
  box-shadow: 0 2px 12px rgba(29, 42, 33, 0.08);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.site-header.on-hero {
  background: transparent;
  box-shadow: none;
}
.site-header.scrolled,
.site-header.on-hero.scrolled {
  background: rgba(246, 242, 234, 0.95);
  box-shadow: 0 2px 12px rgba(29, 42, 33, 0.08);
}
.site-header.scrolled .logo,
.site-header.scrolled .main-nav a {
  color: var(--color-sage-900);
  text-shadow: none;
}
.site-header.scrolled .main-nav a.active { color: #7CA389; }
.site-header.scrolled .main-nav a:hover { color: var(--color-clay-600); }
.site-header.scrolled .nav-toggle span {
  background: var(--color-sage-900);
}
/* L'header occupa tutta la larghezza dello schermo (non limitato a --max-width) */
.site-header .container {
  max-width: 100%;
  padding: 0 2.5rem;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  transition: height 0.25s ease;
}
.site-header.on-hero .header-inner {
  height: 104px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-sage-900);
  letter-spacing: 0.02em;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-tagline {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 0.2rem;
  opacity: 0.9;
}
.logo-mark {
  height: 58px;
  width: auto;
  display: block;
  transition: height 0.25s ease;
}
/* Solo in home il logo è più grande */
.site-header.on-hero .logo-mark {
  height: 84px;
}

/* In home il logo bianco (sopra la foto) sfuma nel logo verde quando si scorre */
.logo-mark-wrap {
  display: inline-grid;
}
.logo-mark-wrap .logo-mark {
  grid-area: 1 / 1;
  transition: height 0.25s ease, opacity 0.25s ease;
}
.logo-mark-wrap .logo-mark-white { opacity: 1; }
.logo-mark-wrap .logo-mark-green { opacity: 0; }
.site-header.on-hero.scrolled .logo-mark-wrap .logo-mark-white { opacity: 0; }
.site-header.on-hero.scrolled .logo-mark-wrap .logo-mark-green { opacity: 1; }

.main-nav { display: flex; gap: 1.35rem; flex-wrap: wrap; justify-content: flex-end; }
.main-nav a {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-sage-900);
  position: relative;
  padding: 0.25rem 0;
  white-space: nowrap;
}
.main-nav a.active { color: #7CA389; }
.main-nav a:hover { color: var(--color-clay-600); }
.main-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: #7CA389;
}

/* Header trasparente sovrapposto all'immagine scura della home: testo chiaro per leggibilità */
.site-header.on-hero .logo,
.site-header.on-hero .main-nav a {
  color: var(--color-white);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.site-header.on-hero .main-nav a.active { color: #7CA389; }
.site-header.on-hero .main-nav a:hover { color: var(--color-sand-200); }
.site-header.on-hero .nav-toggle span {
  background: var(--color-white);
}

/* Con lo scroll lo sfondo diventa chiaro: il testo torna sempre scuro, anche sopra la foto */
.site-header.on-hero.scrolled .logo,
.site-header.on-hero.scrolled .main-nav a {
  color: var(--color-sage-900);
  text-shadow: none;
}
.site-header.on-hero.scrolled .main-nav a.active { color: #7CA389; }
.site-header.on-hero.scrolled .main-nav a:hover { color: var(--color-clay-600); }
.site-header.on-hero.scrolled .nav-toggle span {
  background: var(--color-sage-900);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--color-sage-900);
  border-radius: 0;
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  margin-top: -104px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  padding: 2rem;
  padding-bottom: 6.5rem;
  overflow: hidden;
  cursor: default;
}
/* Bagliore che segue il cursore al passaggio sull'immagine */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle 320px at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.28), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.hero:hover::before,
.hero.glow-active::before {
  opacity: 1;
}
/* Scia di bagliore che segue il cursore */
.hero-glow-trail {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.hero:hover .hero-glow-trail,
.hero.glow-active .hero-glow-trail {
  opacity: 1;
}
.glow-dot {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%);
  will-change: transform;
}
.glow-dot:nth-child(1) { width: 70px; height: 70px; opacity: 0.55; }
.glow-dot:nth-child(2) { width: 60px; height: 60px; opacity: 0.45; }
.glow-dot:nth-child(3) { width: 50px; height: 50px; opacity: 0.35; }
.glow-dot:nth-child(4) { width: 40px; height: 40px; opacity: 0.26; }
.glow-dot:nth-child(5) { width: 32px; height: 32px; opacity: 0.18; }
.glow-dot:nth-child(6) { width: 24px; height: 24px; opacity: 0.12; }
.hero-content { position: relative; z-index: 2; max-width: 780px; }
.hero-quote {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  font-weight: 500;
  margin-bottom: 0.6rem;
}
.hero-author { letter-spacing: 0.08em; opacity: 0.9; }
.scroll-cue {
  position: absolute;
  z-index: 2;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  color: var(--color-white);
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------- Page hero (sottopagine) ---------- */
.page-hero {
  position: relative;
  height: 70vh;
  min-height: 70vh;
  margin-top: -78px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  padding: 2rem;
  padding-bottom: 3rem;
}
.page-hero .eyebrow { color: var(--color-sand-200); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); }
.page-hero h1 { color: var(--color-white); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4); }
.page-hero > .container > p { text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); }
.page-hero-quote {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--color-white);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.page-hero-quote span { display: block; font-size: 0.95rem; font-style: normal; color: var(--color-sand-200); margin-top: 0.3rem; }

/* ---------- Sections ---------- */
.section { padding: 5rem 0; }
.section.alt { background: var(--color-sage-100); }
.prose p { margin-bottom: 1em; }

/* ---------- Testo con immagine a destra (Ambiti di intervento, Formazione e supervisione) ---------- */
.text-image-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  align-items: start;
}
.text-image-row .text-image-photo img {
  width: 100%;
  border-radius: 0;
  box-shadow: var(--shadow-soft);
}
@media (max-width: 860px) {
  .text-image-row { grid-template-columns: 1fr; }
  .text-image-row .text-image-photo { order: -1; max-width: 340px; margin: 0 auto; }
}

/* Variante con immagine a sinistra (es. riquadro "significato di Essentia" in Chi siamo) */
.text-image-row.img-left { grid-template-columns: 340px 1fr; }
.text-image-row.img-left .text-image-photo { order: -1; }
@media (max-width: 860px) {
  .text-image-row.img-left { grid-template-columns: 1fr; }
}

/* Riquadro con bordo/sfondo distinto per contenuti evidenziati */
.essentia-meaning-box {
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(29, 42, 33, 0.08);
  padding: 2.5rem;
}
.essentia-meaning-box .eyebrow { display: block; margin-bottom: 0.75rem; }

/* ---------- Cards (servizi in home) ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.75rem;
  margin-top: 2.5rem;
}
.card {
  background: var(--color-white);
  border-radius: 0;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(29, 42, 33, 0.06);
  transition: transform 0.25s ease;
}
.card:hover { transform: translateY(-4px); }
.card-icon {
  width: 52px; height: 52px;
  border-radius: 0;
  background: var(--color-sage-100);
  color: var(--color-sage-700);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
}
.card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card p { color: var(--color-text-muted); font-size: 0.95rem; margin: 0; }

/* ---------- Servizi (pagina dedicata) ---------- */
.service-row {
  display: flex;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid rgba(29, 42, 33, 0.08);
}
.service-row:last-child { border-bottom: none; }
.service-icon {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 0;
  background: var(--color-sand-200);
  color: var(--color-clay-600);
  display: flex; align-items: center; justify-content: center;
}
.service-row h2 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.service-row p { color: var(--color-text-muted); margin: 0; }

/* ---------- Team / Chi siamo ---------- */
.therapist {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
  padding: 3rem 0;
  border-bottom: 1px solid rgba(29, 42, 33, 0.08);
}
.therapist:last-child { border-bottom: none; }
.therapist.reverse { direction: rtl; }
.therapist.reverse > * { direction: ltr; }
.therapist-photo img,
.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 0;
  background: var(--color-sage-100);
}
.photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--color-sage-500);
}
.therapist-bio .qualifica { color: var(--color-clay-600); font-weight: 500; margin-bottom: 1.2rem; }
.therapist-contacts { display: flex; gap: 1rem; margin-top: 1.2rem; font-size: 0.9rem; flex-wrap: wrap; }
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border: 1px solid var(--color-sage-700);
  color: var(--color-sage-700);
  background: transparent;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}
.contact-btn:hover {
  background: var(--color-sage-700);
  color: var(--color-white);
}
.contact-btn .contact-icon { flex-shrink: 0; }

.bio-toggle {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-clay-600);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bio-toggle:hover { color: var(--color-clay-500); }

/* ---------- Griglia team (pagina Le professioniste) ---------- */
.team-intro { margin-bottom: 2.5rem; }
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  justify-content: center;
  gap: 2.5rem 3rem;
  margin-top: 2.5rem;
}
.team-card {
  display: block;
  color: inherit;
  transition: opacity 0.2s ease;
}
.team-card:hover { color: inherit; opacity: 0.85; }
.team-card-photo img,
.team-card-photo .photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 0;
  background: var(--color-sage-100);
  transition: transform 0.3s ease;
}
.team-card:hover .team-card-photo img { transform: scale(1.02); }
.team-card-photo { overflow: hidden; }
.team-card-photo .photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--color-sage-500);
}
.team-card h2 { font-size: 1.7rem; margin: 1.3rem 0 0.2rem; }
.team-card .qualifica { color: var(--color-clay-600); font-weight: 500; margin-bottom: 1rem; font-size: 0.95rem; }

/* ---------- CTA ---------- */
.cta { background: var(--color-sage-900); color: var(--color-sand-100); text-align: center; }
.cta h2 { color: var(--color-white); }
.cta p { color: rgba(246, 242, 234, 0.85); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--color-clay-500);
  color: var(--color-white);
}
.btn-primary:hover { background: var(--color-clay-600); color: var(--color-white); }
.btn-outline {
  border-color: var(--color-sage-700);
  color: var(--color-sage-700);
  background: transparent;
}
.btn-outline:hover { background: var(--color-sage-700); color: var(--color-white); }

/* ---------- Contatti ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 3rem;
}
.contact-info h2 { margin-bottom: 1.5rem; }
.info-block {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-bottom: 1.4rem;
  color: var(--color-sage-700);
}
.info-block svg { flex-shrink: 0; margin-top: 3px; }
.info-block div { color: var(--color-text); }
.map-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: var(--color-clay-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.map-link:hover { color: var(--color-clay-500); }

.contact-form-wrap {
  background: var(--color-white);
  border-radius: 0;
  padding: 2.25rem;
  box-shadow: var(--shadow-soft);
}
.form-row { margin-bottom: 1.2rem; }
.form-row label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--color-sage-900);
}
.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(29, 42, 33, 0.18);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--color-sand-100);
  resize: vertical;
}
.form-row select { cursor: pointer; }
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--color-sage-500);
  background: var(--color-white);
}
.field-honeypot { position: absolute; left: -9999px; }

.alert {
  padding: 1rem 1.25rem;
  border-radius: 0;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.alert-success { background: #e4efe3; color: var(--color-sage-900); border: 1px solid #bcd4ba; }
.alert-error { background: #f6e6e0; color: #7a3b28; border: 1px solid #e3b7a6; }
.alert-error ul { margin: 0; padding-left: 1.1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-sage-900); color: rgba(246, 242, 234, 0.85); padding-top: 3.5rem; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}
.footer-col h3, .footer-col h4 { color: var(--color-white); }
.footer-col h4 { font-size: 1rem; font-family: var(--font-body); letter-spacing: 0.05em; text-transform: uppercase; }
.footer-col p { color: rgba(246, 242, 234, 0.75); font-size: 0.92rem; }
.footer-col a { color: rgba(246, 242, 234, 0.85); }
.footer-col a:hover { color: var(--color-white); }
.footer-bottom {
  border-top: 1px solid rgba(246, 242, 234, 0.12);
  padding: 1.25rem 0;
  font-size: 0.85rem;
  color: rgba(246, 242, 234, 0.6);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .therapist, .therapist.reverse { grid-template-columns: 1fr; direction: ltr; }
  .therapist-photo { max-width: 320px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 78px; left: 0; right: 0;
    background: var(--color-sand-100);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    gap: 1rem;
    box-shadow: var(--shadow-soft);
    display: none;
  }
  .main-nav.open { display: flex; }
  /* Il menu mobile aperto ha sempre sfondo chiaro: testo scuro anche in home */
  .site-header.on-hero .main-nav.open a {
    color: var(--color-sage-900);
    text-shadow: none;
  }
  .site-header.on-hero .main-nav.open a.active { color: #7CA389; }
  .site-header.on-hero .main-nav.open a:hover { color: var(--color-clay-600); }
  .cards-grid { grid-template-columns: 1fr; }
}

/* Codice GLN dei professionisti */
.gln { font-size: 0.85rem; letter-spacing: 0.04em; color: var(--color-text-muted); margin: -0.6rem 0 1rem; }
.team-card .gln { margin: -0.7rem 0 0; }

/* Credit footer */
.footer-bottom-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-bottom-inner p { margin: 0; }
.design-credit { margin-left: auto !important; text-align: right; }
.design-credit a { color: rgba(246, 242, 234, 0.85); }
.design-credit a:hover { color: var(--color-white); }

/* Ambiti di intervento: sei aree in 3 colonne */
.ambiti-grid { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
@media (max-width: 900px) { .ambiti-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .ambiti-grid { grid-template-columns: 1fr; } }

/* Testi lunghi nei riquadri: tagliati dopo 5 righe con "Leggi tutto" */
.ambiti-grid { align-items: start; }
.card-text { white-space: pre-line; }
.card-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-more {
  background: none; border: 0; padding: 0; margin-top: 0.8rem;
  font: inherit; font-size: 0.92rem; font-weight: 500;
  color: var(--color-sage-700); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.read-more:hover { color: var(--color-sage-900); }
