/* ====== HERO SECTION ====== */
#blog-hero {
  text-align: center;
  padding: 80px 20px 60px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column; 
  align-items: center;
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.divider-line {
  width: 60px;
  height: 2px;
  background-color: #6b2aa5;
  border-radius: 2px;
}

.hero-header h1 {
  font-size: 3rem;
  color: #333;
}

.hero-subtext {
  margin-top: 10px;
  font-size: 1.2rem;
  color: #666;
}

/* ====== CATEGORIES (icons) ====== */
#categories-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 30px;
  max-width: 1000px;
  margin-bottom: 0;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #333;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-item img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

.category-item span {
  font-weight: 600;
  font-size: 1rem;
}

.category-item:hover img {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Latest Posts */
#latest-posts {
  padding: 0 20px;
  text-align: center;
  margin-top: -2rem;
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
}

.divider-line.full {
  flex: 1;
  height: 2px;
  background-color: #ccc;
  max-width: 500px;
}

#latest-posts h2 {
  font-size: 2rem;
  color: #333;
  cursor: default;
}

#latest-posts-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  cursor: default;
}

#latest-posts-container .blog-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  width: 300px;
  padding: 20px;
  transition: transform 0.3s;
  position: relative;
}

#latest-posts-container .blog-card:hover {
  transform: translateY(-5px);
}

#latest-posts-container .image-wrapper {
  position: relative;
}

#latest-posts-container img {
  width: 100%;
  border-radius: 12px;
}

#latest-posts-container .tape {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 80px;
  height: 20px;
  background: #f6e58d;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#latest-posts-container h3 {
  margin: 15px 0 10px;
  font-size: 1.2rem;
  color: #222;
}

#latest-posts-container p {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 15px;
}

#latest-posts-container .read-more {
  display: inline-block;
  text-decoration: none;
  color: #fff;
  background-color: #6b2aa5;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background 0.3s;
}

#latest-posts-container .read-more:hover {
  background-color: #541d82;
}


/* Category file list */
#blog-tabs {
  padding: 60px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Grid background behind the category blog cards */
#blog-tabs::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200%; 
  height: 200%;
  background-image: 
    linear-gradient(#aaa 1px, transparent 1px),
    linear-gradient(90deg, #ccc 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.25; 
  z-index: -1;
  pointer-events: none;
}

#blog-tabs {
  position: relative;
  overflow: hidden; 
}

#blog-tabs .tabs-inner {
  width: 100%;
  max-width: 1200px; 
  display: flex;
  flex-direction: column;
  gap: 30px; 
}

.tabs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0rem;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: -2rem;
}

.tabs-header h2 {
  font-size: 2rem;
  background: #fff;
  color: #333;
  padding: 10px 25px;
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(107, 42, 165, 0.15);
  font-weight: 700;
  text-align: center;
}

.tabs-head-text {
  cursor: default;
  transform: transform 0.2s ease, box-shadow 0.2s ease;;
}

.tabs-head-text:hover {
  transform: scale(1.05); 
  box-shadow: 0 0 25px rgba(107, 42, 165, 0.2); 
}

.tabs-header input {
  flex: 1;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  width: 220px;
  transition: 0.3s;
}

.tabs-header input:focus {
  border-color: #6b2aa5;
  outline: none;
}

#tabs-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 25px;
}

.tab-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background-color: #e0e0e0;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s, transform 0.2s;
}

.tab-btn:hover {
  background-color: #d0c4ff;
  transform: translateY(-2px);
}

.tab-btn.active {
  background-color: #6b2aa5;
  color: #fff;
  transform: translateY(-2px);
}

.misc-tab {
  background-color: #ffd86f;
  color: #333;
}

.misc-tab.active {
  background-color: #f9b233;
  color: #fff;
}

#posts-display {
  display: grid;
  grid-template-columns: repeat(4, 1fr); 
  gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
  justify-items: center;
  padding: 0 20px;
  box-sizing: border-box;
}

.blog-card.category-style {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 250px;
  box-sizing: border-box;
  padding: 15px;
  transition: transform 0.3s;
}

.blog-card.category-style:hover {
  transform: translateY(-4px);
}

.blog-card.category-style img {
  width: 100%;
  border-radius: 10px;
}

.blog-card.category-style h3 {
  margin: 10px 0;
  font-size: 1rem;
  color: #222;
}

.blog-card.category-style .read-more {
    display: inline-block;
    text-decoration: none;
    color: #fff; 
    background-color: #6b2aa5; 
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.3s, transform 0.2s;
}

.blog-card.category-style .read-more:hover {
    background-color: #541d82; 
}

/* Tablet: 2 columns */
@media (max-width: 980px) {
  #posts-display {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
  }

  .blog-card.category-style {
    max-width: 100%;
  }

  #latest-posts-container {
    gap: 20px;
  }

  #latest-posts-container .blog-card {
    width: 240px; 
    padding: 18px;
  }

  #latest-posts-container h3 {
    font-size: 1.1rem;
  }

  #latest-posts-container p {
    font-size: 0.9rem;
  }

  #latest-posts-container .read-more {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
}

@media (max-width: 750px) {
  #blog-hero {
    padding-top: 30px;
  }
}

/* Mobile: 1 column */
@media (max-width: 650px) {
  #posts-display {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .blog-card.category-style {
    max-width: 100%;
  }

  #latest-posts-container {
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }

  #latest-posts-container .blog-card {
    width: 80%;  
    padding: 15px;
  }

  #latest-posts-container h3 {
    font-size: 1rem;
  }

  #latest-posts-container p {
    font-size: 0.85rem;
  }

  #latest-posts-container .read-more {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* No Results Message */
.no-results {
  text-align: center;
  font-style: italic;
  color: #666;
  width: 100%;
  margin-top: 20px;
}

/* Responsive */
@media (max-width: 980px) {
  #latest-posts-container,
  #posts-display {
    justify-content: center;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .tabs-header {
    flex-direction: column;
    align-items: center;
  }

  .blog-card.category-style {
    width: 90%;
  }

  #latest-posts-container .blog-card {
    width: 90%;
  }
}


@media (max-width: 618px) {
  #posts-display {
    grid-template-columns: 1fr; /* mobile */
  }
}

#sortSelect {
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background-color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: border 0.3s;
}

#sortSelect:focus {
  border-color: #6b2aa5;
  outline: none;
}

