/* Dopo il nuovo riordino la ricerca accompagna l'ultimo filtro prima dei risultati. */
.routes-panel + .search-panel {
  margin-top: 24px;
  box-shadow: 0 14px 30px #3b302214;
}
.phase-c-highlight:empty { display: none; }

/* Dal player al viaggio: box editoriale e link pratici più raffinati. */
.cinema-story-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 15px;
  margin: 4px 0 26px;
  padding: 20px 21px;
  border: 1px solid #e6c56d;
  border-radius: 17px;
  background: linear-gradient(135deg, #fffaf0, #fff 72%);
  box-shadow: 0 12px 26px #7c5b1a12;
}
.detail-content .cinema-story-card { margin-top: 4px; }
.cinema-story-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #d99d29, #b86d27);
  font-size: 23px;
  box-shadow: 0 8px 16px #b86d2738;
}
.cinema-story-card h3 {
  margin: 2px 0 0;
  color: #49361d;
  font-family: Georgia, serif;
  font-size: clamp(21px, 3vw, 28px);
  font-weight: 500;
  letter-spacing: -.035em;
}
.cinema-story-card .eyebrow-small {
  margin: 0;
  color: #a36a20;
}
.cinema-story-copy {
  margin: 8px 0 0;
  color: #655943;
  font-size: 14px;
  line-height: 1.6;
}
.cinema-story-place-description {
  margin: 10px 0 0;
  color: #3f3527;
  font-family: Georgia, serif;
  font-size: 16px;
  line-height: 1.52;
}
.cinema-story-card .button {
  margin-top: 14px;
  min-height: 42px;
}
.cinema-travel-section {
  padding-top: 3px;
}
.cinema-travel-section .section-heading-inline {
  margin-bottom: 13px;
}
.cinema-travel-section .section-heading-inline .eyebrow-small {
  color: var(--coral-dark);
}
.cinema-travel-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.cinema-travel-section .practical-links {
  gap: 10px;
}
.cinema-travel-section .travel-link {
  min-height: 58px;
  border-radius: 13px;
  background: #fffdfb;
  box-shadow: 0 5px 13px #3b30220a;
}
.cinema-travel-section .travel-link.is-featured {
  color: #76511b;
  background: linear-gradient(135deg, #fff3cc, #fffaf0);
  border-color: #e6c56d;
}
.cinema-travel-section .travel-link-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: #f3e6c8;
}
.cinema-travel-section .travel-link b { color: #b87825; }
@media (max-width: 760px) {
  .cinema-story-card { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 17px 15px; }
  .cinema-story-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
}

/* Chiusura schede: controllo flottante, evidente e sempre raggiungibile durante lo scroll. */
.dialog-close {
  position: fixed;
  top: max(18px, calc(50% - min(46vh, 460px)));
  left: max(12px, calc(50% - 480px));
  right: auto;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 3px solid #ffd66a;
  border-radius: 50%;
  color: #fff;
  background: #202330;
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 26px #14120e66, 0 0 0 5px #2023301f;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.dialog-close:hover {
  color: #fff;
  background: var(--coral-dark);
  transform: scale(1.08);
  box-shadow: 0 12px 30px #14120e80, 0 0 0 6px #ef765e33;
}

.dialog-close:focus-visible {
  outline: 4px solid #ffd66a;
  outline-offset: 3px;
}

#itineraryDialog .dialog-close {
  left: max(12px, calc(50% - 380px));
}

@media (max-width: 960px) {
  .dialog-close,
  #itineraryDialog .dialog-close {
    top: 18px;
    left: max(12px, env(safe-area-inset-left));
  }
}

@media (prefers-reduced-motion: reduce) {
  .dialog-close { transition: none; }
}

/* Nell'embed la scheda del luogo occupa tutto il frame: la chiusura resta
   dentro il bordo sinistro, sopra il contenuto e sempre visibile durante lo scroll. */
html.is-cinema-embed #detailDialog .dialog-close {
  position: fixed !important;
  top: max(16px, env(safe-area-inset-top)) !important;
  left: max(12px, calc(env(safe-area-inset-left) + 8px)) !important;
  right: auto !important;
  z-index: 1000 !important;
  width: 58px;
  height: 58px;
  border: 3px solid #ffd66a;
  background: #202330;
  color: #fff;
  font-size: 38px;
  box-shadow: 0 10px 28px #14120e80, 0 0 0 5px #2023302b;
}

html.is-cinema-embed #detailDialog .dialog-close:hover {
  background: var(--coral-dark);
  transform: scale(1.08);
}

@media (max-width: 700px) {
  html.is-cinema-embed #detailDialog .dialog-close {
    top: max(12px, env(safe-area-inset-top)) !important;
    left: max(10px, calc(env(safe-area-inset-left) + 6px)) !important;
    width: 52px;
    height: 52px;
    font-size: 34px;
  }
}

/* Ripristino definitivo della chiusura delle schede luogo: il simbolo viene
   disegnato esplicitamente per evitare conflitti con reset e temi dei button. */
#detailDialog > .dialog-card > button.dialog-close,
html.is-embedded #detailDialog > .dialog-card > button.dialog-close {
  position: fixed !important;
  top: max(14px, env(safe-area-inset-top)) !important;
  left: max(12px, env(safe-area-inset-left)) !important;
  right: auto !important;
  z-index: 2147483647 !important;
  display: grid !important;
  place-items: center !important;
  width: 54px !important;
  height: 54px !important;
  min-width: 54px !important;
  min-height: 54px !important;
  padding: 0 !important;
  border: 3px solid #ffd66a !important;
  border-radius: 50% !important;
  background: #202330 !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
}

#detailDialog > .dialog-card > button.dialog-close::before,
html.is-embedded #detailDialog > .dialog-card > button.dialog-close::before {
  content: "×";
  display: block;
  color: #fff !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 38px !important;
  font-weight: 900;
  line-height: 48px;
  text-align: center;
}

@media (max-width: 700px) {
  #detailDialog > .dialog-card > button.dialog-close,
  html.is-embedded #detailDialog > .dialog-card > button.dialog-close {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
  }
  #detailDialog > .dialog-card > button.dialog-close::before,
  html.is-embedded #detailDialog > .dialog-card > button.dialog-close::before {
    font-size: 36px !important;
    line-height: 46px;
  }
}

/* Banner RC88 Home: stesso movimento morbido del banner Cinema, senza rotazione. */
.home-cinema-banner {
  position: relative;
  z-index: 2;
  flex: 0 1 690px;
  width: min(690px, 100%);
  max-width: 100%;
  min-width: 0;
  text-decoration: none;
}

.home-cinema-banner:hover {
  transform: translateY(-2px);
}

.home-cinema-banner:focus-visible {
  outline: 3px solid #ff0909;
  outline-offset: 4px;
}

.home-cinema-banner .hero-logo-mark {
  width: 100%;
  max-width: 690px;
  height: auto;
}

.hero-orbit {
  animation: none !important;
}

.hero-orbit span {
  animation: none !important;
}

/* Il wordmark occupa meno spazio nella composizione stretta, lasciando
   un margine netto al pannello giallo invece di farli sembrare sovrapposti. */
@media (max-width: 700px) {
  /* Il tema crea due glows circolari sull'hero: su mobile il banner deve
     restare pulito, senza alcun cerchio sotto il logo o le icone. */
  .hero::before,
  .hero::after {
    display: none !important;
    content: none !important;
    animation: none !important;
  }

  .hero-brand-row {
    width: 100%;
    min-width: 0;
  }

  .home-cinema-banner {
    display: block;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .home-cinema-banner .hero-logo-mark {
    display: block;
    width: 100%;
    max-width: none;
  }

  .home-cinema-banner .hero-logo-wordmark {
    transform: translate(3px, 5px) scale(.82);
    transform-origin: 0 0;
  }

  .home-cinema-banner .hero-logo-ribbon {
    transform: translate(3px, 5px) scale(.82);
    transform-origin: 0 0;
  }

  .hero-orbit {
    right: 10px;
    top: 8px;
    bottom: auto;
    z-index: 1;
    transform: scale(.72) rotate(-10deg) !important;
  }

  .hero::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-orbit span { animation: none !important; }
}

/* Override finale: rimuove qualsiasi anello decorativo residuo del banner.
   Le icone restano visibili perché il reset riguarda solo il contenitore. */
@media (max-width: 700px) {
  .hero-orbit,
  .hero-orbit::before,
  .hero-orbit::after {
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    content: none !important;
  }

  .hero-orbit::before,
  .hero-orbit::after {
    display: none !important;
  }
}

/* Composizione mobile finale: le icone vivono sopra il banner RC88,
   senza occupare una riga propria e senza lasciare spazio vuoto sotto. */
@media (max-width: 700px) {
  .hero {
    min-height: 0 !important;
    padding-bottom: 18px !important;
  }

  .hero-orbit {
    position: absolute !important;
    top: 12px !important;
    right: 7px !important;
    bottom: auto !important;
    width: 150px !important;
    height: 94px !important;
    margin: 0 !important;
    transform: rotate(-10deg) !important;
    pointer-events: none;
  }

  .hero-orbit span {
    position: absolute !important;
    display: grid !important;
    place-items: center;
    width: 36px !important;
    height: 36px !important;
    border-radius: 0;
    background: transparent !important;
    font-size: 22px;
    filter: drop-shadow(0 8px 12px #0005);
  }

  .hero-orbit span:nth-child(1) { top: 0; left: 59px; }
  .hero-orbit span:nth-child(2) { top: 38px; left: 0; }
  .hero-orbit span:nth-child(3) { top: 57px; left: 60px; }
  .hero-orbit span:nth-child(4) { top: 24px; right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-orbit span {
    animation: none !important;
  }
}

/* Mobile: icone ferme, sparse e leggere sotto il banner giallo.
   Restano fuori dal flusso dell'hero e hanno coordinate volutamente irregolari. */
@media (max-width: 700px) {
  .hero-orbit {
    top: auto !important;
    right: 6px !important;
    bottom: 4px !important;
    width: 210px !important;
    height: 118px !important;
    transform: none !important;
    background: transparent !important;
  }

  .hero-orbit span {
    width: 30px !important;
    height: 30px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .045)) !important;
  }

  /* Coordinate fisse e non allineate: ogni area occupata è separata
     dalle altre, senza griglia e senza sovrapposizioni. */
  .hero-orbit span:nth-child(1) { top: 0; left: 10px; }
  .hero-orbit span:nth-child(2) { top: 56px; left: 112px; }
  .hero-orbit span:nth-child(3) { top: 28px; left: 48px; }
  .hero-orbit span:nth-child(4) { top: 88px; left: 145px; right: auto; }
}

/* Il banner Home segue lo stesso allineamento del banner Video: il logo
   completo è centrato nella superficie dell'hero, non ancorato a sinistra. */
.hero-split .hero-copy {
  align-items: center;
  max-width: none;
}

.hero-brand-row {
  width: min(758px, 100%);
  margin-inline: auto;
}

.home-cinema-banner {
  margin-inline: auto;
}

/* Nell'embed Home non esistono i comandi amministrativi: il contenuto
   deve iniziare subito dal banner principale, senza fascia vuota sopra. */
html.is-embedded .site-header {
  display: none !important;
}

html.is-embedded .app-shell {
  min-height: 0;
}

html.is-embedded #cards {
  scroll-margin-top: 14px;
}

/* Nell'embed Home lascia un respiro minimo sopra il banner principale. */
html.is-embedded:not(.is-cinema-embed):not(.is-feed-embed) #top {
  padding-top: 8px;
}

/* Banner heading: logo centrale e payoff editoriale del progetto. */
.home-heading-proposal {
  position: relative;
  width: min(820px, 100%);
  margin-inline: auto;
  padding: clamp(16px, 3vw, 28px) clamp(14px, 3.5vw, 34px) clamp(15px, 2.8vw, 25px);
  overflow: hidden;
  border: 1px solid #e7d7b5;
  border-radius: 26px;
  text-align: center;
  background:
    radial-gradient(circle at 8% 12%, #ffcf5d2e 0 13%, transparent 34%),
    radial-gradient(circle at 96% 88%, #ef765e1c 0 14%, transparent 35%),
    linear-gradient(145deg, #fffdf8, #fff7eb 64%, #fdf3ef);
  box-shadow: 0 18px 42px #3b302214;
}

.home-heading-proposal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 4px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #ef765e, #fbb13e 48%, #ef765e);
}

.home-heading-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 11px;
  color: #a84d32;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .18em;
  line-height: 1.25;
  text-transform: uppercase;
}

.home-heading-proposal .hero-brand-row {
  position: relative;
  z-index: 1;
}

/* Anche l'eventuale heading storico del Cinema non mostra più il vecchio kicker. */
.cinema-heading-proposal .home-heading-kicker {
  display: none;
}

.home-heading-lead {
  position: relative;
  z-index: 1;
  max-width: 70ch;
  margin: 10px auto 0;
  color: #40372f;
  font-family: Georgia, serif;
  font-size: clamp(17px, 2.3vw, 23px);
  line-height: 1.22;
}

.home-heading-line {
  display: inline;
}

.event-highlight {
  position: relative;
  z-index: 0;
  isolation: isolate;
  color: #b6402d;
  font-weight: 900;
  text-shadow: 0 0 8px #ffd66a, 0 0 18px #ffd66a80;
}

.event-highlight::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 22% -0.16em 8%;
  border-radius: 999px;
  background: #ffd66a70;
  filter: blur(7px);
  pointer-events: none;
}


@media (max-width: 700px) {
  .home-heading-proposal {
    padding: 15px 10px 17px;
    border-radius: 20px;
  }

  .home-heading-kicker {
    margin-bottom: 8px;
    font-size: 9px;
    letter-spacing: .13em;
  }

  .home-heading-lead {
    max-width: 100%;
    margin-top: 8px;
    font-size: 16px;
  }

}

/* =========================================================
   Hero Home nello stile del banner Video: superficie chiara,
   card centrata, niente gradienti sul container esterno.
   ========================================================= */
.hero-video-banner {
  position: relative;
  padding: clamp(18px, 4vw, 40px) clamp(14px, 4vw, 54px) clamp(22px, 4vw, 46px);
  background: var(--paper);
  overflow: visible;
  min-height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.hero-video-banner:before,
.hero-video-banner:after {
  display: none;
  content: none;
}

.hero-video-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  max-width: 1240px;
}

.hero-video-banner .home-heading-proposal {
  width: min(820px, 100%);
}

/* Il kicker viene mostrato anche nella Home, come nel banner Video. */
.home-heading-proposal .home-heading-kicker {
  display: block;
  margin: 0 0 12px;
}

@media (max-width: 700px) {
  .hero-video-banner {
    padding: 16px 12px 26px;
  }

  .hero-video-inner {
    display: block;
  }

  .hero-video-banner .home-heading-proposal {
    width: 100%;
  }
}

/* La card crema mantiene la misura originale del banner Video.
   Le card editoriali della Home usano la stessa larghezza sul telefono. */
@media (max-width: 700px) {
  main#top > .archive-banner,
  main#top > .editorial-section,
  main#top > .travel-home-banner,
  main#top > .feed-banner-bare {
    width: calc(100% - 24px);
    max-width: none;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }

  main#top > .live-section {
    width: calc(100% - 24px);
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }

  main#top > .feed-banner-bare {
    padding-left: 0;
    padding-right: 0;
  }

  main#top > .archive-banner,
  main#top > .travel-home-banner {
    border-radius: 20px;
  }
}
