/* Reset, fonts & base from before */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f8fbff;
  color: #1a1a1a;
  line-height: 1.6;
}

.wrapper {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
  padding-bottom: 70px;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

header h1 {
  font-weight: 700;
  color: #1e3a8a;
  /* deep blue */
  font-size: 2.8rem;
  margin-bottom: 0.2rem;
}

header h1 .highlight {
  color: #3b82f6;
  /* lighter blue */
}

header p {
  font-size: 1.2rem;
  color: #555;
  margin-top: 0;
}

/* Sections */
main section {
  margin-bottom: 3rem;
}

main h2 {
  color: #1e40af;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 0.3rem;
}

/* Cards Row */
.cards-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Rounded button */
.btn-rounded {
  display: block;
  margin: 1.5rem auto 0 auto;
  background-color: #3b82f6;
  color: white;
  font-weight: 600;
  padding: 0.7rem 2.2rem;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 6px rgb(59 130 246 / 0.5);
  user-select: none;
}

.btn-rounded:hover {
  background-color: #1e40af;
}

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #e6f0ff;
  border-top: 1px solid #c4d1f0;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: #444;
  z-index: 1000;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
}

footer p {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

footer p a {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  gap: 4px;
  transition: color 0.2s ease;
}

footer p a:hover {
  color: #1e40af;
}

footer p a svg {
  height: 1em;
  width: 1em;
  vertical-align: middle;
  fill: currentColor;
  transition: transform 0.2s ease;
}

footer p a:hover svg {
  transform: scale(1.2);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.2));
}

footer {
  text-align: center;
  padding: 1rem;
  font-family: sans-serif;
}

.footer-top,
.footer-bottom {
  margin: 0.25rem 0;
  white-space: nowrap; /* Prevent line breaks */
}

.footer-bottom svg {
  margin-right: 4px;
  vertical-align: middle;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .cards-row {
    flex-direction: column;
    align-items: center;
  }

  .card {
    flex: 1 1 90%;
    height: 220px;
  }
}

.post-card {
  flex: 0 0 320px;
  border-radius: 12px;
  background: #1e293b;
  color: #f1f5f9;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
}

.card-image {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay-title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px 15px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}


.overlay-title h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #fff;
  /* <-- set to white */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  /* adds contrast on any image */
}

.overlay-title a {
  color: inherit;
  text-decoration: none;
}

.card-content {
  padding: 12px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-meta {
  font-size: 0.85rem;
  color: #94a3b8;
}

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

.tag {
  background: #3b82f6;
  color: #e0f2fe;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Search & Filter Bar */
.search-filter {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.search-container {
  position: relative;
  flex: 1 1 250px;
  /* flex sizing */
}

.search-container input[type="search"] {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 2px solid #3b82f6;
  border-radius: 30px;
  outline-offset: 2px;
  transition: border-color 0.3s ease;
}

.search-container input[type="search"]:focus {
  border-color: #1e40af;
}

.search-filter select {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 30px;
  border: 2px solid #3b82f6;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
  min-width: 150px;
}

.search-filter select:hover,
.search-filter select:focus {
  border-color: #1e40af;
}

.suggestions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  z-index: 1000;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.suggestions-list li {
  padding: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  border-bottom: 1px solid #eee;
  transition: background 0.2s ease;
}

.suggestions-list li:hover {
  background-color: #f0f4ff;
}

.suggestion-list-item{
  border-radius: 8px;
}

.suggestion-list-item h3{
  margin: 0 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#pagination {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  text-align: center;
}

#pagination button.btn-rounded {
  background-color: #007BFF;  /* match your brand color */
  color: white;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin: 0;

}

#pagination button.btn-rounded:hover {
  background-color: #0056b3;
}

#pagination button.btn-rounded:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

#pageIndicator {
  font-size: 1rem;
  font-weight: 500;
  color: #333;
}

#posts-container, #recent-list, #popular-list{
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Exactly 3 columns */
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  #posts-container, #recent-list, #popular-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  #posts-container, #recent-list, #popular-list {
    grid-template-columns: 1fr;
  }
}

.blog-header {
  max-width: 750px;
  margin: 0 auto 2rem auto;
  text-align: center;
}

.blog-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 0.3rem;
}

.blog-header p {
  font-size: 0.95rem;
  color: #555;
  margin-top: 0.3rem;
}

.blog-hero-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.blog-article {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  line-height: 1.7;
  font-size: 1.05rem;
  color: #1a1a1a;
}

.blog-main {
  display: flex;
  gap: 5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

/* Left content: blog article */
.blog-left {
  flex: 3;
  min-width: 0; /* helps with flexbox overflow */
}

/* Right content: sidebar */
.blog-sidebar {
  flex: 1;
  min-width: 250px;
}

/* Optional: make sidebar sticky while scrolling */
.blog-sidebar {
  position: sticky;
  top: 100px;
}

/* Adjust for mobile */
@media (max-width: 900px) {
  .blog-main {
    flex-direction: column;
  }
  .blog-sidebar {
    position: relative;
    top: 0;
  }
}
