/* === article-detail.css — single Article reading page ===
   Layout inspired by kudanil.com/the-yacht: a (reduced-height) full-bleed
   hero with centred title, a centred lead, a large feature image, a reading
   column, a 3-up image grid and a dark closing CTA. Content-faithful — only
   the article's own data is shown (no fabricated captions/labels). Your
   Holidays CI: cream / rust / almost-black, Old Standard TT + Anuphan /
   JS Pumpuang. Globals live in style.css; DOM built by article-detail.js. */

.adetail { background: var(--c-cream, #EEEEE5); color: var(--ink, #181715); }
.adx { display: block; }

/* ---- shared helpers ---- */
.adx-wrap { max-width: var(--container, 1240px); margin: 0 auto; padding-inline: var(--gutter, 1.5rem); }
.adx-wrap--wide { max-width: var(--container-wide, 1600px); }
.adx-wrap--narrow { max-width: 740px; }

.adx-eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: "Anuphan", system-ui, sans-serif;
  font-weight: 500; font-size: 0.72rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--c-rust, #7C3C1B);
}
.adx-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: 0 0 auto;
}
.adx-eyebrow--light { color: rgba(238, 238, 229, 0.9); }

.adx-pill {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: "Anuphan", system-ui, sans-serif;
  font-weight: 500; font-size: 0.76rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.95rem 1.7rem;
  border: 1px solid var(--ink, #181715);
  color: var(--ink, #181715); background: transparent;
  text-decoration: none; cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.adx-pill:hover { background: var(--ink, #181715); color: var(--c-cream, #EEEEE5); }
.adx-pill--rust { background: var(--c-rust, #7C3C1B); border-color: var(--c-rust, #7C3C1B); color: var(--c-cream, #EEEEE5); }
.adx-pill--rust:hover { background: var(--c-cream, #EEEEE5); color: var(--ink, #181715); border-color: var(--c-cream, #EEEEE5); }

/* =====================================================================
   1 · HERO — fixed inset banner (เหมือนหน้าอื่น: ปักนิ่งใต้ navbar,
   เนื้อหา .adx-flow เลื่อนขึ้นมาทับ)
   ===================================================================== */
.adx-hero {
  position: fixed;
  top: 0;
  left: 0;            /* เต็มกว้าง — ไม่มีขอบซ้ายขวา */
  right: 0;
  z-index: 0;
  height: calc(var(--nav-h) + var(--hero-band));
  overflow: hidden;
  background: var(--c-black, #181715);
  display: flex; flex-direction: column;
}
/* เนื้อหาเลื่อนขึ้นมาทับ hero */
.adx-flow {
  position: relative;
  z-index: 1;
  background: var(--c-cream, #EEEEE5);
  margin-top: calc(var(--nav-h) + var(--hero-band) + var(--frame));
}
.adx-hero__img { position: absolute; inset: 0; width: 100%; height: 100%!important; object-fit: cover; }
.adx-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(24,23,21,0.46) 0%, rgba(24,23,21,0.18) 42%, rgba(24,23,21,0.5) 100%);
}
.adx-hero__top {
  position: relative; z-index: 1; width: 100%;
  max-width: var(--container-wide, 1600px); margin: 0 auto;
  padding: clamp(5.5rem, 11vw, 8.5rem) var(--gutter, 1.5rem) 0;
}
.adx-hero__back {
  font-family: "Anuphan", system-ui, sans-serif; font-weight: 500;
  font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--c-cream, #EEEEE5); text-decoration: none; opacity: 0.85;
}
.adx-hero__back:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

/* Back link moved out of the banner, into the cream content area at the top of
   .adx-flow (which already carries the below-hero offset). */
.adx-back {
  max-width: var(--container-wide, 1600px);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.25rem) var(--gutter, 1.5rem) 0;
}
.adx-back .adx-hero__back { display: inline-block; color: var(--ink, #181715); opacity: 0.7; }
.adx-hero__center {
  position: relative; z-index: 1; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center; gap: 1.1rem;
  max-width: var(--container, 1240px); width: 100%; margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) var(--gutter, 1.5rem) clamp(1.75rem, 4vw, 3rem);
}
.adx-hero__title {
  font-family: var(--font-en-serif, "Old Standard TT", serif);
  font-weight: 400; color: var(--c-cream, #EEEEE5);
  font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1.06;
  letter-spacing: -0.01em; margin: 0; white-space: nowrap;
}
.adx-hero__title em { font-style: italic; }
[data-lang="th"] .adx-hero__title, .adx-hero__title-th {
  font-family: "JS Pumpuang", "Old Standard TT", serif; line-height: 1.22;
  font-size: clamp(1.7rem, 4vw, 3.1rem);
}

/* =====================================================================
   2 · DOC — editorial: text ค้าง (sticky) + แถบรูปเลื่อนผ่าน
   เลื่อนหน้า → ข้อความค้าง รูปในแถบ rail เลื่อนผ่านทีละรูป
   จนหมดแถบ → ปล่อยไปต่อ section ถัดไป (Other articles)
   ===================================================================== */
.adx-doc {
  max-width: var(--container-wide, 1600px);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5.5rem) var(--gutter, 1.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.adx-doc__main {
  position: sticky;
  top: calc(var(--nav-h) + clamp(1.5rem, 4vw, 3rem));
  max-width: 56ch;
}
.adx-doc__title {
  margin: 0.9rem 0 0;
  font-family: var(--font-en-serif, "Old Standard TT", serif);
  font-weight: 400; font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 1.05; letter-spacing: -0.01em; color: var(--ink, #181715);
}
.adx-doc__title .show-th, .adx-doc__title-th { font-family: "JS Pumpuang", "Old Standard TT", serif; line-height: 1.18; }
.adx-doc__meta {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  margin: 1.1rem 0 1.9rem;
  font-family: "Anuphan", system-ui, sans-serif; font-weight: 500;
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(24, 23, 21, 0.55);
}
.adx-doc__meta .adx-doc__date::before { content: "·"; margin-right: 0.9rem; }
.adx-doc__body p {
  font-family: "Anuphan", system-ui, -apple-system, "Segoe UI", sans-serif !important;
  font-weight: 300;
  font-size: clamp(1.02rem, 1.2vw, 1.14rem); line-height: 1.85;
  color: rgba(24, 23, 21, 0.86); margin: 0 0 1.3rem;
}
.adx-doc__body p:last-child { margin-bottom: 0; }
.adx-doc__body .show-th { font-family: "Anuphan", system-ui, -apple-system, "Segoe UI", sans-serif !important; font-weight: 300; line-height: 2.05; }

/* แชร์ + ติดตามเพจ (ตอนท้ายเนื้อหา) */
.adx-share {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  padding-top: 1.5rem; border-top: 1px solid rgba(24, 23, 21, 0.14);
}
.adx-share__label {
  font-family: "Anuphan", system-ui, sans-serif; font-weight: 500;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(24, 23, 21, 0.55); margin-right: 0.4rem;
}
.adx-share__btn {
  width: 42px; height: 42px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(24, 23, 21, 0.3); border-radius: 50%;
  color: var(--ink, #181715); background: transparent; padding: 0;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.adx-share__btn svg { width: 18px; height: 18px; display: block; }
.adx-share__btn:hover { background: var(--ink, #181715); color: var(--c-cream, #EEEEE5); border-color: var(--ink, #181715); }
.adx-share__btn.is-copied { background: var(--c-rust, #7C3C1B); color: var(--c-cream, #EEEEE5); border-color: var(--c-rust, #7C3C1B); }
.adx-follow {
  margin: clamp(1.25rem, 2.5vw, 1.75rem) 0 0;
  font-family: "Anuphan", system-ui, sans-serif; font-weight: 300;
  font-size: 0.95rem; line-height: 1.6; color: rgba(24, 23, 21, 0.72);
}
.adx-follow a { color: var(--c-rust, #7C3C1B); text-decoration: underline; text-underline-offset: 3px; }

/* แถบรูป — flow ปกติ (สูง) เลื่อนผ่านขณะข้อความค้าง · กดดูเต็มได้ */
.adx-doc__rail {
  display: flex; flex-direction: column;
  gap: clamp(1rem, 2vw, 1.5rem);
}
.adx-doc__rail figure { margin: 0; }
.adx-doc__rail img {
  width: 100%; display: block; cursor: zoom-in;
  transition: opacity .25s ease;
}
.adx-doc__rail img:hover { opacity: 0.9; }
@media (max-width: 860px) {
  .adx-doc { grid-template-columns: 1fr; gap: clamp(2rem, 6vw, 3rem); }
  .adx-doc__main { position: static; max-width: none; }
  /* บนจอเล็ก ให้หัวข้อตัดบรรทัดได้ ไม่ล้นแนวนอน */
  .adx-hero__title, .adx-cta__title { white-space: normal; }
}

/* =====================================================================
   2b · OTHER ARTICLES — section ถัดไปหลังจากเลื่อนรูปหมด
   ===================================================================== */
.adx-other {
  background: var(--c-cream, #EEEEE5);
  border-top: 1px solid rgba(24, 23, 21, 0.14);
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}
.adx-other__wrap { max-width: var(--container-wide, 1600px); margin: 0 auto; padding: 0 var(--gutter, 1.5rem); }
/* หัวข้อ + ปุ่ม View all อยู่บรรทัดเดียวกัน */
.adx-other__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
}
.adx-other__title {
  margin: 0;
  font-family: var(--font-en-serif, "Old Standard TT", serif);
  font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.1;
}
.adx-other__view { flex: 0 0 auto; }
.adx-other__title-th { font-family: "JS Pumpuang", "Old Standard TT", serif; }
.adx-other__grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.75rem);
}
.adx-other__card { display: block; text-decoration: none; color: inherit; }
.adx-other__media { overflow: hidden; aspect-ratio: 3 / 2; background: var(--c-charcoal, #211F1C); }
.adx-other__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.adx-other__card:hover .adx-other__media img { transform: scale(1.04); }
.adx-other__name {
  margin: 0.9rem 0 0;
  font-family: var(--font-en-serif, "Old Standard TT", serif);
  font-weight: 400; font-size: 1.1rem; line-height: 1.3;
}
.adx-other__name-th { font-family: "Anuphan", system-ui, sans-serif; font-weight: 500; }
@media (max-width: 700px) { .adx-other__grid { grid-template-columns: 1fr; } }
.adx-other__more { margin-top: clamp(2rem, 4vw, 3rem); text-align: center; }

/* =====================================================================
   3 · LIGHTBOX — full-size image viewer
   ===================================================================== */
.adx-lb {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(18, 17, 16, 0.94);
  display: none; align-items: center; justify-content: center;
}
.adx-lb.is-open { display: flex; }
.adx-lb img { max-width: 92vw; max-height: 88vh; object-fit: contain; box-shadow: 0 10px 50px rgba(0,0,0,0.5); }
.adx-lb__close {
  position: absolute; top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem);
  background: transparent; border: none; color: var(--c-cream, #EEEEE5);
  font-size: 2rem; line-height: 1; cursor: pointer; opacity: 0.85;
}
.adx-lb__close:hover { opacity: 1; }
.adx-lb__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: transparent; border: 1px solid rgba(238,238,229,0.5);
  color: var(--c-cream, #EEEEE5);
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.5rem; transition: background .2s ease;
}
.adx-lb__btn:hover { background: rgba(238,238,229,0.15); }
.adx-lb__prev { left: clamp(0.75rem, 3vw, 2.5rem); }
.adx-lb__next { right: clamp(0.75rem, 3vw, 2.5rem); }
.adx-lb__counter {
  position: absolute; bottom: clamp(1rem, 3vw, 2rem); left: 0; right: 0;
  text-align: center; color: rgba(238,238,229,0.7);
  font-family: "Anuphan", sans-serif; font-size: 0.78rem; letter-spacing: 0.1em;
}
@media (max-width: 600px) { .adx-lb__btn { width: 42px; height: 42px; } }

/* =====================================================================
   6 · CLOSING CTA — dark full-width band, centred
   ===================================================================== */
.adx-cta {
  background: var(--c-cream, #EEEEE5);
  color: var(--ink, #181715);
  border-top: 1px solid rgba(24, 23, 21, 0.14);
  padding: clamp(3.5rem, 9vw, 7rem) 0;
  text-align: center;
}
.adx-cta .adx-wrap { display: flex; flex-direction: column; align-items: center; }
.adx-cta__title {
  margin: 1.1rem 0 1.8rem; white-space: nowrap;
  font-family: var(--font-en-serif, "Old Standard TT", serif);
  font-weight: 400; font-size: clamp(1.9rem, 4vw, 3.2rem); line-height: 1.15;
}
.adx-cta__title .show-th { font-family: "JS Pumpuang", "Old Standard TT", serif; }

/* Not-found fallback */
.adetail__missing { max-width: 700px; margin: 0 auto; padding: 9rem var(--gutter, 1.5rem); text-align: center; }
.adetail__missing a { color: var(--c-rust, #7C3C1B); }

/* =====================================================================
   MOBILE — ต้องอยู่ท้ายไฟล์เพื่อชนะ base rule ที่ตั้ง white-space: nowrap
   (media query ไม่เพิ่ม specificity ลำดับหลังสุดจึงชนะ)
   ===================================================================== */
@media (max-width: 860px) {
  .adx-hero__title,
  .adx-cta__title,
  .adx-doc__title { white-space: normal; }
}
