/* ============================================================
   โรงเรียนนิลประพันธ์ — News / Article detail
   Single centered reading column · 3 visual directions
   Builds on css/styles.css (same tokens, fonts, nav, footer)
   Directions: .dir-reader · .dir-editorial · .dir-bold
   ============================================================ */

/* ---------- Article hero (title + date first; cover below) ---------- */
.ahero { position: relative; overflow: hidden; }
.ahero .wrap { position: relative; z-index: 1; }
.ahero__inner { max-width: 820px; }

.cat-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 15px; border-radius: 100px;
}
.cat-badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}
.cat-badge--news    { background: var(--yellow-tint); color: var(--yellow-deep); }
.cat-badge--article { background: var(--yellow-tint); color: var(--yellow-deep); }
.cat-badge--event   { background: var(--yellow-tint); color: var(--yellow-deep); }

.ahero h1 {
  font-size: clamp(30px, 4.4vw, 50px);
  margin: 18px 0 0; text-wrap: balance; line-height: 1.16;
}
.ahero__lede {
  margin-top: 18px; color: var(--ink-2); font-size: clamp(17px, 1.9vw, 21px);
  line-height: 1.6; max-width: 60ch; text-wrap: pretty; font-weight: 500;
}

/* meta row: date · reading time · share */
.ameta {
  margin-top: 26px; display: flex; align-items: center; gap: 18px 22px; flex-wrap: wrap;
}
.ameta__item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 600; color: var(--ink-2);
}
.ameta__item svg { width: 16px; height: 16px; color: var(--yellow-deep); }
.ameta__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); }

/* share cluster */
.share { display: inline-flex; align-items: center; gap: 9px; }
.share__lbl { font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }
.share__btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 1.5px solid var(--line-2); color: var(--ink);
  cursor: pointer; transition: .22s var(--ease); position: relative;
}
.share__btn:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.share__btn svg { width: 19px; height: 19px; }
.share__btn--fb:hover   { background: #1877F2; border-color: #1877F2; color: #fff; }
.share__btn--line:hover { background: #06C755; border-color: #06C755; color: #fff; }
.share__btn--copy:hover { background: var(--yellow); border-color: var(--yellow); color: #2A2200; }
.share__btn .tip {
  position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: var(--charcoal); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap;
  padding: 5px 10px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s var(--ease);
}
.share__btn.copied .tip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Cover (below hero) ---------- */
.cover-sec { padding-top: 0; }
.cover {
  max-width: 940px; margin: 0 auto; position: relative;
  border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 1200/630;
  box-shadow: var(--sh-lg); background: var(--bg-soft);
}
.cover .mock, .cover .ph { position: absolute; inset: 0; }

/* ---------- Reading column / prose ---------- */
.article-body { padding-top: clamp(40px, 5vw, 64px); }
.prose { max-width: 720px; margin: 0 auto; color: #2B2720; font-size: 18.5px; line-height: 1.85; }
.prose > * + * { margin-top: 1.35em; }
.prose .lead { font-size: 21px; line-height: 1.7; color: var(--ink); font-weight: 500; }
.prose h2 {
  font-size: clamp(24px, 3vw, 32px); line-height: 1.25; margin-top: 1.9em; color: var(--ink);
  scroll-margin-top: 96px;
}
.prose h3 { font-size: clamp(19px, 2.2vw, 23px); line-height: 1.35; margin-top: 1.6em; color: var(--ink); }
.prose p { text-wrap: pretty; }
.prose strong { font-weight: 800; color: var(--ink); }
.prose a:not(.btn) { color: var(--yellow-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

.prose ul, .prose ol { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.prose ul li { position: relative; padding-left: 30px; }
.prose ul li::before {
  content: ""; position: absolute; left: 4px; top: .72em; width: 9px; height: 9px;
  border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px var(--yellow-tint);
}
.prose ol { counter-reset: li; }
.prose ol li { position: relative; padding-left: 44px; counter-increment: li; min-height: 30px; }
.prose ol li::before {
  content: counter(li); position: absolute; left: 0; top: .1em;
  width: 30px; height: 30px; border-radius: 9px; background: var(--yellow-tint); color: var(--yellow-deep);
  font-weight: 800; font-size: 15px; display: grid; place-items: center;
}

/* figures / inline images */
.prose figure { margin: 2em 0; }
.prose figure .frame {
  border-radius: var(--r); overflow: hidden; position: relative; aspect-ratio: 4/3;
  border: 1px solid var(--line); background: var(--bg-soft);
}
.prose figure .frame .mock, .prose figure .frame .ph { position: absolute; inset: 0; }
.prose figcaption { text-align: center; color: var(--ink-3); font-size: 14px; margin-top: 12px; font-weight: 500; }

/* ---------- Callout / key box ("กุญแจสำคัญ") ---------- */
.callout {
  margin: 1.8em 0; border-radius: var(--r-lg); padding: 24px 26px;
  background: var(--yellow-tint); border: 1px solid var(--yellow-soft);
  display: grid; grid-template-columns: 46px 1fr; gap: 16px; align-items: start;
}
.callout__ic {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--yellow); color: #2A2200;
}
.callout__ic svg { width: 24px; height: 24px; }
.callout__k { font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--yellow-deep); }
.callout__title { font-size: 18px; font-weight: 800; margin-top: 2px; color: var(--ink); }
.callout p { margin-top: 8px; color: #5C4E2E; font-size: 16px; line-height: 1.7; }

/* pull quote */
.pullquote {
  margin: 1.8em 0; font-size: clamp(21px, 2.6vw, 27px); line-height: 1.45; font-weight: 700;
  color: var(--ink); text-wrap: balance; padding-left: 22px; border-left: 4px solid var(--yellow);
}

/* ---------- Stat strip (e.g. O-NET numbers) ---------- */
.statstrip {
  margin: 2em 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.statstrip .s {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px 16px; text-align: center;
}
.statstrip .s b { display: block; font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; color: var(--yellow-dark); line-height: 1; letter-spacing: -.02em; }
.statstrip .s span { display: block; margin-top: 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; line-height: 1.4; }
.statstrip .s em { font-style: normal; color: var(--green); font-weight: 700; font-size: 12px; }

/* ---------- Announcement: details box + highlights ---------- */
.infobox {
  margin: 1.8em 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px 30px; box-shadow: var(--sh-sm);
}
.infobox__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.infobox__head .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--charcoal); color: var(--yellow); display: grid; place-items: center; flex: none; }
.infobox__head .ic svg { width: 21px; height: 21px; }
.infobox__head h3 { font-size: 20px; }
.infobox dl { display: grid; grid-template-columns: auto 1fr; gap: 14px 22px; margin: 0; }
.infobox dt { font-weight: 700; color: var(--ink-3); font-size: 14.5px; white-space: nowrap; }
.infobox dd { margin: 0; font-weight: 600; color: var(--ink); font-size: 16px; }
.infobox dd .hi { color: var(--yellow-deep); font-weight: 800; }

.hl-list { margin: 1.6em 0; display: grid; gap: 14px; }
.hl-list .hl {
  display: grid; grid-template-columns: 44px 1fr; gap: 15px; align-items: start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.hl-list .hl:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.hl-list .hl .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--yellow-tint); color: var(--yellow-deep); display: grid; place-items: center; flex: none; }
.hl-list .hl .ic svg { width: 23px; height: 23px; }
.hl-list .hl b { font-size: 16.5px; font-weight: 800; color: var(--ink); }
.hl-list .hl p { margin-top: 4px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }

/* ---------- End-of-article CTA ---------- */
.article-cta {
  max-width: 820px; margin: clamp(40px,5vw,64px) auto 0;
  border-radius: var(--r-xl); overflow: hidden; position: relative;
  background: var(--charcoal);
  padding: clamp(34px, 4vw, 52px); color: rgba(255,255,255,.78); box-shadow: var(--sh-lg);
}
.article-cta::before { content: ""; position: absolute; right: -50px; top: -50px; width: 260px; height: 260px; background: radial-gradient(circle, rgba(229,169,16,.16), transparent 66%); }
.article-cta__k { position: relative; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--yellow); }
.article-cta h2 { position: relative; font-size: clamp(24px, 3vw, 34px); margin-top: 10px; color: #fff; text-wrap: balance; }
.article-cta p { position: relative; margin-top: 12px; font-size: 17px; font-weight: 500; color: rgba(255,255,255,.82); max-width: 52ch; }
.article-cta__row { position: relative; margin-top: 26px; display: flex; gap: 14px; flex-wrap: wrap; }
.article-cta .btn--dark { background: var(--yellow); color: #2A2200; box-shadow: var(--sh-sm); }
.article-cta .btn--dark:hover { background: var(--yellow-bright); transform: translateY(-3px); box-shadow: var(--sh-md); }

/* ---------- Author / byline footer ---------- */
.byline {
  max-width: 720px; margin: clamp(32px,4vw,48px) auto 0; padding-top: 28px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
}
.byline__av { width: 54px; height: 54px; border-radius: 50%; flex: none; background: var(--yellow-tint); display: grid; place-items: center; overflow: hidden; }
.byline__av img { width: 100%; height: 100%; object-fit: cover; }
.byline__av svg { width: 26px; height: 26px; color: var(--yellow-deep); }
.byline__n { font-weight: 800; font-size: 16px; }
.byline__r { color: var(--ink-3); font-size: 14px; font-weight: 600; margin-top: 2px; }
.byline__share { margin-left: auto; }

/* ---------- Related news ---------- */
.related-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: clamp(24px,3vw,40px); flex-wrap: wrap; }

/* ============================================================
   DIRECTION A — Reader (warm, soft, friendly)  [default look]
   ============================================================ */
.dir-reader .ahero { background: var(--bg-warm); padding: clamp(40px,5vw,72px) 0 clamp(30px,4vw,48px); }
.dir-reader .ahero__inner { text-align: center; margin-left: auto; margin-right: auto; }
.dir-reader .ahero .crumb { justify-content: center; }
.dir-reader .ahero__lede { margin-left: auto; margin-right: auto; }
.dir-reader .ameta { justify-content: center; }
.dir-reader .cover { margin-top: clamp(28px,4vw,40px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  .statstrip { grid-template-columns: repeat(2, 1fr); }
  .infobox dl { grid-template-columns: 1fr; gap: 4px 0; }
  .infobox dd { margin-bottom: 12px; }
  .prose { font-size: 17.5px; }
  .byline { flex-wrap: wrap; }
  .byline__share { margin-left: 0; width: 100%; }
}
@media (max-width: 480px) {
  .statstrip { grid-template-columns: 1fr; }
}
