/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --blu: #1b3a4b;
  --blu-light: #2c5f7a;
  --oro: #c49a3c;
  --oro-light: #e8c96d;
  --carta: #f7f3ec;
  --carta-dark: #ede8df;
  --testo: #2d2d2d;
  --testo-soft: #5a5a5a;
  --bordo: #d5cfc4;
  --verde: #1e5c3a;
  --rosso: #b03a2e;
  --grigio: #4a4a4a;
  --bianco: #ffffff;
  --ombra: 0 2px 12px rgba(27, 58, 75, 0.12);
  --ombra-lg: 0 8px 32px rgba(27, 58, 75, 0.18);
  --r: 8px;
  --r-lg: 14px;
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
}
body {
  font-family: "Inter", sans-serif;
  background: var(--carta);
  color: var(--testo);
  min-height: 100vh;
}
h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  font-family: "Inter", sans-serif;
  border: none;
}
input,
select,
textarea {
  font-family: "Inter", sans-serif;
}

/* ── Accessibilità ───────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--bianco);
  color: var(--blu);
  font-weight: 600;
  border-radius: var(--r);
  box-shadow: var(--ombra-lg);
}
.skip-link:focus {
  top: 12px;
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--oro);
  outline-offset: 2px;
}
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── View Manager ────────────────────────────────────────── */

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--blu);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--bianco);
}
.navbar-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--oro);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.navbar-brand .brand-name {
  font-family: "Playfair Display", serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.navbar-brand .brand-sub {
  font-size: 0.65rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  margin-top: -2px;
}
.navbar-nav {
  display: flex;
  gap: 4px;
}
.navbar-nav button {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 0.875rem;
  transition: all 0.2s;
}
.navbar-nav button:hover,
.navbar-nav button.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--bianco);
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-login {
  background: var(--oro);
  color: var(--blu) !important;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--r);
  font-size: 0.875rem;
  transition: background 0.2s;
}
.btn-login:hover {
  background: var(--oro-light);
}

/* ── HOME VIEW ───────────────────────────────────────────── */

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--blu) 0%, #2c5f7a 60%, #1e4d62 100%);
  padding: 80px 32px 96px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C49A3C' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-badge {
  display: inline-block;
  background: rgba(196, 154, 60, 0.2);
  border: 1px solid rgba(196, 154, 60, 0.4);
  color: var(--oro-light);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--bianco);
  line-height: 1.2;
  max-width: 700px;
  margin: 0 auto 16px;
}
.hero h1 span {
  color: var(--oro-light);
}
.hero-sub {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  font-weight: 300;
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

/* Search Card */
.search-card {
  background: var(--bianco);
  border-radius: var(--r-lg);
  box-shadow: var(--ombra-lg);
  max-width: 820px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.search-tabs {
  display: flex;
  border-bottom: 2px solid var(--carta-dark);
}
.search-tab {
  flex: 1;
  padding: 14px 8px;
  background: var(--carta);
  color: var(--testo-soft);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.2s;
  border-right: 1px solid var(--bordo);
  text-align: center;
}
.search-tab:last-child {
  border-right: none;
}
.search-tab .tab-icon {
  font-size: 1.1rem;
  display: block;
  margin-bottom: 3px;
}
.search-tab:hover {
  background: var(--carta-dark);
  color: var(--blu);
}
.search-tab.active {
  background: var(--bianco);
  color: var(--blu);
  font-weight: 600;
  border-bottom: 2px solid var(--blu);
  margin-bottom: -2px;
}

.search-panel {
  display: none;
  padding: 28px 32px 32px;
}
.search-panel.active:not([hidden]) {
  display: block;
}
.search-panel[hidden] {
  display: none !important;
}

/* Maschera 1 – Ricerca Semplice */
.simple-search-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.search-input-wrap {
  flex: 1;
  position: relative;
}
.search-input-wrap .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--grigio);
}
.search-input-wrap input {
  width: 100%;
  padding: 14px 14px 14px 42px;
  border: 1.5px solid var(--bordo);
  border-radius: var(--r);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-input-wrap input:focus {
  border-color: var(--blu);
}
.search-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--grigio);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.search-hint span {
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  white-space: nowrap;
}
.btn-cerca {
  background: var(--blu);
  color: var(--bianco);
  padding: 14px 28px;
  border-radius: var(--r);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-cerca:hover {
  background: var(--blu-light);
}

/* Maschera 2 */
.form-grid {
  display: grid;
  gap: 16px;
}
.form-grid.col2 {
  grid-template-columns: 1fr 1fr;
}
.form-grid.col3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.form-group label,
fieldset legend {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--testo-soft);
  margin-bottom: 6px;
}
fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}
fieldset legend {
  padding: 0;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--bordo);
  border-radius: var(--r);
  font-size: 0.9rem;
  outline: none;
  background: var(--bianco);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--blu);
}
.sentiment-group {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}
.sentiment-btn {
  flex: 1;
  padding: 9px;
  border: 1.5px solid var(--bordo);
  border-radius: var(--r);
  background: var(--bianco);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
  text-align: center;
}
.sentiment-btn:hover {
  border-color: var(--blu);
  color: var(--blu);
}
.sentiment-btn.pos.sel {
  background: #e8f5ed;
  border-color: var(--verde);
  color: var(--verde);
}
.sentiment-btn.neg.sel {
  background: #fceae8;
  border-color: var(--rosso);
  color: var(--rosso);
}
.sentiment-btn.neu.sel {
  background: #eef2f5;
  border-color: var(--blu);
  color: var(--blu);
}
.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.btn-reset {
  background: transparent;
  border: 1.5px solid var(--bordo);
  padding: 10px 20px;
  border-radius: var(--r);
  font-size: 0.875rem;
  color: var(--testo-soft);
  transition: all 0.2s;
}
.btn-reset:hover {
  border-color: var(--blu);
  color: var(--blu);
}

/* Maschera 3 – Entità */
.entity-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.entity-tab {
  padding: 8px 18px;
  border: 1.5px solid var(--bordo);
  border-radius: 20px;
  background: var(--bianco);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
  color: var(--testo-soft);
}
.entity-tab.active {
  background: var(--blu);
  border-color: var(--blu);
  color: var(--bianco);
}
.entity-panel {
  display: none;
}
.entity-panel.active:not([hidden]) {
  display: block;
}
.entity-panel[hidden] {
  display: none !important;
}
.date-range-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--testo-soft);
  margin-bottom: 6px;
}
.date-range-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.date-range-row span {
  color: var(--grigio);
  font-size: 0.85rem;
}
.toggle-label-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.verified-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bordo);
  border-radius: 22px;
  transition: background 0.2s;
  cursor: pointer;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider {
  background: var(--blu);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}
.toggle-label {
  font-size: 0.82rem;
  color: var(--testo-soft);
}

/* Stats strip */
.stats-strip {
  background: var(--carta-dark);
  border-top: 1px solid var(--bordo);
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 20px 32px;
}
.stat-item {
  text-align: center;
}
.stat-num {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blu);
}
.stat-lbl {
  font-size: 0.75rem;
  color: var(--grigio);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Contenuto pagine testuali (home, chi siamo) */
.home-content,
.chisiamo-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 32px 80px;
}

.text-lead {
  font-size: 0.97rem;
  line-height: 1.8;
  color: var(--testo);
  margin-bottom: 16px;
}
.text-lead--spaced {
  margin-bottom: 20px;
}
.text-lead--soft {
  color: var(--testo-soft);
  margin-bottom: 28px;
}
.text-intro {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 28px;
}
.text-body {
  font-size: 0.9rem;
  line-height: 1.8;
}
.text-footnote {
  font-size: 0.9rem;
  color: var(--testo-soft);
  line-height: 1.7;
}
.text-caption {
  font-size: 0.85rem;
  color: var(--testo-soft);
  line-height: 1.8;
}
.text-hint {
  font-size: 0.78rem;
  color: var(--grigio);
  margin-top: 8px;
}
.link-accent {
  color: var(--blu-light);
  font-weight: 600;
  text-decoration: underline;
}
.date-range-row input {
  flex: 1;
}
.section-title {
  font-size: 1.6rem;
  color: var(--blu);
  margin-bottom: 8px;
}
.section-sub {
  color: var(--testo-soft);
  font-size: 0.9rem;
  margin-bottom: 32px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--bianco);
  border: 1px solid var(--bordo);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: box-shadow 0.2s;
}
.feature-card:hover {
  box-shadow: var(--ombra);
}
.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--carta);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.feature-card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 0.85rem;
  color: var(--testo-soft);
  line-height: 1.6;
}

/* ── RESULTS VIEW ────────────────────────────────────────── */
.results-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  min-height: calc(100vh - 64px);
  transition: grid-template-columns 0.25s ease;
}
.results-layout.sidebar-hidden {
  grid-template-columns: 0px 1fr;
}

.sidebar-left {
  background: var(--bianco);
  border-right: 1px solid var(--bordo);
  padding: 24px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: padding 0.25s ease;
}
.results-layout.sidebar-hidden .sidebar-left {
  padding: 0;
  border-right: none;
}
.results-layout.sidebar-hidden .sidebar-left > * {
  display: none;
}

.sidebar-toggle {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--bianco);
  border: 1px solid var(--bordo);
  border-radius: var(--r);
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--testo-soft);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  z-index: 10;
  cursor: pointer;
  font-family: "Inter", sans-serif;
}
.sidebar-toggle:hover {
  border-color: var(--blu);
  color: var(--blu);
}
.results-center {
  position: relative;
}

.filter-section h5.filter-heading {
  margin-bottom: 10px;
}
.filter-toggle {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--testo);
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.filter-toggle .toggle-arrow {
  transition: transform 0.2s;
  display: inline-block;
  font-size: 0.7rem;
  color: var(--grigio);
}
.filter-section.collapsed .filter-toggle .toggle-arrow {
  transform: rotate(-90deg);
}
.filter-body {
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.filter-body--lingua {
  max-height: 120px;
}
.filter-body--fonte {
  max-height: 100px;
}
.filter-body--data {
  max-height: 220px;
}
.filter-body--artisti {
  max-height: 280px;
}
.filter-body--beni {
  max-height: 220px;
}
.filter-body--luoghi {
  max-height: 160px;
}
.filter-section.collapsed .filter-body {
  max-height: 0 !important;
}
.filter-body[hidden] {
  display: none !important;
}
.filter-form .form-group--flush {
  margin-bottom: 0;
}
.filter-form .divider {
  margin: 12px 0;
}
.filter-form .entity-toggle-row--spaced {
  margin-bottom: 10px;
}
.filter-form .toggle--compact {
  transform: scale(0.85);
  transform-origin: left;
}
.filter-form .toggle-label--small {
  font-size: 0.72rem;
  color: var(--grigio);
}
.filter-form .btn-cerca {
  margin-top: 16px;
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--grigio);
  margin-bottom: 16px;
}
.filter-section {
  margin-bottom: 24px;
}
.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.filter-item input[type="checkbox"] {
  accent-color: var(--blu);
}
.filter-item label {
  font-size: 0.83rem;
  color: var(--testo-soft);
  cursor: pointer;
  flex: 1;
}
.filter-item .count {
  font-size: 0.72rem;
  color: var(--grigio);
  background: var(--carta);
  padding: 1px 6px;
  border-radius: 10px;
}
.date-slider-label {
  font-size: 0.78rem;
  color: var(--grigio);
  margin-bottom: 6px;
}
.date-slider {
  width: 100%;
  accent-color: var(--blu);
  margin-bottom: 4px;
}
.date-slider-vals {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--grigio);
}
.date-inputs {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.date-inputs input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--bordo);
  border-radius: 6px;
  font-size: 0.75rem;
}

.results-center {
  padding: 24px 28px;
  background: var(--carta);
}
.results-inner {
  max-width: 900px;
  margin: 0 auto;
}
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.results-count {
  font-size: 0.9rem;
  color: var(--testo-soft);
}
.results-count strong {
  color: var(--testo);
  font-weight: 600;
}
.results-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.results-sort select {
  padding: 6px 10px;
  border: 1px solid var(--bordo);
  border-radius: var(--r);
  background: var(--bianco);
  font-size: 0.82rem;
}
.active-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-tag {
  background: var(--blu);
  color: var(--bianco);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.filter-tag .rm {
  cursor: pointer;
  opacity: 0.7;
}
.filter-tag .rm:hover {
  opacity: 1;
}

/* Result cards */
.result-card {
  background: var(--bianco);
  border: 1px solid var(--bordo);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 14px;
  cursor: pointer;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}
.result-card:hover {
  box-shadow: var(--ombra);
  border-color: #b8b0a4;
}
.result-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.result-source-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--grigio);
}
.source-badge {
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--testo-soft);
}
.sentiment-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}
.sentiment-badge.pos {
  background: #e8f5ed;
  color: var(--verde);
}
.sentiment-badge.neg {
  background: #fceae8;
  color: var(--rosso);
}
.sentiment-badge.neu {
  background: #eef2f5;
  color: #4a6578;
}
.result-title {
  font-family: "Playfair Display", serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--blu);
  margin-bottom: 8px;
  line-height: 1.35;
}
.result-abstract {
  font-size: 0.85rem;
  color: var(--testo-soft);
  line-height: 1.6;
  margin-bottom: 12px;
}
.entity-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.entity-tag {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}
.entity-tag.artista {
  background: #eef0ff;
  color: #3d4cb7;
}
.entity-tag.bene {
  background: #fff3e0;
  color: #9a5000;
}
.entity-tag.luogo {
  background: #f0f8f0;
  color: #2e7d52;
}

.entity-toggle-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--grigio);
  margin-bottom: 16px;
}
.entity-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--grigio);
  margin-bottom: 10px;
  margin-top: 16px;
}
.entity-section-title:first-of-type {
  margin-top: 0;
}
.entity-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
a.entity-list-item {
  text-decoration: none;
  color: inherit;
}
.entity-list-item input {
  accent-color: var(--blu);
}
.entity-list-item span {
  font-size: 0.8rem;
  color: var(--testo-soft);
  flex: 1;
}
.entity-list-item .ecount {
  font-size: 0.7rem;
  color: var(--grigio);
  background: var(--carta);
  padding: 1px 6px;
  border-radius: 8px;
}
.entity-divider {
  height: 1px;
  background: var(--bordo);
  margin: 16px 0;
}

/* ── ARTICLE VIEW ────────────────────────────────────────── */
.article-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}
.article-breadcrumb {
  font-size: 0.78rem;
  color: var(--grigio);
  margin-bottom: 20px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.article-breadcrumb a {
  color: var(--blu-light);
  cursor: pointer;
}
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
}
.article-left {
}
.article-header {
  margin-bottom: 24px;
}
.article-meta-top {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--grigio);
  margin-bottom: 14px;
}
.article-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--blu);
  line-height: 1.25;
  margin-bottom: 16px;
}
.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--bordo);
  border-bottom: 1px solid var(--bordo);
  margin-bottom: 20px;
}
.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blu);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bianco);
  font-size: 0.8rem;
  font-weight: 600;
}
.author-name {
  font-size: 0.88rem;
  font-weight: 600;
}
.author-role {
  font-size: 0.75rem;
  color: var(--grigio);
}
.article-abstract {
  background: var(--carta);
  border-left: 3px solid var(--oro);
  padding: 16px 20px;
  border-radius: 0 var(--r) var(--r) 0;
  margin-bottom: 24px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--testo-soft);
  font-style: italic;
}
.article-body {
  font-size: 0.93rem;
  line-height: 1.8;
  color: var(--testo);
}
.article-body p {
  margin-bottom: 16px;
}
.hl-artista {
  background: rgba(61, 76, 183, 0.12);
  border-radius: 3px;
  padding: 1px 3px;
  cursor: pointer;
  border-bottom: 1.5px solid #3d4cb7;
}
.hl-bene {
  background: rgba(154, 80, 0, 0.1);
  border-radius: 3px;
  padding: 1px 3px;
  cursor: pointer;
  border-bottom: 1.5px solid #9a5000;
}
.hl-luogo {
  background: rgba(46, 125, 82, 0.1);
  border-radius: 3px;
  padding: 1px 3px;
  cursor: pointer;
  border-bottom: 1.5px solid #2e7d52;
}
.hl-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.hl-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--testo-soft);
}
.hl-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.hl-dot.artista {
  background: rgba(61, 76, 183, 0.3);
  border: 1.5px solid #3d4cb7;
}
.hl-dot.bene {
  background: rgba(154, 80, 0, 0.2);
  border: 1.5px solid #9a5000;
}
.hl-dot.luogo {
  background: rgba(46, 125, 82, 0.2);
  border: 1.5px solid #2e7d52;
}

/* Right panel */
.article-right {
}
.info-card {
  background: var(--bianco);
  border: 1px solid var(--bordo);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.info-card-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--grigio);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--bordo);
  padding-bottom: 10px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 8px;
}
.info-key {
  font-size: 0.78rem;
  color: var(--grigio);
  font-weight: 500;
  flex-shrink: 0;
}
.info-val {
  font-size: 0.82rem;
  color: var(--testo);
  text-align: right;
}
.sentiment-large {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: var(--r);
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 600;
}
.sentiment-large.pos {
  background: #e8f5ed;
  color: var(--verde);
}
.sentiment-large.neg {
  background: #fceae8;
  color: var(--rosso);
}
.sentiment-large.neu {
  background: #eef2f5;
  color: #4a6578;
}
.entity-chip-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.extraction-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}
.extraction-badge.verified {
  background: #e8f5ed;
  color: var(--verde);
}
.extraction-badge.unverified {
  background: #fff8e1;
  color: #7a5800;
}

/* Related articles */
.related-section {
  margin-top: 40px;
}
.related-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blu);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.related-card {
  background: var(--bianco);
  border: 1px solid var(--bordo);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.related-card:hover {
  box-shadow: var(--ombra);
}
.related-card .r-source {
  font-size: 0.7rem;
  color: var(--grigio);
  margin-bottom: 6px;
}
.related-card .r-title {
  font-family: "Playfair Display", serif;
  font-size: 0.88rem;
  color: var(--blu);
  line-height: 1.35;
  margin-bottom: 8px;
}
.related-card .r-date {
  font-size: 0.72rem;
  color: var(--grigio);
}

/* ── Utility ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--bordo);
  margin: 32px 0;
}
.text-muted {
  color: var(--grigio);
}
.text-muted--sm {
  font-size: 0.9rem;
}
.text-empty {
  font-size: 0.8rem;
  color: var(--grigio);
}
.results-empty {
  color: var(--testo-soft);
  padding: 24px 0;
}
.results-empty a {
  color: var(--blu-light);
  text-decoration: underline;
}
.entity-cited-group {
  margin-bottom: 10px;
}
.entity-cited-group:last-child {
  margin-bottom: 0;
}
.related-grid--spaced {
  margin-bottom: 32px;
}
.related-title-note {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--grigio);
}
.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  background: #e8f5ed;
  color: var(--verde);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.badge-unverified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  background: #fff8e1;
  color: #7a5800;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  padding-bottom: 32px;
}
.page-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--bordo);
  border-radius: 8px;
  background: var(--bianco);
  font-size: 0.85rem;
  color: var(--testo-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  cursor: pointer;
}
.page-btn:hover {
  border-color: var(--blu);
  color: var(--blu);
}
.page-btn.active {
  background: var(--blu);
  border-color: var(--blu);
  color: var(--bianco);
}
.page-btn--meta {
  border: none;
  background: transparent;
  width: auto;
  min-width: 36px;
  padding: 0 8px;
}

/* Tooltip */
.entity-tooltip {
  position: fixed;
  left: var(--tooltip-left, 0);
  top: var(--tooltip-top, 0);
  z-index: 200;
  background: var(--blu);
  color: var(--bianco);
  padding: 8px 14px;
  border-radius: var(--r);
  font-size: 0.78rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  max-width: 200px;
  box-shadow: var(--ombra-lg);
}
.entity-tooltip.show {
  opacity: 1;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 49;
}
.sidebar-backdrop.show {
  display: block;
}

.results-layout:not(.sidebar-hidden) .results-header--with-toggle {
  padding-left: 90px;
}
.results-layout.sidebar-hidden .results-header--with-toggle {
  padding-left: 0;
}

/* Navbar links (Django) */
.navbar-nav a {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 0.875rem;
  transition: all 0.2s;
  display: inline-block;
}
.navbar-nav a:hover,
.navbar-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--bianco);
}

.search-tab {
  cursor: pointer;
  border: none;
  font-family: "Inter", sans-serif;
}
.entity-tab {
  cursor: pointer;
  font-family: "Inter", sans-serif;
}

.site-footer {
  background: var(--blu);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 20px 24px;
  font-size: 0.78rem;
}
.site-footer a {
  color: var(--oro-light);
  text-decoration: underline;
}

.chisiamo-content h1 {
  font-size: 1.9rem;
  color: var(--blu);
  margin-bottom: 8px;
}
.chisiamo-rule {
  height: 3px;
  width: 60px;
  background: var(--oro);
  border-radius: 2px;
  margin-bottom: 32px;
}
.chisiamo-card {
  background: var(--bianco);
  border: 1px solid var(--bordo);
  border-radius: var(--r-lg);
  padding: 28px;
  margin-bottom: 20px;
}
.chisiamo-card h3 {
  font-size: 1.05rem;
  color: var(--blu);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chisiamo-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}
.chisiamo-list li {
  font-size: 0.9rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--carta-dark);
}
.chisiamo-note {
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-left: 3px solid var(--oro);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 16px 20px;
  margin-bottom: 28px;
  font-size: 0.88rem;
  color: var(--testo-soft);
  line-height: 1.7;
}
.chisiamo-note strong {
  color: var(--testo);
}
.chisiamo-block {
  margin-bottom: 14px;
}
.chisiamo-block:last-child {
  margin-bottom: 0;
}
.chisiamo-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--grigio);
  margin-bottom: 6px;
}
.chisiamo-thanks p {
  margin-bottom: 8px;
}
.chisiamo-thanks p:last-child {
  margin-bottom: 0;
}

.normative-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.normative-card {
  background: var(--bianco);
  border: 1px solid var(--bordo);
  border-top: 3px solid var(--oro);
  border-radius: var(--r);
  padding: 16px 18px;
}
.normative-card .num {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--grigio);
  margin-bottom: 4px;
}
.normative-card .title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blu);
}
.normative-card-link {
  text-decoration: none;
  color: inherit;
}
.normative-count {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--testo-soft);
}
.normative-subsections {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.normative-subsections li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.normative-subsections a {
  font-size: 0.8rem;
  color: var(--testo);
  text-decoration: none;
}
.normative-subsections a:hover {
  text-decoration: underline;
}
.normative-subsections span {
  font-size: 0.76rem;
  color: var(--grigio);
}

.filter-form .form-group {
  margin-bottom: 12px;
}
.filter-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--testo-soft);
  margin-bottom: 6px;
}
.filter-form input,
.filter-form select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--bordo);
  border-radius: var(--r);
  font-size: 0.85rem;
}
.filter-form button:not(.filter-toggle) {
  width: 100%;
}

a.result-card {
  display: block;
  color: inherit;
}
a.related-card {
  display: block;
  color: inherit;
}

.pagination a.page-btn {
  text-decoration: none;
}
.pagination span.page-btn {
  cursor: default;
}

.article-body .hl-artista,
.article-body .hl-bene,
.article-body .hl-luogo {
  cursor: help;
}

@media (max-width: 720px) {
  .form-grid.col2,
  .form-grid.col3,
  .normative-grid,
  .chisiamo-list {
    grid-template-columns: 1fr;
  }
  .stats-strip {
    flex-wrap: wrap;
    gap: 24px;
  }
  .simple-search-row {
    flex-direction: column;
  }
  .simple-search-row .btn-cerca {
    width: 100%;
  }
  .search-panel {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Responsive tweaks */
@media (max-width: 960px) {
  .results-layout {
    grid-template-columns: 1fr !important;
  }
  .article-layout {
    grid-template-columns: 1fr;
  }
  .related-grid {
    grid-template-columns: 1fr 1fr;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-left {
    position: fixed;
    top: 64px;
    left: 0;
    width: 280px;
    height: calc(100vh - 64px);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    padding: 24px 20px;
    border-right: 1px solid var(--bordo);
  }
  .sidebar-left.mobile-open {
    transform: translateX(0);
  }
  .results-layout.sidebar-hidden .sidebar-left {
    padding: 24px 20px;
    border-right: 1px solid var(--bordo);
  }
  .results-layout.sidebar-hidden .sidebar-left > * {
    display: unset;
  }
  .sidebar-toggle {
    position: static;
    margin-bottom: 12px;
  }
  .results-layout:not(.sidebar-hidden) .results-header--with-toggle,
  .results-layout.sidebar-hidden .results-header--with-toggle {
    padding-left: 0 !important;
  }
}
