/* ═══════════════════════════════════════════════════════════════════════════
   News (Notizie) — mobile-first
   Design tokens from style.css:
     --ra-ink        #0f2b46   headings / body
     --ra-accent     #5386a5   interactive blue
     --ra-accent-2   #0eab9e   teal hover
     --ra-muted      #6b7a86   secondary text
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Section wrapper ───────────────────────────────────────────────────────── */

.news {
  padding: 2.5rem 1rem 3.5rem;
}

.news__inner {
  width: min(96%, 1160px);
  margin: 0 auto;
}

/* ── Main heading ──────────────────────────────────────────────────────────── */

.news__heading {
  font-family: "Roboto Condensed", "Segoe UI", sans-serif;
  font-weight: 400;
  color: var(--ra-ink);
  text-align: center;
  letter-spacing: -0.01em;
}

/* ── Section label (h2, right column) ─────────────────────────────────── */

.news__section-label {
  font-family: "Roboto Condensed", "Segoe UI", sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ra-ink);
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;

  padding-bottom: 0.6rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE: filter bar across the top, content below
   ════════════════════════════════════════════════════════════════════════════ */

.news__layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */

.news__sidebar {
  /* sits above content on mobile */
}

.news__filter-title {
  font-family: "Roboto Condensed", "Segoe UI", sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ra-ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(15, 43, 70, 0.15);
}

/* ── Radio list — wraps horizontally on mobile ─────────────────────────────── */

.news__filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.news__filter-list[hidden] {
  display: none;
}

.news__filter-item {
  margin: 0;
  padding: 0;
}

.news__filter-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--ra-ink);
  user-select: none;
  padding: 0.2rem 0;
  transition: color 150ms;
}

.news__filter-label:hover {
  color: var(--ra-accent);
}

/* Custom radio */
.news__filter-radio {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  border: 1.5px solid #b0bec8;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}

.news__filter-radio:checked {
  border-color: var(--ra-accent);
  background: var(--ra-accent);
  box-shadow: inset 0 0 0 3px #fff;
}

.news__filter-radio:focus-visible {
  outline: 2px solid var(--ra-accent-2);
  outline-offset: 2px;
}

/* ── Content area ──────────────────────────────────────────────────────────── */

.news__content {
  min-width: 0;
}

.news__list {
  /* border removed — section-label h2 provides visual separation */
}

/* ── Group heading (e.g. "2025 Comunicati Stampa") ─────────────────────────── */

.news__group-heading {
  font-family: "Roboto Condensed", "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ra-ink);
  letter-spacing: 0.02em;
  margin: 1.25rem 0 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(15, 43, 70, 0.15);
}

/* ── Item row ──────────────────────────────────────────────────────────────── */

.news__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(15, 43, 70, 0.08);
  text-decoration: none;
  transition: background 150ms;
  border-radius: 2px;
}

.news__item:last-child {
  border-bottom: none;
}

.news__item:hover,
.news__item:focus-visible {
  background: rgba(83, 134, 165, 0.04);
}

.news__item:focus-visible {
  outline: 2px solid var(--ra-accent-2);
  outline-offset: 2px;
}

/* Date */
.news__item-date {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--ra-muted);
  white-space: nowrap;
  min-width: 7.5rem;
}

/* PDF badge */
.news__item-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #c0392b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 2.5rem;
}

/* Title */
.news__item-title {
  flex: 1 1 200px;
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--ra-accent);
  line-height: 1.45;
  transition: color 150ms;
}

.news__item:hover .news__item-title,
.news__item:focus-visible .news__item-title {
  color: var(--ra-accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Loading ───────────────────────────────────────────────────────────────── */

.news__loading {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
}

.news__list[aria-busy="false"] .news__loading,
.news__list:not([aria-busy]) .news__loading {
  display: none;
}

.news__spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 2.5px solid rgba(15, 43, 70, 0.12);
  border-top-color: var(--ra-accent);
  border-radius: 50%;
  animation: news-spin 0.65s linear infinite;
}

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

/* ── Empty / Error ─────────────────────────────────────────────────────────── */

.news__empty {
  padding: 2.5rem 0;
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--ra-muted);
  text-align: center;
}

.news__error {
  padding: 1rem 1.25rem;
  background: #fff5f5;
  border-left: 3px solid #c0392b;
  border-radius: 2px;
  font-size: 0.875rem;
  color: #842029;
  margin-top: 1rem;
}

/* ── Fade-in animation ─────────────────────────────────────────────────────── */

@keyframes news-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.news__group,
.news__item {
  animation: news-fade-in 220ms ease both;
}

/* ════════════════════════════════════════════════════════════════════════════
   TABLET (≥ 640px): sidebar moves to left column
   ════════════════════════════════════════════════════════════════════════════ */

@media (min-width: 640px) {
  .news__layout {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0 3rem;
    align-items: start;
  }

  /* Sidebar: vertical stack of radios, border on top */
  .news__sidebar {
    border-top: 1px solid rgba(15, 43, 70, 0.15);
    padding-top: 0.75rem;
    position: sticky;
    top: 5rem;
    /* clears sticky header */
  }

  .news__filter-list {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.55rem;
  }

  /* Content: top border removed */
  .news__list {}

  /* Item row: three defined columns */
  .news__item {
    display: grid;
    grid-template-columns: 8.5rem 3rem 1fr;
    gap: 0 1rem;
    flex-wrap: unset;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(15, 43, 70, 0.08);
    border-radius: 0;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   DESKTOP (≥ 1024px): wider sidebar, larger type
   ════════════════════════════════════════════════════════════════════════════ */

@media (min-width: 1024px) {
  .news__layout {
    grid-template-columns: 180px 1fr;
    gap: 0 4rem;
  }

  .news__filter-label {
    font-size: 1rem;
  }

  .news__item-date {
    font-size: 0.9375rem;
    text-transform: capitalize;
  }

  .news__item-title {
    font-size: 1rem;
  }
}