/* =======================================================================
   FILIERA AMICA — Foglio di stile principale
   -----------------------------------------------------------------------
   Sito vetrina del Gruppo Operativo PEI-AGRI "FILIERA AMICA".
   Tecnologie: HTML5 + CSS3 + JavaScript + Bootstrap 5 (via CDN).

   Questo file contiene SOLO le personalizzazioni grafiche del tema.
   Tutto il layout responsive di base è gestito da Bootstrap 5.

   PALETTE (ispirata a sostenibilità e agricoltura):
     verde   -> natura, foraggi, sostenibilità
     blu     -> ricerca, dati, intelligenza artificiale
     giallo  -> accento (dal segno di spunta del logo)
     bianco  -> spazio, pulizia, stile istituzionale
   ======================================================================= */

:root {
  /* ---- Colori del progetto (modificabili qui in un colpo solo) ---- */
  --fa-green:        #2e7d32;
  --fa-green-dark:   #1b5e20;
  --fa-green-soft:   #eaf4ea;
  --fa-blue:         #16487a;
  --fa-blue-dark:    #0e3157;
  --fa-yellow:       #f4c430;
  --fa-ink:          #1d2b22;   /* testo principale */
  --fa-muted:        #5d6b62;   /* testo secondario */
  --fa-bg-soft:      #f6faf6;   /* fondo sezioni alternate */
  --fa-border:       #e4ece4;

  /* ---- Override delle variabili Bootstrap ---- */
  --bs-primary:       var(--fa-green);
  --bs-primary-rgb:   46, 125, 50;
  --bs-link-color:    var(--fa-green-dark);
  --bs-link-hover-color: var(--fa-blue);
  --bs-body-color:    var(--fa-ink);
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ----------------------------- Base ----------------------------- */
html { scroll-behavior: smooth; }

/* Evita lo scorrimento/spostamento orizzontale su mobile: nessun elemento
   deve poter far "scrollare" la pagina lateralmente. */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  color: var(--fa-ink);
  font-family: var(--bs-body-font-family);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display-5, .display-6 {
  font-weight: 700;
  letter-spacing: -.01em;
}

.text-green      { color: var(--fa-green) !important; }
.text-blue       { color: var(--fa-blue)  !important; }
.bg-soft         { background: var(--fa-bg-soft); }
.bg-green-soft   { background: var(--fa-green-soft); }

a { text-decoration: none; }

/* Etichetta/“tag” sopra i titoli di sezione */
.section-kicker {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fa-green);
  background: var(--fa-green-soft);
  padding: .35rem .85rem;
  border-radius: 50rem;
  margin-bottom: .9rem;
}

.section-pad { padding-top: 5rem; padding-bottom: 5rem; }
@media (max-width: 768px) { .section-pad { padding-top: 3rem; padding-bottom: 3rem; } }

/* ----------------------------- Bottoni ----------------------------- */
.btn-primary {
  --bs-btn-bg: var(--fa-green);
  --bs-btn-border-color: var(--fa-green);
  --bs-btn-hover-bg: var(--fa-green-dark);
  --bs-btn-hover-border-color: var(--fa-green-dark);
  --bs-btn-active-bg: var(--fa-green-dark);
  --bs-btn-active-border-color: var(--fa-green-dark);
  --bs-btn-padding-x: 1.4rem;
  --bs-btn-padding-y: .7rem;
  font-weight: 600;
  border-radius: 50rem;
  box-shadow: 0 6px 18px rgba(46,125,50,.22);
}
.btn-outline-primary {
  --bs-btn-color: var(--fa-green-dark);
  --bs-btn-border-color: var(--fa-green);
  --bs-btn-hover-bg: var(--fa-green);
  --bs-btn-hover-border-color: var(--fa-green);
  --bs-btn-active-bg: var(--fa-green-dark);
  font-weight: 600;
  border-radius: 50rem;
  --bs-btn-padding-x: 1.4rem;
  --bs-btn-padding-y: .7rem;
}
.btn-blue {
  background: var(--fa-blue);
  border-color: var(--fa-blue);
  color: #fff;
  font-weight: 600;
  border-radius: 50rem;
}
.btn-blue:hover { background: var(--fa-blue-dark); color: #fff; }

/* ----------------------------- Header / Navbar ----------------------------- */
.navbar.fa-navbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--fa-border);
  transition: box-shadow .25s ease;
  padding-top: .35rem;
  padding-bottom: .35rem;
}
.navbar.fa-navbar.scrolled { box-shadow: 0 6px 22px rgba(20,40,25,.08); }

.navbar.fa-navbar .navbar-brand img { height: 62px; width: auto; transition: height .25s ease; }
/* Logo leggermente ridotto quando si scorre, per non ingombrare */
.navbar.fa-navbar.scrolled .navbar-brand img { height: 52px; }
.navbar.fa-navbar .brand-text {
  font-weight: 800;
  line-height: 1.05;
  font-size: 1.15rem;
  color: var(--fa-green-dark);
  letter-spacing: .02em;
}
.navbar.fa-navbar .brand-text small {
  display: block;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fa-muted);
}
.navbar.fa-navbar .nav-link {
  font-weight: 600;
  color: var(--fa-ink);
  padding-inline: .9rem;
}
.navbar.fa-navbar .nav-link:hover,
.navbar.fa-navbar .nav-link.active { color: var(--fa-green); }
.navbar.fa-navbar .nav-link.active {
  border-bottom: 2px solid var(--fa-green);
}

/* ----------------------------- Hero ----------------------------- */
.hero {
  position: relative;
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(22,72,122,.10), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--fa-green-soft) 100%);
  overflow: hidden;
}
.hero::after { /* sottile striscia decorativa “campo coltivato” */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 6px;
  background: linear-gradient(90deg, var(--fa-green), var(--fa-blue), var(--fa-yellow));
}
.hero .hero-logo {
  width: 230px;
  max-width: 56vw;
  height: auto;
  padding: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 18px 44px rgba(20,60,30,.22);
  filter: drop-shadow(0 6px 14px rgba(20,60,30,.10));
}
@media (max-width: 576px) { .hero .hero-logo { width: 170px; } }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
.hero .lead { color: var(--fa-muted); max-width: 720px; }

/* ---------- Hero delle pagine interne (foto di sfondo + velatura) ---------- */
.page-hero {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.40), rgba(0,0,0,.58));
}
.page-hero > .container { position: relative; z-index: 1; }
.page-hero h1,
.page-hero .lead { color: #fff !important; }
/* Link "Torna alle news": blu su sfondo chiaro, bianco quando c'è la foto */
.news-back { color: var(--fa-blue); font-weight: 600; }
.page-hero .news-back { color: #fff; }
.page-hero .news-back:hover { color: #fff; opacity: .85; }
.hero-progetto  { background-image: url(../assets/img/hero-progetto.webp); }
.hero-news      { background-image: url(../assets/img/hero-news.webp); }
.hero-partner   { background-image: url(../assets/img/hero-partner.webp); }
.hero-contatti  { background-image: url(../assets/img/hero-contatti.webp); }
.hero-documenti { background-image: url(../assets/img/DocumentiSfondo.webp); }

/* ----------------------------- Card generiche ----------------------------- */
.fa-card {
  background: #fff;
  border: 1px solid var(--fa-border);
  border-radius: 18px;
  padding: 1.75rem;
  height: 100%;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.fa-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(20,50,30,.10);
  border-color: var(--fa-green);
}
.fa-card .fa-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 1.6rem;
  background: var(--fa-green-soft);
  color: var(--fa-green-dark);
  margin-bottom: 1rem;
}
.fa-card.is-blue   .fa-icon { background: #e8f0f8; color: var(--fa-blue); }
.fa-card.is-yellow .fa-icon { background: #fdf3d6; color: #9a7b10; }

/* ----------------------------- Partner ----------------------------- */
.partner-card { text-align: center; }
.partner-card .logo-box {
  height: 110px;
  display: grid; place-items: center;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: var(--fa-bg-soft);
  overflow: hidden;
}
.partner-card .logo-box img { max-height: 84px; max-width: 80%; object-fit: contain; }
/* Per i partner senza logo: icona elegante al posto del logo */
.partner-card .logo-box .logo-mono {
  width: 64px; height: 64px; border-radius: 16px;
  display: grid; place-items: center; font-size: 1.9rem;
  background: #fff; border: 1px solid var(--fa-border);
  color: var(--fa-green-dark); box-shadow: 0 6px 16px rgba(20,50,30,.08);
}
.partner-card .badge-role {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Striscia loghi (partner / finanziatori in home e footer) */
.logo-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.5rem 2.5rem; }
.logo-strip .logo-slot {
  height: 130px; min-width: 200px;
  display: grid; place-items: center;
  padding: 1rem 1.5rem;
  background: #fff;
  border: 1px solid var(--fa-border);
  border-radius: 12px;
  color: var(--fa-muted);
  font-weight: 700;
  font-size: .9rem;
  text-align: center;
  opacity: 1;
  transition: opacity .25s ease, transform .25s ease;
}
.logo-strip .logo-slot:hover { transform: translateY(-3px); }
.logo-strip .logo-slot img { max-height: 104px; max-width: 100%; object-fit: contain; }
/* Logo con link: il <a> riempie lo slot, così l'immagine (anche SVG) resta
   visibile e tutta l'area è cliccabile. */
.logo-strip .logo-slot a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Striscia FINANZIATORI: loghi istituzionali sempre a colori e più grandi */
.logo-strip--funders .logo-slot { filter: none; opacity: 1; height: 96px; min-width: 150px; }
.logo-strip--funders .logo-slot img { max-height: 74px; }

/* ----------------------------- Numeri / statistiche ----------------------------- */
.stat .num {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--fa-green-dark);
  line-height: 1;
}
.stat .lbl { color: var(--fa-muted); font-weight: 600; }

/* ----------------------------- Timeline attività ----------------------------- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px;
  width: 2px; background: var(--fa-border);
}
.timeline .t-item { position: relative; padding-bottom: 1.75rem; }
.timeline .t-item::before {
  content: ""; position: absolute; left: -2rem; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--fa-green);
}

/* ----------------------------- News ----------------------------- */
.news-card { overflow: hidden; padding: 0; }
.news-card .news-thumb {
  aspect-ratio: 16 / 9;
  background: var(--fa-green-soft);
  object-fit: cover;
  width: 100%;
}
.news-card .news-body { padding: 1.5rem; }
.news-card .news-date {
  font-size: .8rem; font-weight: 700; color: var(--fa-blue);
  text-transform: uppercase; letter-spacing: .05em;
}

/* ----------------------------- Documenti ----------------------------- */
.doc-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--fa-border);
  border-radius: 14px;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.doc-row:hover { border-color: var(--fa-green); box-shadow: 0 10px 24px rgba(20,50,30,.08); }
.doc-row .doc-ico {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 10px;
  display: grid; place-items: center; background: #fdecec; color: #c0392b; font-weight: 800;
}

/* ----------------------------- Fascia CTA ----------------------------- */
.cta-band {
  background: linear-gradient(120deg, var(--fa-green-dark), var(--fa-green));
  color: #fff;
}
.cta-band .btn-light { font-weight: 700; border-radius: 50rem; }

/* ----------------------------- Footer ----------------------------- */
.site-footer { background: #0f1c14; color: #cfe0d3; }
.site-footer a { color: #cfe0d3; }
.site-footer a:hover { color: #fff; }
.site-footer h5 { color: #fff; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; }
.site-footer .foot-logo { height: 64px; }
.site-footer .foot-badge {
  display: inline-block; font-size: .72rem; line-height: 1.2; font-weight: 600;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px; padding: .45rem .7rem; color: #e7f1e9;
}
.site-footer .foot-bottom { border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; color: #9fb4a5; }

/* ----------------------------- Animazioni leggere allo scroll ----------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: .1s; }
.reveal.delay-2 { transition-delay: .2s; }
.reveal.delay-3 { transition-delay: .3s; }
/* Rispetta le preferenze di accessibilità (riduzione del movimento) */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ----------------------------- Utility ----------------------------- */
.lead-narrow { max-width: 760px; }
.rounded-2xl { border-radius: 20px; }
.shadow-soft { box-shadow: 0 14px 40px rgba(20,50,30,.10); }


/* ---------- SLIDER HERO (carousel Bootstrap: robusto e responsive) ----------
   Usa il carousel di Bootstrap (già caricato) con immagini object-fit:cover.
   'isolation:isolate' rende affidabile la sovrapposizione foto/velatura/testo. */
.hero { min-height: 62vh; isolation: isolate; }
.hero-slider { position: absolute; inset: 0; z-index: 0; }
.hero-slider,
.hero-slider .carousel-inner,
.hero-slider .carousel-item { height: 100%; }
.hero-slider .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;         /* riempie e adatta su qualsiasi schermo */
  object-position: center;
}
/* Velatura per la leggibilità del testo bianco sopra le foto */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.52));
  pointer-events: none;
}
.hero > .container { position: relative; z-index: 2; }
.sfondoCaseificio{
  background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.62)), url(../assets/img/Caseificio.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  width: 100%;
  height: 100%;
}
.sfondoAziendaAgricola{
  background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.62)), url(../assets/img/AziendaAgricola.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  width: 100%;
  height: 100%;
}
.sfondoDatiEAI{
  background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.62)), url(../assets/img/DatiEAI.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  width: 100%;
  height: 100%;
}
.sfondoImprontaCarbonica{
  background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.62)), url(../assets/img/ImprontaCarbonica.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  width: 100%;
  height: 100%;
}

.card-Progetto:hover{
  background-color: #f4f7f0;
}

.hero-overlay{
  background: rgba(0,0,0,0.5);
}
.sfondoDoc{
  background-image: url(../assets/img/DocumentiSfondo.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  width: 100%;
  height: 100%;
}
#testo{
  color: #016caa;
}

/* ----------------------------- Cookie banner ----------------------------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1080;
  background: #fff;
  border-top: 1px solid var(--fa-border);
  box-shadow: 0 -8px 28px rgba(20,50,30,.12);
  padding: 1rem 0;
}
.cookie-banner[hidden] { display: none; }
.cookie-inner {
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  justify-content: space-between;
}
.cookie-text {
  font-size: .9rem;
  color: var(--fa-muted);
  max-width: 780px;
}
.cookie-actions { flex-shrink: 0; }
@media (max-width: 576px) {
  .cookie-inner { flex-direction: column; align-items: flex-start; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { width: 100%; }
}