@font-face{font-family:IBMThai;src:url('/reader/assets/IBMPlexSansThai-Regular.woff2') format('woff2');font-weight:400;font-display:swap}
@font-face{font-family:IBMThai;src:url('/reader/assets/IBMPlexSansThai-Medium.woff2') format('woff2');font-weight:500;font-display:swap}
@font-face{font-family:NotoThai;src:url('/reader/assets/NotoSerifThai%5Bwdth%2Cwght%5D.woff2') format('woff2');font-weight:100 900;font-display:swap}

:root{color-scheme:light;--paper:#f5f3ec;--ink:#202a29;--title:#141c1b;--accent:#00645c;--band:#173532;--bandink:#eef2ec;--muted:#52615b;--line:#52615b;--soft:#ebe7dc;--focus:#b04715;--spotlight:#173532}
html[data-theme=dark]{color-scheme:dark;--paper:#1c2423;--ink:#edf1e9;--title:#f6f8f2;--accent:#94d6c4;--band:#111816;--bandink:#eef2ec;--muted:#becdc4;--line:#667871;--focus:#ffd079;--soft:#232d2b;--spotlight:#2c4740}
*{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);font:17px/1.7 IBMThai,sans-serif}
a{color:inherit;text-decoration-thickness:1px;text-underline-offset:.2em}
button,input,select{font:inherit}
button{cursor:pointer}
button,input,select{border:1px solid var(--line);border-radius:3px;padding:.55rem .8rem;background:var(--paper);color:var(--ink)}
button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.wrap{width:min(1200px,calc(100% - 48px));margin:auto}
.skip{position:absolute;top:-100px}
.skip:focus{top:0;background:var(--paper);z-index:3}
.masthead,footer{background:var(--band);color:var(--bandink)}
.top{display:flex;align-items:center;gap:1rem;padding:20px 0}
.brand{font-size:1.25rem;font-weight:500;text-decoration:none;margin-right:auto}
.brand .mark{color:#94d6c4;width:1.5em;height:1.5em;vertical-align:middle}
.masthead button{background:transparent;color:inherit;border-color:#7b9286}
.masthead nav{display:flex;gap:24px;align-items:center;padding:8px 0 16px}
.masthead nav span{margin-left:auto;color:#b9c9c2}
#menuButton{display:none}
main{min-height:100vh;padding:44px 0 72px}
#main{outline-offset:4px}
h1,h2,h3{font-family:NotoThai,serif;color:var(--title);line-height:1.3}
h1{font-size:clamp(1.65rem,4vw,2.7rem);margin:0 0 1.2rem}
h2{font-size:1.4rem}
.kicker{color:var(--accent);font-weight:500}
.searchbar{display:flex;gap:10px;max-width:900px}
.searchbar input{flex:1;min-width:0}
.searchbar button{white-space:nowrap}
.count{color:var(--muted);margin:20px 0}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chips:not(:empty){margin-bottom:24px}
.chip{border-color:var(--accent);text-align:start}
.stories{display:grid;grid-template-columns:2fr 1fr;gap:32px}
.story{border-top:1px solid var(--line);padding:16px 0}
.story:first-child h2{font-size:clamp(1.5rem,3vw,2.5rem)}
.story h2{margin:.5rem 0}
.story a{text-decoration:none}
.story a:hover{text-decoration:underline}
.story p{margin:.4rem 0}
.story small,.meta{color:var(--muted)}
.article{max-width:760px}
.article .body{font:19px/1.8 IBMThai,sans-serif}
.article .body p{margin:1.4em 0}
.notice{background:var(--soft);padding:20px;margin:20px 0}
.actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}
/* Close's line box, vertical padding and border, plus the header's padding.
   Native focus scrolling also reserves its 3px outline and 3px offset. */
dialog{--dialog-head-height:calc(1.7em + 1.1rem + 26px);width:min(680px,calc(100% - 32px));max-height:85vh;overflow:auto;scroll-padding-block:calc(var(--dialog-head-height) + 6px) 6px;border:1px solid var(--line);background:var(--paper);color:var(--ink);padding:0 24px 24px}
dialog::backdrop{background:#0009}
fieldset{border:0;border-top:1px solid var(--line);padding:12px 0}
fieldset label{display:block;margin:6px 0}
footer{padding:36px 0}
footer p{color:#b9c9c2}
@media(max-width:700px){.wrap{width:calc(100% - 32px)}
.top{flex-wrap:wrap}
.brand{font-size:1rem}
.masthead nav{display:none;flex-direction:column;align-items:start}
.masthead nav.open{display:flex}
.masthead nav span{margin:0}
#menuButton{display:block}
.stories{grid-template-columns:1fr;gap:0}
.searchbar{flex-wrap:wrap}
.searchbar input{flex-basis:100%}
main{padding-top:28px}
.story:first-child h2{font-size:1.5rem}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}
}


figure{margin:12px 0}
figure img{width:100%;height:auto;display:block}
figcaption{font-size:17px;color:var(--muted)}


.brand{display:flex;align-items:center;gap:8px;white-space:nowrap}
.brand .mark{flex:none}

.stories{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;gap:28px}

.story{min-width:0}
.story:first-child{grid-column:span 2;grid-row:span 2;border-top:0;padding-top:0}
.story:first-child h2{max-width:24em}

.story small{font-size:17px}
.story.spotlight{background:var(--spotlight);--ink:#eef2ec;--title:#eef2ec;--accent:#94d6c4;--muted:#b9c9c2;color:var(--ink);padding:20px;border-top:0}

.article{margin:24px auto 0}
.article .body{overflow-wrap:anywhere}
.article nav{margin-bottom:24px}

input[type=checkbox]{width:20px;height:20px;accent-color:var(--accent)}
select:focus-visible{outline:3px solid var(--focus);outline-offset:3px}

@media(max-width:1000px){.stories{grid-template-columns:repeat(2,minmax(0,1fr))}
.story:first-child{grid-column:1 / -1;grid-row:auto}
}
@media(min-width:701px) and (max-width:1000px){.story:last-child:nth-child(even){grid-column:1 / -1}
.story.spotlight:not(:first-child) img{aspect-ratio:16 / 9;max-height:18rem;object-fit:cover}
}

@media(max-width:700px){.stories{grid-template-columns:minmax(0,1fr);gap:12px}
.story:first-child{grid-column:auto;grid-row:auto}
.brand{font-size:17px;flex-basis:100%}
.story:first-child h2{font-size:1.5rem}
.article{margin-top:20px}
}


.masthead,footer,.story.spotlight{--focus:#ffd079}


/* The initial empty/loading frame keeps the footer below the viewport while
   fresh content is authorized. No previous content is retained for layout. */
.range{white-space:nowrap}
.query-context{overflow-wrap:anywhere}
.count+button{margin-bottom:24px}
.dialog-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 -12px 24px;padding:12px;background:var(--paper)}
.dialog-head button{flex:none;white-space:nowrap}
.dialog-head h2{margin:0}
.filter-help{margin:0 0 28px;max-width:36em}
dialog fieldset{margin:0 0 24px;padding:8px 0 12px}
dialog legend{font-weight:500}
dialog label{display:grid;grid-template-columns:20px minmax(0,1fr);column-gap:12px;align-items:start;margin:4px 0;padding:8px 6px}
dialog input[type=checkbox]{padding:0;margin:calc((1.7em - 20px)/2) 0 0;scroll-margin-block:6px}
@media(max-height:500px){
dialog{--dialog-head-height:calc(1.7em + 1.1rem + 14px);max-height:calc(100vh - 16px);padding-bottom:8px}
.dialog-head{padding-block:6px;margin-bottom:8px}
.filter-help{margin-bottom:8px}
dialog fieldset{margin-bottom:12px;padding-block:4px 6px}
dialog fieldset:last-child{margin-bottom:0}
}
.notice>strong{display:block;font-weight:500}
.notice p{margin:10px 0 0}
.correction-notice{background:var(--band);color:var(--bandink)}
html[data-theme=dark] .correction-notice{background:var(--spotlight)}
.correction-notice .meta{color:var(--bandink)}
.historical-notice{border-inline-start:4px solid var(--accent)}
.correction-cue{color:var(--accent);font-weight:500}
.empty-notice{max-width:760px;margin-top:0}
