/* ============================================================
   FEDERCARDIO CAMPANIA - Foglio di stile condiviso
   Design istituzionale - Versione 2.0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Outfit:wght@300;400;500;600&display=swap');

/* -- VARIABILI -- */
:root {
  --red:         #B01828;
  --red-dark:    #7A0F1A;
  --red-light:   #D42030;
  --red-subtle:  rgba(176, 24, 40, 0.06);
  --ink:         #111418;
  --ink-soft:    #3A3F47;
  --ink-muted:   #717880;
  --rule:        #DDE0E4;
  --surface:     #F5F4F1;
  --white:       #FFFFFF;
  --nav-h:       72px;
  --font-serif:  'Cormorant Garamond', Georgia, serif;
  --font-sans:   'Outfit', system-ui, sans-serif;
  --max-w:       1160px;
  --radius:      6px;
  --shadow-sm:   0 2px 8px rgba(0,0,0,.06);
  --shadow-md:   0 8px 32px rgba(0,0,0,.10);
  --shadow-lg:   0 20px 64px rgba(0,0,0,.12);
  --transition:  0.22s cubic-bezier(.4,0,.2,1);
}

/* -- RESET & BASE -- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-sans); }

/* Protezione globale: Classic Editor/TinyMCE a volte inserisce paragrafi
   <p></p> come "filler" nel markup durante il salvataggio del contenuto
   (comportamento noto come wpautop), a volte completamente vuoti, a volte
   contenenti solo un commento HTML residuo (es. <p><!--form--></p>), che il
   selettore :empty NON rileva perche il commento e tecnicamente un nodo
   figlio. Senza questa regola, un <p> di questo tipo che si infiltra come
   figlio diretto di un contenitore a grid/flex occupa una colonna o riga,
   spostando il resto del layout (successo piu volte durante lo sviluppo).
   Soluzione: nei nostri layout grid/flex non esiste mai un <p> legittimo
   come figlio diretto - i paragrafi di testo reali sono sempre annidati
   dentro altri elementi (card, colonne). Quindi nascondiamo SEMPRE qualsiasi
   <p> figlio diretto di questi contenitori specifici, indipendentemente dal
   suo contenuto. */
.contact-body > p,
.news__grid > p,
.objectives__grid > p,
.mission__inner > p,
.hero__content > p,
.hero__stats > p {
  display: none !important;
}
/* Protezione aggiuntiva generica per qualsiasi altro paragrafo davvero vuoto
   non coperto dai selettori specifici sopra. */
p:empty { display: none !important; }
ul { list-style: none; }

/* -- TIPOGRAFIA GLOBALE -- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
p { color: var(--ink-soft); }

/* -- LAYOUT UTILITIES -- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
}
.section { padding: 96px 0; }
.section--sm { padding: 64px 0; }

/* -- LABEL -- */
.label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 16px;
}

/* -- TITOLI -- */
.heading-xl {
  font-size: clamp(40px, 5.5vw, 72px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.5px;
}
.heading-lg {
  font-size: clamp(28px, 3.5vw, 48px);
  letter-spacing: -0.3px;
}
.heading-md {
  font-size: clamp(22px, 2.5vw, 32px);
}

/* -- BOTTONI -- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 13px 28px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn--primary {
  background: var(--red);
  color: var(--white);
}
.btn--primary:hover { background: var(--red-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(176,24,40,.3); }
.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--rule);
}
.btn--outline:hover { border-color: var(--ink); background: var(--surface); }
.btn--ghost {
  background: transparent;
  color: var(--red);
  padding-left: 0; padding-right: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: none;
  gap: 6px;
}
.btn--ghost:hover { gap: 12px; }
.btn--ghost svg { transition: transform var(--transition); }
.btn--ghost:hover svg { transform: translateX(4px); }

/* -- NAVIGATION -- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.nav.scrolled {
  border-color: var(--rule);
  box-shadow: var(--shadow-sm);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
}

/* Logo */
.nav__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav__logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}
.nav__logo-text { line-height: 1.2; }
.nav__logo-text strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.nav__logo-text span {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Desktop links */
.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav__links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
  position: relative;
  padding-bottom: 3px;
  transition: color var(--transition);
}
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 0; height: 2px;
  background: var(--red);
  transition: width var(--transition);
}
.nav__links a:hover,
.nav__links a.active { color: var(--red); }
.nav__links a:hover::after,
.nav__links a.active::after { width: 100%; }

/* Burger button */
.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 8px;
  transition: border-color var(--transition);
}
.nav__burger:hover { border-color: var(--ink-soft); }
.nav__burger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
  transform-origin: center;
}
.nav__burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.nav__drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  padding: 16px 0 24px;
  z-index: 199;
  box-shadow: var(--shadow-md);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s, opacity .3s;
}
.nav__drawer.open {
  pointer-events: all;
  transform: translateY(0);
  opacity: 1;
}
.nav__drawer a {
  display: block;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.nav__drawer a:hover,
.nav__drawer a.active {
  color: var(--red);
  border-left-color: var(--red);
  background: var(--red-subtle);
}

/* -- DIVIDER -- */
.divider {
  height: 1px;
  background: var(--rule);
}

/* -- FOOTER -- */
footer {
  margin-top: auto;
  background: var(--ink);
  color: rgba(255,255,255,.5);
}
.footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 64px;
  padding: 64px 0 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer__brand .nav__logo-text strong { color: rgba(255,255,255,.9); }
.footer__brand .nav__logo-text span { color: rgba(255,255,255,.3); }
.footer__brand p {
  font-size: 13px;
  line-height: 1.75;
  margin-top: 18px;
  color: rgba(255,255,255,.4);
}
.footer__social {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.55);
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.footer__social a:hover {
  border-color: var(--red);
  color: white;
  background: var(--red);
}
.footer__social svg,
.footer__social svg * {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  display: block;
  flex-shrink: 0;
}
.footer__col h4 {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 20px;
}
.footer__col ul { display: flex; flex-direction: column; gap: 10px; }
.footer__col ul li a {
  font-size: 13px;
  color: rgba(255,255,255,.4);
  transition: color var(--transition);
}
.footer__col ul li a:hover { color: rgba(255,255,255,.85); }
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  font-size: 12px;
  color: rgba(255,255,255,.28);
  flex-wrap: wrap;
  gap: 12px;
}
.footer__legal { display: flex; gap: 20px; }
.footer__legal a {
  color: rgba(255,255,255,.4);
  font-size: 12px;
  transition: color var(--transition);
}
.footer__legal a:hover { color: rgba(255,255,255,.85); }

/* -- ANIMAZIONI ENTRATA -- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.reveal-delay-4 { transition-delay: .4s; }
.reveal-delay-5 { transition-delay: .5s; }

/* -- RESPONSIVE -- */
@media (max-width: 1024px) {
  .container { padding: 0 28px; }
  .nav__inner { padding: 0 28px; }
  .footer__top { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 768px) {
  :root { --nav-h: 64px; }
  .container { padding: 0 20px; }
  .nav__inner { padding: 0 20px; }
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .nav__drawer { display: block; }
  .section { padding: 64px 0; }
  .section--sm { padding: 48px 0; }
  .footer__top { grid-template-columns: 1fr; gap: 32px; }
  .footer__bottom { flex-direction: column; gap: 12px; text-align: center; }
  .footer__legal { justify-content: center; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
}