@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --accent: #e30613;       /* rosso da portale news, tipo Repubblica */
  --accent-dark: #ff3b30;  /* variante più chiara del rosso, per leggibilità su sfondo scuro */
  --ink: #f2f2f2;          /* testo principale (chiaro, su sfondo scuro) */
  --muted: #a3a3a3;
  --bg: #121212;           /* sfondo pagina */
  --bg-elevated: #1c1c1c;  /* card, box, superfici "sollevate" */
  --bg-elevated-2: #262626; /* superfici ancora più sollevate (form, hover) */
  --border-color: #333333;
  --card-radius: 0.75rem;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { text-decoration: none; }

/* ================= TEMA SCURO: superfici Bootstrap ================= */
.navbar { background: #000 !important; border-bottom: 1px solid var(--border-color); }

.card, .article-card, .ad-box, .custom-tile, .hero-card,
.pagination .page-link, .empty-state, .alert, .tab-content, .nav-tabs {
  background-color: var(--bg-elevated);
  color: var(--ink);
  border-color: var(--border-color) !important;
}

.text-muted { color: var(--muted) !important; }
.text-white-50 { color: rgba(255,255,255,.65) !important; }

.pagination .page-link { color: var(--ink); }
.pagination .page-item.disabled .page-link { background-color: var(--bg-elevated); color: var(--muted); }
.pagination .page-link:hover { background-color: var(--bg-elevated-2); color: var(--ink); }

.form-control, .form-select, textarea {
  background-color: var(--bg-elevated-2) !important;
  color: var(--ink) !important;
  border-color: var(--border-color) !important;
}
.form-control::placeholder { color: var(--muted); }
.form-label { color: var(--muted); }

.nav-tabs .nav-link { color: var(--muted); border-color: transparent; }
.nav-tabs .nav-link.active { background-color: var(--bg-elevated); color: var(--ink); border-color: var(--border-color) var(--border-color) var(--bg-elevated); }

.bg-light { background-color: var(--bg-elevated) !important; }
.bg-white { background-color: var(--bg-elevated) !important; }

.edition-switcher { display: flex; gap: 4px; }
.edition-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 1.1rem;
  border-radius: 4px;
  opacity: 0.55;
  filter: grayscale(40%);
  transition: opacity .15s ease, filter .15s ease, background .15s ease;
  text-decoration: none;
}
.edition-flag:hover { opacity: 0.85; filter: grayscale(0%); }
.edition-flag.active {
  opacity: 1;
  filter: grayscale(0%);
  background: rgba(255,255,255,.15);
}

.custom-tile {
  background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
  border: 1px solid var(--border-color);
}
.custom-tile img { max-height: 220px; width: 100%; object-fit: cover; }

/* ================= NAVBAR ================= */
.topbar {
  background: #000;
  color: #fff;
  font-size: 0.78rem;
}
.topbar a { color: rgba(255,255,255,.85); }
.topbar a:hover { color: #fff; }

.navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  padding-top: 0;
  padding-bottom: 0;
}
.navbar-brand span { color: var(--accent); }
.navbar-logo {
  height: 40px;
  width: auto;
  display: block;
}
@media (max-width: 576px) {
  .navbar-logo { height: 32px; }
}

.navbar .nav-link {
  font-weight: 600;
  font-size: 0.92rem;
  color: rgba(255,255,255,.85) !important;
  position: relative;
}
.navbar .nav-link:hover { color: #fff !important; }
.navbar .nav-link.active::after {
  content: "";
  position: absolute;
  left: 0.5rem; right: 0.5rem; bottom: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ================= TICKER ================= */
.ticker-bar {
  background: var(--accent);
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  align-items: stretch;
}
.ticker-flag {
  flex: none;
  background: var(--accent-dark);
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
}
.ticker-scroll { overflow: hidden; flex: 1; }
.ticker-track {
  display: inline-block;
  padding-left: 100%;
  animation: scroll-ticker 55s linear infinite;
  font-size: 0.85rem;
  font-weight: 500;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.ticker-track a { color: #fff; margin-right: 3rem; }
.ticker-track a:hover { text-decoration: underline; }
@keyframes scroll-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; padding-left: 0; }
}

/* ================= HERO (testata in evidenza) ================= */
.hero-card { display: block; }
.hero-img-wrap {
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: #2a2a2a;
}
.hero-img-wrap img,
.hero-img-wrap .placeholder-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,.35) 60%, transparent);
  color: #fff;
}
.hero-title {
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
}
@media (max-width: 576px) {
  .hero-img-wrap { aspect-ratio: 4 / 3; }
}

/* ================= SECTION HEADING ================= */
.section-heading .bar {
  width: 5px;
  height: 1.4rem;
  background: var(--accent);
  border-radius: 3px;
  display: inline-block;
}
.section-heading h2 { font-size: 1.3rem; font-weight: 800; }
.section-more { color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.section-more:hover { color: var(--accent-dark); }

/* ================= ARTICLE CARDS ================= */
.article-card { transition: transform .15s ease, box-shadow .15s ease; border-radius: var(--card-radius); }
.article-card:hover { transform: translateY(-3px); box-shadow: 0 0.75rem 1.5rem rgba(0,0,0,.1) !important; }

.article-card .thumb-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #2a2a2a;
  border-top-left-radius: var(--card-radius);
  border-top-right-radius: var(--card-radius);
}
.article-card.article-card-lead .thumb-wrap { aspect-ratio: 16 / 10; }
.article-card .thumb-wrap img,
.article-card .thumb-wrap .placeholder-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
}
.article-card .placeholder-thumb {
  background: repeating-linear-gradient(45deg, #2a2a2a, #2a2a2a 10px, #333333 10px, #333333 20px);
}

.article-card .card-meta {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.article-card h3 {
  font-weight: 700;
  line-height: 1.3;
}
.article-card p.excerpt {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.article-card .read-more {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
}
.article-card .read-more:hover { color: var(--accent-dark); }

/* ================= SPAZI PUBBLICITARI (Google Ads) ================= */
.ad-box {
  /*border: 2px dashed var(--border-color);
  border-radius: var(--card-radius);*/
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /*padding: 1.5rem 1rem;*/
}
.ad-box .ad-label {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--muted);
}
.ad-box .ad-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.ad-box.ad-box-live { /*border-style: solid;*/ padding: 0.75rem; }
.ad-box.ad-box-live .adsbygoogle { width: 100%; }

.ad-box.ad-box-square {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 494px;
  margin: 0.5rem auto;
  min-height: 0;
}

/* ================= FOOTER ================= */
.site-footer {
  background: #000;
  color: rgba(255,255,255,.7);
  font-size: 0.85rem;
}

.empty-state {
  border: 1px dashed var(--border-color);
  border-radius: var(--card-radius);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
