/**
 * Layout editorial: metadados no topo, título, corpo, imagem em card arredondado, rodapé.
 * Escopo: .preview-area[data-slide-layout="editorial-clean"].
 */

.preview-area[data-slide-layout="editorial-clean"] {
  --editorial-teal: #13b5c0;
  /** Altura da área da imagem (~30% menor que o preenchimento flex anterior; pode encolher com textos longos) */
  --editorial-image-max-height: 406px;
  --editorial-canvas-bg: #000000;
  --editorial-title-color: #ffffff;
  --editorial-body-color: rgba(255, 255, 255, 0.78);
  --editorial-meta-color: rgba(255, 255, 255, 0.92);
  --editorial-meta-muted: rgba(255, 255, 255, 0.65);
  --editorial-swipe-color: rgba(255, 255, 255, 0.55);
  --editorial-placeholder-bg: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  --editorial-placeholder-emoji-opacity: 0.35;
}

.preview-area[data-slide-layout="editorial-clean"][data-carousel-theme="editorial-clean-white"] {
  --editorial-canvas-bg: #ffffff;
  --editorial-title-color: #000000;
  --editorial-body-color: #757575;
  --editorial-meta-color: #1a1a1a;
  --editorial-meta-muted: #757575;
  --editorial-swipe-color: #757575;
  --editorial-placeholder-bg: linear-gradient(145deg, #eef2f6 0%, #dde4ec 100%);
  --editorial-placeholder-emoji-opacity: 0.45;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-canvas {
  background: var(--editorial-canvas-bg);
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-root {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 48px 56px 44px;
  font-family: 'Inter', sans-serif;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
  gap: 24px;
  margin-bottom: 36px;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-header-left,
.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-header-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-header-right {
  text-align: right;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-meta-line {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--editorial-meta-color);
  letter-spacing: 0.01em;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-meta-sub {
  font-size: 22px;
  font-weight: 400;
  color: var(--editorial-meta-muted);
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-stack {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: safe center;
  gap: 28px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-title {
  font-family: 'Inter', sans-serif;
  font-size: 64px;
  font-weight: 700;
  line-height: 1.12;
  color: var(--editorial-title-color);
  letter-spacing: -0.02em;
  word-break: break-word;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-body-text {
  font-family: 'Inter', sans-serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--editorial-body-color);
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Card da foto: mesma largura útil do título/corpo (100% da coluna de conteúdo) */
.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-image-wrap {
  flex: 0 0 var(--editorial-image-max-height);
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: var(--editorial-image-max-height);
  max-height: var(--editorial-image-max-height);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/** Sem imagem: remove o card da foto para o texto ocupar a área vertical disponível */
.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-image-wrap--hidden {
  display: none !important;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-image-inner {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  background: var(--editorial-canvas-bg);
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-image-inner .slide-bg-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--editorial-placeholder-bg);
  border-radius: inherit;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-image-inner .slide-bg-placeholder span {
  font-size: 52px;
  opacity: var(--editorial-placeholder-emoji-opacity);
}

/**
 * Tamanho/posição da foto são definidos em JS (positionEditorialFeaturedImage) para coincidir
 * com o preview na exportação — html2canvas distorce object-fit: cover.
 */
.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-featured-img {
  position: absolute;
  display: block;
  width: 0;
  height: 0;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0;
  border: 0;
  max-width: none;
  max-height: none;
  object-fit: none;
  vertical-align: top;
}

/**
 * Miniaturas no editor: .slide-canvas usa transform: scale(0.375); object-fit: cover no browser
 * preenche o card sem faixas. O JPEG de exportação usa #slide (fora de .preview-slide-card) + JS.
 */
.preview-area[data-slide-layout="editorial-clean"] .preview-slide-card .slide-scale-wrapper .slide-editorial-featured-img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  left: 0 !important;
  top: 0 !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  object-fit: cover !important;
  object-position: center center !important;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  margin-top: 36px;
  padding-top: 0;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-footer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(128, 128, 128, 0.2);
}

.preview-area[data-slide-layout="editorial-clean"] .slide-editorial-brand-pill.tag-blue {
  background: var(--editorial-teal);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 600;
  padding: 14px 30px;
  border-radius: 999px;
  white-space: nowrap;
}

.preview-area[data-slide-layout="editorial-clean"] .slide-swipe {
  margin-left: auto;
  color: var(--editorial-swipe-color);
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 500;
  white-space: nowrap;
}

body.light-theme .preview-area[data-slide-layout="editorial-clean"][data-carousel-theme="editorial-clean-black"]
  .slide-editorial-image-inner .slide-bg-placeholder {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

body.light-theme .preview-area[data-slide-layout="editorial-clean"][data-carousel-theme="editorial-clean-black"]
  .slide-editorial-image-inner .slide-bg-placeholder span {
  opacity: 0.35;
}
