@import url('https://fonts.googleapis.com/css2?family=Bai+Jamjuree:wght@400;600&display=swap');

body, h1, h2, h3, h4, h5, h6, p, a, li, input, button {
  font-family: 'Bai Jamjuree', sans-serif;
}

/*
Theme Name: Green
Version: 1.1
*/
body { font-family: 'Bai Jamjuree', sans-serif; margin: 0; color: #222; background: #fff; }
.container, .green-container { max-width: 1160px; margin: auto; padding: 1rem; }
.green-container { display: flex; gap: 2rem; }
.green-sidebar { width: 260px; background: #f8f9fa; padding: 1rem; border: 1px solid #ddd; }
.green-main { flex: 1; }
.green-hero { padding: 1.5rem; background: #e0f2f1; margin-bottom: 2rem; border-radius: 6px; text-align: center; }
.green-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.post-card {
  background: #fff; border: 1px solid #ddd; border-radius: 6px;
  padding: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.post-card h3 { margin: 0 0 0.5rem; color: #00796b; font-size: 1.1rem; }
.related-section {
  background: #fefefe; padding: 1rem; border: 1px solid #cfcfcf; border-radius: 6px;
}
.related-section h2 {
  font-size: 1.2rem; margin-bottom: 1rem; color: #00695c;
}
.popular-posts { list-style: none; padding: 0; }
.popular-posts li { padding: 0.4rem 0; border-bottom: 1px dashed #ccc; }
.scroll-top {
  position: fixed; bottom: 20px; right: 20px; z-index: 999;
  background: #00796b; color: #fff; border: none; padding: 10px;
  border-radius: 50%; font-size: 18px; cursor: pointer;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 1rem 2rem;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: bold;
  color: #2f3e1e;
}
.hero .tagline {
  font-size: 1.25rem;
  color: #555;
  margin-bottom: 1.5rem;
}
.hero .search-form input {
  padding: 0.75rem 1.2rem;
  font-size: 1rem;
  width: 100%;
  max-width: 420px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* Breadcrumb styling */
.breadcrumb {
  margin-bottom: 1rem;
  padding-left: 0.25rem;
  font-size: 0.9rem;
  color: #666;
}

/* Post navigation styling */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.post-navigation a {
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  background: #f1f8e9;
  border-radius: 4px;
  color: #33691e;
}
.post-navigation a:hover {
  background: #dcedc8;
}


/* Section: Getting Started */
/* เพิ่มใหม่*/
.sidebar-categories {
  list-style: none;
  padding-left: 0;
}

.sidebar-categories li {
  padding: 0.4rem 0;
  border-bottom: 1px dashed #ddd;
}

.sidebar-categories li a {
  text-decoration: none;
  color: #33691e;
  transition: color 0.2s ease;
}

.sidebar-categories li a:hover {
  color: #1b5e20;
}


/*ของเดิม*/

.section-start {
  margin-top: 4rem;
}
.section-start h2 {
  font-size: 1.5rem;
  color: #004d40;
  margin-bottom: 0.5rem;
}
.section-start .section-desc {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: #666;
}
.btn-more {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: #00796b;
  color: white;
  border-radius: 4px;
  text-decoration: none;
}
.btn-more:hover {
  background: #004d40;
}

/* Section: View by Category */
.section-categories {
  margin-top: 3rem;
}
.section-categories h2 {
  font-size: 1.5rem;
  color: #2e7d32;
  margin-bottom: 0.5rem;
}
.section-categories .section-desc {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: #666;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.category-card {
  background: #f1f8e9;
  padding: 1rem;
  border-radius: 6px;
  text-decoration: none;
  color: #2e7d32;
  font-weight: 500;
  border: 1px solid #c5e1a5;
  transition: background 0.2s;
}
.category-card:hover {
  background: #dcedc8;
}

/* Pagination */
.pagination {
  margin-top: 2rem;
  text-align: center;
}
.pagination .page-numbers {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  margin: 0 0.2rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-decoration: none;
  color: #00796b;
}
.pagination .current {
  background: #00796b;
  color: white;
  border-color: #00796b;
}

/* Navbar styles */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #e8f5e9;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #c8e6c9;
  font-family: 'Bai Jamjuree', sans-serif;
}
.navbar-logo a {
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  color: #2e7d32;
}
.navbar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}
.navbar-menu li {
  display: inline-block;
}
.navbar-menu a {
  text-decoration: none;
  color: #2e7d32;
  font-weight: 500;
}
.navbar-menu a:hover {
  color: #1b5e20;
}

/* ============== HOMEPAGE HERO + SECTION COLORS ============== */

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  background: #f1f8e9;
  border-bottom: 1px solid #c5e1a5;
}
.hero h1 {
  font-size: 2.75rem;
  font-weight: bold;
  color: #2e7d32;
  margin-bottom: 0.5rem;
}
.hero .tagline {
  font-size: 1.2rem;
  color: #4e6e50;
  margin-bottom: 1.5rem;
}
.hero .search-form input {
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  width: 100%;
  max-width: 480px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* Section Title */
.section-start h2,
.section-categories h2 {
  font-size: 1.4rem;
  color: #2e7d32;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.section-desc {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1.2rem;
}

/* Grid Category Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.category-card {
  background: #e8f5e9;
  padding: 1rem 1rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: #2e7d32;
  font-weight: 500;
  border: 1px solid #c8e6c9;
  transition: background 0.2s, transform 0.2s;
}
.category-card:hover {
  background: #dcedc8;
  transform: translateY(-2px);
}
.category-card span {
  font-size: 0.95rem;
  color: #555;
}

/* Button: More */
.btn-more {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: #00796b;
  color: #fff;
  font-weight: bold;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1rem;
}
.btn-more:hover {
  background: #004d40;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .hero .tagline {
    font-size: 1rem;
  }
  .category-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    color: #2e7d32;
  }
  .navbar-menu {
    display: none;
    flex-direction: column;
    gap: 0;
    margin-top: 1rem;
  }
  .navbar-menu.show {
    display: flex;
  }
  .navbar-menu li {
    padding: 0.5rem 0;
  }
}

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: #666;
}
.breadcrumb a {
  color: #2e7d32;
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

/* Docs filter form */
form label {
  font-weight: 600;
  margin-right: 0.5rem;
}
form select, form input[type=search] {
  padding: 0.5rem;
  font-size: 1rem;
  margin-right: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}
form button.btn-more {
  margin-top: 0.5rem;
}

/* Load More Button Position */
#load-more {
  display: inline-block;
  margin-top: 2rem;
}
.guidance-box {
  background: #f1f8e9;
  border: 1px solid #c5e1a5;
  padding: 1.5rem;
  border-radius: 8px;
}
.page-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}
.sidebar {
  flex: 0 0 260px;
}
.main {
  flex: 1;
}


/* หมวดหมู่หลัก */
.sidebar-categories,
.sidebar-categories ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ลิงก์ของหมวดหมู่ */
.sidebar-categories li a {
  display: block;
  padding: 0.4rem 0.6rem;
  background-color: #e8f5e9;
  border-radius: 6px;
  text-decoration: none;
  color: #00796b;
  transition: background 0.2s ease;
}

/* hover effect */
.sidebar-categories li a:hover {
  background-color: #b2ebf2;
}

/* 🔶 หัวข้อย่อย: เยื้องจากหัวข้อหลัก */
.sidebar-categories li ul {
  padding-left: 1.2rem; /* หรือจะใช้ margin-left ก็ได้ */
}






/* ใส่ในไฟล์ style.css ของธีม (wp-content/themes/green/style.css) หรือใน Customizer ก็ได้ แก้ไข sibebar ให้สวยงาม */

.green-sidebar {
  background-color: #f9f9f9;
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.sidebar-box {
  margin-bottom: 2rem;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #ccc;
}

.search-form {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

.search-field {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
}

.search-submit {
  padding: 0.5rem 1rem;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
}

.search-submit:hover {
  background-color: #45a049;
}

.category-list,
.category-list ul {
  list-style: none;
  padding-left: 1rem;
  margin: 0;
}

.category-list li {
  margin-bottom: 0.4rem;
}

.category-list a {
  text-decoration: none;
  color: #006699;
}

.category-list a:hover {
  text-decoration: underline;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-cloud a {
  background-color: #eee;
  color: #333;
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  font-size: 0.9em;
  text-decoration: none;
  transition: background 0.3s;
}

.tag-cloud a:hover {
  background-color: #ccc;
}



/* ========== MODERN SIDEBAR v2 (โลโก้สีเขียวโทน) ========== */

/* ขยายความกว้าง sidebar */
.sidebar {
  flex: 0 0 300px; /* จาก 260px เป็น 300px */
}

/* กล่อง sidebar */
.nst-sidebar .sidebar-box {
  background: #e0f2e9; /* เขียวอ่อนนวลเหมือน logo bar */
  border: 1px solid #c8e6c9;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  word-break: break-word;
}

/* หัวข้อใน sidebar */
.nst-sidebar .sidebar-box h2 {
  font-size: 1.15rem;
  color: #2e7d32;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid #c8e6c9;
  padding-bottom: 0.3rem;
  font-weight: 600;
}

/* ค้นหา */
.nst-sidebar input[type="search"] {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid #b2dfdb;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  background: #fff;
}

/* ปุ่มค้นหา */
.nst-sidebar input[type="submit"],
.nst-sidebar .search-submit {
  background: #2e7d32;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.nst-sidebar input[type="submit"]:hover {
  background: #004d40;
}

/* หมวดหมู่ */
.sidebar-categories ul,
.sidebar-categories {
  list-style: none;
  padding-left: 0;
  font-size: 0.96rem;
  line-height: 1.6;
}
.sidebar-categories li {
  margin: 0.3rem 0;
}
.sidebar-categories li a {
  display: block;
  padding: 0.45rem 0.8rem;
  background-color: #f1f8e9;
  border-radius: 6px;
  text-decoration: none;
  color: #33691e;
  transition: background 0.2s;
}
.sidebar-categories li a:hover {
  background-color: #dcedc8;
  color: #004d40;
}

/* ป้าย tag */
.tag-cloud a {
  display: inline-block;
  background: #e0f7fa;
  color: #00695c;
  padding: 0.4rem 0.7rem;
  margin: 0.2rem;
  font-size: 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s ease;
}
.tag-cloud a:hover {
  background: #b2ebf2;
  color: #004d40;
}
.lucide {
  width: 1em;
  height: 1em;
  stroke: #444;
  vertical-align: middle;
  margin-right: 0.4em;
}
/* มือถือ/แท็บเล็ตแนวตั้ง */
@media (max-width: 991px){
  body.category .green-container{ display:block; }
  body.category .green-main{ width:100%; max-width:100%; padding:0 1rem; }
  body.category .green-grid{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
    gap:16px;
  }
  /* ให้ sidebar ไปอยู่ใต้เนื้อหา */
  body.category .green-sidebar{ margin-top:1rem; }
}
.breadcrumb { font-size:.9rem; color:#64748b; margin:.5rem 0 1rem; }
.breadcrumb ol{ list-style:none; padding:0; margin:0; display:flex; flex-wrap:wrap; gap:.25rem .5rem; }
.breadcrumb a{ text-decoration:none; color:inherit; }
.breadcrumb li::after{ content:"/"; opacity:.5; margin-left:.5rem; }
.breadcrumb li:last-child::after{ content:none; }
