@charset "utf-8";

:root {
  color-scheme: light;
  --ink: #29231e;
  --muted: #615448;
  --paper: #f8f1e3;
  --line: #cdbb9e;
  --gold: #e2c085;
  --nav: #222a35;
  --blue: #193e61;
  --serif: "Noto Serif TC", "PMingLiU", Georgia, serif;
  --sans: system-ui, "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 0;
  background: radial-gradient(ellipse at 50% 16rem, #fff8eb, transparent 62rem), #eee2cd;
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
}
a { color: var(--blue); text-underline-offset: .2em; }
a:focus-visible { outline: 3px solid #a64e20; outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 4vw, 2.15rem); }
h2 { font-size: 1.35rem; }
img { max-width: 100%; height: auto; }
.shell { width: min(72rem, 100% - 3rem); margin-inline: auto; }

.skip {
  position: absolute;
  inset: .5rem auto auto .5rem;
  padding: .55rem .85rem;
  color: var(--ink);
  background: var(--paper);
  z-index: 2;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }
.masthead { background: #202630; border-bottom: 1px solid #92754e; }
.masthead-inner { min-height: 4rem; display: flex; align-items: center; }
.brand {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: #fff4df;
  font: 700 1.6rem/1.2 var(--serif);
  text-decoration: none;
}
.brand small {
  border-inline-start: 1px solid #8c775e;
  padding-inline-start: .7rem;
  font: 600 .9rem/1.2 var(--sans);
  letter-spacing: .13em;
}
.sigil { display: inline-block; flex: none; }
.brand .sigil, .download-button .sigil, .nav a[aria-current] { color: var(--gold); }
.landscape {
  height: clamp(9rem, 21vw, 16rem);
  background: #31465a url("/assets/first-light.png") center 48% / cover no-repeat;
  image-rendering: pixelated;
  box-shadow: inset 0 -1px #292c35;
}
.nav {
  background: var(--nav);
  border-block: 1px solid #9e8057;
  box-shadow: 0 2px 0 #b59b76;
}
.nav-inner { display: grid; grid-template-columns: repeat(5, 1fr); }
.nav a {
  display: grid;
  min-height: 3.25rem;
  place-items: center;
  padding: .4rem;
  border-inline-start: 1px solid #725f4d;
  color: #f8efdf;
  font-weight: 700;
  text-decoration: none;
}
.nav a:last-child { border-inline-end: 1px solid #725f4d; }
.nav a:hover, .nav a[aria-current] { background: #34404e; }
.nav a:focus-visible, .brand:focus-visible { outline-color: #f4ce90; outline-offset: -4px; }

.main { min-height: 40vh; padding-block: 1.6rem 2rem; }
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, .43fr);
  grid-template-areas: "latest download" "latest directory";
  align-items: start;
  gap: 1rem 1.25rem;
}
.latest { grid-area: latest; }
.directory { grid-area: directory; }
.home-grid > .download-box { grid-area: download; }
.panel {
  min-width: 0;
  background: var(--paper);
  border: 1px solid #a58b69;
  border-radius: .35rem;
  box-shadow: 0 2px 4px #563c1c14;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: #ecddc3;
  border-radius: .29rem .29rem 0 0;
}
.panel-heading h1, .panel-heading h2 { margin: 0; }
.panel-heading a { flex: none; font-weight: 600; }
.panel-heading .sigil, .section-page .sigil { margin-inline-end: .5rem; color: #825a32; }
.post-list, .category-list { padding: 0; margin: 0; list-style: none; }
.post-list li + li, .category-list li + li { border-top: 1px solid var(--line); }
.post-list a {
  color: var(--ink);
  text-decoration: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  padding: 1rem 1.15rem;
  min-height: 4rem;
}
.post-list a:hover, .category-list a:hover { background: #f0e2c8; }
.post-list a:hover .post-title { text-decoration: underline; }
.board-label {
  align-self: center;
  display: inline-block;
  width: fit-content;
  border-radius: .2rem;
  padding: .12rem .55rem;
  background: var(--blue);
  color: #fff7e8;
  font-size: .875rem;
  white-space: nowrap;
}
.post-title { font-weight: 700; overflow-wrap: anywhere; }
time { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }

.download-box {
  padding: .75rem;
  border: 1px solid #a58b69;
  border-radius: .35rem;
  background: #f3e6cf;
  text-align: center;
}
.download-box p { margin: .45rem 0 0; color: var(--muted); font-size: .875rem; }
.download-box p:only-child { margin: 0; }
.download-button {
  display: flex;
  gap: .65rem;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: .5rem .75rem;
  font: 700 1.16rem/1.3 var(--sans);
  color: #fff6e6;
  background: linear-gradient(#254e73, #163653);
  border: 1px solid #9f814b;
  border-radius: .22rem;
  text-decoration: none;
}
.download-button:hover { background: #284f76; text-decoration: underline; }
.category-list a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1.15rem;
  min-height: 2.75rem;
  text-decoration: none;
  font-weight: 700;
}
.category-list .sigil { color: #825a32; }
.category-list a:hover { text-decoration: underline; }

.crumbs { display: flex; flex-wrap: wrap; gap: .25rem .55rem; margin-bottom: 1rem; font-size: .94rem; }
.crumbs span { overflow-wrap: anywhere; }
.section-page, .article { padding: clamp(1rem, 3vw, 2rem); }
.article { max-width: 53rem; }
.section-page h1, .article h1 { margin: 0 0 1rem; overflow-wrap: anywhere; }
.section-page .post-list, .section-page .category-list { border-block: 1px solid var(--line); }
.section-page .download-box, .section-page .category-list { margin-bottom: 1.25rem; }
.empty { margin: 0; padding: 1rem 1.15rem; color: var(--muted); }
.article .meta { display: flex; align-items: center; gap: .75rem; margin: 0 0 1.2rem; }
.cover { display: block; width: 100%; border: 1px solid var(--line); border-radius: .25rem; }
.prose { overflow-wrap: anywhere; }
.prose h2, .prose h3 { margin-top: 1.5em; }
.prose pre { overflow: auto; background: #eee2cd; padding: .65rem; }
.prose blockquote { border-inline-start: .2rem solid #a58b69; margin-inline: 0; padding-inline: .85rem; }
.prose table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; }
.prose td, .prose th { border: 1px solid var(--line); padding: .4rem .6rem; }
.footer { padding-block: .9rem 1.6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }

@media (max-width: 43rem) {
  .shell { width: calc(100% - 1.5rem); }
  .masthead-inner { min-height: 3.35rem; }
  .brand { font-size: 1.35rem; }
  .landscape { height: 6.45rem; }
  .nav-inner { width: 100%; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .nav a { grid-column: span 2; min-height: 2.75rem; font-size: .92rem; }
  .nav a:nth-child(n+4) { grid-column: span 3; border-top: 1px solid #725f4d; }
  .nav a:nth-child(1), .nav a:nth-child(4) { border-inline-start: none; }
  .nav a:last-child { border-inline-end: none; }
  .main { padding-top: 1rem; }
  .home-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "download" "latest" "directory"; gap: .8rem; }
  .panel-heading, .post-list a { padding-inline: .85rem; }
  .post-list a { grid-template-columns: 1fr auto; gap: .3rem .65rem; }
  .post-title { grid-row: 2; grid-column: 1 / -1; }
  .post-list time { grid-column: 2; grid-row: 1; }
}
