/* ก่อนถ้อยคำ — shared design system for inner pages.
   Tokens, header, footer, search overlay and mobile menu are copied 1:1 from the approved homepage (gallery.html);
   everything below "Components" is new and reused across the five inner pages. */
:root{
  --wall:#151412; --wall-2:#1C1B18; --wall-3:#24231F;
  --text:#ECE7DD; --text-2:#B9B3A7; --text-3:#9C9689;
  --line:rgba(236,231,221,.14); --line-2:rgba(236,231,221,.28);
  --mat:#ECE7DC; --mat-ink:#1B1A17; --mat-ink-2:#5C574D;
  --accent:#C8B48C;
  --header-bg:rgba(21,20,18,.86); --scrim:rgba(15,14,12,.97);
  color-scheme:dark;
  --sans:"Anuphan", system-ui, sans-serif;
  --latin:"Instrument Serif", Georgia, serif;
  --gut:clamp(20px,4vw,64px);
  --measure:36em;
}
/* Reading mode (article page only): warm paper. Same token names, so every component follows. */
:root[data-theme="light"]{
  --wall:#F3EEE4; --wall-2:#EAE4D8; --wall-3:#DFD8CA;
  --text:#1E1C18; --text-2:#3F3B34; --text-3:#5A554B;
  --line:rgba(30,28,24,.14); --line-2:rgba(30,28,24,.3);
  --accent:#6B5226;
  --header-bg:rgba(243,238,228,.9); --scrim:rgba(243,238,228,.97);
  color-scheme:light;
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{background:var(--wall);color:var(--text);font-family:var(--sans);font-weight:400;font-size:17px;line-height:1.8;-webkit-font-smoothing:antialiased;transition:background-color .35s,color .35s}
img{display:block;max-width:100%}
a{color:inherit;text-decoration:none}
button,input,select{font:inherit;color:inherit;background:none;border:0}
button{cursor:pointer}
::selection{background:var(--accent);color:var(--wall)}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:2px}
.skip{position:fixed;left:12px;top:-64px;z-index:100;background:var(--text);color:var(--wall);padding:10px 18px;border-radius:4px;font-size:15px;transition:top .2s}
.skip:focus{top:12px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.wrap{max-width:1440px;margin:0 auto;padding:0 var(--gut)}
.lat{font-family:var(--latin);font-style:italic;font-weight:400;letter-spacing:.005em}
.label{font-size:14px;letter-spacing:.02em;color:var(--text-3);line-height:1.6}
.sample{font-size:13px;color:var(--accent);border:1px solid color-mix(in srgb,var(--accent) 45%,transparent);padding:2px 10px;border-radius:99px;line-height:1.6;white-space:nowrap}
.linkline{display:inline-block;font-size:15px;color:var(--text);border-bottom:1px solid var(--line-2);padding:6px 0 2px;transition:border-color .2s}
.linkline:hover{border-color:var(--text)}

/* ── Header (from homepage) ── */
header.site{position:fixed;inset:0 0 auto;z-index:50;background:var(--header-bg);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);transition:background .35s}
header.site .wrap{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;height:80px;gap:24px}
.mark{display:flex;flex-direction:column;line-height:1.2;justify-self:start}
.mark .lat{font-size:22px;font-style:normal;letter-spacing:.06em}
.mark span:last-child{font-size:13.5px;color:var(--text-2);margin-top:2px}
nav.main{display:flex;gap:clamp(20px,2.6vw,44px)}
nav.main a{font-size:15.5px;color:var(--text-2);transition:color .25s;position:relative;padding:4px 0}
nav.main a:hover,nav.main a[aria-current]{color:var(--text)}
nav.main a[aria-current]::before{content:"";position:absolute;left:50%;top:-6px;width:4px;height:4px;border-radius:50%;background:var(--accent);transform:translateX(-50%)}
.hr{display:flex;justify-content:flex-end;gap:8px;align-items:center}
.icon{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--line-2);transition:background .25s,border-color .25s,color .25s}
.icon:hover{background:var(--text);color:var(--wall);border-color:var(--text)}
.menubtn{display:none}
.progress{position:absolute;left:0;bottom:-1px;height:2px;width:100%;background:var(--accent);transform-origin:left;transform:scaleX(0)}

/* ── Footer (from homepage) ── */
footer.site{margin-top:clamp(96px,12vw,168px);border-top:1px solid var(--line)}
footer.site .wrap{padding-top:56px;padding-bottom:36px}
footer.site .row{display:grid;grid-template-columns:repeat(12,1fr);column-gap:24px;row-gap:36px}
footer.site .brand{grid-column:1/6}
footer.site .brand .lat{font-size:clamp(40px,4.4vw,64px);font-style:normal;letter-spacing:.04em;line-height:1.05;display:block}
footer.site .brand span{font-size:17px;color:var(--text-2);display:block;margin-top:10px}
footer.site .c{grid-column:span 2}
footer.site .c:nth-of-type(2){grid-column:7/9}
footer.site h2{font-weight:400;font-size:14px;color:var(--text-3);margin-bottom:14px}
footer.site .c a{display:block;font-size:15px;line-height:2.1;color:var(--text-2)}
footer.site .c a:hover{color:var(--text)}
footer.site .fine{margin-top:64px;padding-top:18px;border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;font-size:14px;color:var(--text-3);line-height:1.7}
footer.site .fine a{display:inline-block;padding:3px 0;border-bottom:1px solid var(--line-2)}

/* ── Search overlay + mobile menu (from homepage) ── */
.ov-search{position:fixed;inset:0;z-index:80;background:var(--scrim);backdrop-filter:blur(10px);opacity:0;visibility:hidden;transition:opacity .35s,visibility .35s;overflow:auto}
.ov-search.open{opacity:1;visibility:visible}
.ov-search .wrap{max-width:1000px;padding-top:clamp(28px,6vw,80px);padding-bottom:60px}
.ov-search .top{display:flex;justify-content:space-between;align-items:center}
.ov-search .field{display:flex;align-items:center;gap:18px;border-bottom:1px solid var(--line-2);margin-top:clamp(32px,6vw,72px);padding-bottom:12px}
.ov-search input{flex:1;min-width:0;font-weight:300;font-size:clamp(28px,4vw,52px);outline:none;line-height:1.5}
.ov-search input::placeholder{color:var(--text-3)}
.chips{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}
.chips button{border:1px solid var(--line-2);border-radius:99px;padding:5px 16px;font-size:14.5px;color:var(--text-2);transition:all .2s}
.chips button:hover{background:var(--text);color:var(--wall)}
.sres{margin-top:40px;display:grid}
.sres h3{font-weight:400;font-size:14px;color:var(--accent);margin:26px 0 6px}
.sres a{display:grid;grid-template-columns:56px 1fr auto;gap:18px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}
.sres a:hover .t{color:var(--accent)}
.sres .th{width:56px;height:56px;background:var(--wall-3);overflow:hidden;display:grid;place-items:center;font-family:var(--latin);font-size:24px;color:var(--text-3)}
.sres .th img{width:100%;height:100%;object-fit:cover;filter:grayscale(1)}
.sres .t{font-size:20px;line-height:1.5;transition:color .2s}
.sres .s{font-size:14px;color:var(--text-3)}
.sres .empty{color:var(--text-3);padding:20px 0}
.mnav{position:fixed;inset:0;z-index:70;background:var(--wall);padding:20px var(--gut);display:flex;flex-direction:column;opacity:0;visibility:hidden;transition:opacity .35s,visibility .35s}
.mnav.open{opacity:1;visibility:visible}
.mnav .t{display:flex;justify-content:space-between;align-items:center;height:56px}
.mnav nav{margin-top:40px}
.mnav nav a{display:flex;align-items:baseline;gap:16px;font-weight:300;font-size:40px;line-height:1.55;padding:6px 0}
.mnav nav a .lat{font-size:16px;color:var(--text-3);width:28px}

/* ════ Components ════ */

/* Breadcrumb */
.bc{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:14px;color:var(--text-3);line-height:1.6}
.bc a{color:var(--text-2);border-bottom:1px solid transparent;padding:2px 0}
.bc a:hover{border-color:var(--line-2)}
.bc span[aria-hidden]{opacity:.6}

/* Page head (tradition, directory) */
.phead{padding-top:clamp(128px,14vw,176px);padding-bottom:clamp(36px,4vw,56px);display:grid;grid-template-columns:repeat(12,1fr);column-gap:24px;align-items:end;row-gap:20px}
.phead .bc{grid-column:1/13}
.phead .rn{grid-column:1/13;display:flex;gap:14px;align-items:center;margin-top:20px}
.phead .rn .lat{font-size:17px;color:var(--accent)}
.phead .rn::after{content:"";flex:1;height:1px;background:var(--line)}
.phead h1{grid-column:1/7;font-weight:300;font-size:clamp(52px,6.4vw,96px);line-height:1.2}
.phead h1 .lat{display:block;font-size:.3em;font-style:normal;letter-spacing:.06em;color:var(--text-3);margin-top:8px}
.phead .desc{grid-column:7/12;color:var(--text-2);font-size:17px;line-height:1.9;max-width:32em}
.phead .stats{grid-column:1/13;display:flex;gap:28px;flex-wrap:wrap;font-size:14px;color:var(--text-3)}
.phead .stats b{font-weight:300;font-size:28px;color:var(--text);margin-right:8px;font-variant-numeric:tabular-nums}

/* Filter toolbar — sticky under the header; collapses to tabs + "ตัวกรอง" on phones */
.toolbar{position:sticky;top:80px;z-index:20;background:color-mix(in srgb,var(--wall) 94%,transparent);backdrop-filter:blur(10px);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.toolbar .wrap{display:flex;align-items:center;gap:16px 24px;min-height:72px;flex-wrap:wrap;padding-block:12px}
.seg{display:inline-flex;padding:4px;border:1px solid var(--line-2);border-radius:99px;gap:2px}
.seg button{min-height:38px;padding:0 16px;border-radius:99px;font-size:15px;color:var(--text-2);display:inline-flex;align-items:center;gap:8px;transition:background .2s,color .2s}
.seg button:hover{color:var(--text)}
.seg button[aria-pressed="true"]{background:var(--text);color:var(--wall)}
.seg .n{font-size:13px;opacity:.7;font-variant-numeric:tabular-nums}
.field-sel{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--text-3)}
.select{appearance:none;-webkit-appearance:none;min-height:44px;padding:0 42px 0 16px;border:1px solid var(--line-2);border-radius:99px;font-size:15px;color:var(--text);background-color:var(--wall);cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23B9B3A7' stroke-width='1.5'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 16px center;max-width:100%}
.select:hover{border-color:var(--text-2)}
.input{min-height:48px;width:100%;padding:0 18px 0 46px;border:1px solid var(--line-2);border-radius:99px;font-size:16px;background:var(--wall);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23B9B3A7' stroke-width='1.5'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M16.5 16.5l-4-4'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:18px center}
.input::placeholder{color:var(--text-3)}
.input:focus{outline:2px solid var(--accent);outline-offset:2px}
.tb-right{margin-left:auto;display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.filterbtn{display:none}
.count{font-size:14px;color:var(--text-3);font-variant-numeric:tabular-nums}

/* Active filter chips */
.active{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding-top:22px}
.active:empty{display:none}
.chip{display:inline-flex;align-items:center;gap:8px;min-height:34px;padding:0 8px 0 14px;border-radius:99px;background:var(--wall-3);font-size:14px;color:var(--text)}
.chip button{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;color:var(--text-2)}
.chip button:hover{background:var(--text);color:var(--wall)}
.chip-reset{font-size:14px;color:var(--text-2);border-bottom:1px solid var(--line-2);padding:4px 0}

/* Mobile filter sheet */
.sheet-back{position:fixed;inset:0;z-index:60;background:rgba(0,0,0,.5);opacity:0;visibility:hidden;transition:opacity .3s,visibility .3s}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:61;background:var(--wall-2);border-radius:20px 20px 0 0;border-top:1px solid var(--line-2);padding:10px max(20px,env(safe-area-inset-left,0px)) calc(20px + env(safe-area-inset-bottom,0px));transform:translateY(105%);transition:transform .38s cubic-bezier(.2,.7,.2,1);max-height:86svh;overflow:auto}
.sheet.open{transform:none}
.sheet.open + .sheet-back,.sheet-back.open{opacity:1;visibility:visible}
.sheet .grab{width:40px;height:4px;border-radius:2px;background:var(--line-2);margin:4px auto 14px}
.sheet h2{font-weight:400;font-size:22px;display:flex;justify-content:space-between;align-items:center}
.sheet fieldset{border:0;margin-top:22px}
.sheet legend{font-size:14px;color:var(--text-3);margin-bottom:10px}
.sheet .opts{display:flex;flex-wrap:wrap;gap:8px}
.opt{min-height:42px;padding:0 16px;border-radius:99px;border:1px solid var(--line-2);font-size:15px;color:var(--text-2)}
.opt[aria-pressed="true"]{background:var(--text);color:var(--wall);border-color:var(--text)}
.sheet .apply{margin-top:28px;width:100%;min-height:52px;border-radius:99px;background:var(--text);color:var(--wall);font-size:16px}

/* Content list row — one component for tradition, teacher and search pages */
.list{list-style:none}
.row{position:relative;display:grid;grid-template-columns:104px minmax(0,1fr) 180px;gap:28px;align-items:start;padding:28px 0;border-bottom:1px solid var(--line)}
.row .thumb{position:relative;aspect-ratio:4/5;background:var(--wall-3);overflow:hidden;display:grid;place-items:center}
.row .thumb img{width:100%;height:100%;object-fit:cover;filter:grayscale(.85) brightness(.9);transition:filter .5s,transform .8s}
.row .thumb .mono{font-family:var(--latin);font-size:40px;color:var(--text-3)}
.row .thumb .play{position:absolute;left:8px;bottom:8px;width:30px;height:30px;border-radius:50%;background:rgba(0,0,0,.6);display:grid;place-items:center}
.row .thumb .play::before{content:"";border-left:9px solid #ECE7DD;border-top:6px solid transparent;border-bottom:6px solid transparent;margin-left:3px}
.row:hover .thumb img{filter:none;transform:scale(1.03)}
.kind{display:flex;gap:10px;align-items:center;font-size:14px;color:var(--accent);line-height:1.6}
.kind .dot{width:3px;height:3px;border-radius:50%;background:currentColor;opacity:.6}
.row h3{font-weight:400;font-size:clamp(21px,1.9vw,26px);line-height:1.45;margin-top:4px}
.row h3 a::after{content:"";position:absolute;inset:0}       /* whole row is clickable … */
.row h3 a:hover{color:var(--accent)}
.row .ex{color:var(--text-2);font-size:16px;line-height:1.8;margin-top:6px;max-width:40em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.row .side{font-size:14px;color:var(--text-3);line-height:1.8;text-align:right}
.row .side a{position:relative;z-index:1;color:var(--text-2);border-bottom:1px solid var(--line-2)}  /* … but the teacher link stays its own target */
.row .side a:hover{color:var(--text);border-color:var(--text)}
.more{display:flex;flex-direction:column;align-items:center;gap:14px;padding-top:40px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:48px;padding:0 26px;border-radius:99px;border:1px solid var(--line-2);font-size:15.5px;transition:background .2s,color .2s,border-color .2s}
.btn:hover{background:var(--text);color:var(--wall);border-color:var(--text)}
.btn.primary{background:var(--text);color:var(--wall);border-color:var(--text)}
.btn.primary:hover{background:var(--accent);border-color:var(--accent)}
.empty-state{padding:64px 0;text-align:center;color:var(--text-2)}
.empty-state p{margin-bottom:18px}

/* Teacher card — matted portrait or typographic placeholder (never an invented portrait) */
.tgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:clamp(28px,3vw,48px) clamp(20px,2.4vw,36px)}
.tcard{position:relative;display:block}
.tcard .obj{background:var(--mat);padding:14px;box-shadow:0 26px 50px -28px rgba(0,0,0,.9);transition:transform .5s cubic-bezier(.2,.7,.2,1)}
.tcard .img{aspect-ratio:4/5;overflow:hidden;background:#d9d3c6}
.tcard img{width:100%;height:100%;object-fit:cover;filter:grayscale(.85) brightness(.97);transition:filter .6s}
.tcard.art img{filter:saturate(.45) brightness(.95)}
.tcard:hover .obj,.tcard:focus-visible .obj{transform:translateY(-5px)}
.tcard:hover img,.tcard:focus-visible img{filter:none}
.ph{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;background:repeating-linear-gradient(135deg,#dfd9cd 0 1px,transparent 1px 12px),#E6E0D4;color:var(--mat-ink-2);text-align:center;padding:16px}
.ph .ini{font-family:var(--latin);font-size:64px;line-height:1;color:#8C8475}
.ph small{font-size:12.5px;line-height:1.5;max-width:12em}
.tcard .cap{margin-top:16px}
.tcard h3{font-weight:400;font-size:21px;line-height:1.45}
.tcard .lat{display:block;font-size:16px;color:var(--text-2);line-height:1.35}
.tcard .meta{display:flex;justify-content:space-between;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid var(--line);font-size:14px;color:var(--text-3)}

/* Pills: teacher / tradition links on detail pages */
.pills{display:flex;flex-wrap:wrap;gap:8px}
.pill{display:inline-flex;align-items:center;gap:10px;min-height:40px;padding:0 16px 0 6px;border-radius:99px;border:1px solid var(--line-2);font-size:15px;color:var(--text);transition:border-color .2s,background .2s}
.pill:hover{border-color:var(--text);background:color-mix(in srgb,var(--text) 6%,transparent)}
.pill .av{width:28px;height:28px;border-radius:50%;overflow:hidden;background:var(--wall-3);display:grid;place-items:center;font-family:var(--latin);font-size:15px;color:var(--text-3);flex:none}
.pill .av img{width:100%;height:100%;object-fit:cover;filter:grayscale(1)}
.pill.plain{padding-left:16px}

/* Teacher detail header */
.thead{padding-top:clamp(128px,14vw,168px);display:grid;grid-template-columns:repeat(12,1fr);column-gap:24px;row-gap:28px}
.thead .bc{grid-column:1/13}
.thead .portrait{grid-column:1/5}
.thead .portrait .obj{background:var(--mat);padding:clamp(14px,1.4vw,22px);box-shadow:0 40px 80px -30px rgba(0,0,0,.8)}
.thead .portrait .img{aspect-ratio:4/5;overflow:hidden;background:#d9d3c6}
.thead .portrait img{width:100%;height:100%;object-fit:cover}
.thead .portrait figcaption{font-size:13.5px;color:var(--text-3);margin-top:12px;line-height:1.6}
.thead .info{grid-column:6/13;align-self:center}
.thead h1{font-weight:300;font-size:clamp(46px,5.4vw,84px);line-height:1.2}
.thead .sub{font-family:var(--latin);font-size:clamp(20px,1.8vw,26px);color:var(--text-2);margin-top:6px}
.thead .sub span{font-family:var(--sans);font-size:.75em;color:var(--text-3);margin-left:10px}
.thead .pills{margin-top:22px}
.facts{display:grid;grid-template-columns:8.5em minmax(0,1fr);gap:0;margin-top:32px;border-top:1px solid var(--line);font-size:15.5px}
.facts dt,.facts dd{padding:12px 0;border-bottom:1px solid var(--line);line-height:1.7}
.facts dt{color:var(--text-3)}
.facts dd{color:var(--text-2)}
.bio{grid-column:6/12;margin-top:8px}
.bio p{color:var(--text-2);font-size:17px;line-height:1.95;max-width:var(--measure)}
.bio p+p{margin-top:1em}
.bio .src{margin-top:18px;font-size:14px;color:var(--text-3)}
.bio .src a{color:var(--text-2);border-bottom:1px solid var(--line-2)}
.note{border:1px dashed var(--line-2);border-radius:10px;padding:18px 20px;font-size:15px;color:var(--text-2);max-width:var(--measure)}

/* Section heading inside inner pages */
.sec{margin-top:clamp(64px,8vw,112px)}
.sec-h{display:flex;justify-content:space-between;align-items:end;gap:16px 24px;flex-wrap:wrap;padding-bottom:20px;border-bottom:1px solid var(--line)}
.sec-h h2{font-weight:300;font-size:clamp(30px,3vw,44px);line-height:1.3}

/* Reader (article) */
.reader{padding-top:clamp(120px,13vw,160px)}
.ahead{max-width:52em;margin:0 auto;text-align:center}
.ahead .bc{justify-content:center}
.ahead .kind{justify-content:center;margin-top:28px}
.ahead h1{font-weight:300;font-size:clamp(38px,5vw,72px);line-height:1.3;margin-top:12px;text-wrap:balance}
.ahead .dek{color:var(--text-2);font-size:clamp(18px,1.6vw,21px);line-height:1.85;margin:20px auto 0;max-width:34em}
.ahead .pills{justify-content:center;margin-top:28px}
.ahead .meta{margin-top:18px;font-size:14px;color:var(--text-3);display:flex;gap:6px 18px;justify-content:center;flex-wrap:wrap}
.prose{max-width:var(--measure);margin:clamp(48px,6vw,80px) auto 0;font-size:clamp(18px,1.25vw,20px);line-height:2;color:var(--text)}
.prose p{margin-bottom:1.25em;text-wrap:pretty}
.prose h2{font-weight:400;font-size:clamp(25px,2.2vw,30px);line-height:1.45;margin:2em 0 .7em}
.prose blockquote{margin:1.8em 0;padding:4px 0 4px 28px;border-left:2px solid var(--accent);font-weight:300;font-size:1.22em;line-height:1.85;color:var(--text)}
.prose figure{margin:2.4em calc(-1 * min(8vw,120px));}
.prose figure .frame{background:var(--mat);padding:clamp(14px,2vw,28px);display:flex;justify-content:center}
.prose figure img{max-height:min(640px,62svh);width:auto}
.prose figcaption{font-size:14px;color:var(--text-3);margin-top:12px;line-height:1.7;padding-inline:clamp(0px,8vw,120px)}
/* Real posts: original text kept as-is; separator lines (".", "*****") stay but recede */
.prose.raw p{overflow-wrap:anywhere}
.prose.raw p.sep{text-align:center;color:var(--text-3);letter-spacing:.4em;margin:-.4em 0 .8em;line-height:1}
.prose.raw a{border-bottom:1px solid var(--line-2)}
.realtag{color:var(--accent)}
/* article body: a looped Thai face (หัวกลม) reads more easily in long text; headings stay in Anuphan */
.prose.looped{font-family:"Sarabun",var(--sans);font-weight:300;font-size:clamp(18.5px,1.3vw,20.5px);line-height:1.95}
.prose.looped strong,.prose.looped b{font-weight:500}
.bc .readtime{color:var(--text-3);margin-left:4px}
h1 .keep{display:inline-block;max-width:100%}
/* phones: article title a little smaller so a subtitle like "พุทธธรรมแห่งความเท่าเทียม" fits on one line */
@media (max-width:480px){.reader .ahead h1{font-size:clamp(26px,7.6vw,38px)}}
.reader .prose.looped{padding-bottom:clamp(24px,4vw,56px)}
.sec h2[id]{scroll-margin-top:110px}
/* videos page: one teacher select, shown on phones too (the tradition archive hides its select behind a sheet there) */
.toolbar.vfilter .tb-right{display:flex}
@media (max-width:720px){.toolbar.vfilter .tb-right{margin-left:0;width:100%}.toolbar.vfilter .field-sel{width:100%}.toolbar.vfilter .select{flex:1}}
/* sits above the footer rule, with clear air after the last clip */
.pagenote{margin-top:clamp(72px,7vw,112px);font-size:14.5px;line-height:1.8;color:var(--text-3)}
.realnote{font-size:14.5px;line-height:1.8;color:var(--text-2);border:1px solid var(--line);border-left:2px solid var(--accent);padding:14px 18px;margin-top:2.4em}
.realnote b{color:var(--accent);font-weight:500;margin-right:8px}
.vbody .postlabel{font-size:14px;font-weight:400;color:var(--text-3);letter-spacing:.04em;margin-top:30px}
.vbody .postbody{margin:10px 0 0;font-size:17.5px;line-height:1.95;color:var(--text-2)}
.prose .samplenote{font-size:14.5px;color:var(--text-3);border-top:1px solid var(--line);padding-top:16px;margin-top:2.4em}
.srcbox{max-width:var(--measure);margin:56px auto 0;border-top:1px solid var(--text);padding-top:20px}
.srcbox h2{font-weight:400;font-size:15px;color:var(--text-3);margin-bottom:8px}
.srcbox dl{display:grid;grid-template-columns:8em minmax(0,1fr);font-size:15.5px}
.srcbox dt,.srcbox dd{padding:10px 0;border-bottom:1px solid var(--line);line-height:1.7}
.srcbox dt{color:var(--text-3)}
.srcbox dd a{border-bottom:1px solid var(--line-2)}
.srcbox dd a:hover{border-color:var(--text)}
.backto{max-width:var(--measure);margin:40px auto 0;display:grid;grid-template-columns:1fr 1fr;gap:12px}
.backto a{display:flex;flex-direction:column;gap:2px;padding:16px 18px;border:1px solid var(--line-2);border-radius:12px;transition:border-color .2s,background .2s}
.backto a:hover{border-color:var(--text);background:color-mix(in srgb,var(--text) 5%,transparent)}
.backto small{font-size:13.5px;color:var(--text-3)}
.backto b{font-weight:400;font-size:19px}

/* Related cards */
.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:clamp(20px,2.4vw,36px);margin-top:32px}
.card{position:relative;display:block}
.card .thumb{position:relative;aspect-ratio:16/10;background:var(--wall-3);overflow:hidden;display:grid;place-items:center}
.card .thumb img{width:100%;height:100%;object-fit:cover;filter:grayscale(.85) brightness(.85);transition:filter .5s,transform .8s}
.card .thumb .mono{font-family:var(--latin);font-size:56px;color:var(--text-3)}
.card .thumb .play{position:absolute;left:12px;bottom:12px;width:36px;height:36px;border-radius:50%;background:rgba(0,0,0,.6);display:grid;place-items:center}
.card .thumb .play::before{content:"";border-left:11px solid #ECE7DD;border-top:7px solid transparent;border-bottom:7px solid transparent;margin-left:3px}
.card:hover .thumb img{filter:none;transform:scale(1.03)}
.card .kind{margin-top:16px}
.card h3{font-weight:400;font-size:21px;line-height:1.5;margin-top:2px}
.card:hover h3{color:var(--accent)}
.card .by{font-size:14.5px;color:var(--text-3);margin-top:4px}

/* Video player — click-to-load embed, or a clear "open at source" fallback */
.vhead{padding-top:clamp(110px,11vw,132px)}
.player{position:relative;max-width:1180px;margin:22px auto 0;aspect-ratio:16/9;background:#000;overflow:hidden}
.player.fallback{aspect-ratio:auto;min-height:min(56.25vw,664px);display:grid}
.player.fallback .facade{position:relative;inset:auto;padding:40px 24px}
.player iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.player .poster{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:grayscale(.6) brightness(.55)}
.player .facade{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;text-align:center;color:#ECE7DD;padding:24px}
.player .bigplay{width:clamp(72px,8vw,96px);height:clamp(72px,8vw,96px);border-radius:50%;border:1px solid rgba(236,231,221,.7);display:grid;place-items:center;transition:background .3s,transform .3s}
.player .bigplay::before{content:"";border-left:20px solid #ECE7DD;border-top:13px solid transparent;border-bottom:13px solid transparent;margin-left:6px;transition:border-color .3s}
.player .facade:hover .bigplay,.player .facade:focus-visible .bigplay{background:#ECE7DD;transform:scale(1.05)}
.player .facade:hover .bigplay::before,.player .facade:focus-visible .bigplay::before{border-left-color:#151412}
.player .facade small{font-size:14px;color:rgba(236,231,221,.75);max-width:30em;line-height:1.6}
.player .facade b{font-weight:400;font-size:clamp(18px,1.6vw,22px)}
.player .facade .btn{color:#ECE7DD;border-color:rgba(236,231,221,.6)}
.player .facade .btn:hover{background:#ECE7DD;color:#151412}
.vbody{display:grid;grid-template-columns:repeat(12,1fr);column-gap:24px;row-gap:32px;max-width:1180px;margin:40px auto 0}
.vbody .main{grid-column:1/8}
.vbody aside{grid-column:9/13}
.vbody h1{font-weight:300;font-size:clamp(34px,3.8vw,56px);line-height:1.3;margin-top:8px}
.vbody .pills{margin-top:22px}
.vbody .desc{color:var(--text-2);font-size:17.5px;line-height:1.95;margin-top:24px;max-width:var(--measure)}
.vbody .srcbox{margin:0}

/* ── Clip covers (16:9 and 4:3 images with titles set near the edges): never cropped ── */
.thumb.fit{background:#000}
.thumb.fit img{position:absolute;inset:0;object-fit:contain}
.row .thumb.fit{aspect-ratio:16/9}
.thumb.fit .play{top:10px;bottom:auto}   /* cover titles sit low; keep the play mark off them */
.cards.clips{grid-template-columns:repeat(2,1fr);row-gap:clamp(40px,4vw,56px)}
.cards.clips .thumb{aspect-ratio:16/9}
.cards.clips h3{font-size:clamp(21px,1.9vw,25px);text-wrap:pretty}
.card .ex{color:var(--text-2);font-size:15.5px;line-height:1.8;margin-top:10px;max-width:40em;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.player .poster.fit{object-fit:contain;filter:brightness(.8)}
.player .poster.fit ~ .facade b,.player .poster.fit ~ .facade small{display:none}   /* the cover already carries the title; the button keeps its label */
.vbody .clipback{grid-column:1/8;max-width:none;margin:8px 0 0}

/* ── Responsive ── */
@media (max-width:1100px){
  nav.main{display:none}
  header.site .wrap{grid-template-columns:1fr auto}
  .menubtn{display:grid}
  .phead h1{grid-column:1/13}
  .phead .desc{grid-column:1/11}
  .thead .portrait{grid-column:1/6}
  .thead .info{grid-column:6/13}
  .bio{grid-column:1/13}
}
@media (max-width:860px){
  .row{grid-template-columns:88px minmax(0,1fr);gap:18px}
  .row .side{grid-column:2;text-align:left;margin-top:-10px}
  .cards{grid-template-columns:1fr 1fr}
  .vbody .main,.vbody aside,.vbody .clipback{grid-column:1/13}
  .prose figure{margin-inline:0}
  .prose figcaption{padding-inline:0}
}
@media (max-width:720px){
  body{font-size:16.5px}
  header.site .wrap{height:66px}
  .mark .lat{font-size:19px}
  .toolbar{top:66px}
  .toolbar .wrap{min-height:60px;gap:10px}
  .toolbar .seg{flex:1}
  .toolbar .seg button{flex:1;justify-content:center;padding:0 10px}
  .toolbar .tb-right{display:none}
  .toolbar .seg.scroll{flex:1 1 100%;overflow-x:auto;scrollbar-width:none}
  .toolbar .seg.scroll button{flex:none}
  .filterbtn{display:inline-flex;min-height:46px;padding:0 16px;border-radius:99px;border:1px solid var(--line-2);align-items:center;gap:8px;font-size:15px}
  .filterbtn .badge{min-width:20px;height:20px;border-radius:10px;background:var(--accent);color:var(--wall);font-size:12px;display:grid;place-items:center;padding:0 6px}
  .filterbtn .badge:empty{display:none}
  .phead{padding-top:104px}
  .phead h1{font-size:clamp(48px,14vw,64px)}
  .phead .desc{grid-column:1/13;font-size:16.5px}
  .phead .stats b{font-size:24px}
  .row{grid-template-columns:72px minmax(0,1fr);padding:22px 0}
  .row .ex{-webkit-line-clamp:3}
  .tgrid{grid-template-columns:1fr 1fr;gap:28px 16px}
  .tcard .obj{padding:9px}
  .tcard h3{font-size:18px}
  .tcard .lat{font-size:14.5px}
  .tcard .meta{flex-direction:column;gap:0}
  .ph .ini{font-size:44px}
  .ph small{font-size:11.5px}
  .thead{padding-top:96px}
  .thead .portrait{grid-column:1/13;max-width:300px}
  .thead .info{grid-column:1/13}
  .facts{grid-template-columns:1fr}
  .facts dt{padding-bottom:0;border-bottom:0}
  .reader{padding-top:100px}
  .ahead{text-align:left}
  .ahead .bc,.ahead .kind,.ahead .pills,.ahead .meta{justify-content:flex-start}
  .prose blockquote{padding-left:18px}
  .srcbox dl{grid-template-columns:1fr}
  .srcbox dt{padding-bottom:0;border-bottom:0}
  .backto{grid-template-columns:1fr}
  .cards,.cards.clips{grid-template-columns:1fr}
  .vhead{padding-top:66px}
  .vbody,.vhead .sec{padding-inline:var(--gut)}
  .vhead > .wrap{padding:0}
  .vhead .bc{padding:16px var(--gut) 0}
  .player{margin-top:12px}
  footer.site .brand{grid-column:1/13}
  footer.site .c,footer.site .c:nth-of-type(2){grid-column:span 6}
  .sres a{grid-template-columns:48px 1fr}
  .sres .th{width:48px;height:48px}
  .sres .s.r{display:none}
}
@media (min-width:721px){.sheet,.sheet-back{display:none}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}html{scroll-behavior:auto}}

/* teachers page: A–Z name list under the two photo rows */
.tindex{margin-top:clamp(64px,7vw,104px);border-top:1px solid var(--line);padding-top:clamp(28px,3vw,40px)}
.tindex h2{font-weight:300;font-size:clamp(24px,2.2vw,30px);margin:0 0 clamp(20px,2.4vw,32px);color:var(--accent,var(--text))}
.tindex h2 span{font-size:15px;color:var(--text-3,var(--text-2));margin-left:12px}
.tcols{columns:3 260px;column-gap:clamp(28px,4vw,64px)}
.tcols h3{break-after:avoid;font-weight:400;font-size:15px;color:var(--text-3,var(--text-2));margin:22px 0 6px;letter-spacing:.04em}
.tcols .grp{break-inside:avoid;padding-bottom:22px}
.tcols .grp h3{margin-top:0}
.tcols a{break-inside:avoid;display:grid;grid-template-columns:1fr auto;column-gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}
.tcols a .nm{font-size:18px;color:var(--text)}
.tcols a .lt{grid-row:2;font-size:13.5px;color:var(--text-2)}
.tcols a .n{grid-row:1/3;grid-column:2;align-self:center;font-size:13px;color:var(--text-3,var(--text-2))}
.tcols a:hover .nm,.tcols a:focus-visible .nm{color:var(--accent,var(--text))}

/* books page (หน้ากระดาษ) */
.books{display:grid;gap:clamp(72px,9vw,140px);padding:clamp(16px,2vw,32px) 0 clamp(40px,5vw,72px)}
.book{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:clamp(32px,5vw,88px);align-items:center}
.book.cover{grid-template-columns:minmax(0,4fr) minmax(0,6fr)}
.book + .book{border-top:1px solid var(--line);padding-top:clamp(72px,9vw,140px)}
.bimg{margin:0;background:var(--mat);padding:clamp(10px,1.2vw,16px);box-shadow:0 30px 60px -32px rgba(0,0,0,.9)}
.book.cover .bimg{max-width:440px;justify-self:center;width:100%}
.bimg img{display:block;width:100%;height:auto}
.btext{max-width:34em}
.bno{display:block;font-size:14px;letter-spacing:.06em;color:var(--accent);margin-bottom:14px}
.btext h2{font-weight:300;font-size:clamp(34px,3.6vw,54px);line-height:1.25;margin:0}
.bsub{font-size:clamp(18px,1.5vw,21px);color:var(--text-2);margin:10px 0 0;line-height:1.6}
.bcr{font-size:16px;color:var(--text-2);line-height:1.8;margin:22px 0 0}
.bdesc{font-size:17px;line-height:1.95;color:var(--text);margin:26px 0 0}
.bprice{font-size:17px;color:var(--text);margin:24px 0 0}
.bbuy{margin-top:18px}
.bsoon{display:inline-block;margin:28px 0 0;font-size:17px;color:var(--accent);border:1px solid color-mix(in srgb,var(--accent) 50%,transparent);border-radius:99px;padding:4px 18px}
@media (max-width:760px){
  .book,.book.cover{grid-template-columns:1fr;gap:28px}
  .book.cover .bimg{max-width:320px;justify-self:start}
}
.bdesc.ben{color:var(--text-2);font-size:16.5px;line-height:1.85}
.vdek{margin-top:26px;font-size:clamp(18px,1.4vw,20px);line-height:1.85;color:var(--text-2);max-width:36em}
/* share buttons */
.share{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:40px;padding-top:24px;border-top:1px solid var(--line)}
.share .sh-l{font-size:14px;color:var(--text-3,var(--text-2));margin-right:6px}
.share .sh{font:inherit;font-size:15px;color:var(--text);background:none;border:1px solid var(--line-2,var(--line));border-radius:99px;padding:7px 18px;cursor:pointer;text-decoration:none;line-height:1.4}
.share .sh:hover,.share .sh:focus-visible{border-color:var(--accent);color:var(--accent)}
aside .share{margin-top:20px;padding-top:0;border-top:0}
