/* =========================================================
   COMITATI FUTURO NAZIONALE — Design System
   Flat · Minimale · Identitario · Tricolore
   ========================================================= */

/* ---------- CSS Variables ---------- */
:root {
  --hero-cyan:   #2568b2;
  --navy-deep:   #061536;
  --navy-primary:#0A1F4D;
  --navy-mid:    #1A3A7A;
  --verde:       #009246;
  --bianco:      #FFFFFF;
  --rosso:       #CE2B37;
  --gold:        #D4A017;
  --gold-light:  #E8C547;
  --bg:          #F4F6F9;
  --card:        #E8EEF7;
  --text-main:   #1A2332;
  --text-sec:    #6B7A90;
  --radius:      12px;
  --shadow:      0 4px 24px rgba(6,21,54,0.08);
  --shadow-hover:0 8px 32px rgba(6,21,54,0.14);
  --transition:  0.25s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--navy-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: clamp(18px, 2.2vw, 22px); }
p  { margin-bottom: 1rem; color: var(--text-main); }
.text-sec { color: var(--text-sec); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 28px; border-radius: var(--radius);
  font-weight: 700; font-size: 15px; cursor: pointer; border: none;
  transition: var(--transition); letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--navy-primary); color: var(--bianco);
  box-shadow: 0 4px 14px rgba(10,31,77,0.25);
}
.btn-primary:hover { background: var(--navy-mid); color: var(--bianco); transform: translateY(-2px); }
.btn-gold {
  background: var(--gold); color: var(--navy-deep);
  box-shadow: 0 4px 14px rgba(212,160,23,0.25);
}
.btn-gold:hover { background: var(--gold-light); color: var(--navy-deep); /*transform: translateY(-2px);*/ }
.btn-outline {
  background: transparent; color: var(--navy-primary);
  border: 2px solid var(--navy-primary);
}
.btn-outline:hover { background: var(--navy-primary); color: var(--bianco); }




/* 1. Mantiene esattamente le stesse dimensioni (altezza/larghezza) di .btn-outline */
.btn-outline.btn-italy {
  position: relative;
  border: 2px solid transparent; /* Occupa esattamente lo stesso spazio di 2px del bordo originale */
  background-clip: padding-box;  /* Impedisce allo sfondo di invadere lo spazio del bordo */
  z-index: 1;
}

/* 2. Bordo statico di base: Bianco al 30% di trasparenza */
.btn-italy::before {
  content: '';
  position: absolute;
  /* Posizionato esattamente sopra il bordo trasparente di 2px */
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: var(--radius);
  padding: 2px; /* Spessore del bordo */
  background: rgba(255, 255, 255, 0.3); /* Bianco 30% */
  
  /* Buca il centro per mostrare solo il bordo */
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

/* 3. La bandiera posizionata pronta all'ingresso immediato */
.btn-italy::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: var(--radius);
  padding: 2px;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;

  /* Colori riposizionati per una partenza immediata e un'ampia coda trasparente per l'uscita */
  background-image: linear-gradient(
    135deg,
    transparent 0% 10%,
    #009246 10% 25%,
    #ffffff 25% 40%,
    #ce2b37 40% 55%,
    transparent 55% 100%
  );
  background-size: 500% 500%;
  
  /* Partenza esatta dove inizia il verde: zero ritardo percettibile */
  background-position: 80% 80%;
  
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

/* 4. Animazione reattiva istantanea */
.btn-italy:hover::after {
  opacity: 0.85;
  /* ease-out rende l'avvio ancora più scattante */
  animation: italy-flag-pass 2s ease-out 1;
}

@keyframes italy-flag-pass {
  0% {
    /* Il verde è subito pronto all'angolo in basso a destra */
    background-position: 80% 80%;
	
  }
  60% {
    /* Il rosso scompare completamente oltre l'angolo in alto a sinistra */
    background-position: -20% 0%;
	opacity: 1;
  }
  100% {
	background-position: -20% 0%;
	/* L'opacità diminuisce gradualmente per un effetto di dissolvenza */
	opacity: 0;
  }
}



/* ---------- Header ---------- */
.site-header {
  background: var(--navy-deep);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 12px rgba(6,21,54,0.3);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 72px;
}
.brand {
  display: flex; align-items: center; gap: 14px;
}
.brand svg { width: 44px; height: 44px; flex-shrink: 0; }
.brand-text { color: var(--bianco); }
.brand-text .name { font-size: 18px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.1; }
.brand-text .tagline { font-size: 11px; font-weight: 500; color: var(--gold-light); letter-spacing: 0.08em; text-transform: uppercase; }

.main-nav { display: flex; gap: 6px; }
.main-nav a {
  color: rgba(255,255,255,0.85); font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; letter-spacing: 0.02em;
}
.main-nav a:hover, .main-nav a.active { color: var(--bianco); background: rgba(255,255,255,0.08); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.btn-cta-header {
  background: var(--gold); color: var(--navy-deep);
  padding: 8px 18px; border-radius: 8px; font-weight: 700; font-size: 13px;
}
.btn-cta-header:hover { background: var(--gold-light); color: var(--navy-deep); }

.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; }
.burger span { display: block; width: 26px; height: 2px; background: var(--bianco); border-radius: 2px; transition: var(--transition); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--hero-cyan) 0%, var(--navy-primary) 100%);
  color: var(--bianco); padding: 80px 24px; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.6;
}
.hero-inner { max-width: 800px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(32px, 5vw, 48px); margin-bottom: 16px; }
.hero p { font-size: clamp(16px, 2vw, 20px); color: rgba(255,255,255,0.85); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.tricolor-bar {
  display: flex; height: 4px; width: 100%;
}
.tricolor-bar span { flex: 1; }
.tricolor-bar .green { background: var(--verde); }
.tricolor-bar .white { background: var(--bianco); }
.tricolor-bar .red   { background: var(--rosso); }

/* ---------- Sections ---------- */
.section { padding: 64px 24px; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-title {
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.section-title .tricolor-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.section-title .td-green { background: var(--verde); }
.section-title .td-white { background: var(--bianco); border: 1px solid var(--text-sec); }
.section-title .td-red   { background: var(--rosso); }
.section-sub { color: var(--text-sec); font-size: 15px; margin-bottom: 32px; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.card {
  background: var(--bianco); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: var(--transition); display: flex; flex-direction: column;
  border: 1px solid var(--card);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--navy-mid); }
.card-img { height: 180px; background: var(--card); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.card-img svg { width: 64px; height: 64px; opacity: 0.25; }
.card-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--navy-primary); color: var(--bianco);
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.06em;
}
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-meta { font-size: 12px; color: var(--text-sec); margin-bottom: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.card-meta .dot { width: 4px; height: 4px; background: var(--text-sec); border-radius: 50%; align-self: center; }
.card h3 { font-size: 18px; margin-bottom: 10px; line-height: 1.3; }
.card p { font-size: 14px; color: var(--text-sec); line-height: 1.55; margin-bottom: 16px; flex: 1; }
.card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; }

/* ---------- Miniblog page ---------- */
.miniblog-header {
  background: var(--navy-primary); color: var(--bianco); padding: 48px 24px;
}
.miniblog-header-inner { max-width: 1200px; margin: 0 auto; }
.breadcrumb { font-size: 13px; color: rgba(255,255,255,0.7); margin-bottom: 12px; }
.breadcrumb a { color: var(--gold-light); }
.breadcrumb a:hover { color: var(--bianco); }
.miniblog-title { font-size: clamp(24px, 3.5vw, 36px); margin-bottom: 8px; }
.miniblog-stats { display: flex; gap: 20px; font-size: 14px; color: rgba(255,255,255,0.8); flex-wrap: wrap; }

.territory-filter {
  background: var(--bianco); padding: 20px 24px; border-bottom: 1px solid var(--card);
  position: sticky; top: 72px; z-index: 900; box-shadow: 0 2px 8px rgba(6,21,54,0.06);
}
.filter-inner { max-width: 1200px; margin: 0 auto; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filter-inner label { font-size: 13px; font-weight: 700; color: var(--text-main); text-transform: uppercase; letter-spacing: 0.06em; }
.filter-inner select {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--card);
  background: var(--bg); font-size: 14px; color: var(--text-main); cursor: pointer;
}

.article-body {
  max-width: 760px; margin: 0 auto; padding: 48px 24px;
  font-size: 17px; line-height: 1.75; color: var(--text-main);
}
.article-body h2 { margin: 32px 0 16px; font-size: 24px; color: var(--navy-primary); }
.article-body h3 { margin: 24px 0 12px; font-size: 20px; color: var(--navy-mid); }
.article-body ul, .article-body ol { margin: 0 0 20px 24px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  border-left: 4px solid var(--gold); padding: 12px 20px; margin: 24px 0;
  background: var(--card); border-radius: 0 8px 8px 0; font-style: italic; color: var(--text-sec);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start;
}
@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-main); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--card);
  background: var(--bianco); font-size: 15px; color: var(--text-main); transition: var(--transition);
  font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--navy-mid); box-shadow: 0 0 0 3px rgba(26,58,122,0.1);
}
.form-group textarea { min-height: 140px; resize: vertical; }

.contact-info h3 { margin-bottom: 16px; }
.contact-info p { margin-bottom: 12px; color: var(--text-sec); }
.contact-info .info-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.contact-info .info-row svg { width: 20px; height: 20px; color: var(--navy-mid); flex-shrink: 0; margin-top: 2px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep); color: rgba(255,255,255,0.7); padding: 48px 24px 24px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px;
}
@media (max-width: 900px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-top { grid-template-columns: 1fr; } }

.footer-brand .brand { margin-bottom: 16px; }
.footer-brand p { font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.6); }
.footer-col h4 { color: var(--bianco); font-size: 14px; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.08em; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: rgba(255,255,255,0.65); font-size: 14px; }
.footer-col a:hover { color: var(--gold-light); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: rgba(255,255,255,0.45);
}

/* ---------- Logo showcase ---------- */
.logo-showcase {
  background: var(--bianco); border-radius: var(--radius); padding: 40px 24px;
  box-shadow: var(--shadow); border: 1px solid var(--card);
}
.logo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 32px; margin-top: 24px;
}
.logo-item {
  text-align: center; padding: 24px; border-radius: var(--radius);
  background: var(--bg); transition: var(--transition);
  border: 2px solid transparent;
}
.logo-item:hover { border-color: var(--gold); transform: translateY(-4px); }
.logo-item svg { width: 80px; height: 80px; margin: 0 auto 16px; }
.logo-item h4 { font-size: 14px; color: var(--text-main); margin-bottom: 4px; }
.logo-item p { font-size: 12px; color: var(--text-sec); }

/* ---------- Utility ---------- */
.tricolor-stripe {
  display: flex; height: 3px; width: 40px; border-radius: 2px; overflow: hidden; margin-bottom: 12px;
}
.tricolor-stripe span { flex: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .main-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--navy-deep); flex-direction: column; padding: 16px 24px; gap: 4px; box-shadow: 0 8px 24px rgba(6,21,54,0.3); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-radius: 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .burger { display: flex; }
  .hero-actions { flex-direction: column; align-items: center; }
  .card-grid { grid-template-columns: 1fr; }
  .header-actions .btn-cta-header { display: none; }
}
