/* RC88 · Tema scuro globale.
   Caricato per ultimo: armonizza Home, schede, dialoghi e sezioni interne
   senza modificare immagini, video o i colori editoriali dei banner. */

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f1e8;
  --muted: #b8b7b2;
  --paper: #0f1319;
  --paper-2: #171d25;
  --white: #202832;
  --line: #35404d;
  --coral: #ff927b;
  --coral-dark: #ffb7a5;
  --accent: #f2c463;
  --accent-soft: #3a2d17;
  --accent-strong: #ffd77c;
  --gold: #f2c463;
  --card-bg: #1a222c;
  --chip-bg: #202a35;
  --header-bg: rgba(15, 19, 25, .92);
  --shadow: 0 18px 50px rgba(0, 0, 0, .42);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, .28);
}

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell {
  background: var(--paper) !important;
  color: var(--ink);
}

html[data-theme="dark"] body {
  background-image:
    radial-gradient(1000px 430px at 8% -10%, rgba(255, 146, 123, .09), transparent 62%),
    radial-gradient(900px 420px at 94% 0%, rgba(130, 170, 202, .08), transparent 58%);
}

html[data-theme="dark"] .site-header {
  background: var(--header-bg) !important;
  border-color: var(--line) !important;
  color: var(--ink);
}

html[data-theme="dark"] .brand strong,
html[data-theme="dark"] .brand-lockup strong,
html[data-theme="dark"] .results-toolbar h2,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] strong,
html[data-theme="dark"] label {
  color: var(--ink);
}

html[data-theme="dark"] .brand em,
html[data-theme="dark"] .brand-lockup em,
html[data-theme="dark"] .section-count,
html[data-theme="dark"] .view-note,
html[data-theme="dark"] .collections-hint,
html[data-theme="dark"] .map-panel-note,
html[data-theme="dark"] .map-panel-count,
html[data-theme="dark"] .empty p,
html[data-theme="dark"] .card-body p,
html[data-theme="dark"] .card-lead,
html[data-theme="dark"] .wiki-section p,
html[data-theme="dark"] .wiki-section ul,
html[data-theme="dark"] .travel-disclaimer {
  color: var(--muted) !important;
}

html[data-theme="dark"] .app-open-button,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .tool-button,
html[data-theme="dark"] .language-picker,
html[data-theme="dark"] .saved-toggle,
html[data-theme="dark"] .assistant-toggle,
html[data-theme="dark"] .reset-button,
html[data-theme="dark"] #itineraryButton,
html[data-theme="dark"] #mapToggle,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .button-soft,
html[data-theme="dark"] .button-dark {
  border-color: var(--line) !important;
  background: var(--chip-bg) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .search-panel,
html[data-theme="dark"] .collections-panel,
html[data-theme="dark"] #mapPanel,
html[data-theme="dark"] .editorial-note,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .place-card,
html[data-theme="dark"] .fact-tile,
html[data-theme="dark"] .overview-tile,
html[data-theme="dark"] .wiki-panel,
html[data-theme="dark"] .wiki-item,
html[data-theme="dark"] .event-summary,
html[data-theme="dark"] .travel-link,
html[data-theme="dark"] .story-grid > div,
html[data-theme="dark"] .section-card,
html[data-theme="dark"] .home-box,
html[data-theme="dark"] .home-card {
  background: var(--card-bg) !important;
  border-color: var(--line) !important;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

html[data-theme="dark"] .search-field,
html[data-theme="dark"] .select-field,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border-color: var(--line) !important;
  background: #111820 !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #8e969f;
}

html[data-theme="dark"] select option {
  background: #111820;
  color: var(--ink);
}

html[data-theme="dark"] .button-primary,
html[data-theme="dark"] .chip.is-active,
html[data-theme="dark"] .saved-toggle.active,
html[data-theme="dark"] .assistant-toggle.active,
html[data-theme="dark"] #mapToggle.active,
html[data-theme="dark"] #itineraryButton.active {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: #1a1711 !important;
}

html[data-theme="dark"] .button-primary:hover,
html[data-theme="dark"] .chip.is-active:hover {
  background: var(--accent-strong) !important;
  color: #17130d !important;
}

html[data-theme="dark"] .card-body,
html[data-theme="dark"] .detail-content,
html[data-theme="dark"] .overview-tile p,
html[data-theme="dark"] .wiki-panel p,
html[data-theme="dark"] .fact-tile small,
html[data-theme="dark"] .fact-tile strong,
html[data-theme="dark"] .overview-source,
html[data-theme="dark"] .fact-tile a,
html[data-theme="dark"] .wiki-original-link {
  color: var(--ink);
}

html[data-theme="dark"] .place-kind,
html[data-theme="dark"] .save-button {
  background: rgba(10, 14, 19, .78) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, .25) !important;
}

html[data-theme="dark"] .fact-tile-icon,
html[data-theme="dark"] .overview-icon,
html[data-theme="dark"] .wiki-panel-icon {
  background: #554421 !important;
  color: #ffe09a !important;
}

html[data-theme="dark"] .map-frame,
html[data-theme="dark"] .results-map {
  background: #111820 !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] #detailDialog,
html[data-theme="dark"] .assistant-dialog,
html[data-theme="dark"] .embed-dialog,
html[data-theme="dark"] #itineraryDialog,
html[data-theme="dark"] .admin-access-dialog,
html[data-theme="dark"] .admin-export-dialog {
  background: var(--paper-2) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] .dialog-close,
html[data-theme="dark"] .assistant-close,
html[data-theme="dark"] .modal-close {
  background: #26313d !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] .detail-hero-copy,
html[data-theme="dark"] .detail-hero-copy h2 {
  color: #fff !important;
}

html[data-theme="dark"] .site-footer,
html[data-theme="dark"] footer,
html[data-theme="dark"] .site-footer-inner,
html[data-theme="dark"] .site-footer-bottom {
  background: #0b0f14 !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] .site-footer p,
html[data-theme="dark"] .site-footer span,
html[data-theme="dark"] .site-footer label {
  color: var(--muted);
}

/* Tutte le pagine/sezioni che si aprono sopra la Home partono dallo stesso fondo. */
html[data-theme="dark"] section[id$="Page"],
html[data-theme="dark"] section[id$="page"],
html[data-theme="dark"] main[class*="page"],
html[data-theme="dark"] .content-section,
html[data-theme="dark"] .culture-compass,
html[data-theme="dark"] .culture-section,
html[data-theme="dark"] .home-section,
html[data-theme="dark"] .section-band {
  background-color: var(--paper) !important;
  color: var(--ink);
}

html[data-theme="dark"] .culture-compass,
html[data-theme="dark"] .culture-compass-inner,
html[data-theme="dark"] .home-boxes,
html[data-theme="dark"] .home-results,
html[data-theme="dark"] .home-explore,
html[data-theme="dark"] .home-network {
  color: var(--ink);
}

html[data-theme="dark"] .culture-compass h2,
html[data-theme="dark"] .culture-compass h3,
html[data-theme="dark"] .home-boxes h2,
html[data-theme="dark"] .home-boxes h3,
html[data-theme="dark"] .home-explore h2,
html[data-theme="dark"] .home-explore h3 {
  color: var(--ink) !important;
}

html[data-theme="dark"] .section-heading,
html[data-theme="dark"] .section-heading-inline,
html[data-theme="dark"] .results-toolbar,
html[data-theme="dark"] .browse-tools {
  color: var(--ink);
}

html[data-theme="dark"] :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline-color: var(--accent) !important;
}

html[data-theme="dark"] .home-arte-card,
html[data-theme="dark"] .arte-home-banner {
  background: #151b23 !important;
  color: #fff !important;
  border-color: rgba(242, 196, 99, .58) !important;
}

html[data-theme="dark"] .home-arte-card-title,
html[data-theme="dark"] .home-arte-card-text,
html[data-theme="dark"] .arte-home-title {
  color: #fff !important;
}

html[data-theme="dark"] .home-arte-card-kicker,
html[data-theme="dark"] .arte-home-arrow {
  color: #ffd77c !important;
}

html[data-theme="dark"] .live-section,
html[data-theme="dark"] .live-player-frame,
html[data-theme="dark"] .live-player-video {
  background-color: #080b0f !important;
}

@media (max-width: 700px) {
  html[data-theme="dark"] .site-header,
  html[data-theme="dark"] .search-panel,
  html[data-theme="dark"] .collections-panel {
    background: #11161d !important;
  }
}
