@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;800;900&family=DM+Sans:wght@400;5001200 .news-card-image;600&display=swap");

/* ─────────────────────────────────────────
   NEWS PAGE - GLOBAL
───────────────────────────────────────── */
.news-page {
  min-height: 100vh;
  background: #faf8f5;
  overflow-x: hidden;
  font-family: "DM Sans", sans-serif;
}

.news-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

header {
  box-shadow: none;
}

/* ─────────────────────────────────────────
   MASTHEAD
───────────────────────────────────────── */
.news-masthead {
  z-index: 0;
  padding: 6rem 6% 4rem;
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
  border-bottom: 1.5px solid #e8e2d9;
}

.news-masthead-left {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.news-masthead-label {
  font-family: "DM Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--orange-primary, #e9530e);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.news-masthead-label::before {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  background: var(--orange-primary, #e9530e);
  border-radius: 2px;
}

.news-masthead h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 900;
  color: #1a1410;
  line-height: 0.95;
  letter-spacing: -2px;
  margin: 0;
  animation: fadeInDown 0.7s ease-out both;
}

.news-masthead h1 em {
  font-style: italic;
  color: var(--orange-primary, #e9530e);
}

.news-masthead-desc {
  font-size: 1rem;
  color: #6b6460;
  line-height: 1.75;
  max-width: 580px;
  font-weight: 400;
  animation: fadeInUp 0.7s ease-out 0.15s both;
}

.news-masthead-right {
  animation: fadeInUp 0.7s ease-out 0.1s both;
}

.news-issue-number {
  font-family: "Playfair Display", serif;
  font-size: 7rem;
  font-weight: 900;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px #e8e2d9;
  letter-spacing: -4px;
  user-select: none;
}

.news-issue-text {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #1a1410;
  opacity: 0.6;

  margin-top: -18px;
  margin-right: 12px;

  user-select: none;
}

/* ─────────────────────────────────────────
   FILTRI
───────────────────────────────────────── */
.news-filters-bar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
  animation: fadeInUp 0.7s ease-out 0.25s both;
}

.news-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1.5px solid #ddd7ce;
  color: #6b6460;
  padding: 0.55rem 1.4rem;
  border-radius: 4px;
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}

.filter-btn:hover {
  border-color: var(--orange-primary, #e9530e);
  color: var(--orange-primary, #e9530e);
}

.filter-btn.active {
  background: var(--orange-primary, #e9530e);
  border-color: var(--orange-primary, #e9530e);
  color: #fff;
}

.news-count {
  display: none;
  font-size: 0.82rem;
  color: #9e9792;
  font-weight: 500;
  white-space: nowrap;
}

/* ─────────────────────────────────────────
   GRIGLIA & CARD
───────────────────────────────────────── */
.news-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 6% 6rem;
  position: relative;
  z-index: 10;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.news-card {
  background: #faf8f5;
  display: flex;
  flex-direction: column;
  transition: background 0.25s ease;
  position: relative;
  animation: fadeInUp 0.6s ease-out both;
}

.news-card:nth-child(1) {
  animation-delay: 0.3s;
}
.news-card:nth-child(2) {
  animation-delay: 0.4s;
}
.news-card:nth-child(3) {
  animation-delay: 0.5s;
}
.news-card:nth-child(n + 4) {
  animation-delay: 0.55s;
}

.news-card:hover {
  background: #fff;
}

.news-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--orange-primary, #e9530e);
  transition: height 0.3s ease;
}

.news-card:hover::after {
  height: 100%;
}

.news-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: #ede8e0;
}

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

.news-card:hover .news-card-image img {
  transform: scale(1.04);
}

.news-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 20, 16, 0.3), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.news-card:hover .news-card-image::after {
  opacity: 1;
}

.news-card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--orange-primary, #e9530e);
  color: #fff;
  padding: 0.3rem 0.85rem;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  z-index: 2;
}

.news-card-content {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.78rem;
  color: #9e9792;
}

.news-card-date,
.news-card-read-time {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.news-card-date svg,
.news-card-read-time svg {
  width: 13px;
  height: 13px;
  color: var(--orange-primary, #e9530e);
  flex-shrink: 0;
}

.news-card-title {
  font-family: "Playfair Display", serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1410;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.25s ease;
  margin: 0;
}

.news-card:hover .news-card-title {
  color: var(--orange-primary, #e9530e);
}

.news-card-excerpt {
  font-size: 0.9rem;
  color: #6b6460;
  line-height: 1.7;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.news-card-footer {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid #eee9e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-read {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--orange-primary, #e9530e);
  font-weight: 600;
  font-size: 0.78rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: gap 0.25s ease;
}

.btn-read:hover {
  gap: 0.8rem;
}

.btn-read svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}

.btn-read:hover svg {
  transform: translateX(4px);
}

/* ─────────────────────────────────────────
   PAGINATION & LOADING
───────────────────────────────────────── */
.news-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-top: 4rem;
  animation: fadeInUp 0.7s ease-out 0.6s both;
}

.pagination-btn {
  background: transparent;
  border: 1.5px solid #ddd7ce;
  color: #6b6460;
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 42px;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--orange-primary, #e9530e);
  color: var(--orange-primary, #e9530e);
  background: rgba(233, 83, 14, 0.04);
}

.pagination-btn.active {
  background: var(--orange-primary, #e9530e);
  border-color: var(--orange-primary, #e9530e);
  color: #fff;
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.news-loading,
.loader {
  text-align: center;
  padding: 5rem 2rem;
  color: #9e9792;
  grid-column: 1 / -1;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.news-loading .spinner {
  width: 36px;
  height: 36px;
  border: 2px solid #e8e2d9;
  border-top-color: var(--orange-primary, #e9530e);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

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

.news-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: #9e9792;
  font-size: 1rem;
}

/* ─────────────────────────────────────────
   ANIMAZIONI
───────────────────────────────────────── */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ─────────────────────────────────────────
   RESPONSIVE - CORRETTO ✅
───────────────────────────────────────── */

/* ── Tablet Landscape (≤1024px) ── */
@media (max-width: 1024px) {
  .news-masthead {
    gap: 1.5rem;
    padding: 2rem 3rem;
  }

  .news-masthead-right {
    text-align: left;
  }

  .news-issue-number {
    font-size: 5rem;
    -webkit-text-stroke: 1.2px #e8e2d9;
  }

  .news-issue-text {
    font-size: 1rem;
    margin-top: -12px;
    margin-right: 20px;
  }

  .news-filters-bar {
    padding: 1.5rem 5%;
    justify-content: center;
  }

  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }

  .news-card:first-child {
    grid-column: span 2;
  }

  .news-card-image {
    height: 50%;
  }
}

/* ── Mobile Landscape (≤768px) ── */
@media (max-width: 768px) {
  .news-masthead {
    padding: 3.5rem 5% 0;
    text-align: center;
  }

  .news-masthead-left {
    align-items: center;
  }

  .news-masthead-label {
    justify-content: center;
    font-size: clamp(0.5rem, 4vw, 0.55rem);
  }

  .news-masthead h1 {
    /*font-size: clamp(2.2rem, 8vw, 3.2rem);*/
    text-align: center;
  }

  .news-masthead-desc {
    text-align: center;
    margin: 0 auto;
  }

  .news-issue-number,
  .news-issue-text {
    display: none;
  }

  .news-filters-bar {
    padding: 1.25rem 5%;
    flex-direction: column;
    align-items: stretch;
  }

  .news-filters {
    justify-content: center;
    width: 100%;
  }

  .filter-btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
  }

  .news-count {
    display: block;
    text-align: right;
  }

  .news-container {
    padding: 0 5% 4rem;
  }

  /* Grid: 1 colonna su mobile */
  .news-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .news-card,
  .news-card:first-child {
    grid-column: span 1;
  }

  .news-card-content {
    padding: 1.5rem;
  }

  .news-card-title {
    font-size: 1.1rem;
    -webkit-line-clamp: 2;
  }

  .news-card-excerpt {
    font-size: 0.88rem;
    -webkit-line-clamp: 2;
  }

  .news-card-footer {
    padding-top: 1rem;
  }

  .btn-read {
    font-size: 0.75rem;
  }
}

/* ── Mobile Portrait (≤480px) ── */
@media (max-width: 480px) {
  .news-masthead {
    padding: 2.5rem 4% 2rem;
  }

  .news-masthead h1 {
    letter-spacing: -1px;
  }

  .news-masthead-desc {
    font-size: 0.95rem;
  }

  .news-filters {
    flex-direction: column;
    gap: 0.4rem;
  }

  .filter-btn {
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
  }

  .news-card-badge {
    font-size: 0.62rem;
    padding: 0.25rem 0.7rem;
    top: 10px;
    left: 10px;
  }

  .news-card-content {
    padding: 1.25rem;
    gap: 0.6rem;
  }

  .news-card-meta {
    font-size: 0.75rem;
    gap: 0.8rem;
    flex-wrap: wrap;
  }

  .news-card-title {
    font-size: 1rem;
  }

  .news-card-excerpt {
    font-size: 0.85rem;
  }

  .news-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding-top: 1rem;
  }

  .btn-read {
    width: 100%;
    justify-content: center;
  }

  /* Pagination compatta */
  .news-pagination {
    gap: 0.3rem;
    margin-top: 3rem;
    flex-wrap: wrap;
  }

  .pagination-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    min-width: 38px;
  }

  .pagination-btn svg {
    width: 12px;
    height: 12px;
  }
}

/* ── Extra small (≤360px) ── */
@media (max-width: 360px) {
  .news-card-content {
    padding: 1rem;
  }

  .news-card-title {
    font-size: 0.95rem;
  }

  .news-card-excerpt {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
  }

  .filter-btn,
  .pagination-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
}

/* ── Preferenze di sistema ── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .news-card {
    border: 1px solid #ccc;
  }
  .filter-btn,
  .pagination-btn {
    border-width: 2px;
  }
}

/* ─────────────────────────────────────────
   UTILITIES
───────────────────────────────────────── */
.hidden {
  display: none !important;
}
.text-center {
  text-align: center;
}
