/**
 * FONDAZIONE ARMANDO - COMPONENTS CSS
 * 
 * Stili per componenti specifici
 * Card, buttons, forms, etc.
 */

/* ========================================
   BUTTONS - STILI UNIFICATI
   ======================================== */

/* Transizione uniforme per tutti i bottoni - evita effetto a scatto */
a.btn, button.btn, .btn, .btn-primary, .btn-secondary,
.barra-donazioni .btn, .barra-donazioni-btn, .barra-newsletter-btn,
.progetti-cta .btn, .progetti-cta-button, .fondazione-view-all-btn,
.custom-cta-button, .archive-btn, .btn-contribuisci, .progetto-btn-contribuisci,
.transparency-cta .btn {
  transition: background 0.4s ease, background-color 0.4s ease,
              transform 0.4s ease, box-shadow 0.4s ease,
              opacity 0.4s ease, border-color 0.4s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--primary-green);
  color: var(--primary-white);
  text-decoration: none !important;
  border: 2px solid var(--primary-green);
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.4s ease, background-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease, opacity 0.4s ease, border-color 0.4s ease;
  min-height: 44px;
  min-width: 44px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

/* Button font size overrides */
.hero-actions .btn {
  font-size: var(--hero-btn-font-size, 16px) !important;
}

.progetti-card .btn,
.progetto-card .btn {
  font-size: var(--progetti-btn-font-size, 14px) !important;
}

/* Bottoni progetti */
.progetto-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.progetto-buttons .btn,
.progetto-buttons .read-more {
  margin: 0;
  white-space: nowrap;
}

/* Bottone Contribuisci giallo */
.progetto-card .btn-contribuisci,
.btn-contribuisci,
.read-more-contribuisci,
.progetto-btn-contribuisci {
  background-color: #FFC107 !important;
  border-color: #FFC107 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
}

.progetto-card .btn-contribuisci:hover,
.btn-contribuisci:hover,
.read-more-contribuisci:hover,
.progetto-btn-contribuisci:hover {
  background-color: #ffb300 !important;
  border-color: #ffb300 !important;
  color: #ffffff !important;
}

/* Link Contribuisci nel template semplice con sfondo giallo */
.progetto-card-simple .read-more-contribuisci,
.progetto-card-simple .progetto-link .read-more-contribuisci,
.progetto-card-simple .progetto-btn-contribuisci,
.progetto-btn-contribuisci {
  background-color: #FFC107 !important;
  color: #ffffff !important;
  transition: background 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease, opacity 0.4s ease;
  font-weight: 600 !important;
  border-radius: 8px !important;
}

.progetto-card-simple .read-more-contribuisci:hover,
.progetto-card-simple .progetto-link .read-more-contribuisci:hover,
.progetto-card-simple .progetto-btn-contribuisci:hover,
.progetto-btn-contribuisci:hover {
  background-color: #ffb300 !important;
  color: #ffffff !important;
  opacity: 0.9;
}

/* Assicura che i bottoni siano ai lati opposti */
.progetto-card .card-footer > .d-flex.justify-content-between {
  width: 100% !important;
  display: flex !important;
  justify-content: space-between !important;
}

.progetto-card .card-footer .btn {
  flex-shrink: 0;
}

.progetto-card-simple .progetto-buttons.justify-content-between {
  width: 100% !important;
  display: flex !important;
  justify-content: space-between !important;
}

/* Per progetto-card-simple */
.progetto-card-simple .progetto-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.progetto-card-simple .progetto-buttons .read-more {
  margin: 0;
}

.progetto-card-simple .read-more-contribuisci {
  color: #FFC107 !important;
}

.progetto-card-simple .read-more-contribuisci:hover {
  color: #ffb300 !important;
}

.barra-donazioni-btn {
  font-size: var(--barra-donazioni-btn-font-size, 16px) !important;
}

.barra-newsletter-btn {
  font-size: var(--barra-newsletter-btn-font-size, 16px) !important;
}

.custom-cta-button {
  font-size: var(--custom-media-btn-font-size, 16px) !important;
}

.fondazione-view-all-btn {
  font-size: var(--fondazione-news-btn-font-size, 16px) !important;
}

.btn:hover:not(.btn-primary):not(.button-gradient-enabled):not([style*="gradient"]):not([style*="linear-gradient"]) {
  background: var(--secondary-olive);
  color: var(--primary-white);
  border-color: var(--secondary-olive);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Escludi i pulsanti con gradiente dall'hover globale */
.btn[style*="gradient"],
.btn[style*="linear-gradient"],
.btn.button-gradient-enabled,
.btn-primary[style*="gradient"],
.btn-primary[style*="linear-gradient"] {
  /* Mantieni il gradiente anche durante l'hover */
}

/* Transizione smooth per tutti i pulsanti con gradiente - lineare e lenta come barra-donazioni */
.btn[style*="gradient"],
.btn[style*="linear-gradient"],
.btn.button-gradient-enabled,
.btn-primary.button-gradient-enabled,
.btn-primary[style*="gradient"],
.btn-primary[style*="linear-gradient"],
.fondazione-view-all-btn.button-gradient-enabled {
  /* background-color di fallback evita il flash bianco durante la transizione */
  background-color: #0078e8 !important;
  transition: background 0.6s linear, background-color 0.6s linear, transform 0.4s ease, box-shadow 0.4s ease !important;
}

/* Effetto hover uniforme per tutti i pulsanti con gradiente - gradiente → blu, transizione lineare e lenta */
.btn[style*="gradient"]:hover,
.btn[style*="linear-gradient"]:hover,
.btn.button-gradient-enabled:hover,
.btn-primary.button-gradient-enabled:hover,
.btn-primary[style*="gradient"]:hover,
.btn-primary[style*="linear-gradient"]:hover,
.btn[style*="26BF94"]:hover,
.btn[style*="024873"]:hover,
.btn[style*="0078e8"]:hover,
.btn.button-gradient-enabled[style*="26BF94"]:hover,
.btn.button-gradient-enabled[style*="024873"]:hover,
.btn.button-gradient-enabled[style*="0078e8"]:hover,
.fondazione-view-all-btn.button-gradient-enabled:hover,
.fondazione-view-all-btn.button-gradient-enabled:focus,
.progetti-sidebar .archive-btn:hover {
  /* Usa gradient solido per transizione fluida (evita flash bianco gradiente→solido) */
  background: linear-gradient(to right, #0078e8, #0078e8) !important;
  background-color: #0078e8 !important;
  border-color: transparent !important;
  opacity: 1 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn:focus {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--hero-btn-primary-color, var(--primary-blue)); /* Cambiato da primary-green a primary-blue (verde marino) */
  border-color: var(--hero-btn-primary-color, var(--primary-blue));
  padding: var(--spacing-sm) var(--spacing-lg);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--hero-btn-primary-color, var(--primary-blue)) !important; /* Cambiato da primary-green a primary-blue */
  border-color: transparent !important;
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Previeni il flash bianco sui pulsanti hero con gradiente - all'hover diventano completamente blu */
.btn-primary.button-gradient-enabled:hover,
.btn-primary[style*="gradient"]:hover,
.btn-primary[style*="linear-gradient"]:hover,
.btn-primary[style*="26BF94"]:hover,
.btn-primary[style*="024873"]:hover,
.btn-primary[style*="0078e8"]:hover {
  background: linear-gradient(to right, #0078e8, #0078e8) !important;
  background-color: #0078e8 !important;
  opacity: 1 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-secondary {
  background: var(--hero-btn-secondary-color, #9EA665);
  color: var(--primary-white);
  border-color: var(--hero-btn-secondary-color, #9EA665);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0.85;
}

.btn-secondary:hover {
  background: var(--hero-btn-secondary-color, #9EA665);
  color: var(--primary-white);
  border-color: var(--hero-btn-secondary-color, #9EA665);
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-large {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: 1.1rem;
}

.btn-small {
  padding: calc(var(--spacing-xs) + 2px) var(--spacing-md);
  font-size: 0.9rem;
}

/* ========================================
   HERO ACTIONS (BOTTONI HERO SECTION)
   ======================================== */
.hero-actions {
  display: flex;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.hero-actions .btn {
  flex: 0 1 auto;
  white-space: nowrap;
  min-width: 160px;
  text-align: center;
  padding: calc(var(--spacing-sm) + 2px) calc(var(--spacing-lg) + 10px);
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--primary-white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Card hover effects */
.card-image {
  position: relative;
  overflow: hidden;
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover .card-overlay {
  opacity: 1;
}

.card-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-celeste);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.card-read-more:hover {
  color: var(--accent-verde);
}

.card-read-more .arrow {
  transition: transform 0.3s ease;
}

.card-read-more:hover .arrow {
  transform: translateX(5px);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-content {
  padding: var(--spacing-md);
}

.card-title {
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 1.25rem;
}

.card-title a {
  color: var(--text-dark);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent-celeste);
}

.card-meta {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  font-size: 0.9rem;
  color: var(--text-light);
}

.card-excerpt {
  color: var(--text-gray);
  line-height: 1.6;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-celeste);
  box-shadow: 0 0 0 2px rgba(135, 206, 235, 0.2);
}

.form-control.error {
  border-color: var(--error-color);
}

.form-help {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: var(--spacing-xs);
}

.form-error {
  color: var(--error-color);
  font-size: 0.9rem;
  margin-top: var(--spacing-xs);
}

/* ========================================
   GRID LAYOUTS
   ======================================== */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ========================================
   HERO SECTION
   ======================================== */
/* Hero section styles moved to main.css to avoid conflicts */
/* Keeping only component-specific styles here */

.hero-title {
  font-size: 3.5rem;
  font-weight: 800; /* Aumentato da 300 a 800 per font più bold come stillirise.org */
  margin-bottom: var(--spacing-md);
  /* Nessun text-transform: l'utente decide come scrivere il testo */
  letter-spacing: 0.05em; /* Letter-spacing più ampio */
  line-height: 1.1; /* Line-height più stretto */
  /* Color is handled by main.css with customizer variables */
}

.hero-subtitle {
  font-size: 1.3rem;
  /* Color is handled by main.css with customizer variables */
  max-width: 700px;
  margin: 0 auto var(--spacing-lg) auto;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   SECTIONS
   ======================================== */
.section {
  padding: 3rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  color: #000000;
  text-transform: lowercase;
}
.section-title::first-letter {
  text-transform: uppercase;
}

/* Escludi i titoli nella hero/testata */
.hero-section .section-title,
.about-hero .section-title,
.page-hero-section .section-title,
.hero-content .section-title {
  color: inherit; /* Mantieni il colore originale nella hero */
}

.section-subtitle {
  text-align: center;
  color: var(--text-gray);
  max-width: 600px;
  margin: 0 auto var(--spacing-xl) auto;
}

/* ========================================
   POSTS GRID
   ======================================== */
.posts-grid {
  display: grid;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.post-card {
  background: var(--primary-white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.post-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-content {
  padding: var(--spacing-md);
}

.post-title {
  margin: 0 0 var(--spacing-sm) 0;
}

.post-title a {
  color: var(--text-dark);
  text-decoration: none;
}

.post-title a:hover {
  color: var(--accent-celeste);
}

.post-meta {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  font-size: 0.9rem;
  color: var(--text-light);
}

.post-excerpt {
  color: var(--text-gray);
  line-height: 1.6;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  margin: var(--spacing-xl) 0;
}

.pagination .page-numbers {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--primary-white);
  color: var(--text-dark);
  text-decoration: none;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  transition: var(--transition);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--accent-celeste);
  color: var(--primary-white);
  border-color: var(--accent-celeste);
}

.pagination .prev,
.pagination .next {
  font-weight: 600;
}

/* ========================================
   CUSTOM MEDIA BLOCK SECTION
   ======================================== */
.custom-media-section {
    background: var(--color-light);
}

.custom-media-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.custom-media-visual {
    position: relative;
    margin: 0;
    padding: 0;
}

.custom-video-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: 320px;
    margin: 0;
    padding: 0;
    line-height: 0;
    font-size: 0;
}

.custom-image-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.custom-video-iframe {
    width: 100%;
    height: 320px;
    border: none;
    display: block;
    line-height: 0;
    font-size: 0;
    transform: scale(1.03);
    transform-origin: center;
}

.custom-video-internal {
    width: 100%;
    height: 100%;
    min-height: 320px;
    border: none;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    background: #000;
}

/* Custom Video Wrapper with Play Button */
.custom-video-wrapper {
    position: relative;
    cursor: pointer;
}

.custom-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border-radius: 12px;
}

.custom-video-wrapper.playing .custom-video-overlay {
    opacity: 0;
    pointer-events: none;
}

.custom-video-play-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    color: #024873;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(255, 255, 255, 0.4);
    position: relative;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: pulse-ring 8s infinite ease-in-out;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(255, 255, 255, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25), 0 0 0 4px rgba(255, 255, 255, 0);
        transform: scale(1.005);
    }
    100% {
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(255, 255, 255, 0);
        transform: scale(1);
    }
}

.custom-video-play-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.95));
    transform: scale(1.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(255, 255, 255, 0.7);
    animation: none;
}

.custom-video-play-btn .play-icon,
.custom-video-play-btn .pause-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.custom-video-play-btn .play-icon {
    margin-left: 3px;
}

.custom-video-play-btn .play-icon svg,
.custom-video-play-btn .pause-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.custom-video-wrapper.playing .custom-video-play-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.7));
    color: white;
    animation: none !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.custom-video-wrapper.playing .custom-video-play-btn:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.8));
    transform: scale(1.1);
}

.custom-video-wrapper.playing .custom-video-internal {
    cursor: default;
}

.custom-media-image {
    width: 100%;
    height: auto;
    display: block;
}

.custom-media-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: var(--color-gray-100);
    border-radius: 12px;
    color: var(--color-gray-600);
    text-align: center;
}

.custom-media-placeholder .placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.custom-media-text {
    padding-right: 20px;
}

/* Tipografia gestita da home-sections.css (.section-eyebrow / .section-title / .section-lead) */

.custom-media-cta {
    margin-top: 32px;
}

/* ========================================
   CUSTOM CTA BUTTON (UNIFICATO CON .btn)
   ======================================== */
.custom-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: var(--color-primary, var(--primary-green));
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  /* ← font-size rimosso: morto, vince sempre la regola !important a r.158 (Customizer) */
  font-family: var(--font-heading);
  transition: all 0.3s ease;
  min-height: 44px;
  min-width: 44px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.custom-cta-button:hover,
.custom-cta-button:focus {
  color: white;
  opacity: 0.85;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  outline: none;
}

.custom-cta-button:focus {
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 136, 191, 111), 0.3);
}

/* ========================================
   FONDAZIONE VIEW ALL BUTTON (UNIFICATO)
   ======================================== */
.fondazione-view-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--primary-green);
  color: var(--primary-white);
  text-decoration: none;
  border: 2px solid var(--primary-green);
  border-radius: 8px;
  font-family: var(--font-heading);
  /* ← font-size rimosso: morto, vince sempre la regola !important a r.162 (Customizer) */
  font-weight: 600;
  transition: background 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  min-height: 44px;
  min-width: 44px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.fondazione-view-all-btn:hover {
  background: var(--secondary-olive);
  color: var(--primary-white);
  border-color: var(--secondary-olive);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ========================================
   MISSION CTA BUTTON (UNIFICATO)
   ======================================== */
.mission-cta-button {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--primary-white);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  font-family: var(--font-heading);
  /* ← transition rimossa: morta, vince var(--transition) del blocco omonimo a r.~1475 */
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: 8px;
  background: var(--secondary-blue, #0078E8);
  border: 1px solid var(--secondary-blue, #0078E8);
}

.mission-cta-button:hover {
  color: var(--primary-white);
  background: var(--secondary-blue, #0078E8);
  border-color: var(--secondary-blue, #0078E8);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0.9;
}

.mission-cta-button svg {
  transition: var(--transition);
  width: 14px;
  height: 14px;
}

.mission-cta-button:hover svg {
  transform: translateX(2px);
}

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
  background-color: var(--primary-green);
  color: var(--primary-white);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-outline {
  background-color: transparent;
  color: var(--primary-green);
  border: 1px solid var(--primary-green);
}

.badge-outline-sm {
  padding: 0.125rem 0.375rem;
  font-size: 0.7rem;
}

.badge-ricerca { background-color: #007bff; }
.badge-educativo { background-color: #28a745; }
.badge-sociale { background-color: #dc3545; }
.badge-culturale { background-color: #ffc107; color: #212529; }

.badge-foto { background-color: #17a2b8; }
.badge-video { background-color: #6f42c1; }
.badge-misto { background-color: #fd7e14; }

/* ========================================
   SCREEN READER ONLY
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive - Mobile First */
@media (max-width: 768px) {
    .custom-media-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .custom-media-text {
        padding-right: 0;
        order: 2;
    }
    
    .custom-media-visual {
        order: 1;
    }
    
    .custom-media-cta {
        margin-top: 24px;
    }
    
    .custom-cta-button {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .custom-video-iframe {
        height: 200px;
        transform: scale(1.03);
        transform-origin: center;
    }
    
    .custom-video-internal {
        min-height: 200px;
        height: 100%;
        object-fit: cover;
    }
    
    .custom-video-play-btn {
        width: 50px;
        height: 50px;
    }
    
    .custom-video-play-btn .play-icon,
    .custom-video-play-btn .pause-icon {
        width: 20px;
        height: 20px;
    }
    
    .custom-video-play-btn .play-icon {
        margin-left: 2px;
    }
    
    @keyframes pulse-ring {
        0% {
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(255, 255, 255, 0.15);
            transform: scale(1);
        }
        50% {
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(255, 255, 255, 0);
            transform: scale(1.003);
        }
        100% {
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(255, 255, 255, 0);
            transform: scale(1);
        }
    }
    
    .custom-media-image {
        max-height: 300px;
        object-fit: cover;
    }
}

@media (max-width: 480px) {
    .custom-video-container {
        height: 200px;
    }
    
    .custom-cta-button {
        padding: 12px 16px;
        font-size: 15px;
    }
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  background: #f8f9fa;
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
}

.widget {
  margin-bottom: var(--spacing-xl);
}

.widget:last-child {
  margin-bottom: 0;
}

.widget-title {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--accent-celeste);
  color: #000000;
}

.widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget li {
  padding: var(--spacing-xs) 0;
  border-bottom: 1px solid var(--border-light);
}

.widget li:last-child {
  border-bottom: none;
}

.widget a {
    color: #000;
    text-decoration: none;
}

/* Override per bottone archivio nella sidebar progetti */
.progetti-sidebar .widget .archive-btn,
.progetti-sidebar .widget-header .archive-btn {
    color: #ffffff !important;
}

.widget a:hover {
  color: var(--accent-celeste);
}

/* CSS Animations Fallback */
.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
}

.animate-fade-in-up.delay-1 {
  animation-delay: 0.2s;
}

.animate-fade-in-up.delay-2 {
  animation-delay: 0.4s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation speed control */
:root {
  --animation-speed: 1;
}

.animations-paused * {
  animation-play-state: paused !important;
  transition: none !important;
}



/* Apply speed to animations */
.animations-enabled * {
  animation-duration: calc(var(--animation-duration, 0.3s) * var(--animation-speed)) !important;
  transition-duration: calc(var(--transition-duration, 0.3s) * var(--animation-speed)) !important;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   COMMENTS STYLES
   ======================================== */

.comments-area {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid #e0e0e0;
}

.comments-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #333;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment-list .comment {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 8px;
}

.comment-form {
  margin-top: 2rem;
}

.comment-form p {
  margin-bottom: 1rem;
}

.comment-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}

.comment-form .required {
  color: #e74c3c;
}

/* ========================================
   TAGS AND CATEGORIES STYLES
   ======================================== */

.post-tags,
.post-categories {
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid #e0e0e0;
}

.post-tags h4,
.post-categories h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tags-list,
.categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-link,
.category-link {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(38, 191, 148, 0.1); /* Sfondo leggero con verde acqua del logo */
  color: var(--primary-blue); /* Testo con blu marino del logo */
  text-decoration: none;
  border-radius: 20px;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.tag-link:hover,
.category-link:hover {
  background: var(--primary-blue); /* Usa il blu marino del logo */
  color: white;
  transform: translateY(-1px);
}

/* ========================================
   VIDEO BACKGROUND CONTROLS
   ======================================== */
/* Video background styles are now in main.css */

/* Video loading states are now in main.css */
/* Video mobile optimization is now in main.css */
/* Reduced motion support is now in main.css */

.hero-section {
  background-image: var(--hero-poster-image, linear-gradient(135deg, var(--primary-white) 0%, #f8f9fa 100%));
  background-size: cover;
  background-position: center;
}

/* ==========================================================================
   WordPress Required CSS Classes
   ========================================================================== */

/* Image alignment classes */
.alignleft {
  float: left;
  margin: 0 var(--spacing-md) var(--spacing-md) 0;
}

.alignright {
  float: right;
  margin: 0 0 var(--spacing-md) var(--spacing-md);
}

.aligncenter {
  display: block;
  margin: 0 auto var(--spacing-md);
  text-align: center;
}

/* WordPress caption classes */
.wp-caption {
  max-width: 100%;
  margin-bottom: var(--spacing-md);
  background: var(--background-light);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: var(--spacing-xs);
}

.wp-caption img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.wp-caption-text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
  margin: var(--spacing-xs) 0 0;
  padding: 0 var(--spacing-xs);
}

/* Gallery caption */
.gallery-caption {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--spacing-xs);
}

/* Sticky post indicator */
.sticky {
  position: relative;
}

.sticky::before {
  content: "📌";
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: var(--primary-green);
  color: white;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  z-index: 10;
}

/* Post author highlight */
.bypostauthor {
  background: rgba(var(--primary-green-rgb), 0.05);
  border-left: 3px solid var(--primary-green);
  padding-left: var(--spacing-sm);
}

/* ========================================
   MISSION CARDS SECTION
   ======================================== */
.mission-cards-section {
  padding: var(--spacing-xxl) 0;
  background: rgba(0, 255, 136, 0.05); /* Sfondo leggerissimo con verde brillante del logo */
}

.mission-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.mission-header .section-eyebrow,
.mission-header .custom-media-subtitle {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.mission-header .section-title,
.mission-header .custom-media-title {
  text-align: center;
  font-size: clamp(24px, 4vw, 32px);
  color: var(--color-primary);
  margin-bottom: 24px;
  line-height: 1.2;
}



.mission-description {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.mission-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.mission-card {
  background: rgba(38, 191, 148, 0.1); /* Sfondo leggero con verde acqua del logo */
  border-radius: 12px;
  padding: var(--spacing-xl) var(--spacing-lg);
  text-align: left;
  transition: var(--transition);
  border: none;
  position: relative;
  border-left: 4px solid var(--primary-blue); /* Bordo con blu marino del logo */
}

.mission-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.mission-card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}

.mission-card-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

.mission-card-title {
  font-size: 17px;
  font-family: var(--font-heading);
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  line-height: 1.3;
  font-weight: 600;
}

.mission-card-description {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--spacing-lg);
}

.mission-card-cta {
  margin-top: auto;
}

.mission-cta-button {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--primary-white);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: var(--transition);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: 8px;
  background: var(--secondary-blue, #0078E8);
  border: 1px solid var(--secondary-blue, #0078E8);
}

.mission-cta-button:hover {
  color: var(--primary-white);
  background: var(--secondary-blue, #0078E8);
  border-color: var(--secondary-blue, #0078E8);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0.9;
}

.mission-cta-button svg {
  transition: var(--transition);
  width: 14px;
  height: 14px;
}

.mission-cta-button:hover svg {
  transform: translateX(2px);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .mission-cards-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
}

@media (max-width: 768px) {
  .mission-card {
    padding: var(--spacing-lg);
  }
  
  .mission-header .custom-media-title {
    font-size: var(--font-size-xl);
  }
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary-blue); /* Will be overridden by customizer */
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus {
  background: var(--primary-green); /* Will be overridden by customizer */
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
  outline: none;
}

/* .back-to-top:focus - Focus styles will be handled by customizer */

.back-to-top svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
  
  .back-to-top svg {
    width: 20px;
    height: 20px;
  }
}

/* ========================================
   FONDAZIONE CARD TAGS - CLICKABLE
   ======================================== */
.fondazione-card-tag {
  background: rgba(0, 255, 136, 0.1); /* Sfondo leggero con verde brillante del logo */
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--primary-blue); /* Testo con blu marino del logo */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.fondazione-card-tag:hover,
.fondazione-card-tag:focus {
  background: var(--primary-blue); /* Usa il blu marino del logo */
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(2, 72, 115, 0.15); /* Sombra con colore del logo */
}

.fondazione-card-tag:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

/* ========================================
   SEZIONE FACCIAMOLO INSIEME - Custom Design Professionale
   Font: Montserrat (già caricato nel tema)
   ======================================== */

/* === SEZIONE FACCIAMOLO INSIEME === */
.facciamolo-insieme-section {
    background: #ffffff;
}

/* Classi .facciamolo-insieme-header/sopratitolo/title/description rimosse:
 * il refactor ora usa .section-header / .section-eyebrow / .section-title / .section-lead
 * (definite in assets/css/home-sections.css). */

/* === GRID CARDS === */
.facciamolo-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* === SINGOLA CARD === */
.facciamolo-card {
    background: white;
    border: none;
    border-radius: 16px;
    padding: 48px 36px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Linea gradient superiore – stesso gradiente dei bottoni (verde → blu) */
.facciamolo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(to right, #26BF94, #0078e8);
}

/* Numero grande in grigio chiaro nell'angolo superiore destro */
.facciamolo-card-number {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 80px;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.05);
    line-height: 1;
    transition: all 0.3s ease;
    z-index: 0;
}

.facciamolo-card:hover .facciamolo-card-number {
    color: rgba(0, 0, 0, 0.08);
    transform: scale(1.05);
}

.facciamolo-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* === ICONA === */
.facciamolo-card-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Colori icona per ogni card */
.facciamolo-card-icon-1 {
    background: #024873; /* Blu scuro per prima card */
}

.facciamolo-card-icon-2 {
    background: #26BF94; /* Verde per seconda card */
}

.facciamolo-card-icon-3 {
    background: linear-gradient(135deg, #024873, #26BF94); /* Gradient per terza card */
}

.facciamolo-card:hover .facciamolo-card-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(2, 72, 115, 0.3);
}

.facciamolo-card-icon svg {
    width: 32px;
    height: 32px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

/* === CONTENUTI CARD === */
.facciamolo-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #024873;
    margin-bottom: 16px;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.facciamolo-card-text {
    font-size: 15px;
    font-weight: 400;
    color: #666;
    line-height: 1.7;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
    flex-grow: 1;
}

/* === LINK / BOTTONE === */
.facciamolo-card-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-blue, #0078E8);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    padding-bottom: 4px;
    position: relative;
    z-index: 1;
    margin-top: auto;
    width: fit-content;
}

.facciamolo-card-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-blue, #0078E8);
    transition: width 0.3s ease;
}

.facciamolo-card-button:hover {
    gap: 12px;
    color: #26BF94;
}

.facciamolo-card-button:hover::after {
    width: 100%;
}

.facciamolo-card-button svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    fill: currentColor;
}

.facciamolo-card-button:hover svg {
    transform: translateX(4px);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .facciamolo-cards-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .facciamolo-cards-grid {
        gap: 20px;
        padding: 0 20px;
    }
    
    .facciamolo-card {
        padding: 36px 28px;
    }

    .facciamolo-card-title {
        font-size: 1.125rem;
        line-height: 1.3;
    }

    .facciamolo-card-number {
        font-size: 60px;
        top: 20px;
        right: 20px;
    }
}