/* ธีมมืดกลาง (แนว Recode) ใช้ทุกหน้า ยกเว้นหน้าแรกที่มีธีมของตัวเอง
 * ผูกไว้ใต้ @media screen → สั่งพิมพ์ยังเป็นกระดาษขาวตามค่าเดิมของแต่ละหน้า */
@media screen {
  :root {
    --navy:#4a8f50; --navy-dark:#0b120c; --gold:#e0233f; --red:#ff6b7d; --green:#7fd38a;
    --ink:#e8eee6; --muted:#97a596; --line:#223026; --bg:#070b08; --white:#0e150f;
    --card:#0e150f; --tint-red:rgba(255,107,125,.10); --tint-gold:rgba(233,196,106,.10); --tint-violet:rgba(160,120,255,.10); --tint-green:rgba(127,211,138,.13); --tint-gray:rgba(255,255,255,.06);
    --gold-light:rgba(255,107,125,.12); --amber:#f2c24f; --red-ink:#ff8a98;
    --acc:#b6f06e; --acc-ink:#0b1607;
    color-scheme: dark;
  }
  html, body { background:#070b08; color:var(--ink) }
  .flagbar { display:none }
  header { background:rgba(9,13,10,.92)!important; border-bottom:1px solid var(--line)!important; backdrop-filter:blur(8px) }
  .brand b { color:#fff!important }
  input, select, textarea { border-color:#2c3b2f!important; background:#0a100b!important; color:var(--ink)!important }
  input[type=password], input[type=number], input[type=date], input[type=time] { padding:10px 12px; border:1px solid; border-radius:8px; font:inherit; font-size:16px }
  input:focus, select:focus, textarea:focus { outline-color:var(--acc)!important; border-color:var(--acc)!important }
  .card, .box, .panel, .modal, dialog { border-color:var(--line) }
  a { color:inherit }
  main a:not([class]) { color:var(--acc) }
  footer { background:#040705!important; border-top:1px solid var(--line); color:var(--muted)!important }
  h1, h2, h3, .page-title, label { color:#fff!important }
  .btn-navy { background:var(--acc)!important; color:var(--acc-ink)!important }
  .btn-navy:hover { filter:brightness(1.08) }
  #langToggle, #siteSearchBtn { background:transparent!important; color:#fff!important; border-color:#2c3b2f!important }
  #langToggle:hover { background:var(--acc)!important; color:var(--acc-ink)!important }
  #siteSearch .box { background:#0e150f!important; border:1px solid var(--line) }
  #siteSearch input { background:transparent!important; border:0!important; border-bottom:1px solid var(--line)!important }
  #siteSearch li a { color:var(--ink)!important } #siteSearch li a b { color:#fff!important } #siteSearch li a small { color:var(--muted)!important }
  ::selection { background:var(--acc); color:var(--acc-ink) }
}

/* ตราโรงเรียนมุมซ้ายบน: วงแดงตัวอักษรหมุน + หกเหลี่ยม */
.hdr-badge{position:relative;flex:none;width:64px;height:64px;color:#b6f06e;border-radius:50%;background:radial-gradient(circle,#0d160f 62%,transparent 63%)}
.hdr-badge .badge-ring{position:absolute;inset:0;width:100%;height:100%}
.hdr-badge .badge-ring text{font-size:15px}
@media(prefers-reduced-motion:no-preference){.hdr-badge .badge-ring{animation:hdrSpin 22s linear infinite}}
@keyframes hdrSpin{to{transform:rotate(360deg)}}
.hdr-badge .badge-core{position:absolute;inset:14px;display:grid;place-items:center;background:linear-gradient(145deg,#c6f585,#5f9a4e);clip-path:polygon(50% 0,93% 25%,93% 75%,50% 100%,7% 75%,7% 25%)}
.brand .hdr-badge img{width:76%!important;height:auto!important;border:0!important;border-radius:50%}
@media(max-width:480px){.hdr-badge{width:50px;height:50px}.hdr-badge .badge-core{inset:11px}}
