/* ================================================
   BLOG PAGE STYLES - CLEAN DESIGN
   Lightened design consistent with index page
   ================================================ */

/* ================================================
   BLOG CONTAINER
   ================================================ */
.all-publications {
  padding: 2rem 0;
  min-height: 80vh;
  background: linear-gradient(135deg, rgba(39, 137, 206, 0.02) 0%, rgba(39, 137, 206, 0.01) 100%);
}

.all-publications .container {
  max-width: 1200px;
}

.row {
  margin-right: 0;
  margin-left: 0;
}

/* ================================================
   BLOG CARDS - CLEAN DESIGN WITH ANIMATIONS
   ================================================ */
.blog-card {
  border: none;
  background: #ffffff;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(39, 137, 206, 0.06);
  border: 1px solid rgba(39, 137, 206, 0.08);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #2789ce, #1e6bb8);
  transition: left 0.5s ease;
  z-index: 2;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(39, 137, 206, 0.12);
  border-color: rgba(39, 137, 206, 0.15);
}

.blog-card:hover::before {
  left: 100%;
}

/* Garante que o container dos cards tenha largura uniforme */
.all-publications .col-12.col-md-6.col-lg-4 {
  display: flex;
  flex-direction: column;
}

/* ================================================
   CARD IMAGES - SIMPLIFIED STYLING
   ================================================ */
.card-image-wrapper {
  overflow: hidden;
  height: 200px;
  flex-shrink: 0;
  width: 100%;
  position: relative;
}

.blog-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-thumb {
  transform: scale(1.02);
}

/* ================================================
   CARD CONTENT - CLEAN SPACING
   ================================================ */
.blog-card .card-body {
  padding: 1.5rem 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

/* ================================================
   POST META - SIMPLIFIED DESIGN
   ================================================ */
.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.post-date {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(39, 137, 206, 0.04);
  padding: 0.25rem 0.625rem;
  border-radius: 15px;
  border: 1px solid rgba(39, 137, 206, 0.08);
  white-space: nowrap;
}

.post-date i {
  color: #2789ce;
  font-size: 0.8rem;
}

.post-category {
  font-size: 0.7rem;
  color: #6c757d;
  letter-spacing: 0.5px;
  white-space: nowrap;
  background: rgba(39, 137, 206, 0.04);
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(39, 137, 206, 0.2);
  margin-bottom: 0;
  border: 1px solid rgba(39, 137, 206, 0.08);
}

/* ================================================
   POST TITLES - CLEAN TYPOGRAPHY
   ================================================ */
.blog-card .card-title {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: #2c3e50;
  word-wrap: break-word;
  hyphens: auto;
}

.blog-card .card-title .post-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: color 0.3s ease;
  position: relative;
}

.blog-card .card-title .post-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #2789ce, #1e6bb8);
  transition: width 0.3s ease;
}

.blog-card .card-title .post-link:hover {
  color: #2789ce;
  text-decoration: none;
}

.blog-card .card-title .post-link:hover::after {
  width: 100%;
}

/* ================================================
   POST DESCRIPTIONS - CLEAN READABILITY
   ================================================ */
.blog-card .card-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #5a6c7d;
  margin-bottom: 1.25rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex-grow: 1;
}

/* ================================================
   POST TAGS - CLEAN BADGE DESIGN
   ================================================ */
.post-tags {
  margin-bottom: 1rem;
}

/* ================================================
   READ MORE BUTTON - SIMPLIFIED DESIGN
   ================================================ */
.btn-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.40rem 1.00rem;
  background: #2789ce;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.8rem;
  align-self: flex-start;
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(39, 137, 206, 0.15);
}

.btn-read-more:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(39, 137, 206, 0.2);
  text-decoration: none;
  color: white;
  background: #1e6bb8;
}

/* ================================================
   ANIMATION ENTRANCE EFFECTS
   ================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-card {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* Delay escalonado para os cards */
.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.15s; }
.blog-card:nth-child(3) { animation-delay: 0.2s; }
.blog-card:nth-child(4) { animation-delay: 0.25s; }
.blog-card:nth-child(5) { animation-delay: 0.3s; }
.blog-card:nth-child(6) { animation-delay: 0.35s; }

/* ================================================
   LOADING STATE (opcional)
   ================================================ */
.blog-card.loading {
  opacity: 0.7;
  pointer-events: none;
}

.blog-card.loading .card-body {
  position: relative;
}

.blog-card.loading .card-body::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #2789ce;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ================================================
   RESPONSIVE ADJUSTMENTS - CLEAN
   ================================================ */
@media (max-width: 768px) {
  .all-publications {
    padding: 2.5rem 0;
  }

  .blog-card .card-body {
    padding: 1.25rem 1rem;
  }

  .card-image-wrapper {
    height: 180px;
  }

  .blog-card .card-title {
    font-size: 1.125rem;
    margin-bottom: 0.875rem;
  }

  .blog-card .card-text {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  .post-meta {
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
  }

  .post-category {
    align-self: flex-end;
  }

  .btn-read-more {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  /* Reduz a transformação hover em mobile */
  .blog-card:hover {
    transform: translateY(-2px);
  }
}

@media (max-width: 576px) {
  .blog-card .card-body {
    padding: 1rem 0.875rem;
  }

  .card-image-wrapper {
    height: 160px;
  }

  .blog-card .card-title {
    font-size: 1rem;
  }

  .post-date,
  .post-category {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }
}

/* ================================================
   HOVER EFFECTS FOR ACCESSIBILITY
   ================================================ */
@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-thumb,
  .btn-read-more,
  .post-link {
    transition: none;
    animation: none;
  }

  .blog-card:hover {
    transform: none;
  }

  .blog-card:hover .blog-thumb {
    transform: none;
  }
}

/* ================================================
   HIGH CONTRAST MODE SUPPORT
   ================================================ */
@media (prefers-contrast: high) {
  .blog-card {
    border: 2px solid #2789ce;
  }

  .post-category {
    background: #2789ce;
    color: white;
  }

  .btn-read-more {
    background: #2789ce;
    border: 2px solid #1e6bb8;
  }
}
