/* =========================================================
   LANDING ARTICOLI
   ========================================================= */

/* HERO landing articoli */
.articles-hero {
  margin-top: -2.25rem;
  padding: 3.5rem 0 3.5rem;
  min-height: 520px;

  background-size: cover;
  background-position: 80% 45%;
  background-repeat: no-repeat;
}

@media (min-width: 992px) {
  .articles-hero {
    margin-top: -2.75rem;
    padding: 4rem 0 4rem;
    min-height: 560px;
    background-position: 78% 45%;
  }
}

/* Variante LIGHT per l'hero */
html[data-bs-theme="light"] .articles-hero {
  background-image:
    linear-gradient(
      90deg,
      rgba(248, 250, 252, 0.98) 0%,
      rgba(248, 250, 252, 0.96) 40%,
      rgba(248, 250, 252, 0.40) 65%,
      rgba(248, 250, 252, 0.00) 100%
    ),
    url("../img/hero/articles-hero.webp");
}

/* Variante DARK per l'hero */
html[data-bs-theme="dark"] .articles-hero {
  background-image:
    linear-gradient(
      90deg,
      rgba(15, 23, 42, 0.98) 0%,
      rgba(15, 23, 42, 0.96) 40%,
      rgba(15, 23, 42, 0.70) 65%,
      rgba(15, 23, 42, 0.00) 100%
    ),
    url("../img/hero/articles-hero.webp");
}

/* Larghezza max del testo */
.articles-hero .container {
  max-width: 1200px;
}

.articles-hero-kicker {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.articles-hero h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--bs-body-color);
}

.articles-hero .lead {
  max-width: 56rem;
  color: var(--bs-secondary-color);
}

.articles-hero-meta .badge {
  font-size: .75rem;
}

/* ===== Sezione articoli + filtri ===== */

.articles-section {
  padding: 2rem 0 3.5rem;
}

.articles-filters {
  margin-bottom: 1.75rem;
  padding: 1rem 1.2rem;
  border-radius: 1.25rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
}

.articles-tag-btn {
  border-radius: 999px;
  font-size: .8rem;
  padding: .35rem .9rem;
}

.articles-tag-btn.active {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

/* ===== Card articolo ===== */

.article-card {
  position: relative;
  border-radius: 1.25rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.65);
}

.article-card-body {
  padding: 1.25rem 1.3rem 1.2rem;
}

@media (min-width: 768px) {
  .article-card-body {
    padding: 1.4rem 1.5rem 1.3rem;
  }
}

.article-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}

.article-title {
  font-size: 1.02rem;
  line-height: 1.25;
  margin-bottom: .4rem;
  color: var(--bs-body-color);
}

.article-excerpt {
  font-size: .9rem;
  color: var(--bs-secondary-color);
  margin-bottom: .85rem;
}

.article-meta {
  color: var(--bs-secondary-color);
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}

.article-link {
  font-size: .85rem;
  font-weight: 600;
  color: var(--bs-primary);
  text-decoration: none;
}

.article-link:hover {
  text-decoration: underline;
}

/* Stato vuoto */

.articles-empty {
  margin-top: 1.5rem;
}

.articles-empty-inner {
  border-radius: 1.25rem;
  border: 1px dashed var(--bs-border-color);
  padding: 1.5rem 1.4rem;
  background: var(--bs-tertiary-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

@media (max-width: 575.98px) {
  .articles-empty-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================================================
   DETTAGLIO ARTICOLO LUNGO
   ========================================================= */

/* HERO dettaglio articolo */
.article-hero {
  margin-top: -2.25rem;
  padding: 3rem 0 1.75rem;
  border-bottom: 1px solid var(--bs-border-color);
}

@media (min-width: 992px) {
  .article-hero {
    margin-top: -2.75rem;
    padding: 3.5rem 0 2rem;
  }
}

@media (max-width: 575.98px) {
  .article-hero {
    padding-top: 2.25rem;
    padding-bottom: 1.5rem;
  }
}

/* Background HERO: light vs dark */

html[data-bs-theme="light"] .article-hero {
  background: radial-gradient(circle at top left,
              #e0f2fe 0,
              #f8fafc 55%,
              #ffffff 100%);
}

html[data-bs-theme="dark"] .article-hero {
  background: radial-gradient(circle at top left,
              #0b1120 0,
              #020617 55%,
              #020617 100%);
}

.article-breadcrumb {
  font-size: .85rem;
  color: var(--bs-secondary-color);
  margin-top: 0;
}

.article-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.article-breadcrumb a:hover {
  text-decoration: underline;
}

.article-kicker {
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--bs-primary);
  margin-bottom: .4rem;
}

.article-hero h1 {
  font-weight: 800;
  letter-spacing: -.03em;
  font-size: clamp(2rem, 3vw, 2.7rem);
  margin-bottom: .9rem;
  color: var(--bs-body-color);
}

.article-subtitle {
  font-size: 1rem;
  color: var(--bs-secondary-color);
  max-width: 720px;
}

.article-header-meta {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  align-items: center;
  font-size: .9rem;
}

/* chips */
.badge-chip {
  border-radius: 999px;
  padding: .25rem .75rem;
  font-size: .75rem;
  font-weight: 600;
  background: rgba(var(--bs-primary-rgb), .12);
  color: var(--bs-body-color);
}

.badge-chip-neutral {
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
}

/* Layout articoli lunghi */

.article-main {
  padding-top: 2.25rem;
  padding-bottom: 3.25rem;
  background-color: var(--bs-body-bg);
}

@media (min-width: 992px) {
  .article-main {
    padding-top: 2.75rem;
    padding-bottom: 4rem;
  }
}

.article-long-wrapper {
  max-width: 880px;
  margin: 0 auto;
}

/* Cover */

.article-cover {
  margin-bottom: 1.75rem;
}

.article-cover img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1.5rem;
  object-fit: cover;
  max-height: 420px;
}

.article-cover figcaption {
  font-size: .75rem;
  color: var(--bs-secondary-color);
  margin-top: .35rem;
}

/* TOC */

.article-toc {
  margin-bottom: 1.75rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
}

.article-toc h2 {
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--bs-secondary-color);
  margin-bottom: .4rem;
}

.article-toc ol {
  padding-left: 1rem;
  margin: 0;
  font-size: .9rem;
}

.article-toc li + li {
  margin-top: .25rem;
}

.article-toc a {
  text-decoration: none;
  color: var(--bs-body-color);
}

.article-toc a:hover {
  color: var(--bs-primary);
}

/* Contenuto articolo */

.article-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--bs-body-color);
}

.article-content h2,
.article-content h3 {
  font-weight: 700;
  letter-spacing: -.01em;
  margin-top: 1.9rem;
  margin-bottom: .75rem;
  color: var(--bs-body-color);
}

.article-content h2 { font-size: 1.5rem; }
.article-content h3 { font-size: 1.22rem; }

.article-content p {
  margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
  padding-left: 1.2rem;
  margin-bottom: 1rem;
}

.article-content li + li {
  margin-top: .15rem;
}

.article-content blockquote {
  padding: .95rem 1.1rem;
  border-left: 3px solid var(--bs-primary);
  background: var(--bs-secondary-bg);
  border-radius: .9rem;
  font-size: .96rem;
  color: var(--bs-body-color);
  margin: 1.6rem 0;
}

/* Box autore */

.article-author {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1.25rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-secondary-bg);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.article-author-avatar {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f172a, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e5e7eb;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  box-sizing: border-box;
}

.article-author h3 {
  font-size: .98rem;
  margin-bottom: .15rem;
  color: var(--bs-body-color);
}

.article-author p {
  font-size: .86rem;
  margin-bottom: .15rem;
  color: var(--bs-secondary-color);
}

/* Blocchi annuncio */

.article-ad {
  margin: 2rem 0;
  text-align: center;
}

.article-ad-top {
  margin-top: 1.25rem;
}

.article-ad-inline {
  margin: 2.5rem 0;
}

.article-ad-placeholder {
  border-radius: 1rem;
  border: 1px dashed var(--bs-border-color);
  padding: 1rem;
  font-size: .85rem;
  color: var(--bs-secondary-color);
  background: var(--bs-secondary-bg);
}

/* Galleria + autore box extra */

.article-gallery p {
  color: var(--bs-body-color);
}

.article-author-box {
  background-color: var(--bs-body-bg);
}

.article-author-box p {
  max-width: 48rem;
}
