/* -------- BASE -------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
}

html, body {
  width: 100%;
  overflow-x: hidden; /* Prevents unwanted horizontal scrollbar */
}

html {
  font-size: 16px;
}

body {
  background: #f7f9f7;
  color: #333;
  line-height: 1.8;
}

body.nav-open {
  overflow: hidden;
}

/* Global links */
a {
  color: #1e88e5;
  text-decoration: none;
}

a:hover {
  color: #1565c0;
  text-decoration: underline;
}

/* Keep navbar white */
.navbar a {
  color: #fff;
}

/* -------- HEADER -------- */
header {
  background: #2e7d32;
  padding: 1rem 0;
  position: relative;
  z-index: 1000;
  width: 100%;
}

/* -------- NAVBAR -------- */
.nav-container {
  max-width: 1200px;
  width: 100%;
  margin: auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  box-sizing: border-box;
}

.nav-logo {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-logo img {
  max-width: 100%;
  height: auto;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
}

.nav-menu a {
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
}

.nav-menu a:hover {
  text-decoration: underline;
}

/* Dropdown Menu Desktop Styling */
.nav-menu .dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #2e7d32;
  min-width: 220px;
  list-style: none;
  padding: 8px 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 6px 6px;
  z-index: 1000;
}

/* Align rightmost dropdown inward */
.nav-menu li.dropdown:last-child .dropdown-menu {
  left: auto;
  right: 0;
}

.dropdown-menu li {
  padding: 0;
  border: none;
}

.dropdown-menu a {
  display: block;
  padding: 8px 16px;
  white-space: normal;
  word-break: break-word; 
  line-height: 1.3;
}

.dropdown-menu a:hover {
  background-color: #1b5e20;
  text-decoration: none;
}

/* Show dropdown menu on hover */
.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-toggle {
  background-color: #2e7d32;
  color: #fff;
  border: 1px solid #ffffff;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  white-space: nowrap; 
  padding: 0.4rem 0.6rem;
}

.dropdown-toggle:hover {
  background-color: #1b5e20;
}

.nav-menu .dropdown-toggle .arrow {
  font-size: 0.8rem;
  margin-left: 6px;
  display: inline-block;
  transition: transform 0.2s ease;
}

/* Mobile Nav Selector Wrapper (Hidden on Desktop) */
.mobile-nav-select-wrapper {
  display: none;
}

/* -------- LAYOUT -------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.2rem;
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 2rem;
  box-sizing: border-box;
}

/* -------- ARTICLE -------- */
article {
  background: #fff;
  padding: 2.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden; /* Constrains any inner expanding elements */
}

article h1 {
  font-size: 2.2rem;
  color: #2e7d32;
  margin-bottom: 1rem;
  line-height: 1.3;
  word-wrap: break-word;
}

article h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  color: #1b5e20;
  word-wrap: break-word;
}

article h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  color: #2e7d32;
  word-wrap: break-word;
}

article p {
  margin-top: 1rem;
  font-size: 1.05rem;
  max-width: 100%;
}

.post-meta {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 1.5rem;
}

/* -------- FEATURE IMAGE -------- */
.featured-img {
  width: 100%;
  max-width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

figcaption {
  font-size: 0.85rem;
  text-align: center;
  color: #666;
  margin-top: 0.5rem;
  margin-bottom: 1.4rem;
}

/* -------- SIDEBAR -------- */
aside {
  background: #fff;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  height: fit-content;
  width: 100%;
  box-sizing: border-box;
}

aside h3 {
  color: #2e7d32;
  margin-bottom: 1rem;
}

aside ul {
  list-style: none;
}

aside li {
  margin-bottom: 0.8rem;
  word-wrap: break-word;
}

aside a {
  text-decoration: none;
  color: #333;
}

aside a:hover {
  text-decoration: underline;
}

/* -------- INLINE CONTENT GRID -------- */
.inline-post-grid {
  display: grid;
  grid-template-columns: 3fr 1.2fr;
  gap: 28px;
  margin: 2.5rem 0;
  width: 100%;
}

.inline-left {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.inline-box {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
}

.inline-box-header {
  background: #2e7d32;
  color: #fff;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 1.05rem;
}

.inline-box-content {
  padding: 16px;
  font-size: 1rem;
  line-height: 1.65;
}

.inline-sidebar {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f1f8f2;
  position: sticky;
  top: 20px;
  height: fit-content;
}

.inline-sidebar .inline-box-header {
  background: #558b2f;
}

/* -------- TABLES -------- */
.table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin-top: 1.5rem;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 450px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  margin: 1.5rem 0;
}

table th {
  background: #2e7d32;
  color: #fff;
  text-align: left;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 600;
}

table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.95rem;
}

table tr:nth-child(even) {
  background: #f9fbf9;
}

table tr:hover {
  background: #eef7ee;
  transition: background 0.2s ease;
}

table td:first-child {
  font-weight: 600;
  color: #1b5e20;
}

table tr:last-child td {
  border-bottom: none;
}

/* -------- SECTION BLOCK -------- */
.section {
  margin-top: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e6e6e6;
}

.section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.section h2 {
  margin-bottom: 0.8rem;
  font-size: 1.6rem;
  color: #1b5e20;
  position: relative;
}

.section h2::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background: #2e7d32;
  margin-top: 6px;
  border-radius: 2px;
}

.section h3 {
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
  font-size: 1.2rem;
  color: #2e7d32;
}

.section p {
  margin-top: 0.7rem;
  color: #444;
}

.section ul {
  margin-top: 0.8rem;
  padding-left: 20px;
}

.section li {
  margin-bottom: 0.4rem;
}

.section p + ul {
  margin-top: 0.6rem;
}

/* -------- FAQ -------- */
.faq-section {
  margin-top: 3rem;
}

.faq-section h2 {
  color: #1b5e20;
  margin-bottom: 1.5rem;
}

.faq-item {
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.1rem;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #2e7d32;
  border-radius: 6px;
}

.faq-question {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1b5e20;
  margin-bottom: 0.4rem;
}

.faq-answer {
  font-size: 1rem;
  color: #444;
  line-height: 1.65;
}

/* -------- BREADCRUMB -------- */
.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  color: #666;
  line-height: 1.4;
  word-wrap: break-word;
}

.breadcrumb a {
  color: #2e7d32;
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: #333;
  font-weight: 500;
}

/* -------- CATEGORY / BLOG GRID -------- */
.category-intro {
  background: #fff;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 6px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: transform .25s ease, box-shadow .25s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.12);
}

.post-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-cover {
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  background: #f2f2f2;
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-content {
  padding: 1rem 1.2rem 1.4rem;
}

.post-title {
  font-size: 1.15rem;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}

.post-excerpt {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.8rem;
}

/* -------- PAGINATION -------- */
.pagination {
  margin: 40px 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  font-weight: bold;
  flex-wrap: wrap;
  row-gap: 8px;
}

.pagination a,
.pagination span {
  padding: 8px 12px;
  border-radius: 6px;
  background: #1b5e20;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

.pagination a:hover {
  background: #111;
  color: #fff;
}

.pagination .active {
  background: #111;
  color: #fff;
  font-weight: bold;
  cursor: default;
}

.pagination .ellipsis {
  background: transparent;
  box-shadow: none;
  padding: 8px 6px;
}

/* -------- ADS -------- */
.home-ad-728,
.home-ad-300 {
  text-align: center;
  margin: 25px auto;
}

.home-ad-300 {
  display: none;
}

/* -------- FOOTER -------- */
footer {
  background: #1b5e20;
  color: #ffffff;
  padding: 2.5rem 1rem 1.5rem;
  margin-top: 3rem;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.footer-links,
.footer-social {
  list-style: none !important;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
}

.footer-links li,
.footer-social li {
  list-style: none !important;
  margin: 0;
}

.footer-links a,
.footer-social a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.footer-links a:hover,
.footer-social a:hover {
  text-decoration: underline;
  color: #ffffff;
  opacity: 0.85;
}

.footer-social {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1rem;
  width: 100%;
  max-width: 400px;
}

.footer-copyright {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.5rem;
}

/* -------- RESPONSIVE / MEDIA QUERIES -------- */

@media (max-width: 900px) {
  .nav-menu {
    display: none !important;
  }

  .mobile-nav-select-wrapper {
    display: block;
    width: 100%;
    margin-top: 10px;
  }

  .mobile-nav-select-wrapper select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
    background-color: #ffffff;
    color: #333333;
    outline: none;
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 16px;
  }
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr; /* Switch to single-column layout */
    padding: 1.2rem 1rem;
    gap: 1.5rem;
  }

  article {
    padding: 1.25rem;
  }

  article h1 {
    font-size: 1.65rem;
  }

  article h2 {
    font-size: 1.3rem;
  }

  article p {
    font-size: 1rem;
  }

  .featured-img {
    height: 220px;
  }

  .inline-post-grid {
    grid-template-columns: 1fr;
  }

  .inline-sidebar {
    position: static;
  }

  .section {
    margin-top: 1.5rem;
  }

  .home-ad-728 {
    display: none !important;
  }

  .home-ad-300 {
    display: block !important;
    max-width: 300px;
    margin: 20px auto;
  }
}

@media (max-width: 600px) {
  table {
    font-size: 0.85rem;
  }

  table th,
  table td {
    padding: 8px 10px;
  }

  .footer-links,
  .footer-social {
    gap: 0.85rem 1rem;
  }
}

@media (max-width: 480px) {
  .pagination a,
  .pagination span {
    padding: 6px 8px;
    font-size: 13px;
  }

  .pagination .nav-link {
    flex-basis: 100%;
    text-align: center;
  }
}