/* ---------- RESET ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global links */
a {
  color: #1e88e5;
  text-decoration: none;
}

a:hover {
  color: #1565c0;
  text-decoration: underline;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f8f9f8;
  color: #333;
  line-height: 1.7;
}

/* ---------- HEADER & NAVIGATION ---------- */
header {
  background: #2e7d32;
  color: #fff;
  padding: 1rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo img {
  display: block;
  height: auto;
  max-width: 100%;
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  font-size: 1rem;
}

.nav-menu a {
  color: #fff;
  font-weight: bold;
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  background-color: #2e7d32;
  color: #fff;
  border: 1px solid #ffffff;
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.dropdown-toggle:hover {
  background-color: #1b5e20;
}

.nav-menu .dropdown-toggle .arrow {
  font-size: 1.35rem;
  margin-left: 6px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 220px;
  max-width: 280px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  list-style: none;
  z-index: 100;
  padding: 0.5rem 0;
}

/* Align rightmost sub-menu to stay within the layout */
.nav-menu .dropdown:last-child .dropdown-menu {
  left: auto;
  right: 0;
}

.dropdown-menu li a {
  color: #333;
  padding: 0.5rem 1rem;
  display: block;
  font-weight: normal;
  white-space: normal;
  word-wrap: break-word;
}

.dropdown-menu li a:hover {
  background: #f1f1f1;
  color: #2e7d32;
  text-decoration: none;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.mobile-nav-select-wrapper {
  display: none;
}

/* ---------- CONTAINER & INTRO ---------- */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 2rem 1rem;
}

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  color: #666;
}

.breadcrumb a {
  color: #2e7d32;
  font-weight: 500;
}

.category-intro {
  background: #fff;
  padding: 1.8rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  margin-bottom: 2rem;
}

.category-intro h1 {
  color: #2e7d32;
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

/* ---------- 3 to 4 COLUMN GRID ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.grid-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.grid-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.card-content {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.card-content h2 {
  font-size: 1.15rem;
  color: #2e7d32;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.card-content h2 a {
  color: #2e7d32;
}

.card-content h2 a:hover {
  color: #1b5e20;
}

.read-more {
  display: inline-block;
  color: #2e7d32;
  font-weight: bold;
  font-size: 0.9rem;
}

/* ---------- FOOTER ---------- */
footer {
  background: #1b5e20;
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
}

.footer-links,
.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-links a,
.footer-social a {
  color: #fff;
}

.footer-copyright {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ---------- RESPONSIVE MEDIA QUERIES ---------- */
@media (max-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-container {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav-logo img {
    height: 40px; /* Scales down logo smoothly for mobile header */
    width: auto;
  }

  .nav-menu {
    display: none;
  }

  .mobile-nav-select-wrapper {
    display: block;
    width: 100%;
  }

  .mobile-nav-select-wrapper select {
    width: 100%;
    padding: 0.6rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1rem;
    background-color: #fff;
    cursor: pointer;
  }

  .post-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 520px) {
  .container {
    padding: 1.2rem 0.8rem;
  }

  .category-intro {
    padding: 1.2rem;
  }

  .category-intro h1 {
    font-size: 1.5rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .grid-card img {
    height: 200px; /* Better aspect ratio for single column view */
  }

  .footer-links,
  .footer-social {
    gap: 1rem;
  }
}