/* หน้าบทความ: ส่วนเสริม 7 พ.ย. 2569 (ใช้คู่กับ _article_upgrade.php)
   สีและฟอนต์ตามธีมเดิม: กรมท่า #272c40 ทอง #b98e44 / #c0b596 ฟอนต์ Prompt */
.tt-ar {
  --tt-navy-900: #1b2030;
  --tt-navy: #272c40;
  --tt-ink: #1d2433;
  --tt-muted: #5a6172;
  --tt-gold: #b98e44;
  --tt-gold-soft: #c0b596;
  --tt-gold-ink: #7d5f27;
  --tt-gold-pale: #f6f0e4;
  --tt-gold-line: #e5d8bd;
  --tt-paper: #f6f3ef;
  --tt-line: #e4ded3;
  --tt-on-navy: #d9d3c6;
  --tt-line-green: #06c755;
  --tt-line-ink: #062b14;
}
html { scroll-padding-top: 112px; }
.tt-ar ::selection { background: #ead9b5; color: #1b2030; }
.tt-ar :focus-visible,
.tt-mbar :focus-visible { outline: 2px solid #b98e44; outline-offset: 3px; border-radius: 3px; }
.tt-ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* โครงหน้า: เนื้อหา + แถบข้าง */
section.tt-ar { padding-top: 40px; }
.tt-ar .tt-ar-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; column-gap: 56px; max-width: 1180px; margin: 0 auto; }
.tt-ar .tt-ar-main { min-width: 0; }

/* เส้นทางหน้า */
.tt-ar .tt-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0 0 14px; padding: 0; font-size: 14px; line-height: 1.6; color: var(--tt-muted); }
.tt-ar .tt-crumbs li { display: inline-flex; align-items: center; }
.tt-ar .tt-crumbs li + li::before { content: "/"; margin: 0 10px; color: #b9b2a3; }
.tt-ar .tt-crumbs a { color: var(--tt-muted); text-decoration: none; }
.tt-ar .tt-crumbs a:hover { color: var(--tt-navy); text-decoration: underline; text-underline-offset: 3px; }
.tt-ar .tt-crumbs [aria-current] { color: var(--tt-navy); }

/* ผู้เขียนในแถวข้อมูล */
.tt-ar .tt-byline-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: top; background: #e9e4da; vertical-align: middle; margin-right: 8px; }
.tt-ar .entry-meta a { color: inherit; }
.tt-ar .entry-meta a:hover { color: var(--tt-gold-ink); }

/* รูปปก */
.tt-ar .tt-hero { margin: 0 auto 40px; max-width: 640px; }
.tt-ar .tt-hero img { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--tt-paper); }

/* สารบัญบนมือถือ */
.tt-ar .tt-toc-m { display: none; margin: 0 0 28px; border: 1px solid var(--tt-line); border-radius: 8px; background: #fff; font-size: 16px; line-height: 1.55; }
.tt-ar .tt-toc-m summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--tt-navy); list-style-position: inside; }
.tt-ar .tt-toc-m ol { margin: 0; padding: 0 18px 14px 38px; }
.tt-ar .tt-toc-m li { padding: 5px 0; }
.tt-ar .tt-toc-m a { color: var(--tt-ink); text-decoration: none; }
.tt-ar .tt-toc-m a:hover { color: var(--tt-gold-ink); text-decoration: underline; }

/* ปุ่ม */
.tt-ar .tt-btn, .tt-ar a.tt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 6px; border: 1px solid transparent; font: 500 15px/1.3 Prompt, sans-serif; text-decoration: none; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.tt-ar .tt-btn-gold, .tt-ar a.tt-btn-gold { background: var(--tt-gold); color: var(--tt-navy-900); }
.tt-ar .tt-btn-gold:hover { background: #c9a05a; color: var(--tt-navy-900); }
.tt-ar .tt-btn-line, .tt-ar a.tt-btn-line { background: var(--tt-line-green); color: var(--tt-line-ink); }
.tt-ar .tt-btn-line:hover { background: #2bd673; color: var(--tt-line-ink); }
.tt-ar .tt-btn-ghost, .tt-ar a.tt-btn-ghost { border-color: rgba(255, 255, 255, .4); color: #fff; }
.tt-ar .tt-btn-ghost:hover { border-color: var(--tt-gold-soft); color: var(--tt-gold-soft); }
.tt-ar .tt-lnk, .tt-ar a.tt-lnk { display: inline-flex; align-items: center; gap: 6px; color: var(--tt-gold-ink); font-weight: 500; text-decoration: none; }
.tt-ar .tt-lnk:hover { color: var(--tt-gold-ink); text-decoration: underline; text-underline-offset: 4px; }
.tt-ar .tt-lnk .tt-ic { width: 16px; height: 16px; }

/* กล่องบริการกลางบทความ */
.tt-ar .tt-svc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; margin: 36px 0 28px; padding: 24px 26px; background: var(--tt-gold-pale); border: 1px solid var(--tt-gold-line); border-radius: 10px; font-family: Prompt, sans-serif; font-size: 16px; line-height: 1.6; color: var(--tt-ink); clear: both; }
.tt-ar .tt-svc .tt-svc-h { margin: 0 0 8px; font-size: 20px; line-height: 1.45; font-weight: 600; color: var(--tt-navy); }
.tt-ar .tt-svc .tt-svc-list { list-style: none; margin: 0; padding: 0; }
.tt-ar .tt-svc .tt-svc-list li { display: flex; gap: 10px; margin: 6px 0; padding: 0; list-style: none; color: #3c4354; font-size: 16px; line-height: 1.6; }
.tt-ar .tt-svc .tt-svc-list li::before { content: none; }
.tt-ar .tt-svc .tt-svc-list .tt-ic { color: var(--tt-gold-ink); margin-top: 3px; }
.tt-ar .tt-svc .tt-svc-act { display: flex; flex-direction: column; gap: 10px; min-width: 220px; }
.tt-ar .tt-svc a.tt-btn { text-decoration: none; }
.tt-ar .tt-svc a.tt-btn-gold { color: var(--tt-navy-900); }
.tt-ar .tt-svc a.tt-btn-line { color: var(--tt-line-ink); }

/* กล่องผู้เขียน */
.tt-ar .tt-author { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 22px; margin: 56px 0 0; padding: 28px 0; border-top: 1px solid var(--tt-line); border-bottom: 1px solid var(--tt-line); font-family: Prompt, sans-serif; font-size: 16px; line-height: 1.65; color: var(--tt-ink); }
.tt-ar .tt-author > img { width: 96px; height: 96px; object-fit: cover; object-position: top; border-radius: 8px; background: #e9e4da; }
.tt-ar .tt-author p { margin: 0 0 10px; font-size: 16px; line-height: 1.65; }
.tt-ar .tt-author .tt-author-h { margin: 0; font-size: 19px; font-weight: 600; color: var(--tt-navy); }
.tt-ar .tt-author .tt-author-h a { color: var(--tt-navy); text-decoration: none; }
.tt-ar .tt-author .tt-author-h a:hover { color: var(--tt-gold-ink); text-decoration: underline; text-underline-offset: 4px; }
.tt-ar .tt-author .tt-author-role { margin: 2px 0 10px; color: var(--tt-gold-ink); font-size: 15px; }
.tt-ar .tt-firm { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
.tt-ar .tt-faces { display: flex; padding-left: 12px; }
.tt-ar .tt-faces img { width: 56px; height: 56px; margin-left: -12px; border-radius: 50%; border: 2px solid #fff; object-fit: cover; object-position: top; background: #e9e4da; }
.tt-ar .tt-firm .tt-author-h { margin-bottom: 8px; }

/* อ่านต่อในหัวข้อนี้ */
.tt-ar .tt-cluster { margin: 48px 0 0; padding: 0; font-family: Prompt, sans-serif; }
.tt-ar .tt-cluster h2 { margin: 0 0 18px; font-size: 24px; line-height: 1.4; font-weight: 600; color: var(--tt-navy); letter-spacing: 0; }
.tt-ar .tt-pillar { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 18px; align-items: center; padding: 14px; border: 1px solid var(--tt-line); border-radius: 10px; background: var(--tt-paper); text-decoration: none; color: var(--tt-navy); transition: border-color .2s; }
.tt-ar .tt-pillar:hover { border-color: var(--tt-gold); color: var(--tt-navy); }
.tt-ar .tt-pillar img { width: 128px; height: 96px; object-fit: cover; border-radius: 6px; }
.tt-ar .tt-pillar-tag { display: block; margin-bottom: 4px; font-size: 14px; color: var(--tt-gold-ink); font-weight: 500; }
.tt-ar .tt-pillar-t { display: block; font-size: 17px; line-height: 1.5; font-weight: 600; }
.tt-ar .tt-pillar:hover .tt-pillar-t { text-decoration: underline; text-underline-offset: 4px; }
.tt-ar .tt-cluster ul { list-style: none; margin: 10px 0 0; padding: 0; }
.tt-ar .tt-cluster li { margin: 0; padding: 13px 0; border-bottom: 1px solid var(--tt-line); list-style: none; font-size: 16.5px; line-height: 1.55; }
.tt-ar .tt-cluster li a { color: var(--tt-navy); font-weight: 500; text-decoration: none; }
.tt-ar .tt-cluster li a:hover { color: var(--tt-gold-ink); text-decoration: underline; text-underline-offset: 4px; }
.tt-ar .tt-cluster-more { margin: 16px 0 0; font-size: 15px; }

/* ปุ่มติดต่อท้ายบทความ */
.tt-ar .tt-end { margin: 48px 0 0; padding: 32px; background: var(--tt-navy); color: #fff; border-radius: 10px; font-family: Prompt, sans-serif; }
.tt-ar .tt-end h2 { margin: 0 0 8px; font-size: 24px; line-height: 1.4; font-weight: 600; color: #fff; letter-spacing: 0; }
.tt-ar .tt-end > p { margin: 0 0 20px; color: var(--tt-on-navy); font-size: 16px; line-height: 1.65; max-width: 40em; }
.tt-ar .tt-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tt-ar .tt-end .tt-end-note { margin: 18px 0 0; font-size: 14px; color: #aea795; }
.tt-ar .tt-end-note a { color: var(--tt-gold-soft); text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }
.tt-ar .tt-end-note a:hover { color: #fff; }

/* แถบข้าง (จอคอมพิวเตอร์) */
.tt-ar .tt-rail { position: relative; font-family: Prompt, sans-serif; }
.tt-ar .tt-rail-in { position: sticky; top: 118px; display: flex; flex-direction: column; max-height: calc(100vh - 136px); padding: 4px 0; }
.tt-ar .tt-toc { display: flex; flex-direction: column; min-height: 0; flex: 0 1 auto; }
.tt-ar .tt-toc-h { flex: none; margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--tt-navy); }
.tt-ar .tt-toc ol { position: relative; min-height: 0; overflow: auto; list-style: none; margin: 0; padding: 0 4px 0 0; border-left: 1px solid var(--tt-line); scrollbar-width: thin; scrollbar-color: #d8cfbd transparent; }
.tt-ar .tt-toc li { margin: 0; padding: 0; list-style: none; }
.tt-ar .tt-toc a { display: block; margin-left: -1px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; font-size: 14.5px; line-height: 1.5; color: var(--tt-muted); text-decoration: none; }
.tt-ar .tt-toc a:hover { color: var(--tt-navy); border-left-color: var(--tt-gold-soft); }
.tt-ar .tt-toc a[aria-current] { color: var(--tt-navy); font-weight: 500; border-left-color: var(--tt-gold); }
.tt-ar .tt-rail-card { flex: none; display: flex; flex-direction: column; gap: 10px; margin-top: 24px; padding: 18px; background: var(--tt-paper); border: 1px solid var(--tt-line); border-radius: 8px; }
.tt-ar .tt-rail-h { margin: 0 0 2px; font-size: 16px; font-weight: 600; color: var(--tt-navy); line-height: 1.5; }
.tt-ar .tt-rail-card .tt-lnk { justify-content: center; gap: 6px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--tt-gold-line); border-radius: 6px; background: #fff; font-size: 15px; line-height: 1.4; text-align: center; }
.tt-ar .tt-rail-card .tt-lnk:hover { border-color: var(--tt-gold); text-decoration: none; }

/* แถบติดต่อบนมือถือ */
.tt-mbar { display: none; }

@media (max-width: 1199.98px) {
  .tt-ar .tt-ar-wrap { grid-template-columns: minmax(0, 1fr) 240px; column-gap: 40px; }
}
@media (max-width: 991.98px) {
  html { scroll-padding-top: 90px; }
  section.tt-ar { padding-top: 24px; }
  .tt-ar .tt-ar-wrap { display: block; }
  .tt-ar .tt-rail { display: none; }
  .tt-ar .tt-toc-m { display: block; }
  .tt-ar .tt-svc { grid-template-columns: 1fr; }
  .tt-ar .tt-svc .tt-svc-act { min-width: 0; }
  .tt-mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: grid; grid-template-columns: repeat(3, 1fr); padding-bottom: env(safe-area-inset-bottom); background: #1b2030; border-top: 1px solid rgba(192, 181, 150, .3); font-family: Prompt, sans-serif; }
  .tt-mbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 10px; color: #fff; font-size: 13px; line-height: 1.2; text-decoration: none; }
  .tt-mbar a:hover, .tt-mbar a:focus { color: #fff; }
  .tt-mbar .tt-ic { width: 20px; height: 20px; }
  .tt-mbar a.tt-mbar-line { color: #3be27f; }
  .tt-mbar a.tt-mbar-svc { color: #c0b596; }
  body.tt-article-page { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
}
@media (max-width: 575.98px) {
  .tt-ar .tt-hero { margin-bottom: 28px; }
  .tt-ar .tt-svc { padding: 20px 18px; }
  .tt-ar .tt-svc .tt-svc-h { font-size: 18px; }
  .tt-ar .tt-author { grid-template-columns: 64px minmax(0, 1fr); gap: 16px; }
  .tt-ar .tt-author > img { width: 64px; height: 64px; }
  .tt-ar .tt-firm { grid-template-columns: 1fr; }
  .tt-ar .tt-pillar { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; padding: 12px; }
  .tt-ar .tt-pillar img { width: 88px; height: 66px; }
  .tt-ar .tt-end { padding: 24px 20px; }
  .tt-ar .tt-end h2 { font-size: 21px; }
  .tt-ar .tt-actions .tt-btn { flex: 1 1 100%; }
  .tt-ar .tt-cluster h2 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tt-ar .tt-btn, .tt-ar .tt-pillar { transition: none; }
}
@media print {
  .tt-ar .tt-rail, .tt-mbar, .tt-ar .tt-svc, .tt-ar .tt-end, .tt-ar .tt-toc-m { display: none !important; }
  .tt-ar .tt-ar-wrap { display: block; }
}
