/*
 * @file: components.css
 * @description: Componenti UI riutilizzabili per il sito UCOI/UCOIM - standard uniformi
 * @author: Altoprofilo Studio
 * @last-updated: 2025-09-19
 * @version: V.1.6
 */

/* ==========================================================================
   ICONE (Lucide)
   ========================================================================== */
i[data-lucide] {
  display: inline-block;
  height: 2rem;
  width: 2rem;
  margin-bottom: 1rem;
  stroke: var(--secondary-color);
  stroke-width: 1.8;
  color: var(--secondary-color);
}

/* Variante per icone su sfondo scuro */
.bg-primary i[data-lucide],
.feature-icon i[data-lucide],
[class*="bg-primary"] i[data-lucide],
[class*="bg-secondary"] i[data-lucide],
.honor-member-icon i[data-lucide],
.step-number i[data-lucide],
.eligibility-header i[data-lucide],
.document-icon i[data-lucide],
.leadership-icon i[data-lucide],
.union-icon i[data-lucide],
.info-icon i[data-lucide] {
  stroke: white !important;
  color: white !important;
  fill: none !important;
  stroke-width: 2px !important;
}

/* Assicura bianco nei path SVG in contesti scuri */
.bg-primary i[data-lucide] path,
.feature-icon i[data-lucide] path,
[class*="bg-primary"] i[data-lucide] path,
[class*="bg-secondary"] i[data-lucide] path,
.honor-member-icon i[data-lucide] path,
.step-number i[data-lucide] path,
.eligibility-header i[data-lucide] path,
.document-icon i[data-lucide] path,
.leadership-icon i[data-lucide] path,
.union-icon i[data-lucide] path,
.info-icon i[data-lucide] path {
  stroke: white !important;
  color: white !important;
}

/* Fix icone specifiche */
.honor-member-icon svg.lucide.lucide-award,
.honor-member-icon svg.lucide.lucide-user-check,
.leadership-icon svg.lucide,
.union-icon svg.lucide,
.document-icon svg.lucide,
.info-icon svg.lucide {
  stroke: white !important;
  color: white !important;
  fill: none !important;
  stroke-width: 2px !important;
}

/* Override forte per SVG in contesti colorati */
.bg-primary svg,
.feature-icon svg,
.document-icon svg,
.leadership-icon svg,
.union-icon svg,
.info-icon svg,
.step-number svg,
.eligibility-header svg {
  stroke: white !important;
  color: white !important;
}

/* Icone documento su sfondo chiaro */
.document-icon-light i[data-lucide],
.document-icon-light svg.lucide {
  stroke: var(--primary-color) !important;
  color: var(--primary-color) !important;
  fill: none !important;
  stroke-width: 2px !important;
}

/* UCOI/UCOIM — icone più grandi nelle colonne */
#sezione-ucoi-ucoim .column .lucide,
#sezione-ucoi-ucoim .column [data-lucide] {
  width: clamp(32px, 2vw, 40px);
  height: clamp(32px, 2vw, 40px);
  stroke-width: 1.75;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

/* Card istituzionali: icona primaria */
.card-istituzionale .lucide,
.card-istituzionale [data-lucide] {
  margin-bottom: 1rem;
  stroke: var(--primary-color);
}

/* Centra icone nelle card e box UCOI/UCOIM */
.card-istituzionale > svg,
.card-istituzionale > i > svg,
.card-istituzionale [data-lucide] {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.ucoi-box i[data-lucide],
.ucoim-box i[data-lucide] {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 1.5rem !important;
}
.ucoi-box > i,
.ucoim-box > i,
.ucoi-box svg,
.ucoim-box svg {
  display: block !important;
  margin: 0 auto 1.5rem !important;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  padding: 4rem 2rem;
  text-align: center;
  background-color: var(--bg-light);
  margin-bottom: 0;
}
.hero h1 { margin-bottom: 1rem; color: var(--text-dark); }
.hero .lead {
  margin: 0 auto 1.2rem;
  max-width: 700px;
  font-size: 2rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Variante compatta */
.hero-small { padding: 3rem 1rem; }
.hero-small h1 { font-size: 2.8rem; }
.hero-small .lead { font-size: 1.2rem; }

/* Hero con immagine */
.hero-image {
  position: relative;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: white;
}
.hero-image .overlay {
  margin: 0 auto;
  max-width: 800px;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  min-height: 200px;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-image h1, 
.hero-image .lead {
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Uniformità altezza per pagine secondarie */
.hero-small { min-height: 300px; display: flex; align-items: center; position: relative; }
@media (max-width: 992px) { .hero-small { min-height: 350px; } }
@media (max-width: 768px)  {
  .hero-small { min-height: 300px; }
  .hero-image .overlay { padding: 1.5rem; margin: 0 1rem; }
}
@media (max-width: 480px) { .hero-small { min-height: 250px; } }

/* Hero alternative (senza immagine) */
.hero:not(.with-image):not(.hero-image),
.hero.hero-image.image-error,
.hero.hero-no-image {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white; position: relative; overflow: hidden;
}
.hero:not(.with-image):not(.hero-image) h1,
.hero:not(.with-image):not(.hero-image) .lead,
.hero.hero-image.image-error h1,
.hero.hero-image.image-error .lead,
.hero.hero-no-image h1,
.hero.hero-no-image .lead {
  color: white; text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.hero:not(.with-image):not(.hero-image)::before,
.hero.hero-image.image-error::before,
.hero.hero-no-image::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zm20.97 0l9.315 9.314-1.414 1.414L34.828 0h2.83zM22.344 0L13.03 9.314l1.414 1.414L25.172 0h-2.83zM32 0l12.142 12.142-1.414 1.414L30 .828 17.272 13.556l-1.414-1.414L28 0h4zM.284 0l28 28-1.414 1.414L0 2.544v-2.26zM0 5.373l25.456 25.455-1.414 1.415L0 8.2V5.374zm0 5.656l22.627 22.627-1.414 1.414L0 13.86v-2.83zm0 5.656l19.8 19.8-1.415 1.413L0 19.514v-2.83zm0 5.657l16.97 16.97-1.414 1.415L0 25.172v-2.83zM0 28l14.142 14.142-1.414 1.414L0 30.828V28zm0 5.657L11.314 44.97 9.9 46.386l-9.9-9.9v-2.828zm0 5.657L8.485 47.8 7.07 49.212 0 42.143v-2.83zm0 5.657l5.657 5.657-1.414 1.415L0 47.8v-2.83zm0 5.657l2.828 2.83-1.414 1.413L0 53.456v-2.83z' fill='%23ffffff' fill-opacity='0.15' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.3;
}
/* Pagine UCOIM: gradiente secondario */
.page-ucoim .hero:not(.with-image):not(.hero-image),
.page-ucoim .hero.hero-image.image-error,
.page-ucoim .hero.hero-no-image {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-hover) 100%);
}

/* ==========================================================================
   BOTTONI
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  transition: var(--transition-normal);
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
}
.btn-primary { color: #fff; background-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-hover); transform: var(--hover-lift-small); box-shadow: var(--shadow-sm); color: #fff; text-decoration: none; }
.btn-secondary { color: #fff; background-color: var(--secondary-color); }
.btn-secondary:hover { background-color: var(--secondary-hover); transform: var(--hover-lift-small); box-shadow: var(--shadow-sm); color: #fff; text-decoration: none; }
.btn-ghost { border: 2px solid var(--primary-color); color: var(--primary-color); background-color: transparent; }
.btn-ghost:hover { color: #fff; background-color: var(--primary-color); transform: var(--hover-lift-small); box-shadow: var(--shadow-sm); text-decoration: none; }
.white-outlined { border: 2px solid #fff; color: #fff; }
.white-outlined:hover { background-color: var(--primary-color)!important; border: 2px solid var(--primary-color)!important; text-decoration: none; }
/* fix selettore */
.hero-btn, .hero-btn:hover { border: 2px solid var(--primary-color); }

/* CTA centrati */
.cta-buttons {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center;
  margin: 2rem auto; max-width: 500px;
}

/* ==========================================================================
   CARD ISTITUZIONALI (altezza uniforme)
   ========================================================================== */
.istituzionali-grid { display: contents; } /* delega al grid/BS */
.column {
  padding: 2rem; text-align: center; background: #fff; box-shadow: var(--shadow-sm);
  border-radius: 8px; flex: 1 1 300px; transition: var(--transition-normal);
  display: flex; flex-direction: column; height: 100%; min-height: 350px; justify-content: space-between;
}
.column:hover { box-shadow: var(--shadow-md); }
.column h3 { margin-bottom: 1rem; flex-shrink: 0; }
.column p { flex-grow: 1; margin-bottom: 1.5rem; text-align: center; }
.column .btn { margin-top: auto; align-self: center; }

.card-istituzionale {
  display: flex; flex-direction: column; background: #fff; border-radius: 12px; padding: 2rem;
  box-shadow: var(--shadow-sm); transition: var(--transition-normal); text-align: center;
  border-top: 3px solid var(--primary-color); height: 100%; min-height: 280px;
}
.card-istituzionale:hover { box-shadow: var(--shadow-lg); transform: var(--hover-lift-medium); }
.card-istituzionale i[data-lucide] {
  width: 3rem !important; height: 3rem !important; margin: 0 auto 1.5rem;
  color: var(--primary-color) !important; stroke: var(--primary-color) !important; stroke-width: 1.5px !important;
  transition: var(--transition-normal);
}
.card-istituzionale:hover i[data-lucide] { transform: var(--hover-lift-small); }
.card-istituzionale h3 { color: var(--primary-color); font-size: 1.3rem; margin-bottom: 1rem; font-weight: 600; transition: var(--transition-normal); }
.card-istituzionale p { color: var(--text-muted); line-height: 1.6; margin-bottom: 0; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
.card-istituzionale .btn { margin-top: auto; align-self: center; min-width: 160px; }

/* ==========================================================================
   STATISTICHE (unificate)
   ========================================================================== */
/* Tipografia numeri/etichette */
.stat-number {
  font-size: 2.5rem; font-weight: 700; color: var(--primary-color);
  margin-bottom: 0.5rem; line-height: 1; font-family: var(--font-heading);
}
.stat-number .plus { font-size: 1.8rem; vertical-align: top; }
.stat-label { font-size: 1rem; color: var(--text-muted); margin-bottom: 0; line-height: 1.4; }

/* Griglia uniforme riutilizzabile */
.stats-grid { --stat-min-h: 260px; --stat-pad: 1.5rem; }
.stats-grid > [class*="col-"] { display: flex; }          /* equal height tra colonne */
.stats-grid .stat-item {
  flex: 1 1 auto; min-height: var(--stat-min-h); width: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: var(--stat-pad); background: #fff; border-radius: 8px;
  box-shadow: var(--shadow-sm); transition: var(--transition-normal); border-top: 3px solid var(--primary-color);
}
.stats-grid .stat-item:hover { box-shadow: var(--shadow-md); }

/* Solo Home: sfondo graduale nella sezione #numeri */
#home #numeri .row.stats-grid > .col-6:nth-child(1) .stat-item { background-color: #ffffff; }
#home #numeri .row.stats-grid > .col-6:nth-child(2) .stat-item { background-color: #f9f9f9; }
#home #numeri .row.stats-grid > .col-6:nth-child(3) .stat-item { background-color: #f3f3f3; }
#home #numeri .row.stats-grid > .col-6:nth-child(4) .stat-item { background-color: var(--bg-light); }

/* ==========================================================================
   FEATURE BOXES
   ========================================================================== */
.features-container {
  display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin: 2rem 0;
}
.feature-box {
  background-color: #fff; border-radius: 12px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; overflow: hidden; transition: var(--transition-normal);
  border-top: 2px solid var(--primary-color);
}
.feature-box:hover { box-shadow: var(--shadow-md); transform: var(--hover-lift-small); }
.feature-icon { align-items: center; background-color: var(--primary-color); display: flex; height: 80px; justify-content: center; width: 100%; }
.feature-icon i { color: #fff !important; stroke: #fff !important; height: 40px !important; width: 40px !important; margin-bottom: 0; }
.feature-content { padding: 1.5rem; flex: 1; }
.feature-content h3 { font-size: 1.25rem; margin-bottom: 0.75rem; color: var(--text-dark); }
.feature-content p { color: var(--text-muted); margin-bottom: 0; line-height: 1.6; }

/* ==========================================================================
   GRIGLIE/UTILITIES
   ========================================================================== */
.news-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem; margin: 2rem auto; max-width: 1200px; padding: 0 1rem;
}
.section { padding: 3rem 0; }
.section:first-child { padding-top: 2rem; }
.section:last-child { padding-bottom: 3rem; }
.section + .section { margin-top: 0; }
.section h2 { margin-bottom: 1.5rem; }
.section p { margin-bottom: 1rem; }
.section p:last-child { margin-bottom: 0; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ==========================================================================
   MISSION OBJECTIVE LIST
   ========================================================================== */
.mission-flex-container { margin: 1.5rem 0; }
.mission-flex-item {
  display: flex; margin-bottom: 0.75rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.mission-flex-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.mission-flex-verb { flex: 0 0 150px; font-weight: 600; color: var(--primary-color); display: flex; align-items: flex-start; }
.mission-flex-description { flex: 1; line-height: 1.6; }
.mission-flex-verb .check-icon { margin-right: 0.5rem; color: var(--secondary-color); width: 16px !important; height: 16px !important; stroke: var(--secondary-color) !important; }

/* ==========================================================================
   ARTICLE LIST
   ========================================================================== */
.article-list li { margin-bottom: 0.75rem; line-height: 1.6; }
.article-list li:last-child { margin-bottom: 0; }
.article-list li::after { content: " "; white-space: pre; }
.mission-flex-container .article-item .article-number::after { content: " "; white-space: pre; }
.article-number { font-weight: 600; color: var(--primary-color); }
.article-number::after { content: " "; white-space: pre; display: inline; }

/* ==========================================================================
   PAGINAZIONE
   ========================================================================== */
.pagination {
  text-align: center; margin: 3rem 0 2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem;
}
.pagination-btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 1.2rem; min-width: 40px;
  border-radius: 8px; font-weight: 600; border: 1px solid var(--primary-color); cursor: pointer;
  background-color: #fff; color: var(--primary-color); transition: var(--transition-fast); text-decoration: none;
}
.pagination-btn:hover { background-color: var(--primary-color); color: #fff; transform: var(--hover-lift-small); box-shadow: var(--shadow-sm); text-decoration: none; }
.pagination-btn.btn-secondary { background-color: var(--primary-color); color: #fff; }
.pagination-btn.btn-ghost { background-color: #fff; color: var(--primary-color); }
.pagination-btn:focus { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.pagination-ellipsis {
  display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 0.8rem;
  color: var(--text-muted); font-weight: bold; margin: 0 0.25rem;
}

/* ==========================================================================
   FILTRI
   ========================================================================== */
.filter-section { padding: 2.5rem 1rem; background-color: var(--bg-light); margin-bottom: 2rem; border-radius: 8px; }
#filter-form { display: flex; flex-direction: column; gap: 1rem; max-width: 1000px; margin: 0 auto; }
.filter-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: center; margin-bottom: 1rem; }
.filter-row-bottom { align-items: flex-end; }
#filter-form label { font-weight: 600; color: var(--primary-color); margin-bottom: 0.25rem; display: block; }
#filter-form select, #filter-form input[type="search"] {
  padding: 0.5rem; font-size: 1rem; border: 1px solid #ccc; border-radius: 6px; background-color: #fff; min-width: 180px; transition: var(--transition-fast);
}
#filter-form select:hover, #filter-form input[type="search"]:hover { border-color: var(--primary-color); }
#filter-form select:focus, #filter-form input[type="search"]:focus { outline: none; border-color: var(--primary-color); box-shadow: var(--focus-ring); }
.news-body .tag.active, .news-body .category-link.active { color: #fff; background-color: var(--primary-hover); }

/* ==========================================================================
   INDICATORI STATO
   ========================================================================== */
.loading-spinner { text-align: center; padding: 30px; width: 100%; }
.loading-spinner::after {
  content: ""; display: block; width: 40px; height: 40px; margin: 10px auto; border-radius: 50%;
  border: 4px solid #ccc; border-top-color: var(--primary-color); animation: spin 1s infinite linear;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.error-message {
  background-color: #ffebee; color: #b71c1c; padding: 15px; border-radius: 4px; margin-bottom: 20px;
  text-align: center; border-left: 3px solid #b71c1c;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.global-footer {
  padding: 2.5rem 1rem 1rem; font-size: 0.9rem; color: #fff; background-color: var(--primary-color); margin-top: 3rem;
}
.footer-main {
  display: flex; gap: 2rem; margin: 0 auto 1.5rem; max-width: 1200px; flex-wrap: wrap; justify-content: space-between;
}
.footer-column { flex: 1 1 280px; }
.footer-column h4 { font-size: 1rem; font-weight: 600; color: #fff; margin-bottom: 1rem; }
.footer-column p, .footer-links li { color: #e0e0e0; margin-bottom: 0.5rem; line-height: 1.5; }
.footer-column a { color: #fff; text-decoration: underline; transition: var(--transition-fast); }
.footer-column a:hover { color: rgba(255, 255, 255, 0.8); text-decoration-thickness: 2px; }
.footer-links { margin: 0; padding: 0; list-style: none; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 1rem; text-align: center; }
.footer-bottom p { font-size: 0.8rem; color: #bbb; margin: 0; }

/* ==========================================================================
   ALLEGATI
   ========================================================================== */
.attachments-section { margin-top: 2rem; padding: 1.5rem; background-color: var(--bg-light); border-radius: 8px; }
.attachments-section h4 { margin-bottom: 1rem; color: var(--primary-color); font-size: 1.1rem; }
.attachments-list { list-style: none; padding: 0; margin: 0; }
.attachment-item { margin-bottom: 0.75rem; }
.attachment-item:last-child { margin-bottom: 0; }
.attachment-link {
  display: flex; align-items: center; padding: 0.75rem; background-color: #fff; border-radius: 4px;
  text-decoration: none; color: var(--text-color); transition: var(--transition-fast); box-shadow: var(--shadow-xs);
}
.attachment-link:hover { background-color: #f0f4f8; box-shadow: var(--shadow-sm); transform: var(--hover-lift-small); text-decoration: none; }
.attachment-icon { margin-right: 0.75rem; color: var(--primary-color); flex-shrink: 0; }
.attachment-icon i { width: 1.5rem !important; height: 1.5rem !important; color: var(--primary-color) !important; stroke: var(--primary-color) !important; margin: 0; }
.attachment-title { flex-grow: 1; font-weight: 500; font-size: 0.9rem; }
.attachment-size { font-size: 0.85rem; color: var(--text-muted); margin-left: 0.5rem; flex-shrink: 0; }
.attachment-count { display: flex; align-items: center; justify-content: center; margin: 0.5rem 0; color: var(--text-muted); }
.attachment-count .attachment-icon { margin-right: 0.3rem; display: inline-flex; }
.attachment-count svg { width: 14px !important; height: 14px !important; stroke: var(--primary-color) !important; color: var(--primary-color) !important; }
.attachment-count span { font-size: 0.75rem; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .cta-buttons { flex-direction: column; gap: 0.75rem; max-width: 300px; }
  .column { min-height: 300px; }
  .card-istituzionale { padding: 1.5rem; min-height: 240px; }
  .card-istituzionale h3 { font-size: 1.2rem; margin-bottom: 0.75rem; }
  .card-istituzionale i[data-lucide] { width: 2.5rem !important; height: 2.5rem !important; margin-bottom: 1rem; }
  .card-istituzionale p { font-size: 0.9rem; line-height: 1.5; }
  .card-istituzionale .btn { margin-top: 1rem; min-width: 140px; padding: 0.65rem 1rem; font-size: 0.9rem; }

  .features-container { grid-template-columns: 1fr; }
  .feature-box { margin-bottom: 1.5rem; }
  .feature-content { padding: 1.25rem; }
  .feature-content h3 { font-size: 1.1rem; }
  .feature-content p { font-size: 0.9rem; }

  .filter-row, .filter-row-bottom { flex-direction: column; align-items: stretch; }
  .btn, .pagination-btn, .filter-action-btn, #filter-form select, #filter-form input[type="search"], #reset-filters {
    min-height: 44px; padding: 0.75rem 1rem;
  }
  .filter-row { gap: 1.5rem; }

  .pagination { gap: 0.75rem; margin: 2rem 0; }
  .pagination-btn { min-width: 44px; min-height: 44px; padding: 0.5rem; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
  .pagination-ellipsis { padding: 0.5rem; font-weight: bold; display: inline-block; min-width: 24px; text-align: center; }

  /* Statistiche: più compatte su mobile */
  .stats-grid { --stat-min-h: 220px; --stat-pad: 1.25rem; }
  .stat-item { padding: 1.5rem 1rem; }
  .stat-number { font-size: 2rem; }

  .footer-main { flex-direction: column; gap: 1.5rem; }
  .footer-column { flex: none; }

  .news-grid { grid-template-columns: 1fr; gap: 1.5rem; padding: 0; }

  .mission-flex-item { flex-direction: column; }
  .mission-flex-verb { flex: 0 0 auto; margin-bottom: 0.5rem; }

  .hero:not(.with-image):not(.hero-image),
  .hero.hero-image.image-error,
  .hero.hero-no-image {
    padding: 3rem 1.5rem;
  }
  .hero:not(.with-image):not(.hero-image) h1,
  .hero.hero-image.image-error h1,
  .hero.hero-no-image h1 { font-size: 1.8rem; }
  .hero:not(.with-image):not(.hero-image) .lead,
  .hero.hero-image.image-error .lead,
  .hero.hero-no-image .lead { font-size: 1rem; }
}
@media (max-width: 480px) {
  .card-istituzionale { padding: 1.25rem; min-height: 220px; }
  .card-istituzionale h3 { font-size: 1.1rem; }
  .card-istituzionale i[data-lucide] { width: 2rem !important; height: 2rem !important; }
  .card-istituzionale p { font-size: 0.85rem; }
  .card-istituzionale .btn { min-width: 120px; padding: 0.6rem 0.8rem; font-size: 0.85rem; }
  .feature-content { padding: 1rem; }
  .feature-content h3 { font-size: 1rem; }
  .feature-content p { font-size: 0.85rem; }
}

/* ==========================================================================
   ACCESSIBILITÀ
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .btn, .pagination-btn, .stat-item, .attachment-link, .card-istituzionale, .feature-box { transition: none; }
  .btn:hover, .pagination-btn:hover, .stat-item:hover, .attachment-link:hover, .card-istituzionale:hover, .feature-box:hover { transform: none; }
}
.btn:focus,
.pagination-btn:focus,
#filter-form select:focus,
#filter-form input:focus,
.card-istituzionale:focus-within,
.feature-box:focus-within {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}
@media (prefers-contrast: high) {
  .btn, .pagination-btn { border-width: 2px; }
  .stat-item, .card-istituzionale, .feature-box { border: 1px solid var(--text-color); }
  .card-istituzionale { border-top-width: 4px; }
}

/* ==========================================================================
   STAMPA
   ========================================================================== */
@media print {
  .hero { padding: 1rem 0; background: none !important; }
  .hero-image { background-image: none !important; }
  .hero-image .overlay { background: none !important; padding: 0; }
  .btn, .pagination, .filter-section { display: none; }
  .section { page-break-inside: avoid; }
  .card-istituzionale, .feature-box, .stat-item {
    page-break-inside: avoid; box-shadow: none; border: 1px solid #ccc;
  }
}

/* ==========================================================================
   CTA BUTTONS — layout uniforme UCOI/UCOIM
   ========================================================================== */

.cta-buttons {
  display: flex;
  flex-wrap: wrap;            /* di base consenti il wrap */
  justify-content: center;    /* centra i bottoni */
  align-items: stretch;
  gap: 1rem;                  /* spazio costante */
}

.cta-buttons a.btn {
  text-align: center;
  white-space: nowrap;        /* evita spezzature imbarazzanti */
  padding: 12px 24px;
  border-radius: var(--btn-radius, 12px);
  min-height: 48px;
}

/* Desktop: 3 bottoni sempre in linea */
@media (min-width: 992px) {
  .cta-buttons {
    flex-wrap: nowrap;        /* niente ritorno a capo */
  }
  .cta-buttons a.btn {
    min-width: 220px;         /* larghezze coerenti */
    flex: 0 0 auto;
  }
}

/* Tablet: 2 colonne; il terzo va sotto ma resta centrato */
@media (min-width: 576px) and (max-width: 991.98px) {
  .cta-buttons {
    display: grid;                                   /* passa a grid per centrare meglio */
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    justify-content: center;
    align-items: stretch;
  }
  .cta-buttons a.btn {
    width: 100%;
  }
}

/* Mobile: una CTA per riga, piena larghezza */
@media (max-width: 575.98px) {
  .cta-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }
  .cta-buttons a.btn {
    width: 100%;
  }
}

 mark{
  background: var(--accent-100, #e6f0ff);
  color: inherit;
  padding: 0 .15em;
  border-radius: .15rem;
}

/* Stacco coerente tra sezioni (come in Home) */
.section + .section { margin-top: 2rem; }

/* Separatore elegante e leggero */
.section-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.1), transparent);
  margin: 1.25rem 0 0 0; /* piccolo respiro prima della sezione successiva */
}

/* Dark mode friendly (se supportata dal progetto) */
@media (prefers-color-scheme: dark) {
  .section-separator {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  }
}
