/* ===== NEWS UX ENHANCEMENTS 2025 ===== */
/* Better visual design and UX improvements */

/* Sticky tabs on desktop - always visible while scrolling */
@media (min-width: 769px) {
  .news-tabs {
    position: sticky;
    top: 0;
    z-index: 999;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.98) 0%, rgba(10, 10, 10, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem 0 1rem 0;
    margin: 0 0 3rem 0 !important;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  }

  .news-tabs.scrolled {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7),
                0 0 0 1px rgba(212, 175, 55, 0.2);
  }
}

/* Mobile select dropdown - NASCOSTO su desktop */
.news-mobile-select {
  display: none;
}

/* Mobile - SELECT DROPDOWN invece di tabs */
@media (max-width: 768px) {
  .news-tabs {
    display: none !important; /* Nascondi i tab su mobile */
  }

  /* Mostra il select dropdown su mobile */
  .news-mobile-select {
    display: block;
    position: sticky;
    top: 0;
    z-index: 999;
    width: 100%;
    padding: 0.875rem 1rem;
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f4eed4;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.1));
    border: 2px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4af37' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
  }

  .news-mobile-select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
  }

  .news-mobile-select option {
    background: #1a1a1a;
    color: #f4eed4;
    padding: 0.75rem;
  }
}

/* ===== ENHANCED TAB STYLING ===== */
.news-tab {
  position: relative;
  overflow: hidden;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  padding: 1rem 1.75rem !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.news-tab:hover {
  background: rgba(212, 175, 55, 0.1) !important;
  border-color: rgba(212, 175, 55, 0.3) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.news-tab.is-active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.15)) !important;
  border-color: rgba(212, 175, 55, 0.5) !important;
  color: #f4eed4 !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
}

.news-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.news-tab:hover::before {
  left: 100%;
}

/* Count badge enhancement */
.news-count {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.15)) !important;
  border: 1px solid rgba(212, 175, 55, 0.3) !important;
  color: #d4af37 !important;
  font-weight: 700;
}

/* ===== ENHANCED NEWS CARDS ===== */
.news-card {
  transition: all 0.3s ease !important;
  border-radius: 12px !important;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(212, 175, 55, 0.02)) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Ensure filtered cards are hidden */
.news-card[style*="display: none"] {
  display: none !important;
}

.news-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 12px 32px rgba(212, 175, 55, 0.15),
              0 0 0 1px rgba(212, 175, 55, 0.2) !important;
  border-color: rgba(212, 175, 55, 0.3) !important;
}

.news-card__media {
  position: relative;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.news-card__media img {
  transition: transform 0.5s ease !important;
}

.news-card:hover .news-card__media img {
  transform: scale(1.05);
}

.news-card__title {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  margin-bottom: 0.75rem !important;
}

.news-card__title a {
  color: #f4eed4 !important;
  transition: color 0.3s ease !important;
}

.news-card:hover .news-card__title a {
  color: #d4af37 !important;
}

.news-card__excerpt {
  color: rgba(255, 255, 255, 0.75) !important;
  line-height: 1.6 !important;
  margin-bottom: 1rem !important;
}

.news-card__tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.news-card__tags .tag {
  background: rgba(212, 175, 55, 0.1) !important;
  border: 1px solid rgba(212, 175, 55, 0.3) !important;
  color: #d4af37 !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: 20px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  cursor: pointer;
}

.news-card__tags .tag:hover {
  background: rgba(212, 175, 55, 0.2) !important;
  border-color: rgba(212, 175, 55, 0.5) !important;
  transform: translateY(-2px);
}

.news-card__cta .link-more {
  color: #d4af37 !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  transition: all 0.3s ease !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.news-card__cta .link-more:hover {
  color: #f0d478 !important;
  transform: translateX(4px);
}

.news-card__cta .link-more::after {
  content: '→';
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.news-card__cta .link-more:hover::after {
  transform: translateX(4px);
}

/* Enhanced grid animations */
@media (prefers-reduced-motion: no-preference) {
  .news-card {
    will-change: transform, opacity;
    animation: fadeSlideUp 0.5s ease-out forwards;
  }

  .news-card:nth-child(1) { animation-delay: 0.05s; }
  .news-card:nth-child(2) { animation-delay: 0.1s; }
  .news-card:nth-child(3) { animation-delay: 0.15s; }
  .news-card:nth-child(4) { animation-delay: 0.2s; }
  .news-card:nth-child(5) { animation-delay: 0.25s; }
  .news-card:nth-child(6) { animation-delay: 0.3s; }
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Better empty state */
.news-empty {
  padding: 4rem 2rem !important;
  text-align: center;
  font-size: 1.1rem !important;
  font-style: italic;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(212, 175, 55, 0.03));
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 12px;
  margin: 2rem 0;
}

/* ===== ENHANCED HERO ===== */
.news-hero {
  margin-bottom: 3rem !important;
  position: relative;
  overflow: hidden;
}

.news-hero__media {
  transition: transform 0.5s ease;
}

.news-hero:hover .news-hero__media {
  transform: scale(1.02);
}

.news-hero__title {
  font-size: 3rem !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #f4eed4, #d4af37);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2 !important;
  margin-bottom: 1rem !important;
}

.news-hero__claim {
  font-size: 1.25rem !important;
  color: rgba(255, 255, 255, 0.85) !important;
  line-height: 1.5 !important;
  font-weight: 500 !important;
}

/* ===== ENHANCED NEWSLETTER CARD ===== */
.newsletter-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(212, 175, 55, 0.05)) !important;
  border: 2px solid rgba(212, 175, 55, 0.25) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  border-radius: 16px !important;
  padding: 2rem !important;
}

.newsletter-card:hover {
  border-color: rgba(212, 175, 55, 0.45) !important;
  box-shadow: 0 12px 32px rgba(212, 175, 55, 0.2);
  transform: translateY(-4px);
}

.newsletter-card__title {
  color: #d4af37 !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  margin-bottom: 1rem !important;
}

.newsletter-card__text {
  color: rgba(255, 255, 255, 0.8) !important;
  line-height: 1.6 !important;
  margin-bottom: 1.5rem !important;
}

.newsletter-card__form .input {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 2px solid rgba(255, 255, 255, 0.1) !important;
  color: #f4eed4 !important;
  padding: 0.875rem 1.25rem !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  font-size: 1rem !important;
}

.newsletter-card__form .input:focus {
  border-color: rgba(212, 175, 55, 0.5) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.newsletter-card__form .btn {
  background: linear-gradient(135deg, #d4af37, #cba135) !important;
  border: 2px solid #d4af37 !important;
  color: #0a0a0a !important;
  font-weight: 700 !important;
  padding: 0.875rem 2rem !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  font-size: 1.05rem !important;
  cursor: pointer;
}

.newsletter-card__form .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
  background: linear-gradient(135deg, #f0d478, #d4af37) !important;
}

.newsletter-preferences {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.85) !important;
  cursor: pointer;
  transition: color 0.3s ease;
}

.checkbox-label:hover {
  color: #d4af37 !important;
}

/* Pager enhancements */
.pager {
  margin-top: 3rem !important;
  padding-top: 2rem;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.pager__link {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  padding: 0.625rem 1rem !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
}

.pager__link:hover:not(.is-disabled) {
  background: rgba(212, 175, 55, 0.15) !important;
  border-color: rgba(212, 175, 55, 0.5) !important;
  color: #d4af37 !important;
  transform: translateY(-2px);
}

.pager__link.is-active {
  background: linear-gradient(135deg, #d4af37, #f0d478) !important;
  border-color: #d4af37 !important;
  color: #0a0a0a !important;
  font-weight: 700 !important;
}

.pager__link.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Accessibility */
.news-tab:focus-visible,
.news-mobile-select:focus-visible,
.pager__link:focus-visible {
  outline: 3px solid #d4af37 !important;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .news-tabs,
  .news-tab,
  .news-mobile-select,
  .news-card,
  .newsletter-card,
  .pager__link {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }

  .news-tab::before {
    display: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .news-tabs {
    border-bottom-width: 3px !important;
  }

  .news-tab.is-active {
    border-width: 2px !important;
  }

  .news-mobile-select {
    border-width: 3px !important;
  }
}
