/**
 * News Page - Modern Layout 2026
 * Premium Design with Engagement Funnel
 * NOTE: engagement-funnel.css is loaded separately by the controller
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --news-sidebar-width: 320px;
  --news-gap: 3rem;
  --news-card-gap: 2rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.news-hero {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0a0a0a;
  margin-bottom: 3rem;
}

.news-hero--with-image .news-hero__media {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.news-hero--with-image .news-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: blur(4px) brightness(0.6);
}

.news-hero__text {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

/* Titolo unificato - eredita da .page-title in base.css */
.news-hero__title {
  margin: 0 0 1.5rem 0;
  text-shadow: 0 2px 30px rgba(212, 175, 55, 0.3);
  animation: heroFadeIn 0.8s ease-out;
}

.news-hero__claim {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 300;
  line-height: 1.6;
  margin: 0;
  animation: heroFadeIn 1s ease-out 0.2s backwards;
}

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

/* ============================================
   MAIN GRID LAYOUT
   ============================================ */
.news-content-wrapper {
  display: grid;
  grid-template-columns: var(--news-sidebar-width) 1fr;
  gap: var(--news-gap);
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  align-items: start;
}

/* ============================================
   SIDEBAR
   ============================================ */
.news-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Premium scrollbar */
.news-sidebar::-webkit-scrollbar {
  width: 4px;
}

.news-sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 2px;
}

.news-sidebar::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.news-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5);
}

.sidebar-inner > * + * {
  margin-top: 2rem;
}

/* ============================================
   SIDEBAR WIDGETS (use engagement-funnel styles)
   ============================================ */
.sidebar-widget {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.sidebar-widget:hover {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.sidebar-widget-title,
.widget-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #d4af37;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.sidebar-widget-title svg,
.widget-title svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* ============================================
   SEARCH WIDGET
   ============================================ */
.search-widget {
  margin-bottom: 2rem;
}

.search-form {
  position: relative;
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9375rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #d4af37;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(212, 175, 55, 0.6);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0.25rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #d4af37;
}

/* ============================================
   CATEGORY FILTERS
   ============================================ */
.category-filters-widget {
  /* Uses .sidebar-widget base styles */
}

.category-filters-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.category-filter-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.category-filter-item:hover {
  background: rgba(212, 175, 55, 0.1);
  transform: translateX(4px);
}

.category-filter-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #d4af37;
  cursor: pointer;
}

.category-label {
  flex: 1;
  font-size: 0.9375rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-count {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  min-width: 32px;
  text-align: center;
}

.category-filter-item:hover .category-count {
  background: rgba(212, 175, 55, 0.2);
  color: #d4af37;
}

/* ============================================
   DATE FILTERS
   ============================================ */
.date-filters-widget {
  /* Uses .sidebar-widget base styles */
}

.date-filters-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.date-filter-group label {
  display: block;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.date-filter-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.date-filter-select:focus {
  outline: none;
  border-color: #d4af37;
  background: rgba(0, 0, 0, 0.4);
}

.date-filter-select option {
  background: #1a1a1a;
  color: #fff;
  padding: 0.5rem;
}

/* ============================================
   ACTIVE FILTERS (CHIPS)
   ============================================ */
.active-filters-section {
  margin-bottom: 1.5rem;
}

.active-filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  color: #d4af37;
  font-size: 0.875rem;
  font-weight: 500;
  animation: chipFadeIn 0.3s ease;
}

@keyframes chipFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.filter-chip-remove {
  background: none;
  border: none;
  color: #d4af37;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.filter-chip-remove:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: rotate(90deg);
}

.clear-all-filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  color: #d4af37;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-all-filters-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: #d4af37;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ============================================
   NEWSLETTER SIDEBAR WIDGET
   ============================================ */
.newsletter-sidebar-widget {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
  border: 2px solid #d4af37;
  position: relative;
  overflow: hidden;
}

.newsletter-sidebar-widget::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
  pointer-events: none;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.newsletter-form-sidebar {
  position: relative;
  z-index: 1;
}

.newsletter-sidebar-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.newsletter-sidebar-input:focus {
  outline: none;
  border-color: #d4af37;
  background: rgba(0, 0, 0, 0.4);
}

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

.newsletter-sidebar-checkbox {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #fff;
}

.newsletter-sidebar-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #d4af37;
  cursor: pointer;
}

.newsletter-sidebar-submit {
  width: 100%;
  padding: 0.75rem;
  background: #d4af37;
  border: none;
  border-radius: 6px;
  color: #000;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.newsletter-sidebar-submit:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.3);
}

.newsletter-feedback {
  margin-top: 0.75rem;
  padding: 0.625rem;
  border-radius: 6px;
  font-size: 0.875rem;
  display: none;
}

.newsletter-feedback--success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.newsletter-feedback--error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================
   MOST READ WIDGET (styling from engagement-funnel.css)
   ============================================ */
.sidebar-most-read {
  /* Inherits .sidebar-widget styles */
}

.most-read-rank-badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 50%;
  font-size: 1.125rem;
}

.most-read-rank-badge[data-rank="1"] {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

.most-read-rank-badge[data-rank="2"] {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  filter: drop-shadow(0 0 6px rgba(192, 192, 192, 0.5));
}

.most-read-rank-badge[data-rank="3"] {
  background: linear-gradient(135deg, #cd7f32, #e8a87c);
  filter: drop-shadow(0 0 6px rgba(205, 127, 50, 0.5));
}

/* ============================================
   CROSS NAVIGATION WIDGET (MODERN)
   ============================================ */
.sidebar-cross-nav {
  /* Inherits .sidebar-widget styles */
}

.cross-nav-grid-modern {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.cross-nav-card-modern {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
}

.cross-nav-card-modern:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.cross-nav-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.cross-nav-card-modern:hover .cross-nav-gradient {
  opacity: 1;
}

.cross-nav-content-modern {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
}

.cross-nav-emoji {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.cross-nav-title-modern {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.25rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cross-nav-desc-modern {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.news-main {
  min-width: 0; /* Fix grid overflow */
}

.news-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

#results-count {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

/* ============================================
   NEWS GRID
   ============================================ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--news-card-gap);
  list-style: none;
  padding: 0;
  margin: 0 0 3rem 0;
}

/* ============================================
   NEWS CARD (preserve existing styles)
   ============================================ */
.news-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  border-color: #d4af37;
}

.news-card.is-hidden {
  display: none;
}

.news-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #000;
}

.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

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

.news-card__content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.news-card__tag {
  padding: 0.25rem 0.75rem;
  background: rgba(212, 175, 55, 0.1);
  color: #d4af37;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.news-card__title {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  line-height: 1.4;
  color: #fff;
  font-weight: 600;
}

.news-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.news-card__excerpt {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  flex: 1;
}

.news-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.news-card__meta time {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.pager {
  margin: 3rem 0;
}

.pager__list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pager__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

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

.pager__link.is-active {
  background: #d4af37;
  border-color: #d4af37;
  color: #000;
  font-weight: 600;
}

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

.pager__ellipsis {
  padding: 0 0.5rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   MOBILE FILTER TOGGLE
   ============================================ */
.mobile-filter-toggle {
  display: none; /* Shown only on mobile */
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: #d4af37;
  border: none;
  border-radius: 50px;
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
  transition: all 0.3s ease;
}

.mobile-filter-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.6);
}

/* ============================================
   MOBILE FILTER MODAL
   ============================================ */
.mobile-filter-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mobile-filter-header {
  position: sticky;
  top: 0;
  background: #1a1a1a;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
}

.mobile-filter-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #d4af37;
  margin: 0;
}

.mobile-filter-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0.25rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mobile-filter-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #d4af37;
  transform: rotate(90deg);
}

.mobile-filter-body {
  padding: 2rem 1.5rem 6rem;
}

.mobile-filter-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  z-index: 1;
}

.mobile-filter-apply {
  flex: 1;
  padding: 1rem;
  background: #d4af37;
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-filter-apply:hover {
  background: #fff;
  transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  :root {
    --news-sidebar-width: 280px;
    --news-gap: 2rem;
  }
}

@media (max-width: 768px) {
  .news-content-wrapper {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 1rem 4rem;
  }

  .news-sidebar {
    display: none;
  }

  .mobile-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  /* Titoli responsive gestiti da .page-title e .page-claim in base.css */

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

  .pager__link {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .news-hero {
    min-height: 300px;
  }

  .news-hero__text {
    padding: 3rem 1.5rem;
  }

  /* Titoli responsive gestiti da .page-title e .page-claim in base.css */

  .news-results-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .news-sidebar,
  .mobile-filter-toggle,
  .mobile-filter-modal,
  .pager {
    display: none !important;
  }

  .news-content-wrapper {
    grid-template-columns: 1fr;
  }
}
