/* Blog Page Specific Styles */
:root {
  --primary-red: #8b0000;
  --secondary-red: #dc143c;
  --accent-red: #ff6b6b;
  --dark-red: #5c0000;
  --light-red: #ffe5e5;
  --text-dark: #2c3e50;
  --text-light: #7f8c8d;
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --border-color: #e9ecef;
}

/* Blog Hero Section */
.blog-hero {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--secondary-red) 100%);
  /* Added proper top padding to account for fixed navbar */
  padding: 140px 0 80px !important;
  text-align: center;
  color: var(--white);
  /* Added flex centering for proper alignment */
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-hero .container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.blog-hero .hero-content {
  max-width: 800px;
  width: 100%;
  text-align: center;
}

.blog-hero .hero-title {
  font-family: "Playfair Display", serif;
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  /* Ensure title is centered */
  text-align: center;
}

.blog-hero .hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  /* Ensure subtitle is centered */
  text-align: center;
}

/* Blog Filters */
.blog-filters {
  background: var(--white);
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 80px;
  z-index: 100;
}

.filter-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-dark);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-red);
  border-color: var(--primary-red);
  color: var(--white);
  transform: translateY(-2px);
}

/* Featured Article */
.featured-article {
  padding: 4rem 0;
  background: var(--light-gray);
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.featured-card:hover {
  transform: translateY(-5px);
}

.featured-image {
  position: relative;
  overflow: hidden;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.featured-card:hover .featured-image img {
  transform: scale(1.05);
}

.featured-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--accent-red);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.featured-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-title {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 1rem 0;
  line-height: 1.3;
}

.featured-excerpt {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.read-more-btn {
  background: var(--primary-red);
  color: var(--white);
  padding: 1rem 2rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.read-more-btn:hover {
  background: var(--dark-red);
  transform: translateY(-2px);
}

/* Enhanced search section styling */
.search-section {
  margin-top: 2rem !important;
  display: flex;
  justify-content: center;
}

.search-form {
  width: 100%;
  max-width: 500px;
}

.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--white);
  border: 2px solid var(--border-color);
  border-radius: 25px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-input-group:focus-within {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.search-input {
  flex: 1;
  padding: 12px 20px !important;
  border: none !important;
  background: transparent !important;
  font-size: 1rem;
  color: var(--text-dark) !important;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-btn {
  background: var(--primary-red) !important;
  color: var(--white) !important;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: var(--dark-red) !important;
}

.search-btn i {
  font-size: 1rem;
}

/* Blog Grid */
.blog-grid {
  padding: 4rem 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.article-card {
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.article-card.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.article-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
  transform: scale(1.05);
}

.article-content {
  padding: 1.5rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.category {
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.category.tum-docere {
  background: var(--light-red);
  color: var(--primary-red);
}

.category.red-peruana {
  background: #e8f5e8;
  color: #2e7d32;
}

.date {
  color: var(--text-light);
  font-size: 0.9rem;
}

.article-title {
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.article-excerpt {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.read-more {
  color: var(--primary-red);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.read-more:hover {
  color: var(--dark-red);
}

/* Load More Section */
.load-more-section {
  text-align: center;
  padding: 2rem 0;
}

.load-more-btn {
  background: transparent;
  border: 2px solid var(--primary-red);
  color: var(--primary-red);
  padding: 1rem 2rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.load-more-btn:hover {
  background: var(--primary-red);
  color: var(--white);
  transform: translateY(-2px);
}

/* Newsletter Section */
.newsletter-section {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--secondary-red) 100%);
  padding: 4rem 0;
  color: var(--white);
  text-align: center;
}

.newsletter-title {
  font-family: "Playfair Display", serif;
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.newsletter-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-form .form-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 1rem;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  outline: none;
}

.newsletter-form button {
  background: var(--white);
  color: var(--primary-red);
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.newsletter-form button:hover {
  background: var(--light-gray);
  transform: translateY(-2px);
}

.newsletter-options {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--white);
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--white);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--primary-red);
  font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
  .blog-hero .hero-title {
    font-size: 2.5rem;
  }

  .blog-hero .hero-subtitle {
    font-size: 1rem;
  }

  /* Improved mobile header padding */
  .blog-hero {
    padding: 120px 0 60px !important;
  }

  .filter-buttons {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Mobile search styling */
  .search-section {
    margin-top: 1.5rem !important;
    padding: 0 1rem;
  }

  .search-input-group {
    border-radius: 20px;
  }

  .search-input {
    padding: 10px 16px !important;
    font-size: 0.9rem;
  }

  .search-btn {
    padding: 10px 16px;
  }

  .featured-card {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .featured-content {
    padding: 1.5rem;
  }

  .featured-title {
    font-size: 1.5rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .newsletter-options {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .blog-hero {
    /* Mobile header padding adjustment */
    padding: 110px 0 50px !important;
  }

  .blog-hero .hero-title {
    font-size: 2rem;
  }

  .featured-title {
    font-size: 1.3rem;
  }

  .newsletter-title {
    font-size: 2rem;
  }

  /* Small mobile search adjustments */
  .search-input {
    padding: 8px 14px !important;
  }

  .search-btn {
    padding: 8px 14px;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
