/* RAM CMS v1.8 — editorial density without hiding any original article copy.
 * Applied after v1.7. No image width/height/aspect-ratio rules are changed. */
body main section#บทความ {
  padding-block: clamp(23px, 2.5vw, 34px) !important;
  background: linear-gradient(180deg, #f1f7f2 0%, #eaf3ed 100%);
}
body main section#บทความ > .container > .section-head {
  gap: 4px;
  padding: 0 0 11px;
}
body main section#บทความ > .container > .section-head .kicker {
  padding: 4px 9px;
  border-radius: 6px;
}
body main section#บทความ > .container > .section-head h2 {
  font-size: clamp(21px, 2vw, 28px) !important;
  line-height: 1.3;
}
body main section#บทความ > .container > .section-head p {
  font-size: 12.5px;
  line-height: 1.5;
}
/* Slim linked table of contents stays in-flow and every heading is accessible. */
body main section#บทความ .rc-article-toc {
  grid-template-columns: minmax(155px, .22fr) minmax(0, 1fr);
  margin-bottom: 9px;
  border-radius: 11px;
  box-shadow: 0 5px 16px rgba(13,63,38,.05);
}
body main section#บทความ .rc-article-toc__label {
  gap: 3px;
  padding: 11px 14px;
}
body main section#บทความ .rc-article-toc__label strong { font-size: 15px; }
body main section#บทความ .rc-article-toc__label small { font-size: 10px; line-height: 1.3; }
body main section#บทความ .rc-article-toc ol { gap: 5px; padding: 8px; }
body main section#บทความ .rc-article-toc a {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.34;
}
body main section#บทความ .article-shell { gap: 8px !important; }
body main section#บทความ .article-shell > .article-card {
  padding: 14px 18px;
  border-left-width: 2px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(15,61,35,.034);
}
body main section#บทความ .article-shell > .article-card:first-child {
  background: linear-gradient(115deg, #103a29 0%, #0d2c21 100%);
  border-color: rgba(180,234,187,.18);
  border-left: 3px solid #a3e68d;
}
body main section#บทความ .article-shell .article-card h2 {
  margin: 0 0 6px;
  font-size: clamp(16px, 1.4vw, 20px) !important;
  line-height: 1.35;
}
body main section#บทความ .article-shell .article-card h3 {
  margin: 10px 0 5px;
  font-size: clamp(14px, 1.15vw, 16.5px) !important;
  line-height: 1.4;
}
body main section#บทความ .article-shell .article-card h4 { margin: 8px 0 4px; font-size: 13.5px; }
body main section#บทความ .article-shell .article-card :is(p,li,blockquote,dd,dt) {
  font-size: clamp(12.8px, .96vw, 13.7px);
  line-height: 1.59;
}
body main section#บทความ .article-shell .article-card :is(p,.lead,.meta,.byline) { margin-bottom: 7px; }
body main section#บทความ .article-shell .article-card :is(ul,ol) {
  margin: 4px 0 8px;
  padding-left: 21px;
}
body main section#บทความ .article-shell .article-card li + li { margin-top: 2px; }
body main section#บทความ .article-shell .article-card :is(blockquote,.note-box) {
  margin: 8px 0;
  padding: 9px 12px;
  border-radius: 7px;
}
body main section#บทความ .article-shell .article-card :is(th,td) {
  padding: 7px 9px;
  line-height: 1.45;
}
/* Exactly two contextual links read like normal article prose, not CTA buttons. */
body main section#บทความ .article-shell .article-card p.rc-article-keywords {
  margin: 9px 0 0;
  padding: 9px 0 0;
  border-top: 1px solid rgba(186,243,187,.22);
  background: transparent;
  color: #d7e9d9;
  font-size: 12.5px;
  line-height: 1.6;
}
body main section#บทความ .article-shell .article-card .rc-article-keywords a,
body main section#บทความ .article-shell .article-card .rc-article-keywords a:visited {
  display: inline;
  color: #cbfb99;
  font-size: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(197,254,133,.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
body main section#บทความ .article-shell .article-card .rc-article-keywords a strong {
  color: inherit;
  font-weight: 900;
}
body main section#บทความ .article-shell .article-card .rc-article-keywords a:hover,
body main section#บทความ .article-shell .article-card .rc-article-keywords a:focus-visible {
  color: #fff;
  text-decoration-color: #fff;
}
body main section#บทความ .article-shell .article-card .rc-article-keywords a:focus-visible {
  outline: 2px solid #bbf88c;
  outline-offset: 2px;
}
/* Pair only safe, brief, text-only neighbouring sections, selected in PHP.
   Full article order is preserved; rich media/table sections always span 2. */
@media (min-width: 1080px) {
  body main section#บทความ .article-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 10px !important;
    row-gap: 8px !important;
  }
  body main section#บทความ .article-shell > * { grid-column: span 2; }
  body main section#บทความ .article-shell > .article-card.rc-article-pair {
    grid-column: span 1;
    height: 100%;
  }
}
@media (min-width: 680px) and (max-width: 1079px) {
  body main section#บทความ .rc-article-toc { grid-template-columns: minmax(0, 1fr); }
  body main section#บทความ .rc-article-toc__label {
    padding: 9px 13px;
    border-right: 0;
    border-bottom: 1px solid rgba(186,247,194,.13);
  }
}
@media (max-width: 679px) {
  body main section#บทความ { padding-block: 22px 28px !important; }
  body main section#บทความ > .container > .section-head { gap: 4px; padding-bottom: 10px; }
  body main section#บทความ > .container > .section-head h2 {
    font-size: clamp(20px, 5.4vw, 24px) !important;
  }
  body main section#บทความ .rc-article-toc {
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 8px;
    border-radius: 9px;
  }
  body main section#บทความ .rc-article-toc__label {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px 9px;
    padding: 9px 11px;
    border-right: 0;
    border-bottom: 1px solid rgba(186, 247, 194, .13);
  }
  body main section#บทความ .rc-article-toc__label strong { font-size: 14px; }
  body main section#บทความ .rc-article-toc ol { gap: 4px; padding: 7px; }
  body main section#บทความ .rc-article-toc a { padding: 7px; font-size: 10.5px; }
  body main section#บทความ .article-shell { grid-template-columns: minmax(0,1fr) !important; gap: 7px !important; }
  body main section#บทความ .article-shell > .article-card,
  body main section#บทความ .article-shell > .article-card.rc-article-pair {
    grid-column: auto;
    padding: 11px 12px;
    border-radius: 8px;
  }
  body main section#บทความ .article-shell .article-card h2 { font-size: 16px !important; margin-bottom: 5px; }
  body main section#บทความ .article-shell .article-card h3 { font-size: 14px !important; margin: 9px 0 4px; }
  body main section#บทความ .article-shell .article-card :is(p,li,blockquote,dd,dt) {
    font-size: 12.5px;
    line-height: 1.56;
  }
  body main section#บทความ .article-shell .article-card :is(p,.lead,.meta,.byline) { margin-bottom: 6px; }
  body main section#บทความ .article-shell .article-card :is(ul,ol) { margin: 4px 0 7px; }
  body main section#บทความ .article-shell .article-card p.rc-article-keywords {
    font-size: 12px;
    padding-top: 8px;
    margin-top: 8px;
  }
}

@media (max-width: 350px) {
  body main section#บทความ .rc-article-toc ol { grid-template-columns: minmax(0, 1fr); }
}
