/* -------- BASE -------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Global responsive media resets */
img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* Global links */
a {
  color: #1e88e5;
  text-decoration: none;
}

a:hover {
  color: #1565c0;
  text-decoration: underline;
}

/* Keep navbar white */
.navbar a {
  color: #fff;
}

html {
  font-size: 16px;
}

body {
  background: #f7f9f7;
  color: #333;
  line-height: 1.75;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.nav-open {
  overflow: hidden;
}

/* -------- HEADER -------- */

header {
  background: #2e7d32;
  padding: 1rem 0;
  position: relative;
  z-index: 1000;
}

header a {
  color: #fff;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 700;
}

/* -------- NAVBAR -------- */

.nav-container {
  max-width: 1200px;
  margin: auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 12px;
}

.nav-logo {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-logo img {
  max-width: 220px;
  height: auto;
  display: block;
}

/* Clean list resetting */
.nav-menu,
.nav-menu ul,
.dropdown-menu {
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.nav-menu {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 1rem;
}

.nav-menu li {
  list-style: none !important;
}

.nav-menu a {
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
}

.nav-menu a:hover {
  text-decoration: underline;
}

/* Align the rightmost dropdown to open inward towards the left */
.nav-menu li.dropdown:last-child .dropdown-menu {
  left: auto;
  right: 0;
}

/* -------- DESKTOP DROPDOWNS -------- */

.nav-menu .dropdown {
  position: relative;
  padding: 12px 0;
}

.nav-menu .dropdown-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  background-color: #2e7d32;
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  font-weight: 500;
}

.nav-menu .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;
}

/* Submenu layout - Hidden by default */
.nav-menu .dropdown-menu {
  display: none !important;
  position: absolute;
  top: 100%;
  left: 0;
  background: #236426;
  min-width: 230px;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  padding: 8px 0;
  z-index: 1001;
  list-style: none !important;
  list-style-type: none !important;
}

/* Show Submenu on Hover for Desktop */
@media (min-width: 901px) {
  .nav-menu .dropdown:hover > .dropdown-menu {
    display: block !important;
  }
  
  .nav-menu .dropdown:hover .dropdown-toggle .arrow {
    transform: rotate(180deg);
  }
}

/* Remove all bullets & custom markers from dropdown list items */
.nav-menu .dropdown-menu li {
  width: 100%;
  display: block;
  list-style: none !important;
  list-style-type: none !important;
  margin: 0;
  padding: 0;
}

.nav-menu .dropdown-menu li::before {
  content: none !important;
}

.nav-menu .dropdown-menu a {
  display: block;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: #ffffff;
  white-space: normal;
  word-break: break-word; 
  line-height: 1.3;
}

.nav-menu .dropdown-menu a:hover {
  background: #1b5e20;
  text-decoration: none;
}

/* -------- MOBILE NAV SELECT -------- */

.mobile-nav-select-wrapper {
  display: none;
}

@media (max-width: 900px) {
  .nav-menu {
    display: none !important;
  }

  .mobile-nav-select-wrapper {
    display: block;
    width: auto;
  }

  #mobile-nav-select {
    background: #1b5e20;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    max-width: 200px;
    width: 100%;
  }

  #mobile-nav-select option {
    background: #ffffff;
    color: #333333;
  }

  #mobile-nav-select optgroup {
    background: #f1f8f2;
    color: #1b5e20;
    font-weight: bold;
  }
}

@media (max-width: 600px) {
  .nav-container {
    flex-direction: column;
    justify-content: center;
    padding: 8px 16px;
  }

  .nav-logo img {
    max-width: 180px;
  }

  .mobile-nav-select-wrapper {
    width: 100%;
  }

  #mobile-nav-select {
    max-width: 100%;
  }
}

/* -------- LAYOUT -------- */

.container {
  max-width: 1200px;
  margin: auto;
  padding: 2.5rem 1.2rem;
}

/* -------- ARTICLE -------- */

article {
  background: #fff;
  padding: 2.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

article h1 {
  font-size: 2.2rem;
  color: #2e7d32;
  margin-bottom: 0.8rem;
  word-break: break-word;
}

article h2 {
  font-size: 1.5rem;
  margin-top: 2.2rem;
  color: #1b5e20;
  word-break: break-word;
}

article h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  color: #2e7d32;
  word-break: break-word;
}

.post-meta {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 1.5rem;
}

article p {
  margin-top: 1rem;
  font-size: 1.05rem;
  max-width: 90ch;
}

article p.full-width {
  max-width: 100%;
}

/* -------- FEATURE IMAGE -------- */

.featured-img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.4rem;
}

figcaption {
  font-size: 0.8rem;
  text-align: center;
  color: #666;
  margin-top: 0.5rem;
}

/* -------- INLINE CONTENT GRID -------- */

.inline-post-grid {
  display: grid;
  grid-template-columns: 3fr 1.2fr;
  gap: 28px;
  margin: 2.5rem 0;
}

.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 -------- */

/* 1. Responsive Outer Wrapper (Add <div class="table-wrapper"> around <table> in HTML) */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  margin: 1.5rem 0;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

/* 2. Base Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
  font-size: 0.95rem;
  text-align: left;
}

/* 3. Header & Cell Styling */
th, td {
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
  line-height: 1.5;
}

th {
  background-color: #f1f8f2;
  color: #1b5e20;
  font-weight: 600;
  border-bottom: 2px solid #c8e6c9;
  white-space: nowrap; /* Keeps headers clean while letting body text wrap */
}

/* Remove bottom border from last row for clean container look */
tr:last-child td {
  border-bottom: none;
}

/* 4. Alternate Row Colors (Zebra Striping for better readability) */
tbody tr:nth-child(even) {
  background-color: #fcfdfc;
}

/* 5. Row Hover Effect */
tbody tr:hover {
  background-color: #f1f8f2;
}

/* -------- RELATED GUIDES -------- */

.related-guides ul {
  list-style: none;
}

.related-guides li {
  margin-bottom: 8px;
}

.related-guides a {
  color: #2e7d32;
  font-size: 0.95rem;
  text-decoration: none;
  font-weight: 500;
}

.related-guides a:hover {
  text-decoration: underline;
}

/* -------- FAQ -------- */

.faq-section {
  margin-top: 3rem;
}

.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;
}

/* -------- 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-fill, 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 0.25s ease, box-shadow 0.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;
}

/* Read More Button Styling */
.read-more {
  display: inline-block;
  padding: 10px 20px;
  background-color: #2e7d32;
  color: #ffffff !important;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.read-more:hover {
  background-color: #1b5e20;
  text-decoration: none;
}

/* -------- 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, 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;
}

@media (max-width: 480px) {
  .pagination a,
  .pagination span {
    padding: 6px 8px;
    font-size: 13px;
  }

  .pagination .nav-link {
    flex-basis: 100%;
    text-align: center;
  }
}

/* -------- FOOTER -------- */

footer {
  background: #1b5e20;
  color: #fff;
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  margin-top: 3rem;
  font-size: 0.95rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* Footer Link & Social Lists Reset */
.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 Styling */
.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;
}

/* Divider Line for Social Links */
.footer-social {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1rem;
  width: 100%;
  max-width: 400px;
}

/* Copyright Text */
.footer-copyright {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .footer-links,
  .footer-social {
    gap: 0.85rem 1rem;
  }
}

/* -------- RESPONSIVE -------- */

@media (max-width: 992px) {
  article p {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1.2rem 0.8rem;
  }

  article {
    padding: 1.2rem;
  }

  article h1 {
    font-size: 1.6rem;
  }

  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;
  }

  .category-intro {
    padding: 1.2rem;
  }
}

@media (max-width: 480px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .faq-item {
    padding: 0.9rem;
  }
}

/* -------- BREADCRUMB -------- */

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  color: #666;
  line-height: 1.4;
}

.breadcrumb a {
  color: #2e7d32;
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: #333;
  font-weight: 500;
}

@media (max-width: 768px) {
  .breadcrumb {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
}

/* -------- ADS -------- */

.home-ad-728,
.home-ad-300 {
  text-align: center;
  margin: 25px auto;
}

.home-ad-300 {
  display: none;
}

@media (max-width: 768px) {
  .home-ad-728 {
    display: none !important;
  }

  .home-ad-300 {
    display: block !important;
    max-width: 300px;
    margin: 20px auto;
  }
}

/* -------- TABLE OF CONTENTS -------- */

.toc-box {
  margin: 2rem 0;
  border: 1px solid #dce8dc;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.toc-title {
  background: linear-gradient(135deg, #2e7d32, #43a047);
  color: #fff;
  padding: 14px 20px;
  font-size: 1.2rem;
  font-weight: 700;
}

.toc-list {
  list-style: none;
  counter-reset: item;
  padding: 18px 22px;
}

.toc-list li {
  counter-increment: item;
  margin-bottom: 10px;
}

.toc-list li:last-child {
  margin-bottom: 0;
}

.toc-list li a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #f8fbf8;
  border: 1px solid #e4eee4;
  border-radius: 8px;
  color: #1b5e20;
  font-weight: 500;
  transition: 0.25s;
}

.toc-list li a::before {
  content: counter(item);
  width: 28px;
  height: 28px;
  margin-right: 12px;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.toc-list li a:hover {
  background: #e8f5e9;
  color: #2e7d32;
  transform: translateX(4px);
  text-decoration: none;
}

/* -------- QUICK CARE -------- */

.quick-care {
  margin: 2rem 0 2.5rem;
  background: #f8fcf8;
  border: 1px solid #dce8dc;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.quick-care h2 {
  margin: 0;
  padding: 14px 20px;
  font-size: 1.3rem;
  color: #fff;
  background: linear-gradient(135deg, #2e7d32, #43a047);
}

.quick-care-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #dce8dc;
}

.quick-item {
  background: #fff;
  padding: 18px;
}

.quick-item span {
  display: block;
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 6px;
  font-weight: 600;
}

.quick-item strong {
  display: block;
  font-size: 1rem;
  color: #1b5e20;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .quick-care-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .quick-care-grid {
    grid-template-columns: 1fr;
  }

  .quick-item {
    padding: 14px 16px;
  }

  .quick-care h2 {
    font-size: 1.15rem;
  }
}

/* Quick Care Intro */

.quick-care-intro {
  margin: 0;
  padding: 12px 20px;
  text-align: center;
  font-size: 0.95rem;
  color: #5f6f60;
  font-style: italic;
  border-bottom: 1px solid #e5efe5;
  background: #fff;
}

.quick-care-intro strong {
  color: #1b5e20;
  font-weight: 600;
}

@media (max-width: 768px) {
  .quick-care-intro {
    padding: 12px 16px 16px;
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 100%;
  }
}

/* -------- BUTTONS -------- */

.btn-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.5rem;
  padding: 12px 28px;
  background-color: #2e7d32;
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
  transition: all 0.25s ease;
}

.btn-home:hover {
  background-color: #1b5e20;
  color: #ffffff !important;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(27, 94, 32, 0.35);
}