
/* ==========================
   Front Page Specific Styles
========================== */

.hero {
  text-align: center;
  margin: 3rem auto;
}

.hero .site-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: #006400;
}

.hero .tagline {
  font-size: 1.2rem;
  color: #666;
  margin-top: 0.5rem;
}

.search-form {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

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

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

.dual-section {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.dual-column {
  flex: 1 1 300px;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #ddd;
  padding-bottom: 0.5rem;
}

.post-card {
  border: 1px solid #ddd;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 6px;
  background: #fff;
  transition: box-shadow 0.3s ease;
}

.post-card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.post-card h3 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.post-card h3 a {
  color: #006400;
  text-decoration: none;
}

.post-date {
  font-size: 0.9rem;
  color: #888;
}

.views-count {
  font-size: 0.85rem;
  color: #999;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .dual-section {
    flex-direction: column;
  }

  .search-form {
    flex-direction: column;
    align-items: center;
  }

  .search-field,
  .search-submit {
    width: 100%;
  }
}
.main-content {
  max-width: 960px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 2rem 1rem;
  background: rgba(0, 128, 0, 0.03); /* เพื่อดูว่าทำงานจริง */
}

/* หมวดหมู่หลัก */
.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;
}
.green-card-grid{
  display:grid; gap:1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
}
.green-card-grid{
  display:grid; gap:1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
}
.hero {
background: var(--wp--preset--gradient--surface-subtle);
padding: clamp(32px, 6vw, 72px) 0;
margin-bottom: clamp(16px, 4vw, 32px);
}
.hero__inner {
max-width: var(--wp--style--global--content-size, 720px);
margin: 0 auto;
text-align: center;
padding: 0 1rem;
}
.hero .site-title {
font-size: clamp(1.8rem, 4vw, 2.4rem);
margin: 0 0 .25em 0;
}
.hero .tagline {
color: var(--wp--preset--color--muted);
margin: 0 0 1rem 0;
}
.hero__search { margin: 1rem auto 1.25rem; max-width: 640px; }
.search-form {
display: flex; gap: .5rem; align-items: center;
background: var(--wp--preset--color--surface);
border: 1px solid var(--wp--preset--color--border);
border-radius: 999px; padding: .5rem .5rem .5rem .75rem;
box-shadow: var(--wp--preset--shadow--sm);
}
.search-field {
flex: 1; border: 0; outline: none; background: transparent;
font-size: var(--wp--preset--font-size--m);
}
.search-submit { border-radius: 999px; padding: .5rem 1rem; }

.dual-section {
max-width: var(--wp--style--global--wide-size, 1100px);
margin: 0 auto; padding: 0 1rem;
display: grid; gap: clamp(16px, 3vw, 32px);
grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (max-width: 860px) { .dual-section { grid-template-columns: 1fr; } }
.box { background: var(--wp--preset--color--paper); border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--preset--border--radius); padding: 1rem; box-shadow: var(--wp--preset--shadow--sm); }
.box__head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.box__more { font-size: var(--wp--preset--font-size--s); color: var(--wp--preset--color--link); text-decoration: none; }

.section-title { margin: 0; font-size: clamp(1.2rem, 2.5vw, 1.5rem); }

.post-card-grid {
display: grid; gap: 1rem;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.post-card { display: flex; flex-direction: column; gap: .5rem; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--preset--border--radius); overflow: hidden; box-shadow: var(--wp--preset--shadow--sm); }
.post-card__thumb img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; display: block; }
.post-card__body { padding: .75rem .9rem 1rem; }
.post-card__title { margin: 0 0 .25rem 0; font-size: var(--wp--preset--font-size--l); line-height: 1.4; }
.post-card__title a { text-decoration: none; }
.post-card__meta { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--s); display: flex; gap: .5rem; align-items: center; }
.post-card__excerpt { margin: .5rem 0 0 0; }

/* ทำ CTA ใน hero ให้เล็กลง */
.hero__actions { 
  gap: .5rem;              /* ลดช่องว่างระหว่างปุ่ม */
  margin-top: .75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero__actions .wp-block-button__link {
  padding: .4rem .9rem;    /* ลด padding */
  font-size: clamp(.85rem, 1.5vw, .95rem);  /* ลดขนาดตัวอักษร */
  line-height: 1.3;
  border-radius: 999px;
}
