/* ==========================================================================
   STORAGILITY DIGITAL SIGNAGE — SHARED SLIDE RENDERER CSS
   Utilisé à l'identique par le lecteur /tv et l'aperçu temps réel Nuxt (/display)
   ========================================================================== */

.sg-slide-stage {
  --sg-primary: #0284c7;
  --sg-secondary: #0f172a;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  container-type: inline-size;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #f8fafc;
  background:
    radial-gradient(circle at 88% 14%, color-mix(in srgb, var(--sg-primary) 34%, transparent) 0%, transparent 52%),
    radial-gradient(circle at 10% 90%, color-mix(in srgb, var(--sg-primary) 20%, transparent) 0%, transparent 48%),
    linear-gradient(140deg, var(--sg-secondary) 0%, #090f1a 100%);
  user-select: none;
  box-sizing: border-box;
}

.sg-slide-stage *,
.sg-slide-stage *::before,
.sg-slide-stage *::after {
  box-sizing: border-box;
}

/* Grille architecturale subtile de fond */
.sg-slide-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 6% 6%;
  pointer-events: none;
  z-index: 0;
}

.sg-slide-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(0.85rem, 0.4rem + 3vw, 2.1rem);
  gap: clamp(0.65rem, 0.3rem + 1.8vw, 1.5rem);
}

@supports (font-size: 1cqi) {
  .sg-slide-shell {
    padding: clamp(0.85rem, 0.35rem + 3.4cqi, 2.125rem);
    gap: clamp(0.65rem, 0.25rem + 2cqi, 1.6rem);
  }
}

/* Barre supérieure : identité du centre */
.sg-slide-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.sg-slide-brand {
  display: flex;
  align-items: center;
  gap: 0.75em;
  min-width: 0;
}

.sg-slide-logo-wrap {
  background: #ffffff;
  border-radius: 0.55em;
  padding: 0.32em 0.65em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
  flex-shrink: 0;
}

.sg-slide-logo {
  display: block;
  height: clamp(1.35rem, 0.8rem + 2.4vw, 3.2rem);
  width: auto;
  max-width: 11em;
  object-fit: contain;
}

@supports (font-size: 1cqi) {
  .sg-slide-logo {
    height: clamp(1.35rem, 0.65rem + 2.8cqi, 3.35rem);
  }
}

.sg-slide-site-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sg-slide-site-name {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.78rem, 0.45rem + 1.2vw, 1.65rem);
  letter-spacing: -0.01em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sg-slide-site-city {
  font-size: clamp(0.66rem, 0.38rem + 0.9vw, 1.25rem);
  color: rgba(248, 250, 252, 0.7);
}

@supports (font-size: 1cqi) {
  .sg-slide-site-name {
    font-size: clamp(0.78rem, 0.35rem + 1.45cqi, 1.9rem);
  }
  .sg-slide-site-city {
    font-size: clamp(0.66rem, 0.3rem + 1.05cqi, 1.45rem);
  }
}

/* Badge dynamique utilisant la couleur primaire du centre avec contraste garanti */
.sg-slide-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  align-self: flex-start;
  padding: 0.36em 0.88em;
  border-radius: 999px;
  background-color: var(--sg-primary);
  color: #ffffff;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.68rem, 0.38rem + 0.95vw, 1.45rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

@supports (color: oklch(from red l c h)) {
  .sg-slide-badge {
    color: oklch(from var(--sg-primary) clamp(0, (0.62 - l) * 999, 1) 0 0);
  }
}

@supports (color: contrast-color(red)) {
  .sg-slide-badge {
    color: contrast-color(var(--sg-primary));
  }
}

@supports (font-size: 1cqi) {
  .sg-slide-badge {
    font-size: clamp(0.68rem, 0.28rem + 1.15cqi, 1.65rem);
  }
}

/* Corps principal (Grille 2 colonnes en paysage, empilée en portrait) */
.sg-slide-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(0.85rem, 0.4rem + 2.4vw, 2.1rem);
}

@supports (font-size: 1cqi) {
  .sg-slide-main {
    gap: clamp(0.85rem, 0.35rem + 2.8cqi, 2.125rem);
  }
}

.sg-slide-stage[data-orientation="portrait"] .sg-slide-main {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-content: center;
}

.sg-slide-stage[data-has-aside="false"] .sg-slide-main {
  grid-template-columns: minmax(0, 1fr);
}

.sg-slide-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.5rem, 0.25rem + 1.3vw, 1.25rem);
  min-width: 0;
}

.sg-slide-headline {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: #ffffff;
  text-wrap: balance;
  font-size: clamp(1.35rem, 0.65rem + 3.1vw, 3.35rem);
}

.sg-slide-body {
  margin: 0;
  color: rgba(248, 250, 252, 0.86);
  line-height: 1.42;
  max-width: 58ch;
  text-wrap: pretty;
  font-size: clamp(0.85rem, 0.45rem + 1.35vw, 1.95rem);
}

@supports (font-size: 1cqi) {
  .sg-slide-headline {
    font-size: clamp(1.35rem, 0.45rem + 3.6cqi, 3.35rem);
  }
  .sg-slide-body {
    font-size: clamp(0.85rem, 0.35rem + 1.65cqi, 2.1rem);
  }
  .sg-slide-stage[data-orientation="portrait"] .sg-slide-headline {
    font-size: clamp(1.35rem, 0.5rem + 4.8cqi, 3.35rem);
  }
  .sg-slide-stage[data-orientation="portrait"] .sg-slide-body {
    font-size: clamp(0.85rem, 0.4rem + 2.3cqi, 2.1rem);
  }
}

/* Bloc offre / tarif / point clé */
.sg-slide-offer-pill {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.65em;
  align-self: flex-start;
  margin-top: 0.2em;
  padding: 0.55em 1.05em;
  border-radius: 0.85em;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.sg-slide-offer-price {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  font-size: clamp(1.1rem, 0.55rem + 2.2vw, 2.7rem);
}

.sg-slide-offer-unit {
  color: rgba(248, 250, 252, 0.8);
  font-weight: 500;
  font-size: clamp(0.75rem, 0.42rem + 1.1vw, 1.6rem);
}

@supports (font-size: 1cqi) {
  .sg-slide-offer-price {
    font-size: clamp(1.1rem, 0.4rem + 2.6cqi, 2.75rem);
  }
  .sg-slide-offer-unit {
    font-size: clamp(0.75rem, 0.32rem + 1.35cqi, 1.8rem);
  }
}

/* Colonne visuelle droite (Média + Carte QR code) */
.sg-slide-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.65rem, 0.3rem + 1.4vw, 1.4rem);
  min-height: 0;
  height: 100%;
}

.sg-slide-media-frame {
  width: 100%;
  flex: 1;
  min-height: 0;
  max-height: 68%;
  border-radius: 1em;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.38);
  background: rgba(15, 23, 42, 0.55);
}

.sg-slide-aside[data-has-qr="false"] .sg-slide-media-frame {
  max-height: 92%;
}

.sg-slide-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Carte QR haute lisibilité (fond blanc pur indispensable pour scan à 3–5 m) */
.sg-slide-qr-card {
  display: flex;
  align-items: center;
  gap: 0.9em;
  background: #ffffff;
  color: #0f172a;
  padding: clamp(0.55rem, 0.3rem + 1.1vw, 1.35rem);
  border-radius: 0.95em;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  max-width: 100%;
}

.sg-slide-aside[data-has-media="false"] .sg-slide-qr-card {
  flex-direction: column;
  text-align: center;
  padding: clamp(0.75rem, 0.4rem + 1.6vw, 1.85rem);
}

.sg-slide-qr-box {
  width: clamp(3.6rem, 1.8rem + 7.5vw, 9rem);
  height: clamp(3.6rem, 1.8rem + 7.5vw, 9rem);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-slide-aside[data-has-media="false"] .sg-slide-qr-box {
  width: clamp(4.5rem, 2.2rem + 10.5vw, 11.25rem);
  height: clamp(4.5rem, 2.2rem + 10.5vw, 11.25rem);
}

@supports (font-size: 1cqi) {
  .sg-slide-qr-box {
    width: clamp(3.6rem, 1.6rem + 8.5cqi, 9rem);
    height: clamp(3.6rem, 1.6rem + 8.5cqi, 9rem);
  }
  .sg-slide-aside[data-has-media="false"] .sg-slide-qr-box {
    width: clamp(4.5rem, 2rem + 12cqi, 11.25rem);
    height: clamp(4.5rem, 2rem + 12cqi, 11.25rem);
  }
}

.sg-slide-qr-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sg-slide-qr-caption {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  min-width: 0;
}

.sg-slide-qr-kicker {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(0.58rem, 0.32rem + 0.72vw, 1.05rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

.sg-slide-qr-cta {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(0.72rem, 0.4rem + 1vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: #0f172a;
  text-wrap: balance;
}

/* Variantes de mise en page (8 modèles orientés centres de box) */
.sg-slide-stage[data-layout="promo-spotlight"] .sg-slide-offer-pill {
  background: var(--sg-primary);
  border-color: transparent;
}

.sg-slide-stage[data-layout="promo-spotlight"] .sg-slide-offer-price,
.sg-slide-stage[data-layout="promo-spotlight"] .sg-slide-offer-unit {
  color: #ffffff;
}

@supports (color: oklch(from red l c h)) {
  .sg-slide-stage[data-layout="promo-spotlight"] .sg-slide-offer-price,
  .sg-slide-stage[data-layout="promo-spotlight"] .sg-slide-offer-unit {
    color: oklch(from var(--sg-primary) clamp(0, (0.62 - l) * 999, 1) 0 0);
  }
}

@supports (color: contrast-color(red)) {
  .sg-slide-stage[data-layout="promo-spotlight"] .sg-slide-offer-price,
  .sg-slide-stage[data-layout="promo-spotlight"] .sg-slide-offer-unit {
    color: contrast-color(var(--sg-primary));
  }
}

.sg-slide-stage[data-layout="review-highlight"] {
  background:
    radial-gradient(circle at 82% 20%, rgba(250, 204, 21, 0.24) 0%, transparent 50%),
    linear-gradient(140deg, var(--sg-secondary) 0%, #090f1a 100%);
}

.sg-slide-stage[data-layout="review-highlight"] .sg-slide-badge {
  background-color: #facc15;
  color: #171000;
}

.sg-slide-stage[data-layout="trust-card"] .sg-slide-copy {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.1em;
  padding: clamp(0.85rem, 0.4rem + 2vw, 2rem);
}

/* Mode visuel plein écran (annonceurs locaux Phase 3 ou affiche dédiée) */
.sg-slide-fullbleed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.sg-slide-stage[data-layout="full-bleed-media"] .sg-slide-shell {
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(9, 15, 26, 0.78) 0%, rgba(9, 15, 26, 0.18) 42%, transparent 100%);
}

/* Pied de slide discret */
.sg-slide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.45em;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(248, 250, 252, 0.64);
  font-size: clamp(0.62rem, 0.35rem + 0.8vw, 1.15rem);
  flex-shrink: 0;
}

@supports (font-size: 1cqi) {
  .sg-slide-footer {
    font-size: clamp(0.62rem, 0.28rem + 0.95cqi, 1.35rem);
  }
}

