/* Layout news nella sezione quattro */
.news-layout {
  display: flex;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 40px 150px 40px 150px;
  gap: 15px;
  overflow: visible;
}

/* Stili colonne pubblicitarie */
.elenchi-pubblicitari.colonna-sinistra,
.elenchi-pubblicitari.colonna-destra {
  margin-top: 0px;
  padding-top: 10px;
  width: 20%;
  max-width: 250px;
  min-width: 180px;
  overflow-y: auto;
}

.pubblicitario-tit {
  margin: 0 auto 15px auto;
  padding: 0px 15px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  position: relative;
  background-color: #c60000;
  border-radius: 5px;
  width: 100%;
}

/* Container principale news */
.news-container {
  flex: 1;
  max-width: 70%;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.155);
  max-height: 80vh;
}

/* Header news */
.news-header {
  display: flex;
  position: relative;
  justify-content: space-between;
  align-items: center;
  padding: 5px 20px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #c60000;
  border-radius: 8px 8px 0 0;
}

.news-title {
  color: white;
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.visita-news {
  display: flex;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: white;
  z-index: 2000;
}
.visita-news a {
  color: white;
  font-size: 15px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  margin: 0px;
}

.visita-news button {
  background-color: #c60000;
  border: none;
}

#refresh-news-btn {
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.2s;
}

#refresh-news-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Griglia news */
.news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto auto auto auto;
  gap: 5px;
  padding: 10px 10px 5px 10px;
  overflow-y: auto;
}

/* Elemento news grande (in evidenza) */
.news-item.featured {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 300px;
  padding: 0px;
}

/* Elemento news medio */
.news-item.medium {
  grid-column: span 2;
  grid-row: span 1;
  min-height: 150px;
}

/* Elemento news piccolo */
.news-item.small {
  grid-column: span 1;
  grid-row: span 1;
  min-height: 120px;
}

/* Stile generico news */
.news-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  cursor: pointer;
}

.news-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Gradiente per migliorare la leggibilità del testo su sfondo immagine */
.news-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0) 100%
  );
  z-index: 1;
}

/* Contenuto news */
.news-item-content {
  position: relative;
  z-index: 2;
  padding: 15px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.news-category {
  display: inline-block;
  padding: 3px 8px;
  background-color: #0080f0;
  color: white;
  font-size: 10px;
  font-weight: bold;
  border-radius: 3px;
  margin-bottom: 10px;
  align-self: flex-start;
}

.news-item-title {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.news-item.featured .news-item-title {
  font-size: 22px;
}

.news-item-excerpt {
  display: none;
  margin: 0 0 15px 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}

.news-item.featured .news-item-excerpt {
  display: block;
}

.news-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.8;
}

/* Stile per news non caricata */
.news-item {
  background-color: #e0e0e0;
  background-image: linear-gradient(
    110deg,
    #ececec 8%,
    #f5f5f5 18%,
    #ececec 33%
  );
  background-size: 200% 100%;
  animation: 10s shine linear infinite;
}

@keyframes shine {
  to {
    background-position-x: -200%;
  }
}

.news-feed-container {
  width: 100%;
  min-height: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0px auto 0px auto;
  overflow-y: auto;
  background: #f9f9f9;
  border-radius: 16px;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid #fff;
}
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-height: 100%;
  position: relative;
}
.news-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 2px 16px rgba(26, 141, 255, 0.09);
  overflow: hidden;
  min-height: 480px;
  animation: fadeInUp 0.7s cubic-bezier(0.23, 1.01, 0.32, 1) both;
  position: relative;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(60px) scale(0.93);
  transition:
    opacity 0.7s,
    transform 0.7s;
}
.news-card.news-card--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: newsFadeIn 0.7s cubic-bezier(0.23, 1.01, 0.32, 1) both;
}
@keyframes newsFadeIn {
  0% {
    opacity: 0;
    transform: translateY(60px) scale(0.93);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.news-card .news-image,
.news-card video.news-image {
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 480px;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.93);
  transition: filter 0.2s;
  border-radius: 0;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}
.news-content {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 60px 48px 60px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.38) 0%,
    rgba(0, 0, 0, 0.18) 60%,
    rgba(0, 0, 0, 0.05) 100%
  );
}
.news-category {
  display: inline-block;
  background: #0080f0cc;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  border-radius: 4px;
  padding: 7px 20px;
  margin-bottom: 22px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.news-title {
  font-size: 2.7rem;
  font-weight: 800;
  margin: 0 0 22px 0;
  color: #fff;
  line-height: 1.13;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}
.news-excerpt {
  font-size: 1.45rem;
  color: #f3f3f3;
  margin: 0 0 22px 0;
  line-height: 1.5;
  opacity: 0.97;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.13);
}
.news-meta {
  display: flex;
  gap: 28px;
  font-size: 18px;
  color: #d7d7d7;
  font-weight: 500;
  margin-bottom: 18px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.13);
}
.news-actions {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.news-card:hover .news-actions {
  opacity: 1;
  pointer-events: auto;
}
.news-btn {
  background: #f1f1f1cc;
  border: none;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0080f0;
  font-size: 1.5em;
  cursor: pointer;
  transition:
    background 0.18s,
    color 0.18s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.news-btn:hover {
  background: #0080f0;
  color: #fff;
}
.news-card.skeleton {
  background: linear-gradient(90deg, #f3f3f3 25%, #e9e9e9 50%, #f3f3f3 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.2s linear infinite;
  min-height: 480px;
  border-radius: 0;
}
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes skeleton-shine {
  0% {
    background-position-x: 200%;
  }
  100% {
    background-position-x: -200%;
  }
}
@media (max-width: 1200px) {
  .news-feed-container {
    max-width: 98vw;
  }
}
@media (max-width: 900px) {
  .news-feed-container {
    max-width: 100vw;
  }
  .news-card,
  .news-card .news-image,
  .news-card video.news-image {
    min-height: 320px;
  }
  .news-content {
    padding: 18px 10px 12px 10px;
  }
  .news-title {
    font-size: 1.3rem;
  }
}
@media (max-width: 600px) {
  .news-feed-container {
    border-radius: 0;
    box-shadow: none;
    height: 90vh;
  }
  .news-feed {
    padding: 0;
    gap: 0;
  }
  .news-card,
  .news-card .news-image,
  .news-card video.news-image {
    min-height: 180px;
  }
  .news-content {
    padding: 10px 8px 8px 8px;
  }
  .news-title {
    font-size: 1.1rem;
  }
}

#news-modal {
  animation: fadeInUp 0.4s;
}
.news-modal-content {
  background: #fff;
  border-radius: 18px;
  max-width: 600px;
  width: 98vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding: 32px 24px;
  position: relative;
  animation: fadeInUp 0.5s;
}
@media (max-width: 600px) {
  .news-modal-content {
    padding: 14px 4vw;
    max-width: 99vw;
  }
}

.news-btn.read-news {
  min-width: 180px !important;
  padding: 0 32px !important;
  font-size: 1em;
  white-space: nowrap !important;
  height: 48px;
  line-height: 48px;
  border-radius: 28px;
  background: #0080f0;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition:
    background 0.18s,
    color 0.18s;
  display: block;
  text-align: center;
  margin-top: 18px;
  text-decoration: none !important;
}
.news-btn.read-news:hover {
  background: #005bb5;
  color: #fff;
}

.news-modal-content .news-meta {
  font-weight: 300;
  font-size: 16px;
  color: #555;
  text-shadow: none;
}
