/* =========================================================
   Progetto SOS-AP – Agricoltura di Precisione
   Stile completo e autonomo (non serve il tema ColorMag né Elementor)
   ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,400&display=swap");

:root {
  --campo: #275a1b;
  --campo-scuro: #183d10;
  --foglia: #4f9a2a;
  --foglia-chiaro: #eaf4e2;
  --mais: #e3a521;
  --mais-chiaro: #fdf3dc;
  --fondo: #f5f7f1;
  --carta: #ffffff;
  --testo: #263022;
  --tenue: #617060;
  --linea: #dfe6d8;
  --font: "DM Sans", "Segoe UI", Arial, sans-serif;
  --raggio: 14px;
  --ombra: 0 1px 2px rgba(39, 90, 27, .06), 0 8px 24px rgba(39, 90, 27, .08);
  --ombra-forte: 0 2px 4px rgba(39, 90, 27, .08), 0 18px 40px rgba(39, 90, 27, .16);
}

/* ---------- Basi ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--testo);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }
a { color: var(--foglia); text-decoration: none; transition: color .2s, background-color .2s; }
a:hover, a:focus { color: var(--campo); }
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  color: var(--campo-scuro);
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.25;
}
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--mais); outline-offset: 2px; }
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.clearfix::after { content: ""; display: table; clear: both; }
.inner-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Menu ---------- */

#masthead { background: var(--carta); }
#header-text-nav-wrap { display: none; }
.main-navigation {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--campo);
  border: 0 !important;
  box-shadow: 0 4px 18px rgba(24, 61, 16, .18);
}
.main-navigation > .inner-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 1340px;
  min-height: 62px;
}
.home-icon a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.home-icon a:hover { background: var(--mais); color: var(--campo-scuro); }
.home-icon .fa {
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.menu-toggle { display: none; }
.menu-primary-container { flex: 1; }
.main-navigation ul.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.main-navigation ul.menu > li > a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, .88);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
}
.main-navigation ul.menu > li > a:hover,
.main-navigation ul.menu > li > a:focus { background: rgba(255, 255, 255, .12); color: #fff; }
.main-navigation ul.menu > .current-menu-item > a,
.main-navigation ul.menu > .current_page_item > a { background: var(--mais); color: var(--campo-scuro); font-weight: 700; }

/* ---------- Immagine di testata ---------- */

.wp-custom-header { padding: 22px 0 0; background: var(--fondo); }
.header-image-wrap {
  max-width: 1152px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--raggio);
  box-shadow: var(--ombra);
  background: linear-gradient(120deg, var(--foglia), var(--campo));
}
.header-image-wrap a { display: block; }
.header-image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 70px;
  object-fit: cover;
}

/* ---------- Contenuto ---------- */

#main { padding: clamp(30px, 4vw, 50px) 0 clamp(50px, 6vw, 80px); }
.front-page-top-section:not(:has(> div:not(:empty))) { display: none; }
#primary, #content, .article-container { width: auto; float: none; }
.home .article-container > article > .entry-header { display: none; }
.entry-title { font-size: clamp(28px, 3.4vw, 40px); }
.entry-footer:empty { display: none; }

/* testi incollati da Word: font e colori del sito al posto di quelli fissi */
.entry-content span[style],
.entry-content p[style] {
  font-family: inherit !important;
  font-size: inherit !important;
  color: inherit !important;
}
.entry-content p[style] {
  margin-bottom: 1em !important;
  text-align: left !important;
}
.entry-content span[style]:empty { display: none; }

/* ---------- Griglia Elementor ---------- */

.elementor-section { position: relative; }
.elementor-section + .elementor-section { margin-top: clamp(28px, 4vw, 44px); }
.elementor-container { max-width: 1152px; margin: 0 auto; }
.elementor-row { display: flex; flex-wrap: wrap; gap: 28px; }
.elementor-column { position: relative; display: flex; min-width: 0; }
.elementor-col-100 { flex: 1 1 100%; }
.elementor-col-50 { flex: 1 1 calc(50% - 14px); }
.elementor-col-33 { flex: 1 1 calc(33.333% - 19px); }
.elementor-column-wrap { width: 100%; }
.elementor-widget-wrap { display: flex; flex-direction: column; gap: 14px; }
.elementor-widget-container > :last-child { margin-bottom: 0; }

/* le parti che il sito nascondeva su computer, tablet o telefono */
@media (min-width: 1025px) {
  .elementor-hidden-desktop { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .elementor-hidden-tablet { display: none !important; }
}
@media (max-width: 767px) {
  .elementor-hidden-phone { display: none !important; }
}

/* titoli di sezione */
.elementor-heading-title {
  position: relative;
  margin: 0 0 6px;
  padding-left: 18px;
  color: var(--campo-scuro);
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.2;
}
.elementor-heading-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: .15em;
  bottom: .15em;
  width: 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--mais), var(--foglia));
}

/* testo dentro schede */
.elementor-widget-text-editor .elementor-widget-container {
  padding: 26px 30px;
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: var(--raggio);
  box-shadow: var(--ombra);
}
.elementor-text-editor p:last-child { margin-bottom: 0 !important; }
.elementor-text-editor strong,
.elementor-text-editor span[style*="bold"] { color: var(--campo); font-weight: 700 !important; }

/* banner con i loghi (immagine molto larga) */
.premium-image-scroll-container {
  position: relative;
  overflow: hidden;
  padding: 18px 22px;
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: var(--raggio);
  box-shadow: var(--ombra);
}
.premium-image-scroll-content { display: none; }
.premium-image-scroll-vertical img { display: block; width: 100%; height: auto; }

/* immagine semplice (targa PSR, solo su telefono) */
.elementor-image img {
  display: block;
  width: 100%;
  border-radius: var(--raggio);
  box-shadow: var(--ombra);
}

/* riquadri con icona (se un giorno vengono mostrati) */
.elementor-icon-box-wrapper { text-align: center; }
.elementor-icon-box-icon .elementor-icon {
  display: inline-flex;
  width: 96px;
  height: 96px;
  padding: 18px;
  border: 2px solid var(--linea);
  border-radius: 50%;
  background: var(--carta);
}
.elementor-icon svg { width: 100%; height: 100%; }
.elementor-icon-box-title { margin-top: 12px; font-size: 18px; }

/* ---------- "In evidenza": notizie ---------- */

.eael-post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.eael-entry-wrapper,
.entry-content p { overflow-wrap: anywhere; }
.eael-grid-post-holder {
  overflow: hidden;
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: var(--raggio);
  box-shadow: var(--ombra);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.eael-grid-post-holder:hover { transform: translateY(-3px); box-shadow: var(--ombra-forte); border-color: transparent; }
.eael-grid-post-holder-inner { display: flex; align-items: stretch; }
.eael-entry-media {
  position: relative;
  flex: 0 0 130px;
  overflow: hidden;
  background: var(--foglia-chiaro);
}
.eael-entry-overlay { position: absolute; inset: 0; z-index: 2; }
.eael-entry-overlay i { display: none; }
.eael-entry-overlay a { position: absolute; inset: 0; }
.eael-entry-thumbnail,
.eael-entry-thumbnail img { height: 100%; }
.eael-entry-thumbnail img {
  display: block;
  width: 100%;
  min-height: 120px;
  object-fit: cover;
  transition: transform .5s;
}
.eael-grid-post-holder:hover .eael-entry-thumbnail img { transform: scale(1.06); }
.eael-entry-wrapper { flex: 1; min-width: 0; padding: 16px 20px 16px; }
.eael-entry-title { margin: 0 0 6px; font-size: 17px; line-height: 1.35; }
.eael-entry-title a { color: var(--campo-scuro); }
.eael-entry-title a:hover { color: var(--foglia); }
.eael-grid-post-excerpt p { margin: 0 0 8px; color: var(--tenue); font-size: 15px; line-height: 1.5; }
.eael-post-elements-readmore-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--foglia);
  font-size: 14px;
  font-weight: 700;
}
.eael-post-elements-readmore-btn::after { content: "\2192"; transition: transform .2s; }
.eael-post-elements-readmore-btn:hover::after { transform: translateX(3px); }

/* ---------- Piè di pagina ---------- */

#colophon { background: var(--campo-scuro); color: rgba(255, 255, 255, .78); }
.footer-widgets-wrapper { padding: clamp(40px, 5vw, 60px) 0 30px; }
.footer-widgets-area {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.tg-footer-other-widgets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}
.tg-fourth-footer-widget:not(:has(img)) { display: none; }
.widget-altervista-profile:empty { display: none; }
.widget-altervista-image img {
  display: block;
  width: 100%;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
}
#colophon .textwidget p { color: rgba(255, 255, 255, .8); font-size: 15.5px; line-height: 1.6; }
#colophon .textwidget p:last-child { margin-bottom: 0; }
#colophon .tg-second-footer-widget,
#colophon .tg-third-footer-widget { padding-left: 20px; border-left: 3px solid var(--mais); }
.footer-socket-wrapper {
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .15);
  color: rgba(255, 255, 255, .6);
  font-size: 14px;
  text-align: center;
}
.footer-socket-wrapper a { color: #fff; }
.footer-socket-wrapper a:hover { color: var(--mais); }
.footer-socket-right-section:empty { display: none; }

/* pulsante "torna su" */
#scroll-up {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--campo);
  color: #fff;
  box-shadow: var(--ombra-forte);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, background-color .2s;
}
html.scrolled #scroll-up,
html:not(.js) #scroll-up { opacity: 1; pointer-events: auto; }
#scroll-up:hover { background: var(--mais); color: var(--campo-scuro); }
#scroll-up i { display: none; }
#scroll-up::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-top: 2.5px solid currentColor;
  border-left: 2.5px solid currentColor;
  transform: rotate(45deg);
}

/* ---------- Protezione: vince sugli stili vecchi di Elementor ed Essential Addons
   (se nella pagina sono rimasti i loro file CSS) ---------- */

.elementor,
.elementor :is(h1, h2, h3, h4, h5, h6, p, a, span, li, div) { font-family: var(--font) !important; }

/* titoli: niente fascia colorata, testo verde a sinistra */
.elementor-widget-heading,
.elementor-widget-heading .elementor-widget-container {
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
.elementor-widget-heading .elementor-heading-title {
  padding: 0 0 0 18px !important;
  background: none !important;
  color: var(--campo-scuro) !important;
  font-size: clamp(24px, 2.6vw, 30px) !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-align: left !important;
  text-transform: none !important;
  text-shadow: none !important;
}

/* testi: dimensione normale */
.elementor-widget-text-editor .elementor-widget-container,
.elementor-text-editor,
.elementor-text-editor p {
  color: var(--testo) !important;
  font-size: 17px !important;
  line-height: 1.7 !important;
  letter-spacing: normal !important;
}
.elementor-text-editor { columns: auto !important; }

/* colonne Elementor */
.elementor-section .elementor-row { display: flex !important; flex-wrap: wrap !important; }
.elementor-section .elementor-column { width: auto !important; min-height: 0 !important; }
.elementor-section .elementor-column-wrap,
.elementor-section .elementor-widget-wrap { padding: 0 !important; }

/* "In evidenza": una scheda per riga, a tutta larghezza */
.eael-post-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  height: auto !important;
  margin: 0 !important;
}
.eael-post-grid .eael-grid-post {
  position: static !important;
  inset: auto !important;
  float: none !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}
.eael-grid-post-holder { height: auto !important; }
.eael-grid-post-holder-inner { display: flex !important; flex-direction: row !important; }
.eael-entry-media { width: 130px !important; flex: 0 0 130px !important; height: auto !important; }
.eael-entry-overlay {
  background: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}
.eael-entry-wrapper { flex: 1 1 auto !important; min-width: 0 !important; width: auto !important; padding: 16px 20px !important; }
.eael-entry-title { font-size: 17px !important; line-height: 1.35 !important; word-break: normal !important; }
.eael-grid-post-excerpt p { font-size: 15px !important; line-height: 1.5 !important; }

@media (max-width: 767px) {
  .eael-entry-media { width: 100px !important; flex-basis: 100px !important; }
  .eael-entry-wrapper { padding: 14px 16px !important; }
  .eael-entry-title { font-size: 16px !important; }
}

/* ---------- Pagine interne (testo, moduli) ---------- */

.article-container > article:not(.post-58) {
  padding: clamp(24px, 4vw, 40px);
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: var(--raggio);
  box-shadow: var(--ombra);
}
.entry-content ul, .entry-content ol { margin: 0 0 1em; padding-left: 1.3em; list-style: revert; }
.entry-content li::marker { color: var(--foglia); }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--fondo);
  border: 1px solid var(--linea);
  border-radius: 10px;
}
.wpcf7 input[type="submit"] {
  padding: 12px 28px;
  background: var(--campo);
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: var(--foglia); }

/* ---------- Tablet ---------- */



@media (max-width: 1260px) {
  /* menu a scomparsa */
  .main-navigation > .inner-wrap { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 0 auto;
    padding: 9px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
  }
  .menu-toggle::before {
    content: "";
    width: 18px;
    height: 2px;
    background: #fff;
    box-shadow: 0 -6px 0 #fff, 0 6px 0 #fff;
  }
  .menu-toggle::after { content: "Menu"; }
  .menu-primary-container { display: none; flex: 1 1 100%; padding: 6px 0 4px; }
  .main-navigation.toggled .menu-primary-container,
  .main-navigation:focus-within .menu-primary-container { display: block; }
  .main-navigation ul.menu { flex-direction: column; }
  .main-navigation ul.menu > li > a { padding: 11px 12px; white-space: normal; }

  .elementor-col-50 { flex-basis: 100%; }
  .footer-widgets-area { grid-template-columns: minmax(0, 1fr); }
  .widget-altervista-image { max-width: 360px; }
}

/* ---------- Telefono ---------- */

@media (max-width: 767px) {
  body { font-size: 16.5px; }
  .inner-wrap { padding: 0 16px; }
  .wp-custom-header { padding: 14px 16px 0; }
  .elementor-row { gap: 18px; }
  .elementor-col-33 { flex-basis: 100%; }
  .elementor-widget-text-editor .elementor-widget-container { padding: 20px; }
  .eael-entry-media { flex-basis: 100px; }
  .eael-entry-wrapper { padding: 14px 16px; }
  .eael-entry-title { font-size: 16px; }
  .tg-footer-other-widgets { grid-template-columns: minmax(0, 1fr); }
  #scroll-up { right: 14px; bottom: 14px; }
}

/* ---------- Stampa ---------- */

@media print {
  .main-navigation, #scroll-up { display: none !important; }
  .elementor-widget-text-editor .elementor-widget-container { box-shadow: none; }
}