/*
  หน้าสาธารณะ — คนละแนวตามรหัสไซต์ (body.theme-{code})
  jpnet     สมุดบันทึกช่าง: แถบซ้าย, กระดาษเทาเย็น, เส้นแดงอิฐ, IBM Plex
  plathong  คู่มือบริการ: เมนูบน, พื้นขาว, ขีดเส้นทองเหลืองใต้ชื่อ, Bai Jamjuree + Sarabun
  myschool  จดหมายเวียน: คอลัมน์กลาง, หัวจดหมายเส้นคู่, กระดาษงาช้าง, Noto Serif Thai + Anuphan
  รหัสอื่น   หน้ากระดาษธรรมดา (ค่าใน :root) จนกว่าจะมีบล็อก .theme-{code}
*/

:root {
  --paper: #fafafa;
  --sheet: #fafafa;
  --sidebar: #fafafa;
  --ink: #1c1c1c;
  --ink-soft: #4a4a4a;
  --line: #e3e3e3;
  --line-strong: #1c1c1c;
  --accent: #1d4a38;
  --accent-ink: #1d4a38;
  --code-bg: #1c1c1c;
  --code-ink: #fafafa;
  --footer-bg: transparent;
  --sans: "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --display: "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.theme-jpnet {
  --paper: #f3f4f3;
  --sheet: #f7f8f7;
  --sidebar: #e3e6e2;
  --ink: #1a1c1a;
  --ink-soft: #3e453f;
  --line: #cfd4cf;
  --line-strong: #1a1c1a;
  --accent: #8e2f2f;
  --accent-ink: #8e2f2f;
  --code-bg: #242624;
  --code-ink: #f4f5f4;
  --footer-bg: transparent;
  --sans: "IBM Plex Sans Thai", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --display: "IBM Plex Sans Thai", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

.theme-plathong {
  --paper: #ffffff;
  --sheet: #ffffff;
  --sidebar: #ffffff;
  --ink: #1c2430;
  --ink-soft: #3e4c5c;
  --line: #e2e6ea;
  --line-strong: #1c2430;
  --accent: #6b4510;
  --accent-ink: #6b4510;
  --code-bg: #1c2430;
  --code-ink: #f7f8f9;
  --footer-bg: #f3f5f7;
  --sans: "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --display: "Bai Jamjuree", "Sarabun", "Noto Sans Thai", Tahoma, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.theme-myschool {
  --paper: #f7f3ea;
  --sheet: #f7f3ea;
  --sidebar: #f7f3ea;
  --ink: #231e18;
  --ink-soft: #5c5348;
  --line: #e2d8c8;
  --line-strong: #231e18;
  --accent: #1a3f68;
  --accent-ink: #1a3f68;
  --code-bg: #1a3f68;
  --code-ink: #f7f3ea;
  --footer-bg: transparent;
  --sans: "Anuphan", "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --display: "Noto Serif Thai", "Noto Serif", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.8;
  color-scheme: light;
}
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: #e7d7a4; color: var(--ink); }

a { color: var(--accent-ink); text-underline-offset: .18em; }
.logo,
.site-nav a,
.cat-link,
.topics a,
.topic-row a,
.post-item,
.crumbs a,
.pager a { text-decoration: none; }
.content a { font-weight: 500; }

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: var(--paper);
  padding: .3rem .7rem;
  z-index: 50;
}
.skip:focus { top: .5rem; }

.nav-label,
.menu-toggle { display: none; }

.shell { min-height: 100vh; }
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.bar,
.site-nav,
.footer-inner { max-width: 960px; margin-left: auto; margin-right: auto; }
.bar {
  padding: .85rem 1.25rem .7rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .8rem;
}
.logo {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.35;
  margin-right: auto;
}
.logo:hover { color: var(--ink); }
.brand-note {
  flex: 1 1 100%;
  order: 5;
  margin: 0;
  color: var(--ink-soft);
  font-size: .92rem;
}
.search { margin: 0; }
.search input {
  width: 220px;
  max-width: 100%;
  padding: .4rem .55rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
  line-height: 1.5;
}
.search input::placeholder { color: var(--ink-soft); opacity: 1; }

.site-nav { padding: .15rem 1.25rem .5rem; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; flex-wrap: wrap; gap: .1rem; }
.site-nav li { position: relative; }
.site-nav a {
  display: block;
  color: var(--ink);
  padding: .35rem .55rem;
  font-size: .98rem;
}
.site-nav a:hover { color: var(--accent-ink); }
.site-nav li.active > a { box-shadow: inset 0 -2px 0 var(--accent); }
.site-nav .sub {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% - 2px);
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--line-strong);
  padding: .25rem 0;
  z-index: 30;
}
.site-nav .sub a { font-weight: 400; padding: .35rem .85rem; }
.site-nav li:hover > .sub,
.site-nav li:focus-within > .sub { display: block; }

.sheet { background: var(--sheet); }
.main { max-width: 42rem; margin: 0 auto; padding: .4rem 1.25rem 3.5rem; }

.page-intro { margin: 1.35rem 0 1.2rem; }
.kicker {
  margin: 0 0 .2rem;
  color: var(--accent-ink);
  font-size: .92rem;
  font-weight: 500;
}
.page-intro h1,
.page-title,
.article h1,
.section-head h2,
.cat-index h2 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
}
.page-intro h1,
.page-title,
.article h1 { margin: 0 0 .3rem; font-size: 1.7rem; }
.dek { margin: 0; color: var(--ink-soft); }
.page-head { margin: 0 0 .75rem; }
.section-head { margin: 1.5rem 0 .15rem; }
.section-head h2,
.cat-index h2 { margin: 0 0 .3rem; font-size: 1.12rem; }

.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { padding: .75rem 0; border-top: 1px solid var(--line); }
.cat-list li:last-child { border-bottom: 1px solid var(--line); }
.cat-link {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.45;
}
.cat-link:hover { color: var(--accent-ink); }
.cat-desc { margin: .12rem 0 0; color: var(--ink-soft); }
.topics { margin: .25rem 0 0; }
.topics a,
.topic-row a { color: var(--ink-soft); font-size: .95rem; }
.topics a:hover,
.topic-row a:hover { color: var(--accent-ink); }
.topics a + a::before,
.topic-row a + a::before { content: "·"; margin: 0 .45rem; color: var(--ink-soft); }
.topic-row { margin: 0 0 1.1rem; }

.post-list { display: flex; flex-direction: column; }
.post-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .35rem;
  padding: .85rem 0;
  border-top: 1px solid var(--line);
  color: inherit;
}
.post-item:last-child { border-bottom: 1px solid var(--line); }
.post-item:hover strong { color: var(--accent-ink); }
.post-item .when,
.post-item .byline { color: var(--ink-soft); font-size: .88rem; }
.byline > * + *::before,
.when + .byline::before {
  content: "·";
  margin: 0 .4rem;
  color: var(--ink-soft);
  font-weight: 400;
}
.post-item strong,
.post-item .excerpt { flex: 1 1 100%; }
.post-item strong {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.45;
}
.post-item .excerpt { color: var(--ink-soft); }
.meta > * + *::before {
  content: "·";
  margin: 0 .4rem 0 .15rem;
  color: var(--ink-soft);
  font-weight: 400;
}
.tag { font-weight: 600; color: var(--accent-ink); }

.crumbs { font-size: .9rem; color: var(--ink-soft); margin: 1.15rem 0 .75rem; }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--accent-ink); }

.article { padding-bottom: .4rem; }
.article > .meta { margin: 0 0 .25rem; font-size: .9rem; color: var(--ink-soft); }
.content { font-size: 1.02rem; }
.content > *:first-child { margin-top: 1rem; }
.content h2,
.content h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.45;
  margin: 1.7rem 0 .45rem;
}
.content h2 { font-size: 1.28rem; }
.content h3 { font-size: 1.08rem; }
.content p { margin: .65rem 0; }
.content ul,
.content ol { padding-left: 1.25rem; margin: .5rem 0 1rem; }
.content li { margin: .25rem 0; }
.content li::marker { color: var(--accent); }
.content img { display: block; margin: 1rem 0; border: 1px solid var(--line); }
.content pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: .9rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .84rem;
  line-height: 1.6;
  border-radius: 0;
}
.content code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--line);
  padding: .05rem .3rem;
}
.content pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.2rem;
  font-size: .95rem;
  line-height: 1.6;
}
.content th,
.content td {
  text-align: left;
  vertical-align: top;
  padding: .5rem .65rem;
  border-bottom: 1px solid var(--line);
}
.content th { font-weight: 600; border-bottom: 2px solid var(--ink); }
.content blockquote {
  margin: 1rem 0;
  padding: .1rem 0 .1rem .9rem;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
}

.support {
  margin-top: 1.5rem;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.pager { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1.2rem; }
.pager a {
  min-width: 2.1rem;
  text-align: center;
  padding: .25rem .55rem;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.pager a:hover { background: var(--line); color: var(--ink); }
.pager a.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.site-footer { background: var(--footer-bg); color: var(--ink-soft); font-size: .92rem; }
.footer-inner { padding: 1.15rem 1.25rem 1.6rem; }
.footer-brand { margin: 0; color: var(--ink); font-family: var(--display); font-weight: 600; }
.footer-note,
.footer-meta { margin: .12rem 0; }
.site-footer a { color: var(--accent-ink); }
.empty { color: var(--ink-soft); }

.menu-toggle {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  font: inherit;
  font-size: .92rem;
  line-height: 1.4;
  padding: .25rem .6rem;
  cursor: pointer;
}

/* ---------- JPNET: แถบซ้าย เป็นสมุดบันทึก ---------- */
.theme-jpnet .shell {
  display: grid;
  grid-template-columns: 16.25rem minmax(0, 1fr);
  align-items: start;
}
.theme-jpnet .site-header {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--sidebar);
  border-bottom: 0;
  border-right: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  padding: 1.15rem 1rem 1.2rem;
}
.theme-jpnet .bar,
.theme-jpnet .site-nav { max-width: none; margin: 0; padding: 0; }
.theme-jpnet .bar { display: block; }
.theme-jpnet .logo {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: .04em;
}
.theme-jpnet .brand-note {
  margin: .15rem 0 .75rem;
  font-family: var(--mono);
  font-size: .75rem;
}
.theme-jpnet .search input { width: 100%; background: #fff; border-color: #c5cac4; }
.theme-jpnet .nav-label {
  display: block;
  margin: 1rem 0 .25rem;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--ink-soft);
}
.theme-jpnet .site-nav > ul { flex-direction: column; gap: 0; }
.theme-jpnet .site-nav a { padding: .28rem .35rem; border-left: 2px solid transparent; }
.theme-jpnet .site-nav li.active > a {
  box-shadow: none;
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.theme-jpnet .site-nav .sub {
  display: block;
  position: static;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0 0 .2rem .65rem;
}
.theme-jpnet .site-nav .sub a { color: var(--ink-soft); font-size: .92rem; }
.theme-jpnet .sheet { min-height: 100vh; }
.theme-jpnet .main { max-width: 40rem; margin: 0; padding: 1.5rem 2rem 3rem; }
.theme-jpnet .page-intro { margin-top: .15rem; }
.theme-jpnet .page-intro h1,
.theme-jpnet .page-title,
.theme-jpnet .article h1 { font-size: 1.42rem; font-weight: 600; }
.theme-jpnet .kicker,
.theme-jpnet .crumbs,
.theme-jpnet .meta,
.theme-jpnet .byline,
.theme-jpnet .when { font-family: var(--mono); font-size: .78rem; }
.theme-jpnet .cat-index { display: none; }
.theme-jpnet .post-item {
  display: grid;
  grid-template-columns: 6.3rem minmax(0, 1fr);
  column-gap: .85rem;
  row-gap: .05rem;
  align-items: baseline;
  padding: .65rem 0;
}
.theme-jpnet .post-item { align-items: baseline; }
.theme-jpnet .post-item .when { grid-column: 1; grid-row: 1; }
.theme-jpnet .post-item strong { grid-column: 2; grid-row: 1; font-size: 1.02rem; }
.theme-jpnet .post-item .byline { grid-column: 2; grid-row: 2; }
.theme-jpnet .post-item .when + .byline::before { content: none; margin: 0; }
.theme-jpnet .post-item .excerpt { grid-column: 2; grid-row: 3; font-size: .95rem; }
.theme-jpnet .article { display: flex; flex-direction: column; }
.theme-jpnet .article > .meta { order: 1; }
.theme-jpnet .article h1 { order: 2; }
.theme-jpnet .article .content { order: 3; }
.theme-jpnet .content h2 { font-size: 1.12rem; }
.theme-jpnet .footer-inner { max-width: 40rem; margin: 0; padding: 0 2rem 1.8rem; }
.theme-jpnet .footer-brand {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: .04em;
  font-size: .95rem;
}

/* ---------- Plathong: เมนูบน เป็นคู่มือบริการ ---------- */
.theme-plathong .site-header {
  background: #14202e;
  border-bottom-color: #14202e;
}
.theme-plathong .bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1rem;
  padding: 1rem 1.25rem .75rem;
}
.theme-plathong .logo {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  margin: 0;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.3;
  border-bottom: 2px solid #c4891a;
  padding-bottom: .02rem;
  color: #fff;
}
.theme-plathong .logo:hover { color: #fff; }
.theme-plathong .brand-note {
  grid-column: 1;
  grid-row: 2;
  order: 0;
  flex: none;
  margin: .2rem 0 0;
  font-size: .9rem;
  color: #c9d4de;
}
.theme-plathong .search { grid-column: 2; grid-row: 1 / span 2; }
.theme-plathong .search input { width: 210px; border-color: #c5ced6; background: #fff; }
.theme-plathong .menu-toggle { color: #fff; border-color: rgba(255, 255, 255, .45); }
.theme-plathong .site-nav {
  border-top: 1px solid rgba(255, 255, 255, .16);
  padding-top: .3rem;
  padding-bottom: .35rem;
}
.theme-plathong .site-nav > ul > li > a { color: #eef3f6; }
.theme-plathong .site-nav > ul > li > a:hover { color: #f0c36a; }
.theme-plathong .site-nav > ul > li.active > a { box-shadow: inset 0 -2px 0 #c4891a; }
.theme-plathong .site-nav .sub { background: #fff; border-color: #c9d5de; }
.theme-plathong .site-nav .sub a { color: #1c2430; }
.theme-plathong .site-nav .sub a:hover { color: #9a6a10; }
.theme-plathong .main { max-width: 960px; padding-top: 1.15rem; }
.theme-plathong .page-intro,
.theme-plathong .cat-index,
.theme-plathong .section-head,
.theme-plathong .post-list,
.theme-plathong .pager,
.theme-plathong .page-head,
.theme-plathong .crumbs,
.theme-plathong .article,
.theme-plathong .support,
.theme-plathong .topic-row,
.theme-plathong .empty { max-width: 40rem; }
.theme-plathong .page-intro h1 { font-size: 1.9rem; }
.theme-plathong .share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin: .85rem 0 1.15rem;
}
.theme-plathong .share-label {
  margin-right: .15rem;
  color: var(--ink-soft);
  font-size: .92rem;
}
.theme-plathong .share-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .7rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}
.theme-plathong .share-btn svg { width: 1rem; height: 1rem; display: block; flex: none; }
.theme-plathong .share-fb svg { color: #1877f2; }
.theme-plathong .share-line svg { color: #06c755; }
.theme-plathong .share-btn:hover { border-color: var(--accent); color: var(--ink); }
.theme-plathong .home-cats {
  list-style: none;
  margin: .4rem 0 2.2rem;
  padding: 0;
  max-width: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9rem;
}
.theme-plathong .home-cats a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .45rem;
  min-height: 9.2rem;
  padding: 1.35rem 1.2rem 1.2rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.theme-plathong .home-cats a:hover { border-color: var(--accent); color: var(--ink); }
.theme-plathong .home-ico { width: 3rem; height: 3rem; color: var(--accent); }
.theme-plathong .home-ico svg { display: block; width: 100%; height: 100%; }
.theme-plathong .home-name {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
}
.theme-plathong .home-desc { color: var(--ink-soft); font-size: .95rem; line-height: 1.45; }
.theme-plathong .cat-link { font-size: 1.28rem; }
.theme-plathong .post-item { padding: .95rem 0; }
.theme-plathong .post-item strong { font-size: 1.22rem; }
.theme-plathong .content h2 { border-bottom: 1px solid var(--line); padding-bottom: .2rem; }
.theme-plathong .site-footer { border-top: 1px solid var(--line); margin-top: .5rem; }
.theme-plathong .footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 2rem;
  align-items: start;
}
.theme-plathong .footer-note { grid-column: 1; }
.theme-plathong .footer-meta { grid-column: 2; text-align: right; }

/* ---------- MySchool: จดหมายเวียน คอลัมน์กลาง ---------- */
.theme-myschool .shell { max-width: 40rem; margin: 0 auto; }
.theme-myschool .site-header { background: transparent; border-bottom: 0; padding-top: 1.5rem; }
.theme-myschool .bar {
  max-width: none;
  margin: 0 1.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}
.theme-myschool .logo {
  flex: 1 1 100%;
  margin: 0;
  text-align: center;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.35;
}
.theme-myschool .brand-note {
  flex: 1 1 100%;
  order: 2;
  text-align: center;
  margin: .05rem 0 0;
}
.theme-myschool .bar::after {
  content: "";
  order: 3;
  flex: 1 1 100%;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  height: 4px;
  margin-top: .65rem;
}
.theme-myschool .search { order: 4; flex: 1 1 100%; text-align: center; margin-top: .7rem; }
.theme-myschool .search input {
  width: min(100%, 16rem);
  text-align: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
}
.theme-myschool .site-nav { max-width: none; text-align: center; padding-top: .7rem; padding-bottom: .15rem; }
.theme-myschool .site-nav > ul { justify-content: center; }
.theme-myschool .main { padding-top: .25rem; }
.theme-myschool .page-intro,
.theme-myschool .cat-index { text-align: center; }
.theme-myschool .page-intro h1,
.theme-myschool .page-title,
.theme-myschool .article h1 { font-weight: 700; }
.theme-myschool .kicker { color: var(--ink-soft); }
.theme-myschool .cat-index h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: .95rem;
  color: var(--ink-soft);
}
.theme-myschool .cat-list li { border: 0; padding: .8rem 0 .2rem; }
.theme-myschool .cat-list li:last-child { border: 0; }
.theme-myschool .cat-link { font-size: 1.42rem; font-weight: 700; }
.theme-myschool .post-item { padding: 1.05rem 0; }
.theme-myschool .post-item strong { font-size: 1.28rem; font-weight: 700; }
.theme-myschool .article > .meta {
  border-bottom: 1px solid var(--line);
  padding-bottom: .5rem;
}
.theme-myschool .site-footer { text-align: center; border-top: 1px solid var(--ink); margin: 0 1.25rem; }
.theme-myschool .footer-inner { max-width: none; padding-left: 0; padding-right: 0; }
.theme-myschool .footer-brand { font-size: 1.15rem; }

@media (max-width: 820px) {
  body { font-size: 16.5px; }
  .menu-toggle { display: inline-block; }
  .site-nav { display: none; }
  body.nav-open .site-nav { display: block; }
  .site-nav > ul { flex-direction: column; align-items: stretch; }
  .site-nav .sub,
  .site-nav li:hover > .sub,
  .site-nav li:focus-within > .sub {
    display: block;
    position: static;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0 0 .25rem .75rem;
  }
  .site-nav li.active > a { box-shadow: inset 3px 0 0 var(--accent); }
  .search { flex: 1 1 100%; order: 4; }
  .search input { width: 100%; }

  .theme-jpnet .shell { display: block; }
  .theme-jpnet .site-header {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 20;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: .65rem 1rem .7rem;
  }
  .theme-jpnet .bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; }
  .theme-jpnet .logo { margin-right: auto; }
  .theme-jpnet .brand-note { display: none; }
  .theme-jpnet .search { flex: 1 1 100%; margin: 0; }
  .theme-jpnet .site-nav { padding-top: .35rem; }
  .theme-jpnet .nav-label { margin-top: .1rem; }
  .theme-jpnet .main,
  .theme-jpnet .footer-inner { padding-left: 1rem; padding-right: 1rem; }
  .theme-jpnet .cat-index { display: block; }

  .theme-plathong .bar { padding: .75rem 1rem .6rem; }
  .theme-plathong .logo { font-size: 1.4rem; }
  .theme-plathong .search input { width: 100%; }
  .theme-plathong .menu-toggle { grid-column: 2; grid-row: 1; justify-self: end; }
  .theme-plathong .site-nav li.active > a { box-shadow: inset 3px 0 0 #c4891a; }
  .theme-plathong .search { grid-column: 1 / -1; grid-row: 3; margin-top: .55rem; }
  .theme-plathong .site-nav { padding-left: 1rem; padding-right: 1rem; }
  .theme-plathong .home-cats { grid-template-columns: 1fr; }
  .theme-plathong .footer-inner { display: block; }
  .theme-plathong .footer-meta { text-align: left; }

  .theme-myschool .bar { justify-content: space-between; align-items: center; }
  .theme-myschool .logo { flex: 1 1 auto; text-align: left; font-size: 1.7rem; }
  .theme-myschool .brand-note { order: 5; text-align: left; margin-top: .35rem; }
  .theme-myschool .menu-toggle { order: 2; }
  .theme-myschool .bar::after { order: 6; }
  .theme-myschool .search { order: 7; text-align: left; }
  .theme-myschool .search input { text-align: left; }
  .theme-myschool .site-nav { text-align: left; }
  .theme-myschool .site-nav > ul { justify-content: flex-start; }
  .theme-myschool .page-intro,
  .theme-myschool .cat-index { text-align: left; }
}

@media (max-width: 420px) {
  .theme-jpnet .post-item { grid-template-columns: 5.2rem minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
