/* ============================================
   BLOG PAGE STYLES
   Purpose: Styles specific to blog.ejs
   Mobile-first approach
   ============================================ */

/* ============================================
   BLOG HERO SECTION
   ============================================ */

.blog-hero {
  padding: 80px 20px;
  background: linear-gradient(135deg, #5B8DDB 0%, #7BA5E8 100%);
  color: var(--text-on-primary);
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

@media (min-width: 768px) {
  .blog-hero {
    padding: 100px 40px;
  }
}

.blog-hero.fade-in {
  opacity: 1;
}

@media (min-width: 768px) {
  .blog-hero.fade-in {
    opacity: 1;
  }
}

.hero-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-on-primary);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 52px;
    margin-bottom: 20px;
  }
}

.hero-subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 22px;
  }
}

/* ============================================
   BLOG POSTS SECTION
   ============================================ */

.blog-posts {
  padding: 60px 20px;
  background-color: var(--bg-cream);
  min-height: 60vh;
}

@media (min-width: 768px) {
  .blog-posts {
    padding: 80px 40px;
  }
}

/* ============================================
   BLOG FILTERS
   ============================================ */

.blog-filters {
  max-width: 1200px;
  margin: 0 auto 40px;
}

@media (min-width: 768px) {
  .blog-filters {
    margin-bottom: 60px;
  }
}

.search-wrapper {
  display: flex;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .search-wrapper {
    gap: 16px;
  }
}

.search-input {
  flex: 1;
  padding: 14px 20px;
  font-size: 16px;
  border: 2px solid var(--bg-light);
  border-radius: var(--radius-medium);
  background-color: var(--bg-white);
  transition: border-color var(--transition-fast);
}

@media (min-width: 768px) {
  .search-input {
    padding: 16px 24px;
    font-size: 17px;
  }
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-blue);
}

@media (min-width: 768px) {
  .search-input:focus {
    border-color: var(--primary-blue);
  }
}

.search-btn {
  padding: 14px 24px;
  background-color: var(--primary-blue);
  color: var(--text-on-primary);
  border: none;
  border-radius: var(--radius-medium);
  font-size: 20px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

@media (min-width: 768px) {
  .search-btn {
    padding: 16px 32px;
    font-size: 22px;
  }
}

.search-btn:hover {
  background-color: var(--primary-blue-hover);
}

@media (min-width: 768px) {
  .search-btn:hover {
    background-color: var(--primary-blue-hover);
  }
}

.search-icon {
  display: block;
}

@media (min-width: 768px) {
  .search-icon {
    display: block;
  }
}

/* ============================================
   POSTS GRID
   ============================================ */

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

@media (min-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.posts-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
}

@media (min-width: 768px) {
  .posts-loading {
    padding: 100px 20px;
  }
}

.loading-spinner-large {
  width: 48px;
  height: 48px;
  border: 4px solid var(--bg-light);
  border-top-color: var(--primary-blue);
  border-radius: var(--radius-circle);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@media (min-width: 768px) {
  .loading-spinner-large {
    width: 60px;
    height: 60px;
    border: 5px solid var(--bg-light);
    border-top-color: var(--primary-blue);
  }
}

.posts-loading p {
  font-size: 16px;
  color: var(--text-medium);
}

@media (min-width: 768px) {
  .posts-loading p {
    font-size: 18px;
  }
}

/* ============================================
   POST CARD
   ============================================ */

.post-card {
  background-color: var(--bg-white);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  opacity: 0;
  transform: translateY(30px);
}

@media (min-width: 768px) {
  .post-card {
    opacity: 0;
  }
}

.post-card.animate-in {
  opacity: 1;
  transform: translateY(0);
  animation: slideUp 0.6s ease forwards;
}

@media (min-width: 768px) {
  .post-card.animate-in {
    animation: slideUp 0.6s ease forwards;
  }
}

.post-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
  text-decoration: none;
}

@media (min-width: 768px) {
  .post-card:hover {
    transform: translateY(-10px);
  }
}

.post-image {
  width: 100%;
  height: 220px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-light);
}

@media (min-width: 768px) {
  .post-image {
    height: 240px;
  }
}

.post-image-placeholder {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, var(--primary-blue-light) 0%, var(--primary-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .post-image-placeholder {
    height: 240px;
  }
}

.post-image-placeholder .placeholder-icon {
  font-size: 64px;
}

@media (min-width: 768px) {
  .post-image-placeholder .placeholder-icon {
    font-size: 72px;
  }
}

.post-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .post-content {
    padding: 28px;
  }
}

.post-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-dark);
  line-height: 1.3;
}

@media (min-width: 768px) {
  .post-title {
    font-size: 22px;
    margin-bottom: 16px;
  }
}

.post-excerpt {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: var(--text-medium);
  flex: 1;
  max-height: 160px;
  overflow: auto;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .post-excerpt {
    font-size: 16px;
    margin-bottom: 20px;
  }
}

.post-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bg-light);
}

@media (min-width: 768px) {
  .post-meta {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
  }
}

.post-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-medium);
}

@media (min-width: 768px) {
  .post-author {
    font-size: 15px;
  }
}

.post-date {
  font-size: 13px;
  color: var(--text-light);
}

@media (min-width: 768px) {
  .post-date {
    font-size: 14px;
  }
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (min-width: 768px) {
  .post-footer {
    justify-content: space-between;
  }
}

.post-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-blue);
}

@media (min-width: 768px) {
  .post-link {
    font-size: 16px;
  }
}

.post-views {
  font-size: 13px;
  color: var(--text-light);
}

@media (min-width: 768px) {
  .post-views {
    font-size: 14px;
  }
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}

@media (min-width: 768px) {
  .pagination {
    margin-top: 64px;
  }
}

.pagination-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

@media (min-width: 768px) {
  .pagination-controls {
    gap: 24px;
  }
}

.pagination-btn {
  padding: 12px 24px;
  background-color: var(--primary-blue);
  color: var(--text-on-primary);
  border: none;
  border-radius: var(--radius-medium);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

@media (min-width: 768px) {
  .pagination-btn {
    padding: 14px 32px;
    font-size: 16px;
  }
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--primary-blue-hover);
  transform: translateY(-2px);
}

@media (min-width: 768px) {
  .pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
  }
}

.pagination-btn:disabled {
  background-color: var(--bg-light);
  color: var(--text-light);
  cursor: not-allowed;
  transform: none;
}

@media (min-width: 768px) {
  .pagination-btn:disabled {
    background-color: var(--bg-light);
  }
}

.pagination-info {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-medium);
}

@media (min-width: 768px) {
  .pagination-info {
    font-size: 16px;
  }
}

/* ============================================
   EMPTY STATE
   ============================================ */

.blog-empty {
  padding: 80px 20px;
  background-color: var(--bg-cream);
}

@media (min-width: 768px) {
  .blog-empty {
    padding: 120px 40px;
  }
}

.empty-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  background-color: var(--bg-white);
  padding: 60px 32px;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
  .empty-content {
    padding: 80px 48px;
  }
}

.empty-icon {
  font-size: 80px;
  margin-bottom: 24px;
  opacity: 0.3;
}

@media (min-width: 768px) {
  .empty-icon {
    font-size: 100px;
    margin-bottom: 32px;
  }
}

.empty-content h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-dark);
}

@media (min-width: 768px) {
  .empty-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
  }
}

.empty-content p {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 32px;
  color: var(--text-medium);
}

@media (min-width: 768px) {
  .empty-content p {
    font-size: 18px;
    margin-bottom: 40px;
  }
}

/* ============================================
   ERROR STATE
   ============================================ */

.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background-color: var(--bg-white);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .error-state {
    padding: 80px 40px;
  }
}

.error-text {
  font-size: 16px;
  color: var(--error-red);
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .error-text {
    font-size: 18px;
    margin-bottom: 32px;
  }
}

/* ============================================
   BLOG CTA SECTION
   ============================================ */

.blog-cta {
  padding: 60px 20px;
  background-color: var(--bg-light);
}

@media (min-width: 768px) {
  .blog-cta {
    padding: 100px 40px;
  }
}

.cta-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

@media (min-width: 768px) {
  .cta-content {
    max-width: 800px;
  }
}

.cta-content h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-dark);
}

@media (min-width: 768px) {
  .cta-content h2 {
    font-size: 42px;
    margin-bottom: 20px;
  }
}

.cta-content p {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 32px;
  color: var(--text-medium);
}

@media (min-width: 768px) {
  .cta-content p {
    font-size: 18px;
    margin-bottom: 40px;
  }
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}

@media (min-width: 768px) {
  .cta-buttons {
    flex-direction: row;
    gap: 20px;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}