/* ==============================================
   News Banner for Elementor — Editorial Style
   v3.0 — Totalmente Fluido & Auto-Responsivo
   Tipografia, espaçamento e layout se ajustam
   automaticamente em qualquer dispositivo.
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700;1,900&family=DM+Sans:ital,wght@0,400;0,500;1,400&display=swap');

/* ── Variáveis de design ───────────────────────── */
.nbe-banner {
  --nbe-red:        #e50000;
  --nbe-black:      #111111;
  --nbe-dark-gray:  #333333;
  --nbe-mid-gray:   #555555;
  --nbe-light-gray: #888888;
  --nbe-white:      #ffffff;
  --nbe-divider:    #e8e8e8;
  --nbe-font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --nbe-font-sans:  'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --nbe-ease:       cubic-bezier(0.4, 0, 0.2, 1);

  /* ── Fluid typography scale (clamp) ──────────────
     clamp(MIN, FLUID, MAX)
     FLUID = valor relativo ao viewport (vw)
     Auto-ajusta entre mobile pequeno e desktop large
  ─────────────────────────────────────────────── */
  --nbe-fs-title:    clamp(1.25rem, 4vw + 0.5rem, 2.375rem); /* 20px → 38px */
  --nbe-fs-subtitle: clamp(0.8125rem, 1.5vw + 0.25rem, 0.9375rem); /* 13px → 15px */
  --nbe-fs-category: clamp(0.625rem, 0.8vw + 0.25rem, 0.6875rem);  /* 10px → 11px */
  --nbe-fs-meta:     clamp(0.625rem, 0.8vw + 0.25rem, 0.6875rem);  /* 10px → 11px */

  /* ── Fluid spacing scale ────────────────────────
     Padding, margens e gaps se encolhem em telas menores
  ─────────────────────────────────────────────── */
  --nbe-pad-content: clamp(14px, 3vw, 32px);
  --nbe-gap-category: clamp(8px, 1.5vw, 12px);
  --nbe-gap-title:    clamp(10px, 1.5vw, 14px);
  --nbe-gap-subtitle: clamp(12px, 1.8vw, 18px);

  /* ── Fluid image height ─────────────────────────
     Encolhe automaticamente em dispositivos menores
  ─────────────────────────────────────────────── */
  --nbe-img-h: clamp(180px, 35vw, 420px);
}

/* ── Reset ─────────────────────────────────────── */
.nbe-banner *,
.nbe-banner *::before,
.nbe-banner *::after { box-sizing: border-box; }

.nbe-banner {
  display: block;
  position: relative;
  font-family: var(--nbe-font-sans);
  overflow: hidden;
  background: var(--nbe-white);
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Link wrapper cobre o banner inteiro */
.nbe-banner .nbe-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ═══════════════════════════════════════════════
   IMAGEM
   ═══════════════════════════════════════════════ */
.nbe-image-wrap {
  position: relative;
  width: 100%;
  height: var(--nbe-img-h);
  overflow: hidden;
  background: #1a1a1a;
  flex-shrink: 0;
}

.nbe-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.4s var(--nbe-ease);
}

.nbe-link:hover .nbe-image { transform: scale(1.04); }

/* Overlay gradiente */
.nbe-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 35%,
    rgba(0,0,0,0.22) 65%,
    rgba(0,0,0,0.55) 100%
  );
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   ÁREA DE CONTEÚDO
   ═══════════════════════════════════════════════ */
.nbe-content-wrap {
  position: relative;
  padding: var(--nbe-pad-content);
  text-align: center;
  background: var(--nbe-white);
}

/* Linha vermelha decorativa (stacked e side) */
.nbe-layout--stacked .nbe-content-wrap::before,
.nbe-layout--side    .nbe-content-wrap::before {
  content: '';
  display: block;
  width: clamp(28px, 5vw, 44px);
  height: 3px;
  background: var(--nbe-red);
  margin: 0 auto var(--nbe-gap-category);
}

/* Quando alinhamento à esquerda, linha vai à esquerda */
.nbe-content-wrap[style*="text-align: left"]::before,
.nbe-content-wrap[style*="text-align:left"]::before {
  margin-left: 0;
}

/* ═══════════════════════════════════════════════
   CATEGORIA
   ═══════════════════════════════════════════════ */
.nbe-category {
  display: inline-block;
  font-family: var(--nbe-font-sans);
  font-size: var(--nbe-fs-category);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--nbe-red);
  margin: 0 0 var(--nbe-gap-category) 0;
  padding: 0;
  line-height: 1;
}

/* ═══════════════════════════════════════════════
   TÍTULO
   ═══════════════════════════════════════════════ */
.nbe-title {
  font-family: var(--nbe-font-serif);
  font-size: var(--nbe-fs-title);
  font-weight: 900;
  line-height: 1.13;
  letter-spacing: -0.02em;
  color: var(--nbe-black);
  margin: 0 0 var(--nbe-gap-title) 0;
  padding: 0;
  transition: color 0.25s var(--nbe-ease);
  hyphens: auto;
  -webkit-hyphens: auto;
}

.nbe-title em { font-style: italic; }

.nbe-link:hover .nbe-title { color: var(--nbe-red); }

/* ═══════════════════════════════════════════════
   SUBTÍTULO / EXCERPT
   ═══════════════════════════════════════════════ */
.nbe-subtitle {
  font-family: var(--nbe-font-sans);
  font-size: var(--nbe-fs-subtitle);
  line-height: 1.65;
  color: var(--nbe-mid-gray);
  margin: 0 auto var(--nbe-gap-subtitle);
  padding: 0;
  max-width: 520px;
  width: 100%;
}

.nbe-subtitle em { font-style: italic; }

/* ═══════════════════════════════════════════════
   META — AUTOR / DATA / LEITURA
   ═══════════════════════════════════════════════ */
.nbe-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 0.8vw, 6px) clamp(6px, 1.2vw, 10px);
  font-family: var(--nbe-font-sans);
  font-size: var(--nbe-fs-meta);
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--nbe-light-gray);
  margin: 0;
  padding: clamp(10px, 2vw, 14px) 0 0;
  border-top: 1px solid var(--nbe-divider);
}

.nbe-sep   { color: var(--nbe-divider); font-weight: 300; }
.nbe-author,
.nbe-date,
.nbe-read-time { white-space: nowrap; }

/* ═══════════════════════════════════════════════
   LAYOUT: OVERLAY
   ═══════════════════════════════════════════════ */
.nbe-layout--overlay { background: transparent; }

.nbe-layout--overlay .nbe-image-wrap {
  height: auto;
  min-height: var(--nbe-img-h);
}

.nbe-layout--overlay .nbe-overlay {
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.45) 50%,
    rgba(0,0,0,0.04) 100%
  );
}

.nbe-layout--overlay .nbe-content-wrap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: transparent;
  padding: var(--nbe-pad-content) clamp(18px, 4vw, 36px);
}

.nbe-layout--overlay .nbe-category  { color: #ff6b6b; }
.nbe-layout--overlay .nbe-title     { color: var(--nbe-white); }
.nbe-layout--overlay .nbe-subtitle  { color: rgba(255,255,255,0.82); }
.nbe-layout--overlay .nbe-meta      {
  color: rgba(255,255,255,0.55);
  border-top-color: rgba(255,255,255,0.18);
}
.nbe-layout--overlay .nbe-sep       { color: rgba(255,255,255,0.22); }
.nbe-layout--overlay .nbe-link:hover .nbe-title { color: #ffd0d0; }

/* ═══════════════════════════════════════════════
   LAYOUT: LADO A LADO
   ═══════════════════════════════════════════════ */
.nbe-layout--side .nbe-link {
  display: flex;
  align-items: stretch;
}

.nbe-layout--side .nbe-image-wrap {
  flex: 0 0 50%;
  height: auto !important;
  min-height: clamp(160px, 25vw, 280px);
}

.nbe-layout--side .nbe-content-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.nbe-layout--side .nbe-content-wrap::before { margin-left: 0; }
.nbe-layout--side .nbe-meta                 { justify-content: flex-start; }
.nbe-layout--side .nbe-subtitle             { margin-left: 0; margin-right: 0; }

/* ═══════════════════════════════════════════════
   RESPONSIVO ESTRUTURAL
   ═══════════════════════════════════════════════ */

/* ── Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {

  .nbe-layout--side .nbe-link         { flex-direction: column; }
  .nbe-layout--side .nbe-image-wrap   { flex: none; width: 100%; }
  .nbe-layout--side .nbe-content-wrap { text-align: center; }
  .nbe-layout--side .nbe-content-wrap::before {
    margin-left: auto; margin-right: auto;
  }
  .nbe-layout--side .nbe-meta         { justify-content: center; }
  .nbe-layout--side .nbe-subtitle     { margin-left: auto; margin-right: auto; }

  .nbe-layout--overlay .nbe-image-wrap { min-height: clamp(220px, 32vw, 340px); }
}

/* ── Mobile (≤ 767px) ── */
@media (max-width: 767px) {

  .nbe-content-wrap { padding: clamp(14px, 4vw, 20px) clamp(14px, 5vw, 20px) !important; }

  .nbe-layout--overlay .nbe-image-wrap  { min-height: clamp(160px, 45vw, 260px); }
  .nbe-layout--overlay .nbe-content-wrap {
    padding: clamp(14px, 4vw, 20px) clamp(14px, 5vw, 20px);
  }

  .nbe-layout--stacked .nbe-content-wrap::before { margin-left: 0; }

  /* Subtítulo 100% no mobile */
  .nbe-subtitle { max-width: 100%; }

  /* Meta empilha verticalmente */
  .nbe-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px 0;
  }

  /* Oculta separador ao empilhar */
  .nbe-sep { display: none; }
}

/* ── Mobile pequeno (≤ 390px) ── */
@media (max-width: 390px) {
  .nbe-title {
    word-break: break-word;
    hyphens: auto;
  }
  .nbe-meta { gap: 2px 0; }
}

/* ── Mobile extra-pequeno (≤ 320px) ── */
@media (max-width: 320px) {
  .nbe-banner,
  .nbe-content-wrap,
  .nbe-title,
  .nbe-subtitle,
  .nbe-category,
  .nbe-meta {
    max-width: 100%;
    overflow-wrap: break-word;
  }
}

/* ═══════════════════════════════════════════════
   ESTADO VAZIO (editor)
   ═══════════════════════════════════════════════ */
.nbe-no-post {
  padding: 24px;
  border: 2px dashed #ccc;
  text-align: center;
  color: #999;
  font-family: sans-serif;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════
   ANIMAÇÃO DE ENTRADA
   ═══════════════════════════════════════════════ */
@keyframes nbe-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nbe-category { animation: nbe-fade-up 0.45s ease both; }
.nbe-title    { animation: nbe-fade-up 0.5s  0.06s ease both; }
.nbe-subtitle { animation: nbe-fade-up 0.5s  0.12s ease both; }
.nbe-meta     { animation: nbe-fade-up 0.5s  0.18s ease both; }

/* Respeita preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  .nbe-category,
  .nbe-title,
  .nbe-subtitle,
  .nbe-meta,
  .nbe-image { animation: none !important; transition: none !important; }
}

/* ═══════════════════════════════════════════════
   CUSTOMIZAÇÃO VIA CSS CUSTOM PROPERTIES
   Sobrescreva no CSS Global do Elementor / tema:

   .nbe-banner { --nbe-red: #0057ff; }

   Para forçar tamanhos fixos (sobrescreve clamp):
   .nbe-banner { --nbe-fs-title: 28px; }
   ═══════════════════════════════════════════════ */
