/* ═══════════════════════════════════════════════════════════
   ARTICLE DETAIL — page-specific styles only.
   Header, footer, buttons (.btn-primary/.view-all), colors,
   .eyebrow, .section-title, .section and .reveal all come from the
   shared css/styles.css (same file the homepage uses), so header,
   footer, margins and button design stay identical to the homepage.

   Layout: a single reading column capped to a comfortable measure,
   flush-left with the rest of the article content above it.
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   20260721 แก้: ใช้ฟอนต์ TH Sarabun New (Font หัวกลม) เฉพาะ "เนื้อหาบทความ"
   (<article class="art">) เท่านั้น — bind ตัวแปรฟอนต์ไว้ที่ .art
   ตัวแปรเป็น custom property จึงถ่ายทอด (inherit) ให้ลูกทุกตัวในบทความ
   ส่วน navbar / breadcrumb / section บทความที่เกี่ยวข้อง / footer
   อยู่นอก .art จึงคงใช้ฟอนต์เดิม Noto Sans Thai แบบหน้า home
   (@font-face อยู่ใน css/fonts.css — โหลดใน article-detail.html)
   ═══════════════════════════════════════════════════════════ */
.art {
  --sans-th: 'TH Sarabun New', 'Noto Sans Thai', system-ui, sans-serif;
  --sans-en: 'TH Sarabun New', 'Noto Sans Thai', system-ui, sans-serif;
  --sans-jp: 'TH Sarabun New', 'Noto Sans Thai', 'Noto Sans JP', sans-serif;
  --serif-jp: 'TH Sarabun New', 'Noto Sans Thai', 'Noto Sans JP', sans-serif;
  --display: 'TH Sarabun New', 'Noto Sans Thai', sans-serif;
  font-family: var(--sans-th);
}

/* The current nav item ("ความรู้") active state comes from the shared
   .nav-item.current rule in css/styles.css — navy text + persistent underline. */

/* Breadcrumb — the shared .hero-crumb-bar (css/styles.css) sits at the very top
   of <main>. On article.html it is position:absolute over the page-hero image;
   this page has no hero image at the top, so render it in-flow (position:static)
   instead. Its own padding (16px 64px) keeps the breadcrumb text at the exact
   same top:16px / left:64px spot as on article.html — pixel-identical. */
.hero-crumb-bar { position: static; }

.art {
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px 64px 72px;
}

/* ═══════════════ ARTICLE HEADER ═══════════════ */

.art-eyebrow {
  font-family: var(--sans-en);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--cyan-deep);
  margin-bottom: 16px;
}

.art-title {
  font-family: var(--display);
  font-size: clamp(28px, 3.6vw, 46px);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.28;
  color: var(--navy);
  margin: 0 0 32px;
  max-width: 900px;
}

.art-metabar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.art-author { display: flex; align-items: center; gap: 14px; }
.art-avatar {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  background: var(--cyan-soft);
  color: var(--cyan-deep);
  font-size: 22px;
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
}
.art-author-text { display: flex; flex-direction: column; line-height: 1.4; }
.art-author-text b { font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--navy); }
.art-author-text span { font-size: 16px; color: var(--gray-500); }

.art-metabar-facts { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.art-metabar-facts > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: var(--gray-700);
}
.art-metabar-facts i { font-size: 18px; color: var(--cyan); }
.art-tag {
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 16px;
  font-weight: 600;
  padding: 4px 12px;
  letter-spacing: .3px;
}

/* ═══════════════ FEATURE IMAGE ═══════════════ */
.art-feature {
  margin: 40px 0 8px;
}
.art-feature img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  /* Cut-corner frame — same 22px notch language as the rest of the site */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}
.art-feature figcaption {
  margin-top: 14px;
  font-size: 16px;
  color: var(--gray-500);
  line-height: 1.6;
  padding-left: 16px;
  border-left: 3px solid var(--cyan);
}

/* ═══════════════ BODY — single reading column ═══════════════
   Simple block flow, no max-width of its own — fills the same content
   box as .art-feature (the feature image), .art-title etc. so the text
   lines up flush with the image's edges at every screen size instead of
   sitting in a narrower column. Each .art-main is one section (heading +
   paragraphs/list/quote); spacing between sections comes from margin,
   not a grid. */
.art-body {
  margin-top: 48px;
}
.art-main + .art-main { margin-top: 40px; }

.art-main > p {
  font-size: 18px;
  line-height: 1.95;
  color: var(--ink-2);
  margin: 0 0 22px;
}
.art-main > p:last-child { margin-bottom: 0; }
.art-lead {
  font-size: 20px !important;
  line-height: 1.85 !important;
  color: var(--navy) !important;
  font-weight: 500;
}
.art-h2 {
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.3;
  color: var(--cyan-deep);
  margin: 12px 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--navy-soft);
}

.art-quote {
  margin: 30px 0;
  padding: 22px 28px;
  border-left: 4px solid var(--cyan);
  background: var(--navy-soft);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--navy);
}

.art-list {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.art-list li {
  position: relative;
  padding-left: 24px;
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink-2);
}
.art-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 8px;
  background: var(--cyan);
  transform: rotate(45deg);
}

/* ═══════════════ TAGS + SHARE ═══════════════ */
.art-tags-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.art-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.art-chip {
  font-size: 16px;
  font-weight: 600;
  color: var(--cyan-deep);
  background: var(--cyan-soft);
  padding: 6px 14px;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.art-chip:hover { background: var(--cyan); color: #fff; }
.art-share { display: flex; align-items: center; gap: 12px; }
.art-share span { font-size: 16px; font-weight: 600; color: var(--gray-700); }
.art-share a {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-2);
  color: var(--navy);
  font-size: 22px;
  text-decoration: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .2s, color .2s, border-color .2s;
}
.art-share a:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
/* Custom share icons — SVG files in /Icons rendered as <img> (works in every
   browser, incl. Safari). Navy by default; turn white on hover via filter.
   The three logos have different viewBox ratios (FB is tall & narrow), so they
   are normalised by HEIGHT and centred, keeping them visually balanced. */
.art-share a { overflow: hidden; }
.art-share a .art-ico {
  width: auto;
  height: 20px;              /* uniform height across all three logos */
  max-width: 24px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  transition: filter .2s;
}
.art-share a:hover .art-ico { filter: brightness(0) invert(1); }

/* ═══════════════ RELATED ARTICLES ═══════════════ */
.related-wrap { max-width: 1180px; margin: 0 auto; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.related-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.related-card:hover { transform: translateY(-4px); box-shadow: 0 22px 46px rgba(35, 57, 105, .12); }
.related-thumb {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
}
.related-body { padding: 22px 24px 26px; }
.related-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 16px;
  color: var(--gray-500);
}
.related-card h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--navy);
  margin: 0;
  transition: color .25s var(--ease);
}
.related-card:hover h3 { color: var(--cyan-deep); }
.related-body .art-tag { display: inline-block; margin-top: 14px; }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 1000px) {
  .art { padding: 16px 32px 56px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .art { padding: 12px 20px 44px; }
  .art-metabar { flex-direction: column; align-items: flex-start; gap: 14px; }
  .art-metabar-facts { gap: 14px; }
  .art-main > p, .art-list li { font-size: 16px; }
  .art-lead { font-size: 18px !important; }
  /* Taller feature image so it keeps presence on a narrow screen */
  .art-feature img { aspect-ratio: 3 / 2; }
  /* Pull-quote sized down for small screens */
  .art-quote { font-size: 18px; padding: 18px 20px; margin: 24px 0; }
  .art-tags-row { flex-direction: column; align-items: flex-start; }
  .art-share { flex-wrap: wrap; }
}

@media (max-width: 400px) {
  .art-title { font-size: 26px; }
  .art-quote { font-size: 18px; }
  .art-share a { width: 38px; height: 38px; font-size: 18px; }
}
