:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-strong: #eaf1f8;
  --ink: #0c1b2a;
  --muted: #647486;
  --soft: #8795a5;
  --card: #ffffff;
  --card-tint: #f9fbfd;
  --line: rgba(12, 27, 42, .12);
  --line-strong: rgba(12, 27, 42, .2);
  --blue: #1664d9;
  --blue-dark: #0a3f8e;
  --cyan: #37b7d7;
  --gold: #d7a83d;
  --red: #d94141;
  --green: #21845d;
  --hero: #09213f;
  --shadow: 0 24px 70px rgba(20, 38, 58, .14);
  --soft-shadow: 0 12px 36px rgba(20, 38, 58, .08);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --content: 1180px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(246, 248, 251, 0) 360px),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(22, 100, 217, .08) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(22, 100, 217, .06) 0 1px, transparent 1px 100%);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .8), transparent 520px);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

:focus-visible {
  outline: 3px solid rgba(55, 183, 215, .72);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  transform: translateY(-140%);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: 100%;
  max-width: calc(var(--content) + 32px);
  margin: 0 auto;
  padding: 0 16px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px 0 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 44px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(22, 100, 217, .22);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 14px;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.topnav {
  display: inline-flex;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 10px 28px rgba(20, 38, 58, .05);
}

.topnav a {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.topnav a:hover {
  background: var(--card-tint);
  color: var(--blue-dark);
}

.status-pill {
  justify-self: end;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 10px 26px rgba(20, 38, 58, .05);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) 380px;
  gap: 26px;
  min-height: 500px;
  padding: clamp(26px, 4vw, 48px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    linear-gradient(100deg, rgba(5, 20, 42, .96) 0%, rgba(9, 35, 72, .88) 46%, rgba(9, 35, 72, .18) 100%),
    url("hero-diritti.jpg") 62% center / cover no-repeat;
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -34%;
  z-index: 0;
  pointer-events: none;
  background: conic-gradient(
    from 210deg at 60% 52%,
    transparent 0deg,
    transparent 66deg,
    rgba(55, 183, 215, .18) 75deg,
    transparent 86deg,
    transparent 360deg
  );
  mix-blend-mode: screen;
  opacity: .55;
  transform-origin: 60% 52%;
  animation: radarSweep 12s linear infinite;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 0;
  height: 42%;
  background: linear-gradient(0deg, rgba(5, 20, 42, .38), transparent);
  pointer-events: none;
}

.hero-copy,
.hero-panel {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero-copy {
  align-self: end;
  max-width: 720px;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(44px, 7vw, 86px);
  line-height: .93;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-copy > p:not(.hero-label) {
  max-width: 660px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, .88);
  font-size: clamp(17px, 1.75vw, 21px);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.reset {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(22, 100, 217, .2);
  background: #eef5ff;
  color: var(--blue-dark);
}

.hero-panel {
  align-self: end;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius-lg);
  background: rgba(5, 20, 42, .64);
  backdrop-filter: blur(18px);
}

.panel-title,
.side-title,
.section-head,
.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.hero-panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.live-dot {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.live-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #42dc8f;
  box-shadow: 0 0 0 5px rgba(66, 220, 143, .16);
  animation: livePulse 1.9s ease-out infinite;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.stats div {
  min-width: 0;
  padding: 13px 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .1);
}

.stats strong {
  display: block;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1;
}

.stats span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.hero-panel p {
  margin: 15px 0 0;
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
  line-height: 1.5;
}

.ticker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 16px 0;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--hero);
  color: #fff;
  box-shadow: 0 14px 34px rgba(9, 33, 63, .18);
}

.ticker strong {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--red);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.ticker-window {
  min-width: 0;
  overflow: hidden;
}

#tickerTrack {
  display: flex;
  gap: 34px;
  width: max-content;
  min-width: 100%;
  white-space: nowrap;
  color: rgba(255, 255, 255, .86);
  font-size: 14px;
  animation: tickerMove 46s linear infinite;
}

#tickerTrack a {
  color: rgba(255, 255, 255, .92);
}

.ticker:hover #tickerTrack {
  animation-play-state: paused;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(150px, .72fr)) 92px;
  gap: 10px;
  margin: 0 0 14px;
}

.control-group {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 10px 26px rgba(20, 38, 58, .05);
}

.control-group label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  font-size: 14px;
  font-weight: 650;
}

input::placeholder {
  color: var(--soft);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.section-head {
  align-items: end;
  margin: 28px 0 14px;
}

.section-head.compact {
  margin-top: 26px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.03;
  letter-spacing: 0;
}

.section-head p {
  margin: 7px 0 0;
  max-width: 650px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.48;
}

#resultMeta,
.side-title span {
  flex: none;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.featured,
.feed-card,
.side-panel,
.mini-stats {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--soft-shadow);
}

.featured {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  min-height: 260px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.featured-media,
.featured-media img,
.thumb,
.fallback-thumb,
.fallback-image {
  display: block;
  width: 100%;
  height: 100%;
}

.featured-media {
  min-height: 260px;
  background: var(--bg-strong);
}

.featured-media img,
.thumb {
  object-fit: cover;
}

.featured-body {
  min-width: 0;
  padding: clamp(20px, 3vw, 30px);
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.eyebrow span,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.eyebrow span {
  background: #eef5ff;
  color: var(--blue-dark);
  text-transform: uppercase;
}

.featured h3,
.feed-card h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.featured h3 {
  font-size: clamp(26px, 3.5vw, 39px);
}

.featured p,
.feed-card p,
.side-panel p,
.related {
  color: var(--muted);
  line-height: 1.58;
}

.featured p {
  margin: 14px 0 0;
  font-size: 16px;
}

.related {
  margin-top: 13px;
  padding: 11px 12px;
  border: 1px solid rgba(22, 100, 217, .12);
  border-radius: var(--radius);
  background: #f2f7ff;
  font-size: 14px;
}

.read-more {
  display: inline-flex;
  margin-top: 15px;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 950;
}

.read-more::after {
  content: ">";
  margin-left: 7px;
}

.feed {
  display: grid;
  gap: 12px;
}

.feed-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-lg);
}

.feed-card:hover {
  border-color: rgba(22, 100, 217, .28);
  box-shadow: 0 16px 38px rgba(20, 38, 58, .1);
}

.thumb,
.fallback-thumb {
  height: 118px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-strong);
}

.feed-card h3 {
  font-size: clamp(19px, 2vw, 23px);
}

.feed-card p {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 14px;
}

.meta {
  align-items: start;
  margin-bottom: 9px;
}

.source {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.date {
  flex: none;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-tint);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.tag {
  background: #edf5ff;
  color: var(--blue-dark);
  text-transform: capitalize;
}

.sidebar {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 14px;
}

.side-panel {
  padding: 16px;
  border-radius: var(--radius-lg);
}

.side-title h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.12;
}

.side-panel p {
  margin: 10px 0 0;
  font-size: 14px;
}

.radar-bars,
.source-coverage-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.radar-row {
  display: grid;
  grid-template-columns: minmax(88px, 112px) minmax(0, 1fr) 34px;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.radar-row:hover span:first-child,
.radar-row:focus-visible span:first-child {
  color: var(--blue-dark);
}

.radar-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radar-track {
  display: block;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.radar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.source-coverage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-tint);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.source-coverage-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-coverage-row b {
  color: var(--blue-dark);
}

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-lg);
}

.mini-stats span {
  display: inline-flex;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.empty-state {
  position: relative;
  overflow: hidden;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.featured > .empty-state,
.feed > .empty-state {
  min-height: 120px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, .78), transparent),
    linear-gradient(180deg, #fff, #f8fbff);
  background-size: 220px 100%, 100% 100%;
  background-position: -220px 0, 0 0;
  animation: skeletonShimmer 1.7s ease-in-out infinite;
}

.feed-warning {
  border: 1px solid rgba(215, 168, 61, .35);
  border-radius: var(--radius-lg);
  background: #fff8e5;
  color: #6d5b2c;
}

.fallback-image,
.fallback-thumb {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  text-align: center;
}

.fallback-image {
  min-height: 260px;
  font-size: 74px;
  font-weight: 950;
}

.fallback-thumb {
  grid-template-rows: auto auto;
  align-content: center;
  gap: 5px;
  padding: 10px;
}

.fallback-thumb strong {
  font-size: 30px;
  line-height: 1;
}

.fallback-thumb span {
  max-width: 100%;
  color: rgba(255, 255, 255, .86);
  font-size: 10px;
  font-weight: 950;
  line-height: 1.15;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.theme-vita-indipendente { background: linear-gradient(135deg, #0b607d, #37b7d7); }
.theme-accessibilita { background: linear-gradient(135deg, #1664d9, #37b7d7); }
.theme-diritti { background: linear-gradient(135deg, #0c1b2a, #d7a83d); }
.theme-europa { background: linear-gradient(135deg, #24458f, #4ca8f5); }
.theme-salute-mentale { background: linear-gradient(135deg, #2f695b, #8bcf8c); }
.theme-tecnologia,
.theme-ai { background: linear-gradient(135deg, #29406e, #7e9cff); }
.theme-sport { background: linear-gradient(135deg, #0d7a4f, #d7a83d); }
.theme-lavoro { background: linear-gradient(135deg, #17405c, #5abf90); }
.theme-scuola { background: linear-gradient(135deg, #7a5012, #f0b74d); }
.theme-welfare { background: linear-gradient(135deg, #5a4168, #d77fb3); }
.theme-donne { background: linear-gradient(135deg, #7d2457, #f08bc3); }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin: 34px 0 38px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

@keyframes tickerMove {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

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

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(66, 220, 143, .34); }
  70% { box-shadow: 0 0 0 9px rgba(66, 220, 143, 0); }
  100% { box-shadow: 0 0 0 0 rgba(66, 220, 143, 0); }
}

@keyframes skeletonShimmer {
  to { background-position: calc(100% + 220px) 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 1060px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    display: none;
  }

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    background-position: center;
  }

  .hero-panel {
    max-width: 520px;
  }

  .sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-stats {
    grid-column: 1 / -1;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 0 10px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 12px;
  }

  .status-pill {
    justify-self: start;
  }

  .hero {
    padding: 24px 18px;
    border-radius: var(--radius-lg);
    background:
      linear-gradient(180deg, rgba(5, 20, 42, .96), rgba(9, 35, 72, .72)),
      url("hero-diritti.jpg") center / cover no-repeat;
  }

  .hero h1 {
    max-width: 9ch;
    font-size: 40px;
    line-height: .98;
  }

  .hero-copy > p:not(.hero-label) {
    max-width: 30ch;
    font-size: 16px;
  }

  .ticker,
  .section-head,
  .meta,
  footer {
    align-items: stretch;
  }

  .section-head,
  footer {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stats div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: baseline;
    padding: 11px 12px;
  }

  .stats strong {
    font-size: 25px;
  }

  .stats span {
    margin-top: 0;
    font-size: 10px;
  }

  .hero-panel {
    overflow: hidden;
  }

  .panel-title {
    align-items: flex-start;
  }

  .ticker {
    grid-template-columns: 1fr;
  }

  .controls,
  .sidebar,
  .featured,
  .feed-card {
    grid-template-columns: 1fr;
  }

  .control-group {
    padding: 9px;
  }

  .section-head {
    gap: 9px;
    margin-top: 22px;
  }

  .section-head h2 {
    font-size: 30px;
  }

  #resultMeta {
    width: fit-content;
  }

  .featured-media {
    min-height: 188px;
  }

  .featured-body {
    padding: 18px;
  }

  .featured h3 {
    font-size: 25px;
  }

  .thumb,
  .fallback-thumb {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 430px) {
  .page-shell {
    padding: 0 8px;
  }

  .brand {
    align-items: flex-start;
  }

  .hero {
    padding: 20px 16px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero-copy > p:not(.hero-label) {
    max-width: 26ch;
    font-size: 15px;
  }


  .hero-panel,
  .side-panel,
  .featured,
  .feed-card,
  .mini-stats {
    border-radius: var(--radius);
  }

  .feed-card {
    padding: 10px;
  }

  .radar-row {
    grid-template-columns: minmax(72px, 92px) minmax(0, 1fr) 28px;
  }
}
