/* Digital signage — fascia display (larga, sotto hero + sidebar) + anteprima admin */

.signage-strip {
  /* Fascia a tutta larghezza pagina, sotto hero + sidebar */
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  box-sizing: border-box;
  flex-shrink: 0;
  background: linear-gradient(180deg, #e8f4fc 0%, #cfe4f8 55%, #b8d6f2 100%);
  border-top: 4px solid var(--brand, #0066b3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  min-height: clamp(120px, 14vh, 180px);
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  text-align: center;
  overflow: hidden;
  transition: opacity 0.35s ease;
}

.signage-strip.is-fading {
  opacity: 0.35;
}

.signage-strip .sg-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  width: 100%;
  max-width: min(1400px, 96vw);
  margin: 0 auto;
  color: #0a2540;
}

/* Slide con sfondo personalizzato scuro: testo chiaro */
.signage-strip .sg-slide[style*="background"] {
  color: #ffffff;
}

.signage-strip .sg-slide.sg-align-left,
.signage-preview-box .sg-slide.sg-align-left {
  justify-content: flex-start;
}

.signage-strip .sg-slide.sg-align-center,
.signage-preview-box .sg-slide.sg-align-center {
  justify-content: center;
}

.signage-strip .sg-slide.sg-align-right,
.signage-preview-box .sg-slide.sg-align-right {
  justify-content: flex-end;
}

.signage-strip .sg-layout-image-text.sg-align-left .sg-text,
.signage-strip .sg-layout-image-text.sg-align-right .sg-text,
.signage-preview-box .sg-layout-image-text.sg-align-left .sg-text,
.signage-preview-box .sg-layout-image-text.sg-align-right .sg-text {
  flex: 1;
  min-width: 0;
}

.signage-strip .sg-layout-image-text.sg-align-center,
.signage-preview-box .sg-layout-image-text.sg-align-center {
  justify-content: center;
}

.signage-strip .sg-layout-image-text.sg-align-center .sg-text,
.signage-preview-box .sg-layout-image-text.sg-align-center .sg-text {
  flex: 0 1 auto;
  max-width: min(72%, 720px);
}

.signage-strip .sg-layout-image-text.sg-align-center .sg-img-side,
.signage-preview-box .sg-layout-image-text.sg-align-center .sg-img-side {
  flex: 0 0 auto;
}

.signage-strip .sg-layout-image-text.sg-align-right,
.signage-preview-box .sg-layout-image-text.sg-align-right {
  flex-direction: row-reverse;
}

.signage-strip .sg-img {
  max-height: clamp(80px, 10vh, 120px);
  max-width: min(36%, 280px);
  object-fit: contain;
  flex-shrink: 0;
}

.signage-strip .sg-img-side {
  max-height: clamp(76px, 9vh, 110px);
}

/* Testo su fascia chiara (default) */
.signage-strip .sg-title {
  color: #042a4a;
  font-size: clamp(1.15rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  text-shadow: none;
}

.signage-strip .sg-body {
  color: #1a3d5c;
  margin-top: 0.35rem;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 600;
  line-height: 1.4;
  text-shadow: none;
}

.signage-strip .sg-link-hint {
  color: #2d5a80;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Slide con sfondo scuro custom */
.signage-strip .sg-slide[style*="background"] .sg-title,
.signage-strip .sg-slide[style*="background"] .sg-body {
  color: #f0f7ff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.signage-strip .sg-text-only .sg-title {
  font-size: clamp(1.25rem, 2.8vw, 1.9rem);
}

/* Anteprima admin (simula fascia chiara) */
.signage-preview-box {
  background: linear-gradient(180deg, #e8f4fc 0%, #cfe4f8 100%);
  border: 1px solid #94b8d9;
  border-radius: 10px;
  min-height: 120px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
}

.signage-preview-box .sg-slide {
  color: #042a4a;
  max-width: 100%;
}

.signage-preview-box .sg-title {
  color: #042a4a;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
}

.signage-preview-box .sg-body {
  color: #1a3d5c;
  margin-top: 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.signage-preview-box .sg-slide[style*="background"] .sg-title,
.signage-preview-box .sg-slide[style*="background"] .sg-body {
  color: #f0f7ff;
}

.signage-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
}

@media (max-width: 720px) {
  .signage-form-grid {
    grid-template-columns: 1fr;
  }
}

.signage-form-grid label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: #475569;
}

.signage-form-grid input,
.signage-form-grid select,
.signage-form-grid textarea {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid #d0d7e2;
  border-radius: 6px;
  font-size: 0.9rem;
}

.signage-form-grid .span-2 {
  grid-column: 1 / -1;
}

.signage-list-actions {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.signage-list-actions button {
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
}

.badge-sg-off {
  color: #b91c1c;
  font-size: 0.75rem;
}

.badge-sg-sched {
  color: #b45309;
  font-size: 0.75rem;
}

/* ——— Admin digital signage ——— */
.signage-summary {
  margin-bottom: 1rem;
}

.signage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}

.signage-layout__editor input,
.signage-layout__editor select,
.signage-layout__editor textarea {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid #d0d7e2;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
}

.signage-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: #475569;
}

.signage-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.signage-editor-head h3 {
  margin: 0;
  font-size: 1rem;
}

.signage-editor-lead {
  margin: 0 0 0.85rem;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.45;
}

.signage-layout-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.signage-layout-pill {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.signage-layout-pill.active {
  background: var(--brand, #0066b3);
  border-color: var(--brand, #0066b3);
  color: #fff;
}

.signage-color-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.signage-color-row input[type="color"] {
  width: 2.5rem;
  height: 2.25rem;
  padding: 0.1rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.signage-color-row input[type="text"] {
  flex: 1;
  margin-bottom: 0;
}

.signage-active-row {
  display: flex;
  align-items: center;
}

.signage-active-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

.signage-active-toggle input {
  width: auto !important;
  margin: 0 !important;
}

.signage-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.signage-aside-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.signage-carousel-box {
  min-height: 130px;
}

.signage-carousel-meta {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.8rem;
  color: #64748b;
}

.signage-aside-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.signage-list-card {
  padding-top: 0.25rem;
}

.signage-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.5rem;
}

.signage-list-head h3 {
  margin: 0;
  font-size: 1rem;
}

.signage-list-table .signage-thumb {
  width: 120px;
  vertical-align: middle;
}

.signage-thumb-inner {
  transform: scale(0.42);
  transform-origin: top left;
  width: 240%;
  pointer-events: none;
}

.signage-thumb-inner .signage-preview-box,
.signage-thumb-inner.signage-preview-box {
  margin: 0;
  min-height: 72px;
  padding: 0.5rem 0.75rem;
}

.signage-status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.signage-status-badge--live {
  background: #dcfce7;
  color: #15803d;
}

.signage-status-badge--sched {
  background: #fef3c7;
  color: #b45309;
}

.signage-status-badge--expired {
  background: #f1f5f9;
  color: #64748b;
}

.signage-status-badge--off {
  background: #fee2e2;
  color: #b91c1c;
}

.signage-list-table tr.signage-row--selected {
  background: #f0f9ff;
}

.signage-list-table tbody tr {
  cursor: pointer;
}

.signage-list-table tbody tr:hover {
  background: #f8fafc;
}

@media (max-width: 960px) {
  .signage-layout {
    grid-template-columns: 1fr;
  }
}
