:root {
  color-scheme: light;
  font-family: Inter, 'Noto Sans Thai', 'Leelawadee UI', Tahoma, system-ui, sans-serif;
  color: #17323a;
  background: #f7f8f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  line-height: 1.7;
  --ink: #17323a;
  --muted: #52696a;
  --line: #d7e1da;
  --paper: #fffefa;
  --canvas: #f7f8f4;
  --forest: #10313a;
  --green: #b8ed72;
  --sage: #e7f0e9;
  --amber: #f3e5c7;
  --focus: #a44f00;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: #176353;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #0c4038;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 0.9rem;
  transform: translateY(-160%);
  border-radius: 0.4rem;
  background: var(--paper);
  color: var(--ink);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.header-inner,
.container,
.footer-inner {
  width: min(100% - 2.5rem, 1200px);
  margin-inline: auto;
}

.header-inner {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-logo {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

.site-logo img {
  width: 42px;
  height: 42px;
}

.wordmark {
  font-size: 1.05rem;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.wordmark span {
  color: #4a7463;
  font-weight: 600;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.2vw, 2rem);
}

.primary-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: #425b5c;
  font-size: 0.94rem;
  font-weight: 630;
  text-decoration: none;
}

.primary-nav a[aria-current='page'] {
  color: #104f42;
  box-shadow: inset 0 -2px #4e8d70;
}

.nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--paper);
  cursor: pointer;
}

.hub-hero {
  overflow: hidden;
  padding-block: clamp(2.5rem, 7vw, 6rem);
  background: #e7f0e9;
}

.hero-grid {
  display: grid;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.hero-copy {
  min-width: 0;
  max-width: 860px;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: #386e5b;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.28;
  text-wrap: pretty;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.1rem);
  letter-spacing: -0.055em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 58ch;
  margin: 1.25rem 0 1.7rem;
  color: #405d5a;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}

.hero-photo {
  min-width: 0;
  margin: 0;
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 1.1rem;
  object-fit: cover;
}

.hero-photo figcaption {
  margin-top: 0.55rem;
  color: #405d5a;
  font-size: 0.86rem;
}

.search-form {
  display: flex;
  max-width: 600px;
  gap: 0.55rem;
}

.search-field {
  display: flex;
  min-height: 54px;
  flex: 1;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1rem;
  border: 1px solid #9db6a9;
  border-radius: 0.65rem;
  background: var(--paper);
}

.search-field svg {
  width: 20px;
  flex: 0 0 auto;
  color: #4e7567;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-field input:focus-visible {
  outline: 0;
}

.search-field:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border: 1px solid var(--forest);
  border-radius: 0.6rem;
  background: var(--forest);
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: #1d4b4d;
  color: white;
}

.button-secondary {
  border-color: #9db6a9;
  background: var(--paper);
  color: var(--ink);
}

.button-secondary:hover {
  background: #eff5ef;
  color: var(--ink);
}

.content-section {
  padding-block: clamp(2.2rem, 5vw, 4.2rem);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.3rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.035em;
}

.section-heading p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.feature-card {
  display: grid;
  overflow: hidden;
  border: 1px solid #d5e0d7;
  border-radius: 1.05rem;
  background: var(--paper);
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
}

.feature-card > img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.feature-copy {
  align-self: center;
  padding: clamp(1.5rem, 4vw, 3.2rem);
}

.feature-copy h2 {
  margin: 0.7rem 0;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
}

.feature-copy p {
  color: var(--muted);
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.category-chip {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid #b7c9bd;
  border-radius: 999px;
  background: var(--paper);
  color: #294d44;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 650;
}

.category-chip img {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.category-chip:hover,
.category-chip[aria-pressed='true'] {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}

.list-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.list-controls label {
  color: var(--muted);
  font-size: 0.92rem;
}

.list-controls select {
  min-height: 44px;
  padding: 0.45rem 2rem 0.45rem 0.7rem;
  border: 1px solid #b7c9bd;
  border-radius: 0.55rem;
  background: var(--paper);
  color: var(--ink);
}

.article-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--paper);
}

.article-card > img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.article-card-copy {
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: 1.1rem 1.2rem 1.25rem;
}

.article-card h3 {
  margin: 0.55rem 0;
  font-size: 1.16rem;
}

.article-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.article-card h3 a:hover {
  text-decoration: underline;
}

.article-card .summary {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  color: #536768;
  font-size: 0.82rem;
}

.article-meta span + span::before {
  margin-right: 0.8rem;
  color: #9caf9f;
  content: '·';
}

.article-card .article-meta {
  margin-top: auto;
}

.category-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  background: #e8f0e8;
  color: #2e6652;
  font-size: 0.78rem;
  font-weight: 730;
}

.empty-state {
  padding: 2rem;
  border: 1px dashed #9db6a9;
  border-radius: 0.8rem;
  background: #fbfcf8;
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.trust-note {
  margin-block: 0.2rem 3rem;
  padding: 1.25rem 1.4rem;
  border-left: 4px solid #7b997e;
  background: #edf2e9;
  color: #3c5550;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #eef2ed;
}

.footer-inner {
  display: grid;
  padding-block: 2.2rem;
  gap: 2rem;
  grid-template-columns: 1.2fr 1fr 1fr;
}

.footer-inner h2 {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
}

.footer-inner p,
.footer-inner a {
  color: #536768;
  font-size: 0.9rem;
}

.footer-links {
  display: grid;
  gap: 0.45rem;
}

.footer-legal {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid #d2ddd4;
}

.article-shell {
  padding-block: 1.3rem 4rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li + li::before {
  margin-right: 0.45rem;
  color: #81958c;
  content: '/';
}

.article-masthead {
  max-width: 880px;
  margin: 2rem auto 1.7rem;
}

.article-masthead h1 {
  max-width: 24ch;
  margin: 0.8rem 0 0.7rem;
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: -0.05em;
}

.article-deck {
  max-width: 72ch;
  margin: 0 0 1.2rem;
  color: #4d6563;
  font-size: clamp(1.05rem, 2vw, 1.23rem);
}

.review-note {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.article-cover {
  width: 100%;
  max-height: 440px;
  aspect-ratio: 3 / 2;
  border-radius: 1rem;
  background: var(--sage);
  object-fit: cover;
}

.article-layout {
  display: grid;
  align-items: start;
  gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 760px) minmax(200px, 250px);
}

.article-body {
  min-width: 0;
  color: #253f42;
  font-size: 1.06rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.article-body h2 {
  margin: 2.4rem 0 0.8rem;
  font-size: clamp(1.42rem, 3vw, 1.85rem);
}

.article-body h3 {
  margin: 1.7rem 0 0.6rem;
  font-size: 1.2rem;
}

.article-body p,
.article-body ul,
.article-body ol {
  max-width: 76ch;
}

.article-body li + li {
  margin-top: 0.4rem;
}

.article-body a {
  overflow-wrap: anywhere;
}

.article-body figure {
  margin: 1.5rem 0;
}

.article-body figure img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}

.article-body figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.87rem;
}

.article-aside {
  position: sticky;
  top: 1.5rem;
}

.toc,
.mobile-toc {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--paper);
}

.toc h2,
.mobile-toc summary {
  margin: 0 0 0.7rem;
  color: var(--ink);
  font-size: 0.97rem;
  font-weight: 750;
}

.toc ol,
.mobile-toc ol {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding-left: 1.2rem;
}

.toc a,
.mobile-toc a {
  font-size: 0.87rem;
}

.mobile-toc {
  display: none;
  margin: 1rem 0 1.5rem;
}

.callout {
  margin: 1.4rem 0;
  padding: 1rem 1.15rem;
  border-left: 4px solid #3c8068;
  background: #edf4ec;
}

.callout strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.callout.warning {
  border-left-color: #a85b1b;
  background: #fff3df;
}

.table-scroll {
  max-width: 100%;
  margin-block: 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--paper);
  overscroll-behavior-inline: contain;
}

.table-scroll table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.table-scroll th,
.table-scroll td {
  padding: 0.72rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-scroll th {
  background: #edf3ee;
  color: var(--ink);
}

.table-scroll tr:last-child td {
  border-bottom: 0;
}

.related-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.related-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--paper);
}

.related-card a {
  font-weight: 700;
}

.pagination-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

.pagination-links a {
  max-width: 48%;
}

.source-list li {
  margin-bottom: 0.55rem;
}

.adsense-slot {
  grid-column: 1;
  min-width: 0;
  margin-block: 2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--paper);
}

.adsense-label {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-copy {
    max-width: 760px;
    margin-inline: auto;
    text-align: center;
  }

  .hero-copy > p:not(.eyebrow) {
    margin-inline: auto;
  }

  .search-form {
    margin-inline: auto;
  }

  .hero-photo {
    width: min(100%, 720px);
    margin-inline: auto;
  }

  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-aside {
    display: none;
  }

  .mobile-toc {
    display: block;
  }
}

@media (max-width: 700px) {
  .header-inner,
  .container,
  .footer-inner {
    width: min(100% - 2rem, 1200px);
  }

  .header-inner {
    min-height: 70px;
    flex-wrap: wrap;
    gap: 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-bottom: 0.6rem;
  }

  .primary-nav a {
    min-height: 46px;
    padding-inline: 0.3rem;
    border-top: 1px solid #e6ece6;
  }

  .has-js .primary-nav:not(.is-open) {
    display: none;
  }

  .feature-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-card > img {
    min-height: 0;
    aspect-ratio: 3 / 2;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .search-form {
    flex-direction: column;
  }

  .search-form .button {
    width: 100%;
  }

  .article-grid,
  .related-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-cover {
    aspect-ratio: 4 / 3;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-brand,
  .footer-legal {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
