/* ============================================
   Sito Dr.ssa Ilaria Marini — style.css
   Stack: HTML + CSS vanilla + JS vanilla
   ============================================ */

/* PALETTE & VARIABILI */
:root {
  /* Verdi */
  --green-bg: #C5D787;        /* sfondi, badge, dettagli, bordi decorativi */
  --green-bg-soft: #eaf3de;   /* badge chiari */
  --green-bg-tint: #f4f7ec;   /* tint pilastri */
  --green-text: #6B7F2B;      /* titoli e link — contrasto 5:1 su bianco */
  --green-text-hover: #556721;

  /* Oro/terracotta */
  --gold: #BE9B4C;            /* CTA principale, dettagli */
  --gold-hover: #a8883f;
  --gold-text: #8C6D2C;       /* eyebrow leggibile — contrasto 4.6:1 su bianco */

  /* Neutri */
  --bg: #FAFAF7;
  --bg-white: #fff;
  --text: #2D3748;
  --text-soft: #4a5568;
  --text-mute: #718096;
  --border: rgba(143, 168, 50, 0.15);
  --border-hover: rgba(143, 168, 50, 0.25);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.08);

  /* Layout */
  --navbar-height: 72px;
  --container-max: 1200px;
}

/* RESET & BASE */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-top: var(--navbar-height);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-text); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--green-text-hover); }

/* SKIP LINK */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--green-bg);
  color: var(--text) !important;
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  z-index: 9999;
  transition: top 0.2s ease;
  text-decoration: none;
}
.skip-link:focus { top: 0; }
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  top: auto;
  left: auto;
}

/* FOCUS VISIBILE */
:focus-visible {
  outline: 3px solid var(--green-bg);
  outline-offset: 3px;
  border-radius: 3px;
}

/* UTILITY */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 1.5rem; }
.bg-white { background: var(--bg-white); }
.bg-soft { background: var(--bg); }
.title-green { color: var(--green-text); margin-bottom: 1.5rem; font-size: 2rem; }

/* SECTION EYEBROW (label sopra titoli) */
.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 0.5rem;
}

/* BOTTONI */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
  border: none;
  text-decoration: none;
  font-family: inherit;
  font-size: 1rem;
}
.btn-terracotta { background: var(--gold); color: var(--bg-white) !important; }
.btn-terracotta:hover { background: var(--gold-hover); transform: translateY(-2px); }
.btn-outline-white { background: transparent; color: var(--bg-white) !important; border: 2px solid var(--bg-white); }
.btn-outline-white:hover { background: var(--bg-white); color: var(--text) !important; }
.btn-cta-nav {
  background: var(--gold);
  color: var(--bg-white) !important;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
}
.btn-cta-nav:hover { background: var(--gold-hover); }

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  min-height: var(--navbar-height);
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  min-height: var(--navbar-height);
}
.navbar__logo { display: flex; align-items: center; }
.navbar__links { display: flex; align-items: center; gap: 1.5rem; }
.navbar__links a { font-size: 0.95rem; font-weight: 500; color: var(--text); }
.navbar__links a:hover { color: var(--green-text); }

/* HAMBURGER */
.navbar__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
  z-index: 1001;
}
.navbar__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
.navbar__hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navbar__hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.navbar__mobile-menu {
  display: none;
  position: absolute;
  top: var(--navbar-height);
  left: 0;
  width: 100%;
  background: var(--bg);
  padding: 1.5rem;
  flex-direction: column;
  gap: 1.25rem;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.navbar__mobile-menu.active { display: flex; }
.navbar__mobile-menu a { color: var(--text); font-weight: 500; }
.navbar__mobile-menu a:hover { color: var(--green-text); }

@media (max-width: 992px) {
  .navbar__links { display: none; }
  .navbar__hamburger { display: flex; }
}

/* WHATSAPP FLOAT */
.wa-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.wa-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
  color: var(--bg-white);
}

/* SOCIAL ICONS */
.social-links { display: flex; gap: 0.75rem; margin-top: 1rem; }
.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.social-links a:hover {
  background: var(--green-bg);
  border-color: var(--green-bg);
  color: var(--text);
}
.social-links svg { width: 16px; height: 16px; fill: currentColor; }

/* FOOTER */
.footer {
  background: var(--bg-white);
  padding: 4rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
}
.footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}
.footer__brand h4 {
  color: var(--green-text);
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-size: 1rem;
  letter-spacing: 0.5px;
}
.footer__desc { font-size: 0.9rem; color: var(--text-soft); margin-bottom: 0.5rem; }
.footer__col h4 { margin-bottom: 1.25rem; font-size: 1rem; color: var(--text); }
.footer__col nav { display: flex; flex-direction: column; gap: 0.75rem; }
.footer__col a { font-size: 0.9rem; color: var(--text-soft); }
.footer__col a:hover { color: var(--green-text); }
.footer__col span { font-size: 0.85rem; color: var(--text-mute); }
.footer__bottom {
  max-width: var(--container-max);
  margin: 2rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-mute);
}
.footer__cookie-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text-soft);
  cursor: pointer;
  text-decoration: underline;
}
.footer__cookie-link:hover { color: var(--green-text); }

@media (max-width: 768px) {
  .footer__inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer__bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* ============================================
   PUZZLE LAYOUT GLOBALE
   Righe alternate testo/immagine 50/50
   Mobile: foto sempre SOPRA il testo
   ============================================ */

.puzzle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  align-items: stretch;
}

.puzzle-row .puzzle-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 10%;
  min-width: 0; /* previene overflow grid */
}

/* Colonne immagine: nessun padding, riempiono la cella */
.puzzle-row .puzzle-col.img-col {
  padding: 0;
}

.puzzle-row .puzzle-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Modificatore sfondo alternato */
.puzzle-row--alt {
  background: var(--bg);
}

/* Mobile: stack verticale, foto SEMPRE sopra il testo */
@media (max-width: 768px) {
  .puzzle-row {
    grid-template-columns: 1fr;
  }

  .puzzle-row .puzzle-col {
    padding: 3rem 1.5rem;
  }

  .puzzle-row .puzzle-col.img-col {
    padding: 0;
    min-height: 280px;
    order: 1; /* foto prima */
  }

  .puzzle-row .puzzle-col.text-col {
    order: 2; /* testo dopo */
  }
}

/* Eccezione: #chi-sono home — su mobile testo sopra, foto sotto */
@media (max-width: 768px) {
  #chi-sono .puzzle-col.img-col  { order: 2; }
  #chi-sono .puzzle-col.text-col { order: 1; }
}

/* ============================================
   COOKIE BANNER GDPR
   ============================================ */

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding: 1.25rem 1.5rem;
  z-index: 10000;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid var(--border);
}
.cookie-banner__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.cookie-banner__desc {
  margin-bottom: 1rem;
  color: var(--text-soft);
}
.cookie-banner__desc a { color: var(--green-text); text-decoration: underline; }
.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.cookie-banner__btn {
  padding: 0.55rem 1.1rem;
  border: 1px solid #ddd;
  background: var(--bg-white);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.cookie-banner__btn:hover { background: #f5f5f5; }
.cookie-banner__btn--primary {
  background: var(--gold);
  color: var(--bg-white);
  border-color: var(--gold);
}
.cookie-banner__btn--primary:hover {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
  color: var(--bg-white);
}

@media (max-width: 480px) {
  .cookie-banner { left: 0.5rem; right: 0.5rem; bottom: 0.5rem; padding: 1rem 1.25rem; }
  .cookie-banner__actions { gap: 0.5rem; }
  .cookie-banner__btn { flex: 1 1 auto; padding: 0.6rem 0.75rem; }
}
