/* RAM CMS v1.15.0 — FULL RAIL Editorial: compact, consistent, uncollapsed.
   Explicitly no changes to img/picture/source/figure dimensions, sources, fit or ratios.
   Designed to override legacy v1.8 2-column article grid and orphan cards.
*/
body main section#บทความ {
  --rc15-green: #196a3f;
  --rc15-ink: #173b27;
  --rc15-border: #dce9df;
  padding-block: clamp(21px, 2.5vw, 33px) !important;
  background: linear-gradient(180deg,#f1f7f2,#eaf3ed);
}
body main section#บทความ > .container > .section-head {
  gap: 4px !important;
  margin-bottom: 0 !important;
  padding-bottom: clamp(10px, 1.3vw, 15px) !important;
  text-align: left;
}
body main section#บทความ > .container > .section-head h2 {
  font-size: clamp(21px, 2vw, 28px) !important;
  line-height: 1.29 !important;
  margin: 0 !important;
}
body main section#บทความ > .container > .section-head p {
  line-height: 1.48 !important;
  margin: 0 !important;
}
/* A slim, useful index rather than a second giant hero block. */
body main section#บทความ .rc-article-toc {
  grid-template-columns: minmax(142px, .19fr) minmax(0,1fr) !important;
  margin: 0 0 10px !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
body main section#บทความ .rc-article-toc__label { padding: 11px 14px !important; }
body main section#บทความ .rc-article-toc ol {
  gap: 5px !important;
  padding: 8px !important;
}
body main section#บทความ .rc-article-toc a {
  min-height: 33px !important;
  padding: 6px 9px !important;
  font-size: 11.25px !important;
  line-height: 1.4 !important;
}
/* Absolute layout guard: EVERY direct article element spans the full rail,
   even if previous PHP added rc-article-pair on an unpaired last card. */
body main section#บทความ .article-shell {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) !important;
  gap: clamp(7px, .8vw, 10px) !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
body main section#บทความ .article-shell > *,
body main section#บทความ .article-shell > .article-card,
body main section#บทความ .article-shell > .article-card.rc-article-pair,
body main section#บทความ .article-shell > .article-card.rc-article-summary,
body main section#บทความ .article-shell > .article-card.rc-article-balanced {
  box-sizing: border-box !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  justify-self: stretch !important;
}
body main section#บทความ .article-shell > .article-card,
body main section#บทความ .article-shell > .article-card.rc-article-pair {
  display: block !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: clamp(12px, 1.25vw, 17px) clamp(14px, 1.5vw, 21px) !important;
  border: 1px solid var(--rc15-border);
  border-left: 3px solid #6ab783;
  border-radius: 12px;
  background: #fff;
  color: #274333;
  box-shadow: 0 4px 13px rgba(12,58,30,.045) !important;
  content-visibility: visible !important;
  contain-intrinsic-size: none !important;
}
body main section#บทความ .article-shell > .article-card:first-child {
  border-left-color: #a9ec75;
  background: linear-gradient(120deg, #123c29, #0c2f20);
  color: #e5f3e8;
  box-shadow: 0 6px 18px rgba(12,58,30,.10) !important;
}
body main section#บทความ .article-shell .article-card h2 {
  margin: 0 0 7px !important;
  padding: 0 0 7px !important;
  border-bottom: 1px solid #e2eee6;
  color: var(--rc15-ink);
  font-size: clamp(17px,1.42vw,19px) !important;
  font-weight: 900;
  line-height: 1.36 !important;
}
body main section#บทความ .article-shell > .article-card:first-child h2 {
  border-color: rgba(218,255,217,.18);
  color: #fff;
}
body main section#บทความ .article-shell .article-card h3 {
  margin: 9px 0 4px !important;
  font-size: clamp(14px,1.05vw,16px) !important;
  line-height: 1.39 !important;
}
body main section#บทความ .article-shell .article-card h4 { margin: 7px 0 4px !important; }
body main section#บทความ .article-shell .article-card :is(p,li,dt,dd,blockquote) {
  font-size: clamp(12.8px, .99vw, 13.7px) !important;
  line-height: 1.57 !important;
  overflow-wrap: break-word;
}
body main section#บทความ .article-shell .article-card p {
  margin: 0 0 6px !important;
}
body main section#บทความ .article-shell .article-card :is(ul,ol) {
  margin: 4px 0 7px !important;
  padding-left: 21px !important;
}
body main section#บทความ .article-shell .article-card li + li { margin-top: 1px !important; }
body main section#บทความ .article-shell .article-card :is(blockquote,.note-box) {
  margin: 6px 0 !important;
  padding: 9px 12px !important;
  border-radius: 8px;
}
body main section#บทความ .article-shell .article-card > :last-child { margin-bottom: 0 !important; }
body main section#บทความ .article-shell .article-card :is(th,td) {
  padding: 7px 9px !important;
  font-size: 12.5px !important;
  line-height: 1.43 !important;
}
body main section#บทความ .article-shell .article-card :is(.table-scroll,.compare-wrap) {
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
/* Editorial balance is INSIDE each full-width text card.
   It cannot cause an empty 50% neighbour. Original reading order is retained. */
@media (min-width: 1050px) {
  body main section#บทความ .article-shell > .article-card.rc-article-balanced,
  body main section#บทความ .article-shell > .article-card.rc-article-summary {
    columns: 2 !important;
    column-gap: clamp(22px,2.8vw,35px) !important;
    column-rule: 1px solid #dceae0 !important;
  }
  body main section#บทความ .article-shell > .article-card.rc-article-balanced > h2,
  body main section#บทความ .article-shell > .article-card.rc-article-summary > h2 {
    column-span: all !important;
    margin-bottom: 9px !important;
  }
  body main section#บทความ .article-shell > .article-card.rc-article-balanced > :not(h2),
  body main section#บทความ .article-shell > .article-card.rc-article-summary > :not(h2) {
    break-inside: avoid-column;
  }
}
body main section#บทความ .article-shell > .article-card.rc-article-summary {
  border-color: #c7e2cc;
  border-left-color: #23834d;
  background: linear-gradient(120deg,#fbfefc,#f1f8f3);
  box-shadow: 0 5px 16px rgba(22,99,55,.06) !important;
}
body main section#บทความ .article-shell > .article-card.rc-article-summary > h2 { color: #19643c; }
/* Keep keyword links readable but visually integrated with their paragraph. */
body main section#บทความ .article-shell .article-card .rc-article-keywords {
  margin-top: 7px !important;
  padding-top: 7px !important;
  line-height: 1.55 !important;
}
@media (max-width: 1049px) {
  body main section#บทความ .rc-article-toc { grid-template-columns: minmax(0,1fr) !important; }
  body main section#บทความ .rc-article-toc__label { border-right: 0; border-bottom: 1px solid rgba(186,247,194,.13); }
  body main section#บทความ .article-shell > .article-card.rc-article-balanced,
  body main section#บทความ .article-shell > .article-card.rc-article-summary {
    columns: 1 !important;
    column-rule: none !important;
  }
}
@media (max-width: 680px) {
  body main section#บทความ { padding-block: 20px 25px !important; }
  body main section#บทความ .article-shell { gap: 7px !important; }
  body main section#บทความ .article-shell > .article-card,
  body main section#บทความ .article-shell > .article-card.rc-article-pair {
    padding: 12px 12px 13px !important;
    border-radius: 10px;
  }
  body main section#บทความ .article-shell .article-card h2 { font-size: 16.5px !important; }
  body main section#บทความ .article-shell .article-card :is(p,li,dt,dd,blockquote) {
    font-size: 12.5px !important;
    line-height: 1.58 !important;
  }
  body main section#บทความ .rc-article-toc { margin-bottom: 8px !important; }
  body main section#บทความ .rc-article-toc__label { padding: 9px 11px !important; }
  body main section#บทความ .rc-article-toc ol { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px !important; padding: 7px !important; }
  body main section#บทความ .rc-article-toc a { min-height: 34px !important; padding: 6px !important; font-size: 10.5px !important; }
}
@media (max-width: 360px) {
  body main section#บทความ .rc-article-toc ol { grid-template-columns: 1fr; }
}
/* Standalone /บทความ.html — tighter editorial spacing, no hidden content. */
body.rc-standalone-article { line-height: 1.55; }
body.rc-standalone-article > :is(h2,h3,h4) { margin-block: 10px 5px !important; }
body.rc-standalone-article > p { margin-block: 0 7px !important; }
body.rc-standalone-article > :is(ul,ol) { margin-block: 5px 8px !important; }
