/* ==========================================================================
   Abelha Whats — blog.css (listagem + artigo)
   ========================================================================== */

.blog-page {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 12rem);
}

/* —— Toolbar (busca + categorias) —— */
.blog-toolbar {
  position: relative;
  z-index: 20;
  margin-top: -2.5rem;
}

.blog-toolbar__inner {
  border-radius: 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.04),
    0 24px 48px -24px rgba(37, 99, 235, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.25rem 1.5rem;
}

.blog-search {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.35rem 0.35rem 0.35rem 0.25rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.blog-search:focus-within {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.blog-search__icon {
  display: flex;
  align-items: center;
  padding-left: 0.75rem;
  color: #94a3b8;
  pointer-events: none;
}

.blog-search input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.65rem 0.5rem;
  font-size: 0.9375rem;
  color: #0f172a;
  outline: none;
}

.blog-search input[type="search"]::placeholder {
  color: #94a3b8;
}

.blog-search__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.75rem;
  padding: 0.65rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-search__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.45);
}

@media (max-width: 479px) {
  .blog-search {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
  }

  .blog-search__icon {
    display: none;
  }

  .blog-search input[type="search"] {
    padding: 0.75rem 0.65rem;
    border-radius: 0.65rem;
    background: #fff;
    border: 1px solid #e2e8f0;
  }

  .blog-search__btn {
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
  }
}

.blog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.blog-cat {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: #fff;
  transition: all 0.25s ease;
}

.blog-cat:hover {
  border-color: rgba(37, 99, 235, 0.35);
  color: #2563eb;
}

.blog-cat.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 4px 14px -4px rgba(37, 99, 235, 0.5);
}

.blog-cat.is-active--gold {
  color: #0b132b;
  background: linear-gradient(135deg, #eab308, #f59e0b);
  box-shadow: 0 4px 14px -4px rgba(245, 158, 11, 0.45);
}

/* —— Destaque —— */
.blog-featured {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: #fff;
  box-shadow: 0 25px 50px -24px rgba(15, 23, 42, 0.12);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.blog-featured:hover {
  box-shadow: 0 32px 64px -28px rgba(37, 99, 235, 0.18);
}

.blog-featured__media {
  position: relative;
  display: block;
  min-height: 280px;
  overflow: hidden;
  background: #e2e8f0;
}

@media (min-width: 1024px) {
  .blog-featured__media {
    min-height: 100%;
  }
}

.blog-featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-featured:hover .blog-featured__media img {
  transform: scale(1.04);
}

.blog-featured__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(11, 19, 43, 0.55) 100%);
  pointer-events: none;
}

.blog-featured__badge {
  position: absolute;
  left: 1.25rem;
  top: 1.25rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0b132b;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.blog-featured__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.75rem;
}

@media (min-width: 640px) {
  .blog-featured__body {
    padding: 2.5rem 2.5rem;
  }
}

/* —— Cards do grid —— */
.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.85);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.blog-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.blog-card:hover {
  transform: translateY(-6px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow:
    0 20px 40px -16px rgba(37, 99, 235, 0.14),
    0 0 0 1px rgba(37, 99, 235, 0.06);
}

.blog-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f1f5f9;
}

.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.blog-card:hover .blog-card__media img {
  transform: scale(1.06);
}

.blog-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.35rem 1.35rem 1.5rem;
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: #64748b;
}

.blog-meta__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.blog-meta__chip svg,
.blog-meta__chip [data-lucide] {
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.7;
}

.blog-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2563eb;
  transition: color 0.2s ease;
}

.blog-tag:hover {
  color: #3b82f6;
}

.blog-card__title {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
  transition: color 0.2s ease;
}

.blog-card:hover .blog-card__title a {
  color: #2563eb;
}

.blog-card__excerpt {
  margin-top: 0.5rem;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #64748b;
}

.blog-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.blog-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2563eb;
}

.blog-card:hover .blog-card__link {
  gap: 0.45rem;
}

/* —— Empty state —— */
.blog-empty {
  text-align: center;
  padding: 4rem 2rem;
  border-radius: 1.5rem;
  border: 2px dashed #cbd5e1;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.blog-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  margin-bottom: 1rem;
}

/* —— Paginação —— */
.blog-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.blog-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  background: #fff;
  transition: all 0.2s ease;
}

.blog-pagination__btn:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.35);
  color: #2563eb;
}

.blog-pagination__btn.is-current {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.5);
}

.blog-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.blog-pagination__gap {
  padding: 0 0.25rem;
  color: #94a3b8;
  user-select: none;
}

/* —— CTA strip —— */
.blog-cta {
  position: relative;
  overflow: hidden;
  background: var(--brand-navy, #0b132b);
}

.blog-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(59, 130, 246, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
  pointer-events: none;
}

.blog-cta__glow {
  position: absolute;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15), transparent 70%);
  top: -30%;
  right: -5%;
  pointer-events: none;
}

/* —— Artigo (post) —— */
.blog-article-hero {
  position: relative;
  padding-top: 6.5rem;
  padding-bottom: 2rem;
  background: var(--brand-navy, #0b132b);
  color: #f8fafc;
}

.blog-article-hero.hero-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(11, 19, 43, 0.4) 100%);
  pointer-events: none;
}

.blog-breadcrumb a {
  color: #94a3b8;
  transition: color 0.2s ease;
}

.blog-breadcrumb a:hover {
  color: #93c5fd;
}

.blog-breadcrumb [aria-hidden="true"] {
  color: #475569;
}

.blog-article-hero h1 {
  text-wrap: balance;
}

.blog-article-cover {
  margin-top: -1.5rem;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .blog-article-cover {
    padding: 0 1.5rem;
  }
}

.blog-article-cover__frame {
  margin: 0 auto;
  max-width: 56rem;
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 25px 50px -20px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  aspect-ratio: 21 / 9;
  background: #1e293b;
}

.blog-article-cover__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-article-layout {
  display: grid;
  gap: 2.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
}

@media (min-width: 1024px) {
  .blog-article-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    padding: 3rem 1.5rem 4rem;
    align-items: start;
  }
}

.blog-article-aside {
  display: none;
}

@media (min-width: 1024px) {
  .blog-article-aside {
    display: block;
    position: sticky;
    top: 6rem;
  }
}

.blog-aside-card {
  border-radius: 1.25rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  padding: 1.5rem;
  box-shadow: 0 12px 32px -20px rgba(15, 23, 42, 0.1);
}

.blog-share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.blog-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  color: #475569;
  background: #fff;
  transition: all 0.2s ease;
}

.blog-share__btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
}

.blog-share__btn.is-copied {
  border-color: #10b981;
  color: #059669;
}

.blog-inline-cta {
  margin-top: 2.5rem;
  padding: 1.75rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.5) 0%, rgba(255, 255, 255, 1) 50%);
}

/* —— Prose —— */
.blog-prose {
  color: #334155;
  font-size: 1.0625rem;
  line-height: 1.8;
  letter-spacing: -0.01em;
}

.blog-prose > *:first-child {
  margin-top: 0;
}

.blog-prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.35rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  border-bottom: 2px solid #f1f5f9;
}

.blog-prose h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.blog-prose p {
  margin-bottom: 1.35rem;
}

.blog-prose ul,
.blog-prose ol {
  margin-bottom: 1.35rem;
  padding-left: 1.5rem;
}

.blog-prose ul {
  list-style-type: disc;
}

.blog-prose ol {
  list-style-type: decimal;
}

.blog-prose li {
  margin-bottom: 0.5rem;
}

.blog-prose a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.blog-prose a:hover {
  color: #1d4ed8;
}

.blog-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 1rem;
  margin: 1.75rem 0;
  box-shadow: 0 12px 32px -16px rgba(15, 23, 42, 0.15);
}

.blog-prose blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid #f59e0b;
  border-radius: 0 0.75rem 0.75rem 0;
  background: #fffbeb;
  font-style: italic;
  color: #475569;
}

.blog-prose pre {
  overflow-x: auto;
  border-radius: 0.875rem;
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  margin-bottom: 1.35rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.blog-prose code {
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  border-radius: 0.35rem;
  background: #f1f5f9;
}

.blog-prose pre code {
  padding: 0;
  background: transparent;
}

/* Barra de progresso de leitura */
.blog-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #2563eb);
  transition: width 0.1s linear;
  pointer-events: none;
}

/* —— Reveal (listagem) —— */
.blog-reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.blog-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* —— Sumário (TOC) —— */
.blog-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 14rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.blog-toc__item {
  margin: 0;
}

.blog-toc__item--sub {
  padding-left: 0.75rem;
}

.blog-toc__list a {
  display: block;
  padding: 0.35rem 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #64748b;
  border-left: 2px solid transparent;
  padding-left: 0.65rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.blog-toc__list a:hover,
.blog-toc__list a.is-active {
  color: #2563eb;
  border-left-color: #2563eb;
}

.blog-aside-card--toc:not([hidden]) + .blog-aside-card {
  margin-top: 1rem;
}

/* —— Barra mobile (artigo) —— */
.blog-mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(110%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-mobile-bar.is-shown {
  transform: translateY(0);
}

@media (min-width: 1024px) {
  .blog-mobile-bar {
    display: none !important;
  }
}

.blog-mobile-bar__btn {
  flex: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  max-width: 6rem;
  padding: 0.5rem 0.35rem;
  border-radius: 0.75rem;
  border: none;
  background: transparent;
  font-size: 0.625rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.blog-mobile-bar__btn:hover,
.blog-mobile-bar__btn:focus-visible {
  background: #f1f5f9;
  color: #2563eb;
  outline: none;
}

.blog-mobile-bar__btn--accent {
  color: #059669;
}

.blog-mobile-bar__btn.is-copied {
  color: #059669;
}

/* —— Categorias scroll horizontal em mobile —— */
@media (max-width: 639px) {
  .blog-cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin-right: -0.5rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .blog-cats::-webkit-scrollbar {
    display: none;
  }

  .blog-cat {
    flex-shrink: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card:hover,
  .blog-featured:hover .blog-featured__media img,
  .blog-card:hover .blog-card__media img {
    transform: none;
  }

  .blog-read-progress {
    display: none;
  }

  .blog-reveal {
    opacity: 1;
    transform: none;
  }

  .blog-mobile-bar {
    transition: none;
  }
}
