/* ═════════════════════════════════════════════════════════════════════════
 * blog.css — Carrossel de Blog + Modal (Sellerion Landing)
 * 3 cards visíveis por vez, setas/dots navegam por páginas
 * ═════════════════════════════════════════════════════════════════════════ */


/* ── Intro da seção ─────────────────────────────────────────────────────── */
.blog-section {
  padding: 4rem 0 5rem;
}

.blog-intro {
  text-align: center;
  color: var(--text-secondary, #475569);
  font-size: clamp(.95rem, 1vw + .5rem, 1.05rem);
  margin: 0 auto 3rem;
  max-width: 600px;
  padding: 0 1rem;
}


/* ── Carrossel ──────────────────────────────────────────────────────────── */
.blog-carousel {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.blog-arrow {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(7, 0, 104, .15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary, #0d4fc4);
  transition: all .2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.blog-arrow:hover:not(:disabled) {
  background: var(--primary, #0d4fc4);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(13, 79, 196, .3);
}

.blog-arrow:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.blog-arrow:focus-visible {
  outline: 2px solid var(--primary, #0d4fc4);
  outline-offset: 3px;
}

.blog-arrow svg {
  width: 24px;
  height: 24px;
}

/* Viewport: janela que mostra os cards */
.blog-viewport {
  flex: 1;
  min-width: 0;          /* ← crítico pro flex calcular largura certa */
  overflow: hidden;
  border-radius: 16px;
  padding: 8px 0;
}

/* Track: trilho que desliza com translateX */
.blog-track {
  display: flex;
  gap: 24px;
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

/* Skeleton enquanto carrega */
.blog-skeleton {
  flex: 1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary, #475569);
  font-size: 14px;
}


/* ╔═══════════════════════════════════════════════════════════════════════╗
 * ║ CARDS DE POST                                                          ║
 * ║                                                                        ║
 * ║ Largura: (viewport - 2*gap) / 3 (calculada via CSS calc())            ║
 * ║ Altura: fixa em 420px pra todos os cards iguais                       ║
 * ╚═══════════════════════════════════════════════════════════════════════╝ */

.blog-post-card {
  /* IMPORTANTE: 3 cards visíveis com 24px de gap entre eles */
  flex: 0 0 calc((100% - 48px) / 3);
  max-width: calc((100% - 48px) / 3);
  height: 460px;

  background: #ffffff;
  border: 1px solid rgba(7, 0, 104, .12);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.blog-post-card:hover {
  transform: translateY(-8px);
  border-color: rgba(13, 79, 196, .35);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .14);
}

.blog-post-card:focus-visible {
  outline: 2px solid var(--primary, #0d4fc4);
  outline-offset: 2px;
}

/* Imagem do card */
.blog-post-image {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, #3ac3ed, #0313a5);
  overflow: hidden;
  flex-shrink: 0;
}

.blog-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.blog-post-card:hover .blog-post-image img {
  transform: scale(1.06);
}

/* Conteúdo textual */
.blog-post-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  min-height: 0;
}

.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-post-tag {
  background: rgba(58, 195, 237, .14);
  color: var(--primary, #0d4fc4);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.blog-post-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-post-subtitle {
  font-size: .92rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-post-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary, #0d4fc4);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
  transition: gap .2s;
}

.blog-post-card:hover .blog-post-cta {
  gap: 10px;
}

.blog-post-cta svg {
  width: 14px;
  height: 14px;
}


/* ── Dots ───────────────────────────────────────────────────────────────── */
.blog-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 32px;
}

.blog-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all .25s ease;
}

.blog-dot:hover {
  background: #94a3b8;
}

.blog-dot.active {
  width: 28px;
  border-radius: 999px;
  background: var(--primary, #0d4fc4);
}


/* ── Empty state ────────────────────────────────────────────────────────── */
.blog-empty-public {
  flex: 1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary, #475569);
}

.blog-empty-public-icon {
  font-size: 48px;
  margin-bottom: 14px;
  opacity: .4;
}


/* ╔═══════════════════════════════════════════════════════════════════════╗
 * ║ MODAL DE LEITURA                                                       ║
 * ╚═══════════════════════════════════════════════════════════════════════╝ */

.blog-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.blog-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.blog-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 26, 67, .7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.blog-modal-card {
  position: relative;
  background: #fff;
  border-radius: 18px;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .35);
  transform: scale(.95) translateY(20px);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}

.blog-modal.is-open .blog-modal-card {
  transform: none;
}

.blog-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e293b;
  z-index: 2;
  transition: all .2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.blog-modal-close:hover {
  background: #fff;
  transform: scale(1.08);
}

.blog-modal-image {
  height: 240px;
  background: linear-gradient(135deg, #3ac3ed, #0313a5);
  flex-shrink: 0;
  overflow: hidden;
}

.blog-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-modal-body {
  padding: 24px 30px 30px;
  overflow-y: auto;
  flex: 1;
}

.blog-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.blog-modal-tag {
  background: rgba(58, 195, 237, .14);
  color: var(--primary, #0d4fc4);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.blog-modal-title {
  font-size: clamp(1.3rem, 1.5vw + .5rem, 1.7rem);
  font-weight: 800;
  color: #1e293b;
  line-height: 1.25;
  margin: 0 0 8px;
}

.blog-modal-subtitle {
  font-size: clamp(.95rem, 1vw + .25rem, 1.1rem);
  color: #64748b;
  margin: 0 0 14px;
  line-height: 1.5;
}

.blog-modal-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.blog-modal-content {
  border-top: 1px solid rgba(7, 0, 104, .1);
  padding-top: 20px;
  font-size: 15px;
  line-height: 1.75;
  color: #334155;
}

.blog-modal-content h1, .blog-modal-content h2, .blog-modal-content h3, .blog-modal-content h4 {
  color: #1e293b;
  margin: 22px 0 10px;
  line-height: 1.3;
}
.blog-modal-content h1 { font-size: 1.4rem; font-weight: 800; }
.blog-modal-content h2 { font-size: 1.2rem; font-weight: 700; }
.blog-modal-content h3 { font-size: 1.05rem; font-weight: 700; }
.blog-modal-content p { margin: 10px 0; }
.blog-modal-content ul, .blog-modal-content ol { padding-left: 28px; margin: 12px 0; }
.blog-modal-content li { margin: 4px 0; }
.blog-modal-content strong { color: #1e293b; font-weight: 700; }
.blog-modal-content em { font-style: italic; }
.blog-modal-content a {
  color: var(--primary, #0d4fc4);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.blog-modal-content a:hover { color: #0a3b8f; }
.blog-modal-content code {
  background: #f1f5f9;
  color: #1e293b;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: .9em;
}
.blog-modal-content pre {
  background: #f1f5f9;
  padding: 14px 18px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 14px 0;
}
.blog-modal-content pre code { background: transparent; padding: 0; }
.blog-modal-content img {
  max-width: 100%;
  border-radius: 10px;
  margin: 14px 0;
}
.blog-modal-content blockquote {
  border-left: 4px solid var(--primary, #0d4fc4);
  padding-left: 16px;
  margin: 14px 0;
  color: #475569;
  font-style: italic;
}


/* ╔═══════════════════════════════════════════════════════════════════════╗
 * ║ RESPONSIVIDADE                                                         ║
 * ║                                                                        ║
 * ║ ≥769px → 3 cards visíveis                                              ║
 * ║ 481-768px → 2 cards visíveis                                           ║
 * ║ ≤480px → 1 card visível                                                ║
 * ╚═══════════════════════════════════════════════════════════════════════╝ */

/* TABLET: 2 cards visíveis */
@media (max-width: 1024px) and (min-width: 769px) {
  .blog-post-card {
    flex: 0 0 calc((100% - 48px) / 3);
    max-width: calc((100% - 48px) / 3);
    height: 420px;
  }
  .blog-post-image { height: 200px; }
}

@media (max-width: 768px) and (min-width: 481px) {
  .blog-post-card {
    flex: 0 0 calc((100% - 24px) / 2);
    max-width: calc((100% - 24px) / 2);
    height: 420px;
  }
  .blog-post-image { height: 200px; }

  .blog-arrow {
    width: 44px;
    height: 44px;
  }
  .blog-arrow svg { width: 20px; height: 20px; }
}

/* MOBILE: 1 card visível */
@media (max-width: 480px) {
  .blog-section { padding: 3rem 0 4rem; }
  .blog-intro { margin-bottom: 2rem; }

  .blog-carousel {
    gap: 10px;
    padding: 0 .5rem;
  }

  .blog-post-card {
    flex: 0 0 100%;
    max-width: 100%;
    height: 440px;
  }

  .blog-post-image { height: 200px; }
  .blog-post-body { padding: 18px 20px 20px; }
  .blog-post-title { font-size: 1rem; }
  .blog-post-subtitle { font-size: .85rem; }

  .blog-track { gap: 12px; }

  .blog-arrow {
    width: 40px;
    height: 40px;
  }
  .blog-arrow svg { width: 18px; height: 18px; }

  /* Modal full bleed */
  .blog-modal { padding: 0; }
  .blog-modal-card {
    max-height: 100vh;
    max-width: 100%;
    border-radius: 0;
  }
  .blog-modal-image { height: 200px; }
  .blog-modal-body { padding: 20px 18px 24px; }
  .blog-modal-close {
    width: 34px;
    height: 34px;
    top: 10px;
    right: 10px;
  }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
  .blog-track,
  .blog-modal-card,
  .blog-post-card,
  .blog-post-image img {
    transition: none !important;
  }
}