/* ==========================================================================
   Video thumbnails component (Modern & Professional)
   Convenzioni: id_snake_case, classi kebab-case
   - Griglia: .video-grid
   - Card: .video-item
   - Thumb: .video-thumb (link con <img.youtube-thumbnail>)
   - Titolo sotto: .video-title
   ========================================================================== */

.video-grid {
  display: grid;
  /* Fix: limitiamo max width delle colonne per evitare che si allarghino troppo */
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px)) !important;
  gap: clamp(1.5rem, 3vw, 2rem);
  justify-content: center !important;
  justify-items: center;
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 2vw, 1.5rem);
}

/* Card generica con glassmorphism */
.video-item {
  width: 100%;
  max-width: 340px !important; /* Riduciamo da 380px a 340px */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}

/* Link immagine con effetti moderni */
.video-thumb {
  position: relative;
  display: block;
  overflow: hidden;

  /* Glassmorphism background - usa variables */
  background: var(--card-bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* Gold accent border */
  border: 2px solid rgba(212, 175, 55, 0.25);
  border-radius: 16px;

  /* Multi-layer shadows */
  box-shadow: var(--card-shadow);

  transition: all 0.4s var(--ease-smooth);
}

/* Video badge (Coming Soon / In Arrivo) */
.video-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font-ui, Montserrat, Arial, sans-serif);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.video-badge--upcoming {
  background: linear-gradient(135deg, #d4af37 0%, #c9a135 100%);
  color: #1a1a1a;
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.4);
  }
  50% {
    box-shadow: 0 2px 20px rgba(212, 175, 55, 0.7);
  }
}

/* Play button overlay */
.video-thumb::before {
  content: '▶';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow:
    0 2px 20px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(212, 175, 55, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.video-thumb:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: var(--card-shadow-hover);
}

.video-thumb:hover::before {
  opacity: 1;
}
  
/* Immagine con zoom hover */
.youtube-thumbnail {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease, filter 0.3s ease;
  filter: brightness(0.9);
}

.video-thumb:hover .youtube-thumbnail {
  transform: scale(1.08);
  filter: brightness(1);
}

/* Titolo SOTTO alla miniatura */
.video-title {
  margin: 0.75rem 0 0;
  padding: 0 0.3rem;
  font-family: var(--font-ui, Montserrat, Arial, sans-serif);
  font-weight: 600;
  font-size: clamp(0.92rem, 1.8vw, 1rem);
  line-height: 1.35;
  color: var(--accent-color, #cba135);
  text-align: left;

  /* Subtle glow */
  text-shadow: 0 2px 8px rgba(212, 175, 55, 0.1);

  /* 2 righe max, ellissi */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;

  transition: text-shadow 0.3s ease;
}

.video-item:hover .video-title {
  text-shadow: 0 2px 12px rgba(212, 175, 55, 0.2);
}

.video-title a {
  color: inherit;
  text-decoration: none;
}

.video-title a:hover {
  text-decoration: underline;
}
  
  /* Variante EMBED (riutilizzabile per /video) */
  .video-card {
    width: min(560px, 92vw);
    background: #181818;
    border: 2px solid var(--accent-color, #cba135);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 16px #0005;
    padding: 0;
  }
  .video-card .video-frame {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
  }
  .video-card .video-title {
    display: block;
    max-width: 90%;
    margin: 0.6rem auto 0.9rem;
    text-align: center;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--accent-color, #cba135);
    line-height: 1.18;
  }
  
  /* Responsive */
  @media (max-width: 768px) {
    .video-item { width: 100%; }
    .video-thumb { border-radius: 10px; }
  }
  