/* =============================================================
   BLOG STYLES - MANTENDO CONTEÚDO VISÍVEL
   ============================================================= */

/* Garante header consistente com outras páginas */
.header {
  background: var(--color-white) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Blog Hero */
.blog-hero-section {
  background: var(--color-white);
  padding: 100px 0 40px;
}

.blog-hero-section .container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.blog-hero-title {
  font-family: 'Oswald', sans-serif;
  font-size: 3.5rem;
  color: #000;
  margin: 0;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  line-height: 1.3em;
}

/* Blog Content Section */
.blog-content-section {
  padding: 80px 0;
  background: var(--color-white);
}

/* Quando o botão está oculto (sem mais posts), reduz padding bottom */
.blog-content-section.no-more-posts {
  padding-bottom: 100px;
}

.blog-content-section .container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Featured Row - Usa calc para largura exata */
.blog-featured-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 4rem;
}

/* Featured post - largura de 2 cards + 1 gap */
.blog-featured-post {
  flex: 0 0 calc(66.666666% - 0.666666rem);
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-featured-post:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.blog-featured-post .post-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.featured-content {
  padding: 2.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.featured-content .post-category {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  display: block;
}

.featured-content h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  color: #000;
  margin-bottom: 1.5rem;
  line-height: 1.3;
  text-transform: uppercase;
}

.featured-content p {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  color: #333;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.featured-content .post-date {
  color: #6c757d;
  font-size: 0.9rem;
}

/* Sidebar/Licitações - largura de 1 card */
.blog-sidebar {
  flex: 0 0 calc(33.333333% - 1.333333rem);
}

/* Licitações Box */
.licitacoes-box-link {
  text-decoration: none;
  display: block;
  height: 100%;
}

.licitacoes-box {
  background: #666;
  color: #fff;
  padding: 2rem;
  border-radius: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  transition: transform 0.3s ease;
}

.licitacoes-box:hover {
  transform: translateY(-5px);
}

.licitacoes-box h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  color: #fff;
  text-align: left;
  line-height: 1.3;
}

.licitacoes-box p {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #fff;
  text-align: left;
  margin: 0;
}

/* Posts Grid - 3 colunas exatamente iguais */
.blog-posts-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Cada card tem exatamente 1/3 da largura menos os gaps */
.blog-post-card,
.post-card {
  flex: 0 0 calc(33.333333% - 1.333333rem);
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.blog-post-card:hover,
.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.blog-post-card .post-link,
.post-card .post-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-post-card .post-content,
.post-card .post-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 100%;
}

.blog-post-card .post-category,
.post-card .post-category {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  display: block;
}

.blog-post-card h3,
.post-card h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  color: #000;
  margin-bottom: 1rem;
  line-height: 1.3;
  text-transform: uppercase;
}

.blog-post-card p,
.post-card p {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.blog-post-card .post-date,
.post-card .post-date {
  color: #6c757d;
  font-size: 0.85rem;
  margin-top: auto;
}

/* Container do botão carregar mais */
.blog-load-more {
  text-align: center;
  margin: 3rem auto 0;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 1400px;
  padding: 0 20px;
}

/* Remove margem do botão dentro deste container específico */
.blog-load-more .btn-primary {
  margin-top: 0;
}

/* Quando o botão está escondido */
.blog-load-more[style*="display: none"] {
  margin: 0;
  padding: 0;
  height: 0;
}

/* Alternativa usando CSS Grid com frações precisas */
@supports (display: grid) {
  .blog-featured-row {
    display: grid;
    grid-template-columns: calc((100% - 2rem) * 0.6666667) calc((100% - 2rem) * 0.3333333);
    gap: 2rem;
    margin-bottom: 4rem;
  }
  
  .blog-featured-post {
    flex: none;
  }
  
  .blog-sidebar {
    flex: none;
  }
  
  .blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
  }
  
  .blog-post-card,
  .post-card {
    flex: none;
  }
}

/* Related posts grid */
.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.related-posts-grid .blog-post-card {
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-posts-grid .blog-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Desktop grande - garantir proporções */
@media (min-width: 1025px) {
  .blog-featured-row {
    display: grid;
    grid-template-columns: 2.08fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
  }
  
  .blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
  }
}

/* =============================================================
   POST PAGE STYLES - ALINHAMENTO CORRETO COM NAVBAR
   ============================================================= */

.post-content-section {
  padding: 80px 0;
  background: #fff;
}

.post-content-section .container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.post-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.post-hero-image {
  width: 100%;
  margin-bottom: 3rem;
}

.post-hero-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.post-content-area {
  width: 100%;
  max-width: 100%;
}

.post-title {
  font-family: 'Oswald', sans-serif;
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  color: #000;
  margin-bottom: 2rem;
  text-align: left;
}

.post-body {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
  text-align: left;
  width: 100%;
}

.post-body p {
  margin-bottom: 1.5rem;
}

.post-body h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  margin: 2rem 0 1rem;
  color: #000;
  text-transform: uppercase;
}

.post-body h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem;
  color: #333;
}

.post-body ul,
.post-body ol {
  margin: 1.5rem 0;
  padding-left: 3rem;
}

.post-body li {
  margin-bottom: 0.8rem;
  line-height: 1.6;
  color: #333;
}

.post-body strong,
.post-body b {
  font-weight: 600;
  color: #000;
}

.post-body blockquote {
  margin: 2rem 0;
  padding: 1rem 2rem;
  border-left: 4px solid #ff6a00;
  background: #f8f9fa;
  font-style: italic;
}

.post-body img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 8px;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.post-back-link {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  color: #333;
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

.post-back-link:hover {
  color: #6c757d;
}

.post-date {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}

/* Related Posts */
.related-posts-section {
  background: #f8f9fa;
  padding: 80px 0;
}

.related-posts-section .container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.related-posts-title {
  font-family: 'Oswald', sans-serif;
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  text-transform: uppercase;
  color: #000;
}

/* Garante que todos os links do menu mobile tenham o mesmo peso */
.mobile-nav-item a {
  font-weight: 500 !important;
}

/* =============================================================
   RESPONSIVE STYLES
   ============================================================= */

/* Tablet - mantém 2/3 e 1/3 no featured, 2 colunas nos posts */
@media (min-width: 769px) and (max-width: 1024px) {
  .blog-featured-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
  }
  
  .blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
  }
  
  .blog-post-card,
  .post-card {
    flex: none;
  }
  
  .related-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Blog Hero Mobile */
  .blog-hero-title {
    font-size: 2.5rem;
    text-align: center;
  }
  
  /* Container principal - estrutura em coluna */
  .blog-content-section .container {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  
  /* Featured Row Mobile - Estrutura sem gap extra */
  .blog-featured-row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 0;
  }
  
  /* Featured post vem primeiro */
  .blog-featured-post {
    flex: 1 1 100%;
    order: 1;
    margin-bottom: 0;
  }
  
  /* Licitações box vem segundo */
  .blog-sidebar {
    flex: 1 1 100%;
    order: 2;
    width: 100%;
    margin-bottom: 0;
  }
  
  /* Box de Licitações - 30% maior em altura no mobile */
  .licitacoes-box {
    min-height: 280px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
  }
  
  .licitacoes-box h3 {
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    margin-top: 0;
  }
  
  .licitacoes-box p {
    font-size: 0.95rem;
    margin-top: 0;
    flex-grow: 0;
  }
  
  /* Posts Grid Mobile */
  .blog-posts-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0;
  }
  
  /* Cada card ocupa 100% da largura */
  .blog-post-card,
  .post-card {
    flex: 1 1 100%;
    width: 100%;
    margin: 0;
  }
  
  /* Related Posts Mobile */
  .related-posts-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  
  /* Post Page Mobile */
  .post-title {
    font-size: 2rem;
  }
  
  .post-body {
    font-size: 0.95rem;
  }
  
  /* Ajuste padding dos cards no mobile */
  .blog-post-card .post-content,
  .post-card .post-content,
  .featured-content {
    padding: 1.5rem;
  }
  
  /* Botão carregar mais no mobile */
  .blog-load-more {
    margin-top: 1.5rem;
  }
}

/* Mobile pequeno */
@media (max-width: 480px) {
  .blog-hero-title {
    font-size: 2rem;
  }
  
  .blog-featured-row {
    gap: 1.2rem;
  }
  
  .blog-posts-grid {
    gap: 1.2rem;
    margin-top: 1.2rem;
  }
  
  .related-posts-grid {
    gap: 1.2rem;
  }
  
  .featured-content h2 {
    font-size: 1.5rem;
  }
  
  .blog-post-card h3,
  .post-card h3 {
    font-size: 1.2rem;
  }
  
  .blog-post-card .post-content,
  .post-card .post-content {
    padding: 1.2rem;
  }
  
  .post-title {
    font-size: 1.8rem;
  }
  
  .licitacoes-box {
    min-height: 240px;
    padding: 1.5rem;
  }
  
  .licitacoes-box h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }
  
  .licitacoes-box p {
    font-size: 0.9rem;
  }
  
  .blog-load-more {
    margin-top: 1.2rem;
  }
}