/* ========================================
   Blog Magazine CSS - Otimiza Pro
   Layout editorial para a pagina de listagem
   ======================================== */

/* === Blog Hero === */
.blog-hero {
  padding: 8rem 0 3rem;
  text-align: center;
  background: var(--white);
  border-bottom: 1px solid var(--gray-medium);
}
body[data-theme='dark'] .blog-hero {
  background: var(--dark-bg);
  border-bottom-color: #1e293b;
}
.blog-hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
body[data-theme='dark'] .blog-hero__title {
  color: #f1f5f9;
}
.blog-hero__description {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}
body[data-theme='dark'] .blog-hero__description {
  color: #94a3b8;
}

/* === Category Filter === */
.blog-categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.blog-categories__btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--gray-medium);
  border-radius: 50px;
  background: transparent;
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-family);
}
.blog-categories__btn:hover,
.blog-categories__btn.is-active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}
body[data-theme='dark'] .blog-categories__btn {
  border-color: #334155;
  color: #94a3b8;
}
body[data-theme='dark'] .blog-categories__btn:hover,
body[data-theme='dark'] .blog-categories__btn.is-active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* === Featured Article Section === */
.blog-featured {
  padding: 3rem 0 0;
  background: var(--gray-light);
}
body[data-theme='dark'] .blog-featured {
  background: var(--dark-surface);
}

.featured-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 420px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease;
}
.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}
body[data-theme='dark'] .featured-card {
  background: #1e293b;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.featured-card__image {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}
.featured-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.featured-card:hover .featured-card__image img {
  transform: scale(1.05);
}
.featured-card__category {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}

.featured-card__content {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-card__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary-color);
  margin-bottom: 1rem;
}
.featured-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
body[data-theme='dark'] .featured-card__meta {
  color: #64748b;
}
.featured-card__title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 1rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.featured-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}
.featured-card__title a:hover {
  color: var(--primary-color);
}
body[data-theme='dark'] .featured-card__title {
  color: #f1f5f9;
}
.featured-card__excerpt {
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
body[data-theme='dark'] .featured-card__excerpt {
  color: #94a3b8;
}
.featured-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: gap 0.25s ease;
}
.featured-card__link::after {
  content: '\2192';
  transition: transform 0.25s ease;
}
.featured-card__link:hover {
  gap: 0.8rem;
}

/* === Magazine Grid Section === */
.blog-articles {
  padding: 3rem 0 6rem;
  background: var(--gray-light);
}
body[data-theme='dark'] .blog-articles {
  background: var(--dark-surface);
}

.magazine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* === Magazine Card (Standard) === */
.mg-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--gray-medium);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
}
body[data-theme='dark'] .mg-card {
  background: #1e293b;
  border-color: #334155;
}
.mg-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}
body[data-theme='dark'] .mg-card:hover {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.mg-card__image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}
.mg-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.mg-card:hover .mg-card__image img {
  transform: scale(1.05);
}
.mg-card__category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}

.mg-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.mg-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
body[data-theme='dark'] .mg-card__meta {
  color: #64748b;
}
.mg-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.mg-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}
.mg-card__title a:hover {
  color: var(--primary-color);
}
body[data-theme='dark'] .mg-card__title {
  color: #f1f5f9;
}
.mg-card__excerpt {
  font-size: 0.925rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  flex: 1;
}
body[data-theme='dark'] .mg-card__excerpt {
  color: #94a3b8;
}
.mg-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: gap 0.25s ease;
  margin-top: auto;
}
.mg-card__link::after {
  content: '\2192';
  transition: transform 0.25s ease;
}
.mg-card__link:hover {
  gap: 0.7rem;
}

/* === Large Card (spans 2 columns) === */
.mg-card--large {
  grid-column: span 2;
  flex-direction: row;
}
.mg-card--large .mg-card__image {
  aspect-ratio: auto;
  min-height: 280px;
  flex: 0 0 45%;
}
.mg-card--large .mg-card__body {
  padding: 2rem;
  justify-content: center;
}
.mg-card--large .mg-card__title {
  font-size: 1.35rem;
}
.mg-card--large .mg-card__excerpt {
  font-size: 1rem;
}

/* === Category Badge Colors === */
.cat-gestao {
  background: var(--primary-color);
}
.cat-tech {
  background: #3b82f6;
}
.cat-finance {
  background: #10b981;
}
.cat-compliance {
  background: #6366f1;
}
.cat-esg {
  background: #22c55e;
}
.cat-urgente {
  background: #ef4444;
}

/* Category gradient fallbacks on card images */
.mg-card[data-categories*='compliance'] .mg-card__image,
.featured-card[data-categories*='compliance'] .featured-card__image {
  background: linear-gradient(135deg, #ede7f6 0%, #d1c4e9 100%);
}
.mg-card[data-categories*='esg'] .mg-card__image,
.featured-card[data-categories*='esg'] .featured-card__image {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}
.mg-card[data-categories*='tech'] .mg-card__image,
.featured-card[data-categories*='tech'] .featured-card__image {
  background: linear-gradient(135deg, #e1f5fe 0%, #b3e5fc 100%);
}
.mg-card[data-categories*='finance'] .mg-card__image,
.featured-card[data-categories*='finance'] .featured-card__image {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}
.mg-card[data-categories*='gestao'] .mg-card__image,
.featured-card[data-categories*='gestao'] .featured-card__image {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

/* === Newsletter CTA (In-Grid) === */
.mg-newsletter {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #0d1b2a 0%, #1e3a5f 100%);
  border-radius: 20px;
  padding: 3.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}
.mg-newsletter::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 50%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
  pointer-events: none;
}
.mg-newsletter__content {
  position: relative;
  z-index: 1;
  flex: 1;
}
.mg-newsletter__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.5rem;
}
.mg-newsletter__text {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}
.mg-newsletter__form {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}
.mg-newsletter__input {
  padding: 0.85rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.95rem;
  font-family: var(--font-family);
  min-width: 280px;
  transition: border-color 0.3s ease;
}
.mg-newsletter__input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.mg-newsletter__input:focus {
  outline: none;
  border-color: var(--primary-color);
}
body[data-theme='dark'] .mg-newsletter {
  border: 1px solid #334155;
}

/* === Blog CTA === */
.blog-cta {
  background: linear-gradient(135deg, #0d1b2a 0%, #1e3a5f 100%);
  color: white;
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.blog-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.08) 0%, transparent 70%);
}
.blog-cta .container {
  position: relative;
  z-index: 1;
}
.blog-cta__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 1rem;
  font-weight: 800;
}
.blog-cta__text {
  opacity: 0.85;
  margin-bottom: 2rem;
  font-size: 1.05rem;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* === No Results === */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* === Responsive === */
@media (max-width: 968px) {
  .magazine-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mg-card--large {
    grid-column: 1 / -1;
  }
  .featured-card {
    grid-template-columns: 1fr;
  }
  .featured-card__image {
    min-height: 250px;
  }
  .featured-card__content {
    padding: 2rem;
  }
  .mg-newsletter {
    flex-direction: column;
    text-align: center;
    padding: 2.5rem 2rem;
  }
  .mg-newsletter__form {
    flex-direction: column;
    width: 100%;
  }
  .mg-newsletter__input {
    min-width: auto;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .blog-hero {
    padding: 7rem 0 2.5rem;
  }
  .blog-hero__title {
    font-size: 1.75rem;
  }
  .blog-hero__description {
    font-size: 1rem;
  }
  .blog-articles {
    padding: 2rem 0 4rem;
  }
  .blog-categories__btn {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }
  .featured-card__title {
    font-size: 1.35rem;
  }
}

@media (max-width: 640px) {
  .magazine-grid {
    grid-template-columns: 1fr;
  }
  .mg-card--large {
    grid-column: auto;
    flex-direction: column;
  }
  .mg-card--large .mg-card__image {
    aspect-ratio: 16 / 9;
    min-height: auto;
    flex: none;
  }
  .mg-card--large .mg-card__body {
    padding: 1.5rem;
  }
  .mg-card--large .mg-card__title {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .blog-categories {
    gap: 0.35rem;
  }
  .blog-categories__btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
  }
  .mg-newsletter {
    padding: 2rem 1.5rem;
  }
  .mg-newsletter__title {
    font-size: 1.25rem;
  }
}
