/* ─── News module (Developer Portal) — usa variabili da /styles.css ─── */

.news-home-section .section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.news-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: clamp(18px, 3vw, 28px);
  align-items: start;
}

@media (max-width: 960px) {
  .news-home-layout {
    grid-template-columns: 1fr;
  }
}

/* Hero: ultima notizia */
.news-hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: clamp(20px, 3vw, 28px);
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(255, 107, 53, 0.2), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(89, 225, 194, 0.12), transparent 50%),
    rgba(14, 24, 46, 0.92);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.news-hero-card:hover {
  border-color: rgba(89, 225, 194, 0.35);
  transform: translateY(-2px);
}

.news-hero-card:focus-visible {
  outline: 2px solid rgba(89, 225, 194, 0.5);
  outline-offset: 3px;
}

.news-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.news-hero-date {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-hero-title {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.news-hero-lead {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
  flex: 1;
}

.news-hero-cta {
  margin-top: 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-cool);
}

/* Aside: fino a 3 notizie */
.news-home-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-home-aside-title {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-side-card {
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.news-side-card:hover {
  border-color: rgba(89, 225, 194, 0.28);
  background: rgba(89, 225, 194, 0.05);
}

.news-side-card:focus-visible {
  outline: 2px solid rgba(89, 225, 194, 0.45);
  outline-offset: 2px;
}

.news-side-date {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.news-side-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.news-home-empty,
.news-home-error {
  margin: 0;
  padding: 20px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  color: var(--muted);
  font-size: 0.95rem;
}

.news-home-error {
  border-color: rgba(255, 123, 123, 0.35);
  color: #ffc9c9;
}

/* ─── Pagina indice notizie ─── */
.news-index-hero {
  margin-bottom: 8px;
}

.news-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.news-index-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(10, 18, 36, 0.65);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.news-index-card:hover {
  border-color: rgba(255, 209, 102, 0.25);
  transform: translateY(-2px);
}

.news-index-card-date {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.news-index-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.news-index-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.news-index-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.news-tag {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(89, 225, 194, 0.1);
  color: var(--accent-cool);
}

/* ─── Articolo singolo ─── */
.news-article-shell {
  /* max-width: 720px; */
}

.news-article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--accent-cool);
  text-decoration: none;
}

.news-article-back:hover {
  text-decoration: underline;
}

.news-article-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.news-article-header .eyebrow {
  display: inline-block;
  margin-bottom: 10px;
}

.news-article-header h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
}

.news-article-meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.news-article-body {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text);
}

.news-article-body p {
  margin: 0 0 1.1em;
}

.news-article-body h2 {
  margin: 1.6em 0 0.6em;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.news-article-body ul,
.news-article-body ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.news-article-body li {
  margin-bottom: 0.4em;
}

.news-article-body code {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.news-article-body pre {
  margin: 1em 0;
  padding: 16px 18px;
  border-radius: 14px;
  overflow-x: auto;
  background: rgba(7, 13, 28, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.news-article-body blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 107, 53, 0.06);
  border-radius: 0 12px 12px 0;
  color: var(--muted);
}
