/* ====== GLOBAL STYLES ====== */
/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #000;
  --secondary-color: #333;
  --text-color: #333;
  --light-text: #666;
  --bg-color: #fff;
  --light-bg: #f9f9f9;
  --border-color: #eee;
  --accent-color: #000;
  --white: #fff;
  --black: #000;
  --transition: all 0.3s ease;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  overflow-x: hidden;
}

/* Container for centered content */
.container {
  width: 100%;
  padding: 0 1rem;
  margin: 0 auto;
}

/* Responsive container widths */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding: 0 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
    padding: 0 2rem;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1400px;
  }
}

/* logo */

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 0; /* reduce top & bottom space */
  height: 7.5rem; /* ensures it wraps the image */
}

.logo {
  max-width: 100%;
  height: auto;
  width: 200px; /* increase image size as needed */
  display: block;
}

/* ====== BLOG TITLE SECTION ====== */
.blog-title {
  text-align: center;
  font-family: "Rubik", sans-serif;
  font-style: normal;
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0.5rem 0;
  color: var(--black);
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .blog-title {
    font-size: 2rem;
    margin: 1.25rem 0;
  }
}

@media (min-width: 1024px) {
  .blog-title {
    font-size: 2.5rem;
    margin: 1.875rem 0;
  }
}

/* ====== NAVIGATION BAR ====== */
.navbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1rem 0;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
}

.navbar a {
  margin: 0.5rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  transition: var(--transition);
}

.navbar a:hover {
  color: var(--black);
}

@media (min-width: 768px) {
  .navbar a {
    margin: 0 1rem;
    font-size: 0.875rem;
  }
}

/* ====== POSTS GRID CONTAINER ====== */
#allPostsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ====== COMPACT POST CARD DESIGN ====== */
.post-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.post-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: scale(1.05);
  box-shadow: 0px 2px 40px #d7dfe2;
}

.post-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.post-card-content {
  padding: 1rem;
}

.post-category {
  display: inline-block;
  font-size: 0.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #666;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
}

.post-card h2 {
  font-size: 1.5rem;
  margin: 0.25rem 0 0.5rem;
  color: var(--black);
  line-height: 1.3;
}

.post-card-excerpt {
  color: var(--text-color);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-author {
  display: flex;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid #f0f0f0;
}

.post-author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 0.5rem;
}

.post-author-info {
  display: flex;
  flex-direction: column;
}

.post-author-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--black);
}

.post-author-followers {
  font-size: 0.7rem;
  color: var(--light-text);
}

/* ====== TIGHT GRID LAYOUT ====== */
#allPostsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  #allPostsContainer {
    gap: 1rem;
    padding: 0.75rem;
  }

  .post-card-image {
    height: 160px;
  }
}

@media (max-width: 480px) {
  #allPostsContainer {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .post-card-image {
    height: 140px;
  }
}
/* ====== LOAD MORE BUTTON ====== */
#loadMoreBtn {
  display: block;
  margin: 2rem auto;
  padding: 0.75rem 2rem;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 0.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

#loadMoreBtn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
}

.loading-text {
  text-align: center;
  padding: 20px;
  font-size: 1.2em;
  color: #666;
}

/* ====== FOOTER STYLES ====== */
.footer {
  background-color: var(--black);
  color: var(--white);
  padding: 2rem 1rem 1.5rem;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.footer-nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 1.5rem;
  transition: opacity 0.3s;
}

.footer-nav a:hover {
  opacity: 0.8;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: opacity 0.3s;
}

.footer-links a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.newsletter {
  max-width: 100%;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}

.newsletter h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.25rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
}

.newsletter-button {
  background-color: var(--white);
  color: var(--black);
  border: none;
  padding: 0.75rem 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.newsletter-button:hover {
  background-color: #ddd;
}

.copyright {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .footer {
    padding: 3rem 1.5rem 1.5rem;
  }

  .footer-nav {
    margin-bottom: 2rem;
  }

  .footer-links {
    margin-bottom: 2rem;
  }

  .footer-links a {
    font-size: 0.9rem;
  }

  .newsletter {
    max-width: 30rem;
    margin-bottom: 2rem;
  }

  .newsletter h3 {
    font-size: 1.125rem;
  }

  .newsletter-form {
    flex-direction: row;
  }

  .newsletter-input {
    font-size: 0.875rem;
  }

  .newsletter-button {
    font-size: 0.875rem;
  }

  .copyright {
    font-size: 0.875rem;
  }
}
