/* คณะสงฆ์ธรรมยุต จังหวัดลพบุรี — โทนสีจีวร (ส้มกรัก) บนพื้นครีม การ์ดมน แถบเมนูล่างแบบแอป
   mobile-first: แถบเมนูล่างบนมือถือ → เมนูบนเมื่อจอ ≥ 960px */

:root {
  --accent: #EE5A1C;        /* สีจีวร */
  --accent-2: #FF8A3D;
  --accent-ink: #FFFFFF;
  --accent-wash: #FFEEE4;
  --gold: #E0A32E;
  --dark: #16171C;          /* การ์ดหัวเว็บ */
  --dark-2: #23252C;
  --bg: #F6F3EE;
  --paper: #FFFFFF;
  --soft: #EFEBE4;          /* ปุ่มเม็ดยาที่ไม่ได้เลือก */
  --ink: #17181C;
  --ink-2: #6A6E78;
  --line: #E8E2D9;
  --ok: #2E7D4F;
  --danger: #C2361B;
  --shadow: 0 1px 2px rgba(23, 24, 28, .04), 0 10px 30px rgba(23, 24, 28, .07);
  --shadow-lg: 0 18px 50px rgba(23, 24, 28, .16);

  --f-head: 'Kanit', Tahoma, sans-serif;
  --f-body: 'Noto Sans Thai', Tahoma, 'Leelawadee UI', sans-serif;

  --r-sm: 12px;
  --r-btn: 14px;
  --r-card: 20px;
  --r-xl: 28px;
  --tab-h: 70px;

  /* ชื่อเดิมที่หลังบ้านใช้ */
  --link: var(--accent);
  --sand: var(--soft);
  --muted: var(--ink-2);
  --body2: var(--ink-2);
  --sky-wash: var(--soft);
  --sky-deep: var(--dark);
  --r-btn-old: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-admin]) {
    --accent: #FF7438; --accent-2: #FF9A5C; --accent-wash: #3A2216; --gold: #F0B44C;
    --dark: #0B0C0F; --dark-2: #1B1D22;
    --bg: #0F1013; --paper: #1A1C21; --soft: #25282E; --ink: #F2F0EC; --ink-2: #A4A7AF; --line: #2C2F36;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"]:not([data-admin]) {
  --accent: #FF7438; --accent-2: #FF9A5C; --accent-wash: #3A2216; --gold: #F0B44C;
  --dark: #0B0C0F; --dark-2: #1B1D22;
  --bg: #0F1013; --paper: #1A1C21; --soft: #25282E; --ink: #F2F0EC; --ink-2: #A4A7AF; --line: #2C2F36;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* ชุดสี ๖ สี (เขตปกครอง ปุ่มลัด) */
:root { --h1: #EE5A1C; --h2: #0E9F84; --h3: #2F6FDB; --h4: #D63F78; --h5: #7650D8; --h6: #C99A12; --hue: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-admin]) { --h1: #FF8A55; --h2: #4FD1B5; --h3: #7FA8F5; --h4: #F17FA8; --h5: #A98DF2; --h6: #E8C55A; } }
:root[data-theme="dark"]:not([data-admin]) { --h1: #FF8A55; --h2: #4FD1B5; --h3: #7FA8F5; --h4: #F17FA8; --h5: #A98DF2; --h6: #E8C55A; }
.c1, .cat-gov { --hue: var(--h1); }
.c2 { --hue: var(--h2); }
.c3, .cat-edu { --hue: var(--h3); }
.c4 { --hue: var(--h4); }
.c5 { --hue: var(--h5); }
.c6, .cat-act { --hue: var(--h6); }
.c1, .c2, .c3, .c4, .c5, .c6, .cat-gov, .cat-edu, .cat-act { --tint: color-mix(in srgb, var(--hue) 13%, var(--paper)); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 16.5px; line-height: 1.75;
  padding-bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}
body.admin, body:has(.login-wrap) { padding-bottom: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; text-wrap: balance; color: inherit; font-family: var(--f-head); font-weight: 500; }
h1 { font-weight: 700; }
p { margin: 0; }
b, strong { font-weight: 600; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.num, time { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 720px) { .container { padding-left: 28px; padding-right: 28px; } }
.chakra { flex: none; display: block; }
.ico { flex: none; display: block; }
.section { padding-top: 28px; padding-bottom: 28px; }
@media (min-width: 960px) { .section { padding-top: 44px; padding-bottom: 44px; } }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px; border-radius: var(--r-btn); border: 0;
  font-family: var(--f-head); font-weight: 500; font-size: 17px; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost, .btn-outline { background: var(--paper); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover, .btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-dark { background: var(--dark); color: #fff; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px;
  background: transparent; border: 0; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--soft); }
.see-all { font-weight: 600; text-decoration: none; white-space: nowrap; font-size: 15.5px; }
.see-all:hover { text-decoration: underline; }
.link-more { font-weight: 600; text-decoration: none; }

/* ---------- หัวเว็บ ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.top-in { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-name { font-family: var(--f-head); font-weight: 700; font-size: 18px; font-style: italic; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: none; }
.top-actions { margin-left: auto; display: flex; gap: 2px; }
@media (min-width: 960px) {
  .topnav { display: flex; gap: 2px; margin-left: auto; }
  .topnav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: 15.5px; white-space: nowrap; }
  .topnav a:hover { background: var(--soft); }
  .topnav a[aria-current="page"] { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
  .top-actions { margin-left: 4px; }
}

/* ---------- แถบเมนูล่าง (มือถือ) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--paper); border-radius: 24px 24px 0 0;
  box-shadow: 0 -6px 30px rgba(23, 24, 28, .10);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 12.5px; color: var(--ink-2); text-decoration: none; padding: 2px 0; min-height: 52px;
}
.tab-ico { width: 52px; height: 32px; display: grid; place-items: center; border-radius: 999px; transition: background .2s; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tabbar a[aria-current="page"] .tab-ico { background: var(--accent-wash); }
@media (min-width: 960px) { .tabbar { display: none; } body { padding-bottom: 0; } }

/* ---------- หัวหน้าแรก (สไลด์) ---------- */
.hero-wrap { padding-top: 6px; }
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--dark); color: #fff; border-radius: var(--r-xl);
  min-height: 300px; box-shadow: var(--shadow-lg);
}
@media (min-width: 720px) { .hero { min-height: 400px; } }
@media (min-width: 1100px) { .hero { min-height: 460px; } }
.slide { position: absolute; inset: 0; display: flex; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility .7s; }
.slide.is-on { opacity: 1; visibility: visible; position: relative; min-height: inherit; }
/* แถบเฉียงสีจีวร */
.slide::before {
  content: ""; position: absolute; z-index: 1; right: -18%; bottom: -40%; width: 85%; height: 120%;
  background: linear-gradient(115deg, transparent 0 38%, var(--accent) 38% 52%, color-mix(in srgb, var(--accent) 55%, transparent) 52% 58%, transparent 58%);
  transform: rotate(-8deg); opacity: .95; pointer-events: none;
}
.slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.slide:has(.slide-img)::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(14, 15, 18, .92) 0%, rgba(14, 15, 18, .72) 45%, rgba(14, 15, 18, .15) 100%);
}
.slide-art { position: absolute; right: -60px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, .08); z-index: 0; }
.slide-art .chakra { width: 340px; height: 340px; }
.slide-body {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px;
  padding: 28px 22px 44px; max-width: 640px;
}
@media (min-width: 720px) { .slide-body { padding: 48px 48px 64px; } }
.slide-title {
  font-family: var(--f-head); font-weight: 700; font-style: italic; color: #fff;
  font-size: clamp(30px, 8.4vw, 62px); line-height: 1.12; letter-spacing: -.01em;
}
.slide-title .hl { color: var(--accent-2); }
.slide-sub { color: rgba(255, 255, 255, .82); font-size: 15.5px; max-width: 46ch; line-height: 1.6; }
@media (min-width: 720px) { .slide-sub { font-size: 17px; } }
.slide-body .btn { margin-top: 6px; }
.slide-tag {
  position: absolute; z-index: 2; right: 20px; bottom: 18px; text-align: right;
  font-family: var(--f-head); font-weight: 500; font-size: 11.5px; letter-spacing: .18em; line-height: 1.5; color: rgba(255, 255, 255, .85);
}
.eyebrow { font-size: 13.5px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.eyebrow.on-dark { color: var(--accent-2); }
.dots { position: absolute; z-index: 3; left: 22px; bottom: 18px; display: flex; gap: 6px; }
@media (min-width: 720px) { .dots { left: 48px; bottom: 26px; } }
.dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: rgba(255, 255, 255, .4); cursor: pointer; transition: width .3s, background .3s; }
.dots button[aria-selected="true"] { width: 24px; background: var(--accent); }
.uposatha {
  margin: 12px auto 0; width: fit-content; display: flex; align-items: center; gap: 8px;
  background: var(--paper); color: var(--ink); padding: 6px 16px; border-radius: 999px; font-size: 14.5px; box-shadow: var(--shadow);
}
.uposatha .chakra { color: var(--gold); }

/* ---------- ปุ่มลัดวงกลม ---------- */
.quick-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 76px; gap: 6px;
  overflow-x: auto; scrollbar-width: none; padding-top: 20px; padding-bottom: 6px; scroll-snap-type: x mandatory;
}
.quick-row::-webkit-scrollbar { display: none; }
@media (min-width: 560px) { .quick-row { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); overflow: visible; } }
.quick { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); font-size: 14px; text-align: center; scroll-snap-align: start; line-height: 1.3; }
.quick-ico {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); color: var(--hue); box-shadow: var(--shadow); transition: transform .2s, background .2s;
}
.quick:hover .quick-ico { transform: translateY(-3px); background: var(--tint); }
.quick.c1 .quick-ico { background: var(--tint); }
@media (min-width: 960px) { .quick-ico { width: 76px; height: 76px; } .quick { font-size: 15.5px; } }

/* ---------- ตัวเลข ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding-top: 18px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.stat { background: var(--paper); border-radius: var(--r-card); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; line-height: 1.3; }
.stat b { font-family: var(--f-head); font-weight: 700; font-size: 30px; color: var(--hue); }
.stat span { font-size: 14px; color: var(--ink-2); }

/* ---------- หัวข้อส่วน ---------- */
.section-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.section-head.row { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 23px; font-weight: 700; }
.section-head p { color: var(--ink-2); }
@media (min-width: 960px) { .section-head h2 { font-size: 30px; } }

/* ---------- ปุ่มเม็ดยา (แท็บ) ---------- */
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin-bottom: 14px; }
.pills::-webkit-scrollbar { display: none; }
.pill, .chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; min-height: 42px; border-radius: 999px; border: 0;
  background: var(--soft); color: var(--ink-2); font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s;
}
.pill:hover, .chip:hover { color: var(--ink); }
.pill[aria-pressed="true"], .pill[aria-current="true"], .chip[aria-current="true"] {
  background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}
.pill-n { font-size: 12.5px; opacity: .75; }

/* ---------- การ์ด ---------- */
.card { background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow); }
a.card { text-decoration: none; color: var(--ink); }
.badge {
  display: inline-block; font-size: 12.5px; font-weight: 600; line-height: 1.3;
  padding: 4px 10px; border-radius: 8px; background: var(--soft); color: var(--ink-2); white-space: nowrap;
}
.badge-new { background: var(--dark); color: #fff; }
.badge-cat { background: var(--accent-wash); color: var(--accent); }
.badge-royal { background: linear-gradient(135deg, #F6C453, #E0A32E); color: #3A2600; }
.go {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--dark); color: #fff; flex: none; transition: background .2s;
}
a.card:hover .go { background: var(--accent); }

/* ข่าว */
.news-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .news-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1100px) { [data-news-grid].news-grid { grid-template-columns: repeat(4, 1fr); } }
.news-card { display: flex; flex-direction: column; padding: 8px; transition: transform .2s, box-shadow .2s; min-width: 0; }
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.news-card .cover {
  position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden;
  background: var(--tint, var(--soft)); color: var(--hue); display: grid; place-items: center;
}
.news-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.news-card .cover .badge { position: absolute; left: 8px; top: 8px; }
.news-card .info { position: relative; padding: 10px 6px 6px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.n-title {
  font-family: var(--f-head); font-weight: 500; font-size: 15.5px; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
@media (min-width: 720px) { .n-title { font-size: 17px; } }
.n-meta { margin-top: auto; display: flex; flex-direction: column; font-size: 13px; color: var(--ink-2); line-height: 1.4; padding-right: 42px; }
.n-cat { color: var(--hue); font-weight: 600; }
.news-card .go { position: absolute; right: 4px; bottom: 4px; }
.empty { color: var(--ink-2); text-align: center; padding: 32px 16px; background: var(--paper); border-radius: var(--r-card); }

/* สารจากเจ้าคณะจังหวัด */
.chief {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--dark); color: #fff; border-radius: var(--r-xl);
  display: grid; gap: 20px; padding: 24px; box-shadow: var(--shadow-lg);
}
.chief::before {
  content: ""; position: absolute; z-index: -1; left: -30%; top: -60%; width: 90%; height: 160%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 45%, transparent), transparent);
  opacity: .55;
}
@media (min-width: 720px) { .chief { grid-template-columns: 240px 1fr; padding: 36px; gap: 36px; align-items: center; } }
.chief-photo {
  width: 160px; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; display: grid; place-items: center;
  background: var(--dark-2); border: 3px solid var(--accent); margin: 0 auto;
}
@media (min-width: 720px) { .chief-photo { width: 100%; } }
.chief-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.chief-body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.chief-body h2 { font-size: clamp(26px, 6vw, 40px); font-weight: 700; font-style: italic; }
.chief-role { color: rgba(255, 255, 255, .78); font-size: 15.5px; }
.chief-role a { color: var(--accent-2); }
.chief blockquote { margin: 8px 0; padding-left: 16px; border-left: 3px solid var(--accent); color: rgba(255, 255, 255, .9); }
.chief .btn { margin-top: 8px; }

/* วัดเด่น (เลื่อนแนวนอน) */
.scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: 74%; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 14px; margin: 0 -2px;
}
.scroller::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .scroller { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; gap: 18px; } }
.t-card { scroll-snap-align: start; padding: 8px; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.t-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.t-photo { position: relative; aspect-ratio: 16 / 11; border-radius: 14px; overflow: hidden; background: var(--tint); color: var(--hue); display: grid; place-items: center; }
.t-photo img { width: 100%; height: 100%; object-fit: cover; }
.t-photo .badge { position: absolute; left: 8px; top: 8px; }
.t-info { position: relative; padding: 10px 48px 6px 6px; display: flex; flex-direction: column; line-height: 1.4; }
.t-info strong { font-family: var(--f-head); font-weight: 500; font-size: 17px; }
.t-info .go { position: absolute; right: 4px; bottom: 4px; }
.o-meta { color: var(--ink-2); font-size: 14px; }

/* เขตปกครอง */
.zone-cards { display: grid; gap: 10px; }
@media (min-width: 720px) { .zone-cards { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (min-width: 1100px) { .zone-cards { grid-template-columns: repeat(3, 1fr); } }
.zone-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; transition: transform .2s; }
.zone-card:hover { transform: translateY(-2px); }
.zone-no { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--tint); color: var(--hue); font-family: var(--f-head); font-weight: 700; font-size: 20px; }
.zone-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; flex: 1; }
.zone-text strong { font-family: var(--f-head); font-weight: 500; font-size: 16.5px; }
.zone-text .o-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-count { font-size: 13px; color: var(--ink-2); text-align: right; line-height: 1.2; white-space: nowrap; }
.zone-count b { display: block; font-family: var(--f-head); font-size: 22px; color: var(--ink); }

/* แถบภาพ */
.photo-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
@media (min-width: 720px) { .photo-strip { grid-template-columns: repeat(8, 1fr); gap: 10px; } }
.photo-strip a { display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--soft); }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.photo-strip a:hover img { transform: scale(1.06); }

/* ---------- หัวหน้าย่อย ---------- */
.page-hero { padding-top: 6px; }
.page-hero > .container > * { position: relative; z-index: 1; }
.page-hero > .container {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--dark); color: #fff; border-radius: var(--r-xl);
  padding-top: 26px; padding-bottom: 30px; max-width: calc(1200px - 32px);
  width: calc(100% - 32px); box-shadow: var(--shadow-lg);
}
@media (min-width: 720px) { .page-hero > .container { width: calc(100% - 56px); max-width: calc(1200px - 56px); padding: 40px 44px 44px; } }
.page-hero > .container::before {
  content: ""; position: absolute; z-index: 0; right: -10%; bottom: -70%; width: 60%; height: 170%;
  background: linear-gradient(115deg, transparent 0 40%, var(--accent) 40% 56%, color-mix(in srgb, var(--accent) 50%, transparent) 56% 62%, transparent 62%);
  transform: rotate(-8deg); opacity: .9;
}
.page-hero h1 { font-size: clamp(28px, 7vw, 46px); font-style: italic; margin: 6px 0 8px; max-width: 22ch; }
.page-hero .article-title { font-size: clamp(24px, 5.6vw, 38px); max-width: 30ch; }
.page-hero p { color: rgba(255, 255, 255, .8); max-width: 60ch; font-size: 15.5px; }
.breadcrumb { font-size: 13.5px; color: rgba(255, 255, 255, .65); }
.breadcrumb a { color: rgba(255, 255, 255, .9); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-2); }

/* ---------- ทำเนียบวัด ---------- */
.filter-panel { padding-top: 16px; }
.filter-box { display: flex; flex-direction: column; gap: 12px; }
.search-field {
  display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 16px;
  padding: 6px 6px 6px 16px; box-shadow: var(--shadow); color: var(--ink-2);
}
.search-field input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16.5px; color: var(--ink); min-height: 44px; outline: none; }
.js [data-nojs-only] { display: none; }
.results-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; color: var(--ink-2); font-size: 14.5px; margin-bottom: 14px; }
.temple-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .temple-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1100px) { .temple-grid { grid-template-columns: repeat(4, 1fr); } }
.temple-card { padding: 8px; display: flex; flex-direction: column; min-width: 0; }
.temple-card .photo { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--tint); color: var(--hue); display: grid; place-items: center; }
.temple-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.temple-card .photo .badge { position: absolute; left: 6px; top: 6px; font-size: 11.5px; }
.temple-card .info { padding: 10px 6px 4px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.temple-card h2 { font-size: 16px; line-height: 1.35; }
.temple-card h2 a { color: var(--ink); text-decoration: none; }
.temple-card h2 a:hover { color: var(--accent); }
.temple-card .line { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.card-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: auto; padding-top: 8px; font-size: 13.5px; }
.card-actions a { text-decoration: none; font-weight: 600; }

/* ---------- หน้ารายละเอียด ---------- */
.detail { display: grid; gap: 20px; padding-top: 24px; padding-bottom: 40px; }
@media (min-width: 960px) { .detail { grid-template-columns: 1fr 360px; gap: 32px; align-items: start; padding-top: 36px; } }
.detail-main { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.detail-photo { aspect-ratio: 16 / 10; border-radius: var(--r-card); overflow: hidden; background: var(--soft); color: var(--ink-2); display: grid; place-items: center; box-shadow: var(--shadow); }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.map-frame { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: var(--r-card); box-shadow: var(--shadow); }
.info-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 960px) { .info-card { position: sticky; top: 84px; } }
.info-card h2 { font-size: 20px; font-weight: 700; }
.info-card dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.info-card dt { font-size: 13px; color: var(--ink-2); }
.info-card dd { margin: 0; }
.notice { background: var(--accent-wash); color: var(--ink); padding: 12px 16px; border-radius: var(--r-sm); font-size: 15px; margin-top: 20px; }
.prose { max-width: 72ch; }
.prose h2 { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.prose p + p { margin-top: 14px; }
.sub-h { font-size: 22px; font-weight: 700; margin-bottom: 14px; }

/* บทความข่าว */
.article { padding-top: 24px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 28px; max-width: 880px; }
.article .cover { border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); }
.article .cover img { width: 100%; }
.article .prose { font-size: 17.5px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 720px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
.gallery a { border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; display: block; background: var(--soft); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.05); }

/* คลังภาพ */
.masonry { columns: 2; column-gap: 10px; }
@media (min-width: 720px) { .masonry { columns: 3; column-gap: 16px; } }
@media (min-width: 1100px) { .masonry { columns: 4; } }
.masonry figure { margin: 0 0 10px; break-inside: avoid; background: var(--paper); border-radius: 16px; padding: 6px; box-shadow: var(--shadow); }
.masonry figure > a { display: block; border-radius: 12px; overflow: hidden; }
.masonry img { width: 100%; transition: transform .3s; }
.masonry figure > a:hover img { transform: scale(1.04); }
.masonry figcaption { font-size: 12.5px; color: var(--ink-2); padding: 6px 4px 2px; line-height: 1.4; }
.masonry figcaption a { color: var(--ink); text-decoration: none; font-weight: 600; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 9, 11, .92); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 14px; }
.lightbox p { color: #fff; text-align: center; margin-top: 10px; font-size: 15px; }
.lightbox button { position: absolute; top: 14px; right: 14px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lightbox .lb-prev, .lightbox .lb-next { top: 50%; transform: translateY(-50%); right: auto; }
.lightbox .lb-prev { left: 10px; }
.lightbox .lb-next { right: 10px; left: auto; }

/* เลขหน้า */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 28px; }
.pagination a, .pagination span { min-width: 44px; height: 44px; padding: 0 12px; display: grid; place-items: center; border-radius: 12px; background: var(--paper); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.pagination span[aria-current] { background: var(--accent); color: #fff; font-weight: 600; }

/* ---------- ทำเนียบพระสังฆาธิการ ---------- */
.orgchart { margin-bottom: 36px; }
.oc-spine { display: flex; flex-direction: column; align-items: center; }
.oc-node { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; line-height: 1.4; text-decoration: none; color: var(--ink); }
.oc-region, .oc-chief { width: min(100%, 520px); text-align: center; align-items: center; }
.oc-chief { background: var(--dark); color: #fff; }
.oc-chief .o-meta, .oc-chief .role { color: rgba(255, 255, 255, .75); }
.oc-level { font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .04em; }
.oc-chief .oc-level { color: var(--accent-2); }
.oc-name { font-family: var(--f-head); font-weight: 500; font-size: 17px; }
.oc-stem { width: 2px; height: 22px; background: var(--line); }
.oc-row { display: flex; align-items: center; gap: 12px; text-align: left; }
.oc-text { display: flex; flex-direction: column; min-width: 0; }
.oc-advisors { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.oc-sub-label { width: 100%; font-size: 12.5px; color: rgba(255, 255, 255, .65); }
.tagpill { font-size: 12.5px; background: rgba(255, 255, 255, .1); padding: 3px 10px; border-radius: 999px; }
.oc-zones { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .oc-zones { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .oc-zones { grid-template-columns: repeat(3, 1fr); } }
.oc-zone { border-top: 4px solid var(--hue); }
.oc-zone .oc-level { color: var(--hue); }
.oc-subs { list-style: none; margin: 8px 0 0 18px; padding: 0 0 0 14px; border-left: 2px dashed var(--line); display: flex; flex-direction: column; gap: 8px; }
.oc-sub { padding: 10px 14px; box-shadow: none; border: 1px solid var(--line); }
.oc-sub .oc-name { font-size: 15px; }
.avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; overflow: hidden; background: var(--soft); display: grid; place-items: center; border: 2px solid var(--paper); box-shadow: 0 0 0 2px var(--accent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.role { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.o-name { font-family: var(--f-head); font-weight: 500; font-size: 17px; }
.org-level { margin-top: 36px; }
.org-level > h2 { font-size: 24px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.org-level > h2 .num { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff; display: inline-grid; place-items: center; font-size: 18px; }
.grid-officials { display: grid; gap: 14px; align-items: start; }
@media (min-width: 720px) { .grid-officials { grid-template-columns: repeat(3, 1fr); } .span-2 { grid-column: span 2; } }
.official-card { overflow: hidden; display: flex; flex-direction: column; }
.official-card .photo { aspect-ratio: 4 / 5; background: var(--dark); display: grid; place-items: center; }
.official-card .photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.official-card .info { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.advisors-card { padding: 20px; min-width: 0; }
.card-title { font-family: var(--f-head); font-weight: 700; font-size: 19px; margin-bottom: 10px; }
.person-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 720px) { .person-list { grid-template-columns: repeat(2, 1fr); } }
.person-list li { display: flex; flex-direction: column; line-height: 1.4; padding: 12px 14px; border-radius: 14px; background: var(--bg); }
.zone { padding: 20px; margin-bottom: 14px; border-left: 5px solid var(--hue); }
.zone h3 { font-size: 21px; font-weight: 700; color: var(--hue); }
.zone-sub { font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.zone-grid { display: grid; gap: 14px; }
@media (min-width: 960px) { .zone-grid { grid-template-columns: 300px 1fr; align-items: start; } }
.lead-official { display: flex; gap: 14px; align-items: center; background: var(--tint); padding: 14px; border-radius: 16px; }
.lead-official .avatar { width: 72px; height: 72px; box-shadow: 0 0 0 2px var(--hue); }
.lead-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.4; }

/* เกี่ยวกับ */
.grid-3 { display: grid; gap: 12px; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.duty { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.duty .num { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-wash); color: var(--accent); font-family: var(--f-head); font-weight: 700; font-size: 20px; display: grid; place-items: center; }
.duty h3 { font-size: 18px; font-weight: 700; }
.duty p { color: var(--ink-2); font-size: 15px; }

/* ---------- ท้ายเว็บ ---------- */
.foot { background: var(--dark); color: rgba(255, 255, 255, .8); margin-top: 32px; padding: 36px 0 24px; border-radius: var(--r-xl) var(--r-xl) 0 0; font-size: 15px; }
.foot-grid { display: grid; gap: 24px; }
@media (min-width: 720px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot-brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-head); font-weight: 500; font-size: 18px; color: #fff; margin-bottom: 8px; }
.foot-title { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.foot a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.foot a:hover { color: var(--accent-2); }
.foot-note { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; color: rgba(255, 255, 255, .55); }
.foot-note a { color: var(--accent-2); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.img-fallback { width: 38% !important; height: auto !important; max-width: 96px; opacity: .55; object-fit: contain !important; margin: auto; }
/* ยังไม่มีรูป: ใช้แถบตราเตี้ย ๆ แทนกรอบภาพเต็ม ไม่ให้รายการยาวเกินบนมือถือ */
.temple-card .photo:not(:has(img)) { aspect-ratio: auto; height: 76px; }
.official-card .photo:not(:has(img)) { aspect-ratio: auto; height: 140px; }

/* ไอคอนสองโทน: ชั้นพื้น (.f) จาง ๆ ใต้เส้น */
.ico .f { fill: currentColor; opacity: .22; stroke: none; }

/* ปุ่มลัด แบบ ๑ — กระเบื้องมนไล่สีสด ไอคอนขาว */
.quick-ico {
  width: 64px; height: 64px; border-radius: 22px; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--hue) 70%, #fff), var(--hue) 55%, color-mix(in srgb, var(--hue) 75%, #000));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--hue) 32%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.quick-ico .ico { width: 30px; height: 30px; }
.quick-ico .ico .f { fill: #fff; opacity: .32; }
.quick.c1 .quick-ico, .quick:hover .quick-ico { background: linear-gradient(145deg, color-mix(in srgb, var(--hue) 70%, #fff), var(--hue) 55%, color-mix(in srgb, var(--hue) 75%, #000)); }
.quick:hover .quick-ico { transform: translateY(-3px) scale(1.04); }
@media (min-width: 960px) { .quick-ico { width: 76px; height: 76px; border-radius: 26px; } .quick-ico .ico { width: 34px; height: 34px; } }
.quick-row { scroll-padding-inline: 16px; padding-bottom: 16px; }
@media (min-width: 720px) { .quick-row { scroll-padding-inline: 28px; } }
.site-logo { flex: none; display: block; object-fit: contain; border-radius: 8px; }
