/* The website's frame and look, shared by every page (site.js draws the bar across the top and the footer).
   Old paper, sepia ink, brass and navy: the colours of the class paintings. */
:root {
  --ink: #36230f; --muted: #7e6243; --soft: #5c4229; --gold: #84530d; --line: #cfb38a; --panel: #f3e6cb; --edge: #b8945f; --bg: #dcc49b;
  --brass: #ad7a25; --gold-bg: #ebcf8e; --navy: #2e3d6b; --paper: #f7edd6; --chip: #e3cea6; --good: #2f7a3e; --bad: #a8402a;
  --wood: #2b1b0e; --wood-2: #3b2614; --head-h: 64px; --page-w: 1240px;
  --k-notice: #2e3d6b; --k-update: #3f7a3a; --k-event: #b0452e; --k-promotion: #7a3a8a;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--head-h) + 12px); }
body.site { margin: 0; font: 15px "Google Sans", "Noto Sans Thai", system-ui, sans-serif; color: var(--ink);
  background: radial-gradient(ellipse at 50% 30%, transparent 50%, rgba(110, 70, 25, 0.22) 100%),
    radial-gradient(ellipse at 25% 10%, rgba(255, 245, 220, 0.55), transparent 55%), var(--bg);
  background-attachment: fixed; padding-top: var(--head-h); }
/* Links take their box's colour — at no weight (:where), so a button's or a menu's own colour always wins. */
:where(body.site a) { color: inherit; }
.wrap { max-width: var(--page-w); margin: 0 auto; padding: 0 20px; }

/* ---------- The bar across the top: the logo, the menus (each with its list), the language, Play now ---------- */
.site-head { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: var(--head-h); color: #f3e3c0;
  background: linear-gradient(180deg, var(--wood-2), var(--wood)); border-bottom: 2px solid #8a6228; box-shadow: 0 3px 12px rgba(30, 18, 6, 0.35); }
.sh-in { display: flex; align-items: center; gap: 18px; height: 100%; max-width: 1480px; margin: 0 auto; padding: 0 20px; }
.sh-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #ffd98a; flex: none; }
.sh-logo img { width: 40px; height: 40px; border-radius: 8px; } /* the favicon: painted, so smooth (not pixelated) */
.sh-logo span { font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 21px; letter-spacing: 0.5px; white-space: nowrap; }
.sh-nav { display: flex; align-items: stretch; height: 100%; margin-left: 18px; }
.sh-item { position: relative; display: flex; }
.sh-top { display: flex; align-items: center; gap: 5px; padding: 0 16px; font-size: 15px; font-weight: 600; text-decoration: none; color: #f3e3c0; white-space: nowrap;
  border-bottom: 3px solid transparent; }
.sh-item:hover .sh-top, .sh-item.on .sh-top { color: #ffd98a; border-bottom-color: #e7b44f; }
.sh-caret { font-size: 11px; opacity: 0.8; }
.sh-drop { position: absolute; top: 100%; left: 0; min-width: 200px; padding: 8px; display: none; flex-direction: column; background: #fbf3e0;
  border: 1px solid var(--edge); border-radius: 0 0 10px 10px; box-shadow: 0 10px 24px rgba(40, 24, 8, 0.3); }
.sh-item:hover .sh-drop, .sh-item:focus-within .sh-drop { display: flex; }
/* .site-head in front: the page's own "a { color: inherit }" would hand them the bar's pale text on the list's paper. */
.site-head .sh-drop a { padding: 9px 12px; border-radius: 6px; text-decoration: none; color: #4a2f12; font-size: 14px; font-weight: 500; white-space: nowrap; }
.site-head .sh-drop a:hover { color: #2a1a08; background: var(--gold-bg); }
.sh-side { display: flex; align-items: center; gap: 14px; margin-left: auto; }
/* The language: a button and a list like the menus' (the browser's own select — blue when pointed at — stays hidden;
   the wiki listens to it). */
.sh-lang { position: relative; }
.sh-langbtn { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font: inherit; font-size: 13.5px; cursor: pointer; color: #f3e3c0;
  background: #1e1309; border: 1px solid #6b4a2b; border-radius: 8px; }
.sh-langbtn:hover, .sh-lang.open .sh-langbtn { color: #ffd98a; border-color: #e7b44f; }
.sh-lang .sh-drop { left: auto; right: 0; min-width: 150px; margin-top: 6px; border-radius: 10px; }
.sh-lang.open .sh-drop { display: flex; }
.site-head .sh-lang .sh-drop a { cursor: pointer; }
.site-head .sh-lang .sh-drop a.on { color: #2a1a08; font-weight: 700; background: var(--gold-bg); }
.sh-play { display: inline-flex; align-items: center; padding: 9px 20px; border-radius: 8px; font-weight: 700; text-decoration: none; white-space: nowrap;
  color: #2a1a08 !important; background: linear-gradient(180deg, #ffe39a, #e7b44f); border: 1px solid #a8762a; box-shadow: 0 2px 0 #7a5418; }
.sh-play:hover { filter: brightness(1.08); }
.sh-burger { display: none; margin-left: auto; width: 42px; height: 38px; font-size: 22px; color: #f3e3c0; background: none; border: 1px solid #6b4a2b; border-radius: 6px; cursor: pointer; }
@media (max-width: 1060px) {
  .sh-burger { display: block; }
  .sh-nav, .sh-side { display: none; }
  .site-head.open .sh-nav { display: flex; position: absolute; top: var(--head-h); left: 0; right: 0; flex-direction: column; height: auto; margin: 0; padding: 8px 12px 14px;
    background: var(--wood); border-bottom: 2px solid #8a6228; max-height: calc(100vh - var(--head-h)); overflow-y: auto; }
  .site-head.open .sh-side { display: flex; position: absolute; top: var(--head-h); right: 12px; transform: translateY(-100%); }
  .site-head.open .sh-item { flex-direction: column; }
  .site-head.open .sh-top { padding: 12px 8px; border-bottom: 1px solid #4a3320; justify-content: space-between; }
  .site-head.open .sh-caret { padding: 4px 10px; font-size: 14px; }
  .sh-item:hover .sh-drop { display: none; }
  .site-head.open .sh-item.drop .sh-drop { display: flex; position: static; box-shadow: none; border-radius: 8px; margin: 6px 0; }
  .sh-logo span { font-size: 18px; }
}

/* ---------- The footer ---------- */
.site-foot { margin-top: 48px; color: #d8c49e; background: linear-gradient(180deg, var(--wood-2), #1e1309); border-top: 2px solid #8a6228; }
.sf-in { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; max-width: var(--page-w); margin: 0 auto; padding: 36px 20px 26px; }
.sf-brand p { margin: 12px 0 16px; font-size: 13.5px; line-height: 1.6; }
.sf-col h4 { margin: 4px 0 10px; font-size: 14px; color: #ffd98a; }
.sf-col a { display: block; padding: 4px 0; font-size: 13.5px; text-decoration: none; color: #d8c49e; }
.sf-col a:hover { color: #fff3d6; }
.sf-copy { padding: 14px 20px; text-align: center; font-size: 12.5px; color: #a8916c; border-top: 1px solid #4a3320; }
@media (max-width: 860px) { .sf-in { grid-template-columns: 1fr 1fr; } .sf-brand { grid-column: 1 / -1; } }

/* ---------- Building blocks ---------- */
.sec-title { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: 22px; color: #4a2f12; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sec-title .more { order: 2; font-size: 13px; font-weight: 600; color: var(--soft); text-decoration: none; white-space: nowrap; }
.sec-title .more:hover { color: var(--gold); }
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; box-shadow: 0 1px 3px rgba(90, 60, 25, 0.12); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; color: #2a1a08; background: linear-gradient(180deg, #ffe39a, #e7b44f); border: 1px solid #a8762a; box-shadow: 0 2px 0 #7a5418; }
.btn:hover { filter: brightness(1.07); }
.btn.ghost { color: #f6ead0; background: rgba(255, 255, 255, 0.08); border-color: rgba(246, 234, 208, 0.5); box-shadow: none; }
.btn.plain { color: var(--soft); background: var(--panel); border-color: var(--edge); box-shadow: none; }

/* A post's kind: its tag and colour. */
.ktag { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 11.5px; font-weight: 700; color: #fff; white-space: nowrap; background: var(--k-notice); }
.ktag.k-update { background: var(--k-update); } .ktag.k-event { background: var(--k-event); } .ktag.k-promotion { background: var(--k-promotion); }
.knew { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 10.5px; font-weight: 700; color: #fff; background: #d0782a; vertical-align: 2px; }

/* Category tabs (the news). */
.ktabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ktab { padding: 7px 16px; border-radius: 18px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--soft);
  background: var(--panel); border: 1px solid var(--edge); }
.ktab:hover { color: var(--ink); border-color: var(--brass); }
.ktab.on { color: #fff8e6; background: var(--wood-2); border-color: var(--wood-2); }

/* A news card: its picture (the post's own, or its kind's), its kind, date, title and a line of it. */
.ncards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ncard { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--edge);
  border-radius: 12px; box-shadow: 0 1px 3px rgba(90, 60, 25, 0.12); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.ncard:hover { transform: translateY(-3px); border-color: var(--brass); box-shadow: 0 8px 20px rgba(90, 60, 25, 0.2); }
.ncard .pic { position: relative; aspect-ratio: 1200 / 630; background: #e6d2b4 center / cover no-repeat; border-bottom: 1px solid var(--line); }
.ncard .pic .ktag { position: absolute; left: 10px; top: 10px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.ncard .txt { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.ncard .date { font-size: 12.5px; color: var(--muted); }
.ncard h3 { margin: 0; font-size: 16px; line-height: 1.4; color: #3a2410; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ncard p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { padding: 40px 12px; text-align: center; color: var(--muted); }
