/* ===============================
   NEWS.CSS - Layout Masonry Avanzato
   =============================== */

/* Container generale */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* HERO SECTION NEWS */
.news-hero {
  height: 50vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  background: linear-gradient(135deg, #4C7031, #6B8A42, #88A654);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  color: white;
  padding: 20px;
  overflow: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.news-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../images/funghi_pattern.png') repeat;
  opacity: 0.05;
  z-index: 1;
}

.news-hero__content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.news-hero__title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 15px;
  font-weight: 700;
  text-shadow: 2px 2px 10px rgba(0,0,0,0.3);
}

.news-hero__subtitle {
  font-family: 'Lora', serif;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  opacity: 0.95;
  line-height: 1.6;
}

/* MAIN NEWS SECTION */
.news-main {
  padding: 60px 0;
  background: linear-gradient(180deg, #f9f9f9, #f4eb9e);
  min-height: 100vh;
}

/* CONTROLLI NEWS */
.news-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  gap: 20px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  background: white;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.search-box:focus-within {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(76, 112, 49, 0.2);
}

.search-box input {
  border: none;
  padding: 15px 20px;
  font-size: 1rem;
  outline: none;
  width: 300px;
  background: transparent;
}

.search-btn {
  background: #4C7031;
  color: white;
  border: none;
  padding: 15px 20px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.search-btn:hover {
  background: #3a5426;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  background: white;
  padding: 8px;
  border-radius: 50px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.filter-btn:hover {
  background: #f0f0f0;
}

.filter-btn.active {
  background: #4C7031;
  color: white;
  box-shadow: 0 4px 15px rgba(76, 112, 49, 0.3);
}

/* GRIGLIA MASONRY */
.news-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

/* NEWS ITEM */
.news-item {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transition: all 0.4s ease;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  display: none;
}

.news-item.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.news-item:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

/* IMMAGINE ARTICOLO */
.news-item__image {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.news-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-item:hover .news-item__image img {
  transform: scale(1.1);
}

.placeholder-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

.news-item__overlay {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.news-item__date {
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.news-item__category {
  background: rgba(255, 165, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
}

/* CONTENUTO ARTICOLO */
.news-item__content {
  padding: 30px;
}

.news-item__title {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 15px;
  color: #2c2c2c;
}

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

.news-item__title a:hover {
  color: #4C7031;
}

.news-item__excerpt {
  color: #666;
  line-height: 1.7;
  margin-bottom: 25px;
  font-size: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

.read-more {
  color: #4C7031;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.read-more:hover {
  color: #FFA500;
  transform: translateX(5px);
}

.read-more svg {
  transition: transform 0.3s ease;
}

.read-more:hover svg {
  transform: translateX(3px);
}

.reading-time {
  color: #999;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.reading-time::before {
  content: "📖";
  font-size: 0.8rem;
}

/* LOAD MORE SECTION */
.load-more-section {
  text-align: center;
  margin: 40px 0;
}

.load-more-btn {
  background: linear-gradient(135deg, #4C7031, #6B8A42);
  color: white;
  border: none;
  padding: 18px 40px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 8px 25px rgba(76, 112, 49, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.load-more-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #6B8A42, #88A654);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.load-more-btn:hover::before {
  opacity: 1;
}

.load-more-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(76, 112, 49, 0.4);
}

.load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-text,
.btn-spinner {
  position: relative;
  z-index: 1;
}

.btn-spinner svg {
  animation: spin 1s linear infinite;
}

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

/* NEWSLETTER SECTION */
.newsletter-section {
  margin-top: 80px;
  padding: 40px 0;
}

.newsletter-card {
  background: linear-gradient(135deg, #4C7031, #6B8A42);
  color: white;
  padding: 50px;
  border-radius: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(76, 112, 49, 0.3);
}

.newsletter-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/funghi_pattern.png') repeat;
  opacity: 0.05;
  z-index: 1;
}

.newsletter-card > * {
  position: relative;
  z-index: 2;
}

.newsletter-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  display: block;
}

.newsletter-card h3 {
  font-size: 2rem;
  margin-bottom: 15px;
  font-family: 'Playfair Display', serif;
}

.newsletter-card p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  display: flex;
  max-width: 400px;
  margin: 0 auto;
  gap: 0;
  background: white;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.newsletter-form input {
  flex: 1;
  border: none;
  padding: 18px 25px;
  font-size: 1rem;
  outline: none;
  background: transparent;
  color: #333;
}

.newsletter-form input::placeholder {
  color: #999;
}

.newsletter-form button {
  background: #FFA500;
  color: white;
  border: none;
  padding: 18px 30px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.newsletter-form button:hover {
  background: #ff8c00;
  transform: scale(1.05);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .news-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }
  
  .search-box {
    justify-content: center;
  }
  
  .search-box input {
    width: 250px;
  }
  
  .filter-tabs {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .news-masonry {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .news-item__content {
    padding: 20px;
  }
  
  .newsletter-card {
    padding: 30px 20px;
  }
  
  .newsletter-form {
    flex-direction: column;
    border-radius: 15px;
    max-width: 300px;
  }
  
  .newsletter-form input,
  .newsletter-form button {
    border-radius: 0;
  }
  
  .newsletter-form input {
    border-radius: 15px 15px 0 0;
  }
  
  .newsletter-form button {
    border-radius: 0 0 15px 15px;
  }
}

@media (max-width: 480px) {
  .news-hero {
    height: 40vh;
    padding: 15px;
  }
  
  .news-main {
    padding: 40px 0;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .news-item__image {
    height: 200px;
  }
  
  .news-item__overlay {
    top: 10px;
    left: 10px;
    right: 10px;
  }
  
  .filter-btn {
    padding: 10px 15px;
    font-size: 0.85rem;
  }
}