/**
 * MINOMO Home — Promo carousel (#hReportsZone)
 * Wave CAROSELLO 2026-07-23.
 *
 * Rotates the pre-existing Citizen Reports card (slide A) with up to 3
 * merchant-lead "Portala tu" slides (B/C/D) — see loadPromoCarousel() /
 * renderPromoCarousel() in assets/js/home.js. Namespaced `.h-promo-*`,
 * deliberately independent from `.h-reports-*` (reports.css) even though
 * the visual language mirrors it 1:1 (same card shell, border, spacing) —
 * this file owns styling for BOTH the single-slide static case and the
 * multi-slide crossfade carousel, reports.css keeps its own classes for
 * anything reused elsewhere (none, today, but kept decoupled on purpose).
 */

.h-promo-single,
.h-promo-carousel {
  margin: 0 16px 0;
}

.h-promo-carousel {
  position: relative;
}

.h-promo-track {
  position: relative;
  min-height: 72px;
}

/* Slide shell — mirrors .h-reports-card (reports.css) so slide A keeps its
   exact pre-existing look; <a> (reports slide) and <button> (merchant
   slides) share this class and are reset to look identical. */
.h-promo-slide {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--surf, #141416);
  border: 1px solid rgba(245, 130, 32, 0.25);
  border-radius: 16px;
  padding: 16px 18px;
  min-height: 72px;
  text-decoration: none;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: opacity 400ms ease, border-color 150ms ease, background 150ms ease;
}

.h-promo-slide:hover,
.h-promo-slide:focus-visible {
  border-color: var(--orange, #F58220);
  background: rgba(245, 130, 32, 0.04);
}
.h-promo-slide:focus-visible {
  outline: 2px solid var(--orange, #F58220);
  outline-offset: 2px;
}

/* Single eligible slide — static, in normal flow, no absolute stacking. */
.h-promo-single .h-promo-slide {
  position: relative;
}

/* 2+ slides — crossfade stack: only the active slide participates in
   layout (position:relative gives .h-promo-track its height), the rest are
   absolutely positioned on top of it at opacity 0. */
.h-promo-track .h-promo-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.h-promo-track .h-promo-slide.h-promo-slide-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.h-promo-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(245, 130, 32, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
}

.h-promo-text { flex: 1; min-width: 0; }
.h-promo-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--orange, #F58220);
  margin: 0 0 3px;
}
.h-promo-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--t1, #F5F5F7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}
.h-promo-chev { flex-shrink: 0; color: var(--text-secondary, #8E8E93); font-size: 1rem; }

/* Dot indicators — only rendered for 2+ slides. */
.h-promo-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
}
.h-promo-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(245, 130, 32, 0.25);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}
.h-promo-dot-active {
  background: var(--orange, #F58220);
  transform: scale(1.25);
}
.h-promo-dot:focus-visible {
  outline: 2px solid var(--orange, #F58220);
  outline-offset: 2px;
}

/* #hReportsZone's own margin (.h-reports-zone) is already set by
   reports.css (loaded before this file on app.html) — not duplicated here.

   prefers-reduced-motion: no crossfade animation — swaps are instant. The
   JS side (home.js renderPromoCarousel) also skips starting the auto-
   rotate timer entirely under this media query; dots stay usable for
   manual browsing. */
@media (prefers-reduced-motion: reduce) {
  .h-promo-slide { transition: none; }
  .h-promo-dot { transition: none; }
}

/* ─────────────────────────────────────────────────────────────────────
   Variante "accento caldo" — events.html (Vito 2026-08-01).
   Il carosello è un lead generator: nel feed eventi la card mimetica
   (stessa shell scura delle card evento) spariva alla vista. Qui si
   stacca: sfumatura brand, bordo pieno, icona e tipografia un gradino
   sopra. Scoped via classe aggiuntiva sul contenitore #hReportsZone di
   events.html — app.html mantiene la versione sobria di Wave CAROSELLO.
   Il titolo passa da nowrap+ellipsis a clamp 2 righe: a 17px i titoli
   localizzati non ci stanno più su una riga a 390px. */
.h-promo-emph .h-promo-track { min-height: 88px; }
.h-promo-emph .h-promo-slide {
  background: linear-gradient(135deg,
    rgba(245, 130, 32, 0.16),
    rgba(245, 130, 32, 0.05) 55%,
    var(--surf, #141416));
  border-color: var(--orange, #F58220);
  gap: 16px;
  padding: 18px;
  min-height: 88px;
}
.h-promo-emph .h-promo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(245, 130, 32, 0.18);
  font-size: 1.4rem;
}
.h-promo-emph .h-promo-eyebrow { font-size: 0.75rem; }
.h-promo-emph .h-promo-title {
  font-size: 1.0625rem;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.h-promo-emph .h-promo-chev { color: var(--orange, #F58220); font-size: 1.15rem; }

/* ============================================================
   Il peso della promo dentro il NUMERO (24/08/2026)

   Osservazione del designer sullo screenshot di Vito: questa promo è
   l'elemento più saliente della schermata — riquadro con bordo arancio,
   icona in tinta, eyebrow arancione, 72px di altezza minima — e sta fra la
   testata e la prima pagina. Se il numero è il prodotto, la promo non può
   interrompere l'edizione proprio lì e battere la cartolina del giorno.

   Vito (24/08) ha scelto: **resta sopra**, ma perde il peso. Non è
   nasconderla: una superficie civica ha ragioni sue e continua a vedersi.
   Cambia il RANGO, non la presenza — bordo neutro, niente riquadro in tinta,
   niente pastiglia colorata attorno all'icona, meno altezza.

   L'arancione resta dove serve davvero: sull'eyebrow, che dice di che cosa
   si tratta, e sul focus/hover, che dice che è toccabile.
   ============================================================ */
body.page-oggi .h-promo-slide {
  background: transparent;
  border-color: var(--bd, rgba(255, 255, 255, 0.09));
  min-height: 60px;
  padding: 12px 16px;
}
body.page-oggi .h-promo-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  font-size: 1rem;
}
