/* Blog Stylesheet - Aposentados.org */

/* ===================================
   VARIABLES & RESET
   =================================== */
:root {
  --blog-font-size-base: 1rem;
  --blog-spacing-sm: 8px;
  --blog-spacing-md: 16px;
  --blog-spacing-lg: 24px;
  --blog-spacing-xl: 40px;
  --blog-spacing-2xl: 60px;
}

/* ===================================
   CONTAINER & LAYOUT
   =================================== */
.blog-container {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.blog-header {
    position: relative;
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: center;
    margin-bottom: 20px;
}

.header-blog {
    position: static !important;
    top: auto !important;
}

.blog-header h1 {
   font-size: 2rem;
   line-height: 1.2;
   color: var(--cor-primaria);
   margin: 0;
}

.blog-header h2 {
   font-size: 1.75rem;
   line-height: 1.2;
   color: var(--cor-texto);
   margin: 0;
}

.blog-header .logo {
   margin-bottom: 0;
}

.blog-header .nav-menu {
   margin-bottom: 0;
   list-style: none;
}

.blog-header .nav-menu li {
   list-style: none;
}

.section-subtitle {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.2rem;
  color: var(--cor-texto-leve);
}

/* ===================================
   BLOG INDEX - CARDS GRID
   =================================== */
.blog-posts-grid {
  display: grid;
  gap: 30px;
}

.blog-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}

/* ===================================
   STATS CARDS
   =================================== */
.stat-card {
  background-color: #f0f7ff;
  padding: 25px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-card.primary {
  background-color: var(--cor-fundo);
  color: var(--cor-primaria);
}

.stat-card.secondary {
  background-color: #fff8e1;
  color: var(--cor-secundaria);
}

.stat-card.success {
  background-color: #e8f5e9;
  color: #218838;
}

.stat-card.warning {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 1rem;
  color: var(--cor-texto-leve);
}

/* ===================================
   POST CARD
   =================================== */
.post-card {
  border-top: 5px solid var(--cor-secundaria);
  border-radius: 8px;
  padding: 25px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.post-card-content {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 30px;
  align-items: start;
}

/* ===================================
   POST DATE DISPLAY
   =================================== */
.post-date {
  min-width: 80px;
  text-align: center;
  padding: 15px;
  background: linear-gradient(135deg, var(--cor-primaria) 0%, #2d5a87 100%);
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(26, 90, 135, 0.3);
}

.post-date-day {
  font-size: 2rem;
  font-weight: bold;
  line-height: 1;
}

.post-date-month {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.post-date-year {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
}

.post-date-time {
  margin-top: 10px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.post-date-separator {
  color: rgba(255, 255, 255, 0.3);
  margin: 0 5px;
}

/* ===================================
   POST CONTENT
   =================================== */
.post-card-body {
  flex: 1;
}

.post-card-title {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 15px;
}

.post-card-title a {
  color: var(--cor-primaria);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card-title a:hover {
  color: var(--cor-secundaria);
  text-decoration: underline;
}

.post-excerpt {
  color: var(--cor-texto-leve);
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 1rem;
}

/* ===================================
   TAGS
   =================================== */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 15px;
}

.post-theme {
  background: linear-gradient(135deg, var(--cor-primaria) 0%, #1a3c5e 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 10px;
}

.post-theme.index {
  background: linear-gradient(135deg, #f0f7ff 0%, #0077b6 100%);
  color: var(--cor-primaria);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-tag, .tag {
  background-color: #f0f7ff;
  color: var(--cor-primaria);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.post-tag:hover, .tag:hover {
  background-color: var(--cor-primaria);
  color: white;
  transform: translateY(-2px);
}

.post-tag.secondary, .tag.secondary {
  background-color: #f8f9fa;
  color: var(--cor-texto-leve);
}

.post-tag.archive, .tag.archive {
  background-color: #e8f4fd;
  color: var(--cor-secundaria);
}

/* Estilo post-it para tags */
.tag.post-it {
  background-color: #fffacd;
  color: #333;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  border: 1px solid #ffeb3b;
  transform: rotate(-1deg);
  display: inline-block;
  margin: 2px 4px;
  position: relative;
  transition: all 0.3s ease;
}

.tag.post-it:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
  background-color: #fff176;
  border-color: #fdd835;
}

.tag.post-it::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: #ff9800;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  opacity: 0.5;
}

/* ===================================
   BUTTONS
   =================================== */
.btn-group {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 30px 0;
}

.btn-primary.blog {
  padding: 12px 30px;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--cor-primaria) 0%, #1a3c5e 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(26, 90, 135, 0.3);
}

.btn-primary.blog:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 90, 135, 0.4);
}

.btn-secondary.blog {
  padding: 12px 30px;
  font-size: 1.1rem;
  background-color: var(--cor-fundo);
  color: var(--cor-primaria);
  border: 2px solid var(--cor-primaria);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary.blog:hover {
  background-color: var(--cor-primaria);
  color: white;
}

.btn-small.blog {
  padding: 8px 20px;
  font-size: 0.95rem;
}

/* ===================================
   SINGLE POST
   =================================== */
.post-article {
  padding: 40px 20px;
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.post-article-header {
   margin-bottom: 20px;
   border-bottom: 1px solid #f0f0ff;
   padding-bottom: 15px;
}

.post-article-title {
  font-size: 2.5rem;
  line-height: 1.2;
  color: var(--cor-primaria);
  margin-bottom: 20px;
}

.post-article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 25px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
}

.post-date-label {
  font-size: 0.9rem;
  color: var(--cor-texto-leve);
  font-weight: 500;
}

.post-time-label {
  font-size: 0.9rem;
  color: var(--cor-texto-leve);
  margin-left: 5px;
}

.post-article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--cor-texto);
  margin-bottom: 40px;
}

/* ===================================
   FEATURED IMAGE
   =================================== */
.featured-image {
  margin-bottom: 30px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.featured-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.featured-image img:hover {
  transform: scale(1.05);
}

.featured-image-caption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--cor-texto-leve);
  margin-top: 15px;
  font-style: italic;
  padding: 0 20px;
}

/* ===================================
   POST NAVIGATION
   =================================== */
.post-nav {
  margin-top: 50px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding-top: 30px;
  border-top: 2px solid #f0f0ff;
}

.post-nav-prev {
  text-align: left;
}

.post-nav-next {
  text-align: right;
}

.post-nav-label {
  font-size: 0.9rem;
  color: var(--cor-texto-leve);
  margin-bottom: 5px;
  font-weight: 500;
}

.post-nav-link {
  color: var(--cor-primaria);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-nav-link:hover {
  color: var(--cor-secundaria);
  text-decoration: underline;
}

/* ===================================
   SHARE BUTTONS
   =================================== */
.share-section {
  background-color: #f9f9f9;
  padding: 25px;
  border-radius: 8px;
  margin: 30px 0;
  border: 2px solid #e0e0e0;
}

.share-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.share-btn {
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.share-btn.facebook {
  background: linear-gradient(135deg, #1877f2 0%, #0d65c9 100%);
  color: white;
}

.share-btn.whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===================================
   CTA SECTION
   =================================== */
.cta-section {
  background: linear-gradient(135deg, #f9f9f9 0%, #f0f7ff 100%);
  padding: 30px;
  border-radius: 12px;
  margin: 40px 0;
  text-align: center;
  box-shadow: 0 4px 16px rgba(240, 247, 255, 0.1);
}

.cta-section h3 {
  color: var(--cor-primaria);
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.cta-section p {
  margin-bottom: 25px;
  font-size: 1.1rem;
  color: var(--cor-texto-leve);
  line-height: 1.6;
}

/* ===================================
   TAGS PAGE
   =================================== */
.tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
}

.tag-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tag-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
}

.tag-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.tag-card-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--cor-primaria);
}

.tag-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tag-card-title a:hover {
  color: var(--cor-secundaria);
  text-decoration: underline;
}

.tag-count {
  color: var(--cor-texto-leve);
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.tag-posts-preview {
  border-top: 1px solid #e0e0e0;
  padding-top: 20px;
  width: 100%;
}

.tag-posts-preview h4 {
  font-size: 1rem;
  margin-bottom: 15px;
  color: var(--cor-texto-leve);
  font-weight: 600;
}

.tag-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tag-posts-list li {
  margin-bottom: 12px;
  border-left: 3px solid #f0f7ff;
  padding-left: 15px;
  transition: all 0.2s ease;
}

.tag-posts-list li:hover {
  background-color: #f9f9f9;
  transform: translateX(5px);
}

.tag-posts-list a {
  color: var(--cor-primaria);
  text-decoration: none;
  font-size: 0.95rem;
}

/* ===================================
   YEAR ARCHIVE
   =================================== */
.year-archive-grid {
  display: grid;
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
}

.year-post-card {
  border-top: 3px solid var(--cor-secundaria);
  border-radius: 8px;
  padding: 25px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.year-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.year-post-content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.year-post-date {
  min-width: 80px;
  text-align: center;
  padding: 15px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e0e0e0 100%);
  border-radius: 8px;
}

.year-post-body {
  flex: 1;
}

.year-post-title {
  font-size: 1.4rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.year-post-title a {
  color: var(--cor-primaria);
  text-decoration: none;
}

/* ===================================
   PAGINATION
   =================================== */
.pagination {
  margin-top: 60px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-info {
  padding: 10px 20px;
  color: var(--cor-texto-leve);
  font-size: 1rem;
  font-weight: 500;
}

.pagination-btn {
  padding: 10px 20px;
  background: white;
  color: var(--cor-primaria);
  border: 2px solid var(--cor-primaria);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

.pagination-btn:hover {
  background: var(--cor-primaria);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 90, 135, 0.3);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
  .blog-container {
    padding: 30px 15px;
  }

  .blog-header h1,
  .blog-header h2 {
    font-size: 2rem;
  }

  .blog-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
  }

  .blog-posts-grid {
    grid-template-columns: 1fr;
  }

  .post-card-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .post-date {
    min-width: auto;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
  }

  .post-card-title {
    font-size: 1.4rem;
  }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .tags-grid {
    grid-template-columns: 1fr;
  }

  .tag-card {
    padding: 25px;
  }

  .post-nav {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .share-buttons {
    justify-content: center;
  }

  .post-article {
    padding: 30px 15px;
  }

  .post-article-title {
    font-size: 2rem;
  }

  .year-archive-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .blog-container {
    padding: 20px 10px;
  }

  .blog-header h1,
  .blog-header h2 {
    font-size: 1.8rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .post-tag {
    font-size: 0.8rem;
    padding: 3px 8px;
  }

  .btn-primary.blog,
  .btn-secondary.blog {
    padding: 10px 20px;
    font-size: 1rem;
    width: 100%;
    text-align: center;
  }

  .pagination {
    flex-direction: column;
    gap: 8px;
  }

  .pagination-btn {
    width: 100%;
  }
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.post-card {
  animation: fadeIn 0.5s ease-out;
}

.tag-card {
  animation: slideIn 0.5s ease-out;
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-40 {
  margin-top: 40px;
}

.mb-40 {
  margin-bottom: 40px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, #f9f9f9 0%, #ffe9e9 100%);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.empty-state p {
  font-size: 1.2rem;
  color: var(--cor-texto-leve);
  margin-bottom: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cor-texto-leve);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(240, 247, 255, 0.1);
}

.back-link:hover {
  background: var(--cor-primaria);
  color: white;
  transform: translateX(-4px);
}

/* Fix: prevent headers from being fixed */
.post-article-header,
.blog-header {
  position: static !important;
  top: auto !important;
  margin-top: 0;
  padding-top: 0;
}
