/* Tema automatico chiaro/scuro. La scelta manuale viene salvata localmente nel browser. */
:root {
  color-scheme: light;
  --theme-header-bg: rgba(255,250,240,.92);
  --theme-mobile-header-bg: rgba(255,250,240,.96);
  --theme-panel-bg: rgba(255,252,240,.68);
  --theme-panel-bg-soft: rgba(255,252,240,.48);
  --theme-card-bg: rgba(255,253,246,.82);
  --theme-menu-bg: #fffdf6;
  --theme-footer-bg: #f3ebca;
  --theme-mobile-actions-bg: rgba(255,255,255,.96);
  --theme-secondary-button-bg: #ffffff;
  --theme-secondary-button-hover: #fafbfa;
  --theme-input-like-bg: rgba(255,255,255,.68);
  --theme-soft-line: rgba(79,125,59,.15);
  --theme-shadow: rgba(18,29,22,.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #111713;
  --color-surface: #182019;
  --color-surface-strong: #202b22;
  --color-text: #f2f3ec;
  --color-text-soft: #c2cbc0;
  --color-border: #3e4b40;
  --color-green: #82a86d;
  --color-green-dark: #b9d6a8;
  --color-green-deep: #d9ead0;
  --color-green-soft: #253528;
  --color-cream: #292e25;
  --color-cream-light: #111713;
  --theme-header-bg: rgba(17,23,19,.94);
  --theme-mobile-header-bg: rgba(17,23,19,.97);
  --theme-panel-bg: rgba(29,39,31,.82);
  --theme-panel-bg-soft: rgba(27,36,29,.70);
  --theme-card-bg: rgba(30,40,32,.90);
  --theme-menu-bg: #182019;
  --theme-footer-bg: #161e18;
  --theme-mobile-actions-bg: rgba(24,32,26,.96);
  --theme-secondary-button-bg: #222c24;
  --theme-secondary-button-hover: #2b372d;
  --theme-input-like-bg: rgba(31,42,34,.92);
  --theme-soft-line: rgba(185,214,168,.18);
  --theme-shadow: rgba(0,0,0,.30);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --color-bg: #111713;
    --color-surface: #182019;
    --color-surface-strong: #202b22;
    --color-text: #f2f3ec;
    --color-text-soft: #c2cbc0;
    --color-border: #3e4b40;
    --color-green: #82a86d;
    --color-green-dark: #b9d6a8;
    --color-green-deep: #d9ead0;
    --color-green-soft: #253528;
    --color-cream: #292e25;
    --color-cream-light: #111713;
    --theme-header-bg: rgba(17,23,19,.94);
    --theme-mobile-header-bg: rgba(17,23,19,.97);
    --theme-panel-bg: rgba(29,39,31,.82);
    --theme-panel-bg-soft: rgba(27,36,29,.70);
    --theme-card-bg: rgba(30,40,32,.90);
    --theme-menu-bg: #182019;
    --theme-footer-bg: #161e18;
    --theme-mobile-actions-bg: rgba(24,32,26,.96);
    --theme-secondary-button-bg: #222c24;
    --theme-secondary-button-hover: #2b372d;
    --theme-input-like-bg: rgba(31,42,34,.92);
    --theme-soft-line: rgba(185,214,168,.18);
    --theme-shadow: rgba(0,0,0,.30);
  }
}

body { background: var(--color-bg); color: var(--color-text); }
.site-header { background: var(--theme-header-bg) !important; border-color: var(--color-border) !important; }
.mobile-menu { background: var(--theme-menu-bg); border-color: var(--color-border); }
.desktop-nav a { color: var(--color-text-soft); }
.menu-toggle,
.theme-toggle { color: var(--color-text); background: var(--theme-secondary-button-bg); border-color: var(--color-border); }
.button--secondary { color: var(--color-text); background: var(--theme-secondary-button-bg); border-color: var(--color-border); }
.button--secondary:hover { background: var(--theme-secondary-button-hover); }
.section--soft { background: var(--color-surface); border-color: var(--color-border); }
.contact-shell,
.contact-main,
.hours-season,
.map-placeholder-inner,
.category-family { color: var(--color-text); }
.contact-shell,
.hours-season,
.map-placeholder-inner { background: var(--theme-card-bg) !important; border-color: var(--color-border) !important; }
.category-family { background: var(--theme-panel-bg) !important; border-color: var(--theme-soft-line) !important; }
.category-family.is-open .category-trigger { background: transparent !important; }
.category-panel li { color: var(--color-text-soft); }
.mobile-actions { background: var(--theme-mobile-actions-bg); border-color: var(--color-border); box-shadow: 0 10px 34px var(--theme-shadow); }
.site-footer { background: var(--theme-footer-bg); border-color: var(--color-border); }
.footer-meta { border-color: var(--color-border); }
.header-social-button { color: var(--color-text); background: var(--theme-panel-bg-soft); border-color: var(--color-border); }
.header-social-button:hover,
.header-social-button:focus-visible { background: var(--theme-panel-bg); }

/* I riquadri dei loghi restano chiari anche in modalità notte per non perdere
   i marchi neri o trasparenti e per conservarne i colori originali. */
#marchi .brand-mark-item,
#marchi .brand-mark-item--secondary {
  background: #ffffff !important;
  border-color: rgba(185,214,168,.18) !important;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.theme-toggle:hover { transform: translateY(-1px); }
.theme-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-icon--sun { display: none; }
:root[data-theme="dark"] .theme-icon--moon { display: none; }
:root[data-theme="dark"] .theme-icon--sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-icon--moon { display: none; }
  :root:not([data-theme]) .theme-icon--sun { display: block; }
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.mobile-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .9rem 0 .3rem;
  padding-top: .9rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-soft);
  font-size: .88rem;
  font-weight: 700;
}
.theme-toggle--mobile {
  width: auto;
  min-width: 132px;
  height: 42px;
  grid-auto-flow: column;
  gap: .5rem;
  padding: 0 .8rem;
  border-radius: 999px;
}
.theme-toggle--mobile .theme-toggle-label {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: nowrap !important;
}

@media (max-width: 919px) {
  html, body { background: var(--color-bg) !important; }
  .site-header { background: var(--theme-mobile-header-bg) !important; }
  .site-header::before,
  .site-header::after { background: var(--theme-mobile-header-bg) !important; }
  .site-header .theme-toggle:not(.theme-toggle--mobile) {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
  }
  .site-header .theme-toggle:not(.theme-toggle--mobile):hover {
    transform: translateY(-50%);
  }
}

/* Footer societario compatto */
.footer-inner--legal { gap: 1.7rem; }
.footer-company-data address {
  display: grid;
  gap: .28rem;
  max-width: 720px;
  margin-top: .65rem;
  color: var(--color-text-soft);
  font-style: normal;
  font-size: .78rem;
  line-height: 1.42;
}
.footer-company-data address a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.footer-legal-short { display: inline-block; }
@media (max-width: 620px) {
  .footer-company-data address { font-size: .74rem; }
  .footer-meta { display: grid; gap: .3rem; }
}

/* Contrasto aggiuntivo per le grandi superfici in modalità notte. */
:root {
  --theme-hero-top: #fff9e9;
  --theme-photo-border: rgba(255,255,255,.74);
  --theme-map-grid: rgba(219,211,176,.42);
}
:root[data-theme="dark"] {
  --theme-hero-top: #182019;
  --theme-photo-border: rgba(185,214,168,.20);
  --theme-map-grid: rgba(185,214,168,.09);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --theme-hero-top: #182019;
    --theme-photo-border: rgba(185,214,168,.20);
    --theme-map-grid: rgba(185,214,168,.09);
  }
}
.hero {
  background:
    radial-gradient(circle at 10% 12%, rgba(130,168,109,.14), transparent 28%),
    linear-gradient(180deg, var(--theme-hero-top), var(--color-bg)) !important;
}
.hero-lead { color: var(--color-text-soft) !important; }
.hero-note {
  color: var(--color-text);
  background: var(--theme-panel-bg) !important;
  border-color: var(--color-border) !important;
}
.store-figure {
  border-color: var(--theme-photo-border) !important;
  background: var(--theme-panel-bg-soft) !important;
}
.section--soft {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
}
.hours-note {
  background: var(--color-green-soft) !important;
  color: var(--color-text-soft) !important;
}
.map-placeholder {
  background-color: var(--color-surface) !important;
  background-image:
    linear-gradient(var(--theme-map-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--theme-map-grid) 1px, transparent 1px) !important;
  background-size: 34px 34px !important;
}
.social-follow-inner { color: #fff; }
.social-follow-inner .eyebrow,
.social-follow-inner h2,
.social-follow-inner p { color: inherit; }


/* ============================================================
   V25 — DARK MODE: CONTRASTO + HEADER SEMPRE CHIARO
   ============================================================ */

/* Contrasto generale più deciso in modalità notte. */
:root[data-theme="dark"] {
  --color-text: #f7f9f4;
  --color-text-soft: #e3e9df;
  --color-border: #68766a;
  --color-green-dark: #cbe3bc;
  --color-green-deep: #e2f0da;
  --theme-soft-line: rgba(218,232,210,.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-text: #f7f9f4;
    --color-text-soft: #e3e9df;
    --color-border: #68766a;
    --color-green-dark: #cbe3bc;
    --color-green-deep: #e2f0da;
    --theme-soft-line: rgba(218,232,210,.28);
  }
}

/* L'header resta chiaro anche quando il resto del sito è in modalità notte.
   In questo modo il logo PNG mantiene sempre la propria resa corretta. */
:root[data-theme="dark"] .site-header,
:root[data-theme="dark"] .site-header::before,
:root[data-theme="dark"] .site-header::after,
:root[data-theme="dark"] .mobile-menu {
  background: rgba(255,250,240,.97) !important;
  border-color: rgba(79,125,59,.16) !important;
  color: #1f2d22 !important;
}

:root[data-theme="dark"] .site-header .desktop-nav a,
:root[data-theme="dark"] .site-header .brand-name,
:root[data-theme="dark"] .site-header .brand-place,
:root[data-theme="dark"] .site-header .menu-toggle,
:root[data-theme="dark"] .site-header .theme-toggle,
:root[data-theme="dark"] .site-header .header-social-button,
:root[data-theme="dark"] .mobile-menu a,
:root[data-theme="dark"] .mobile-menu .mobile-theme-row,
:root[data-theme="dark"] .mobile-menu .theme-toggle--mobile,
:root[data-theme="dark"] .legal-home-link {
  color: #26342a !important;
}

:root[data-theme="dark"] .site-header .menu-toggle,
:root[data-theme="dark"] .site-header .theme-toggle,
:root[data-theme="dark"] .site-header .header-social-button,
:root[data-theme="dark"] .mobile-menu .theme-toggle--mobile {
  background: rgba(255,255,255,.78) !important;
  border-color: rgba(79,125,59,.24) !important;
}

:root[data-theme="dark"] .site-header .header-contact {
  color: #fff !important;
}

:root[data-theme="dark"] .mobile-menu {
  box-shadow: 0 18px 34px rgba(23,35,26,.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .site-header,
  :root:not([data-theme]) .site-header::before,
  :root:not([data-theme]) .site-header::after,
  :root:not([data-theme]) .mobile-menu {
    background: rgba(255,250,240,.97) !important;
    border-color: rgba(79,125,59,.16) !important;
    color: #1f2d22 !important;
  }

  :root:not([data-theme]) .site-header .desktop-nav a,
  :root:not([data-theme]) .site-header .brand-name,
  :root:not([data-theme]) .site-header .brand-place,
  :root:not([data-theme]) .site-header .menu-toggle,
  :root:not([data-theme]) .site-header .theme-toggle,
  :root:not([data-theme]) .site-header .header-social-button,
  :root:not([data-theme]) .mobile-menu a,
  :root:not([data-theme]) .mobile-menu .mobile-theme-row,
  :root:not([data-theme]) .mobile-menu .theme-toggle--mobile,
  :root:not([data-theme]) .legal-home-link {
    color: #26342a !important;
  }

  :root:not([data-theme]) .site-header .menu-toggle,
  :root:not([data-theme]) .site-header .theme-toggle,
  :root:not([data-theme]) .site-header .header-social-button,
  :root:not([data-theme]) .mobile-menu .theme-toggle--mobile {
    background: rgba(255,255,255,.78) !important;
    border-color: rgba(79,125,59,.24) !important;
  }

  :root:not([data-theme]) .site-header .header-contact {
    color: #fff !important;
  }
}

/* I pulsanti social hanno fondo chiaro: il testo deve restare scuro
   indipendentemente dal tema della pagina. */
.social-follow .social-button,
:root[data-theme="dark"] .social-follow .social-button {
  color: #173b21 !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .social-follow .social-button {
    color: #173b21 !important;
  }
}

/* Maggiore leggibilità del testo secondario nelle sezioni scure. */
:root[data-theme="dark"] .section-heading p,
:root[data-theme="dark"] .about-copy p,
:root[data-theme="dark"] .about-copy li,
:root[data-theme="dark"] .category-panel li,
:root[data-theme="dark"] .contact-item small,
:root[data-theme="dark"] .contact-item p,
:root[data-theme="dark"] .hours-season p,
:root[data-theme="dark"] .hours-season li,
:root[data-theme="dark"] .hours-note,
:root[data-theme="dark"] .map-placeholder p,
:root[data-theme="dark"] .footer-company-data address,
:root[data-theme="dark"] .footer-meta,
:root[data-theme="dark"] .legal-section p,
:root[data-theme="dark"] .legal-section li,
:root[data-theme="dark"] .legal-header-block p {
  color: #e3e9df !important;
}

:root[data-theme="dark"] .footer-nav a,
:root[data-theme="dark"] .footer-company-data address a,
:root[data-theme="dark"] .legal-section a,
:root[data-theme="dark"] .legal-contact-card a {
  color: #f7f9f4 !important;
}

:root[data-theme="dark"] .eyebrow:not(.social-follow .eyebrow),
:root[data-theme="dark"] .map-open-label,
:root[data-theme="dark"] .text-link {
  color: #cbe3bc !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .section-heading p,
  :root:not([data-theme]) .about-copy p,
  :root:not([data-theme]) .about-copy li,
  :root:not([data-theme]) .category-panel li,
  :root:not([data-theme]) .contact-item small,
  :root:not([data-theme]) .contact-item p,
  :root:not([data-theme]) .hours-season p,
  :root:not([data-theme]) .hours-season li,
  :root:not([data-theme]) .hours-note,
  :root:not([data-theme]) .map-placeholder p,
  :root:not([data-theme]) .footer-company-data address,
  :root:not([data-theme]) .footer-meta,
  :root:not([data-theme]) .legal-section p,
  :root:not([data-theme]) .legal-section li,
  :root:not([data-theme]) .legal-header-block p {
    color: #e3e9df !important;
  }

  :root:not([data-theme]) .footer-nav a,
  :root:not([data-theme]) .footer-company-data address a,
  :root:not([data-theme]) .legal-section a,
  :root:not([data-theme]) .legal-contact-card a {
    color: #f7f9f4 !important;
  }

  :root:not([data-theme]) .eyebrow:not(.social-follow .eyebrow),
  :root:not([data-theme]) .map-open-label,
  :root:not([data-theme]) .text-link {
    color: #cbe3bc !important;
  }
}

/* Il testo di fallback nei riquadri chiari dei marchi resta scuro. */
:root[data-theme="dark"] #marchi .brand-mark-missing {
  color: #314036 !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) #marchi .brand-mark-missing {
    color: #314036 !important;
  }
}


/* V30 — etichetta modalità notte/giorno sempre dentro il controllo */
.mobile-theme-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.7rem}
.theme-toggle--mobile{min-width:152px;max-width:100%;display:inline-flex!important;align-items:center;justify-content:center;box-sizing:border-box;flex-shrink:0;overflow:hidden}
.theme-toggle--mobile .theme-toggle-label{min-width:0;white-space:nowrap!important;line-height:1.1;text-align:center}
@media(max-width:380px){.mobile-theme-row{grid-template-columns:1fr}.theme-toggle--mobile{width:100%;justify-self:stretch}}


/* V31 — tema persistente, toggle desktop e contrasto rafforzato */
@media(min-width:920px){
  .site-header .theme-toggle:not(.theme-toggle--mobile){position:fixed;left:18px;bottom:18px;top:auto;z-index:160;width:46px;height:46px;flex-basis:46px;background:var(--theme-secondary-button-bg);border:1px solid var(--color-border);box-shadow:0 10px 28px var(--theme-shadow)}
  .site-header .theme-toggle:not(.theme-toggle--mobile):hover{transform:translateY(-2px)}
}
:root[data-theme="dark"]{--color-text:#fbfcf8;--color-text-soft:#edf2ea;--color-border:#829086;--color-green-dark:#d4e9c7;--color-green-deep:#edf7e8}
:root[data-theme="dark"] .page-internal p,
:root[data-theme="dark"] .page-internal li,
:root[data-theme="dark"] .about-copy p,
:root[data-theme="dark"] .about-copy li,
:root[data-theme="dark"] .section-heading p,
:root[data-theme="dark"] .calc-help,
:root[data-theme="dark"] .calculator-tech-note,
:root[data-theme="dark"] .technical-disclaimer,
:root[data-theme="dark"] .result-warnings,
:root[data-theme="dark"] .contact-item small,
:root[data-theme="dark"] .hours-note,
:root[data-theme="dark"] .footer-company-data address,
:root[data-theme="dark"] .footer-meta,
:root[data-theme="dark"] .legal-section p,
:root[data-theme="dark"] .legal-section li{color:#edf2ea!important}
:root[data-theme="dark"] .about-copy h2,
:root[data-theme="dark"] .about-copy h3,
:root[data-theme="dark"] .section-heading h1,
:root[data-theme="dark"] .section-heading h2,
:root[data-theme="dark"] .section-heading h3,
:root[data-theme="dark"] .legal-section h2,
:root[data-theme="dark"] .legal-header-block h1{color:#fbfcf8!important}
:root[data-theme="dark"] .blocked-work,
:root[data-theme="dark"] .calculator-result--warning{background:#4a391f!important;color:#fff8e9!important;border-color:#c9a05e!important}
:root[data-theme="dark"] .blocked-work h3,
:root[data-theme="dark"] .calculator-result--warning h3,
:root[data-theme="dark"] .calculator-result--warning .result-kicker{color:#fff8e9!important}
:root[data-theme="dark"] .calc-note,
:root[data-theme="dark"] .earth-note,
:root[data-theme="dark"] .purchase-note{background:#304235!important;color:#fbfcf8!important;border-color:#82a86d!important}
:root[data-theme="dark"] .calc-field select,
:root[data-theme="dark"] .calc-field input[type="number"],
:root[data-theme="dark"] .mode-choice,
:root[data-theme="dark"] .checkbox-row{background:#101612!important;color:#fbfcf8!important;border-color:#829086!important}
:root[data-theme="dark"] .calc-field select option{background:#101612;color:#fbfcf8}
:root[data-theme="dark"] .calc-field select:disabled,
:root[data-theme="dark"] .calc-field input:disabled{opacity:.88}
:root[data-theme="dark"] .header-utility{background:rgba(255,255,255,.68)!important;border-color:rgba(79,125,59,.16)!important}
:root[data-theme="dark"] .header-utility-inner,
:root[data-theme="dark"] .header-utility-address{color:#465249!important}
:root[data-theme="dark"] .header-utility-email,
:root[data-theme="dark"] .header-utility-phone{color:#2f5a2b!important}
