/*
Theme Name: Koyori Base
Author: Koyori Editorial
Description: Read-only newspaper archive theme for the Unified Era archive.
Version: 1.1.0
Text Domain: koyori-base
*/

:root {
  --page: #f2f2f0;
  --paper: #fff;
  --ink: #111;
  --muted: #555;
  --quiet: #777;
  --line: #161616;
  --hair: #d6d6d2;
  --soft: #eeeeeb;
  --faint: #f8f8f6;
  --max: 1180px;
  --serif-cn: SimSun, STSong, "Noto Serif SC", "Songti SC", serif;
  --serif-en: "Times New Roman", Times, serif;
  --sans: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover,
a:focus {
  color: var(--muted);
}

img {
  max-width: 100%;
  height: auto;
}

.site-shell {
  width: min(var(--max), calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  border-left: 1px solid var(--hair);
  border-right: 1px solid var(--hair);
}

.site-header {
  padding: 18px 22px 0;
}

.masthead {
  padding: 14px 0 16px;
  border-top: 4px double var(--line);
  border-bottom: 4px double var(--line);
  text-align: center;
}

.publication-note,
.site-subtitle,
.issue-line,
.archive-kicker,
.entry-meta,
.mini-label,
.archive-code,
.term-count,
.footer-inner {
  font-family: var(--serif-en);
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  text-transform: uppercase;
}

.publication-note {
  margin: 0 0 8px;
}

.site-title {
  margin: 0;
  font-family: var(--serif-cn);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.12;
}

.site-title a {
  text-decoration: none;
}

.site-subtitle {
  margin: 5px 0 12px;
  font-size: 13px;
}

.issue-line {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--ink);
}

.primary-nav {
  margin: 12px 0 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--hair);
}

.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav li {
  display: flex;
  align-items: center;
}

.primary-nav li + li::before {
  content: "/";
  padding: 0 10px;
  color: var(--quiet);
}

.primary-nav a {
  font-size: 13px;
  text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a:focus {
  text-decoration: underline;
}

.site-main {
  padding: 24px 22px 46px;
}

.front-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.front-headline {
  margin: 4px 0 10px;
  font-family: var(--serif-cn);
  font-size: 34px;
  line-height: 1.18;
  font-weight: 700;
}

.front-copy {
  max-width: 760px;
  margin: 0;
  color: #222;
}

.index-panel {
  border: 1px solid var(--line);
  padding: 12px;
  background: var(--faint);
}

.section-block {
  margin-top: 28px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
  padding-bottom: 7px;
  border-bottom: 3px double var(--line);
  font-family: var(--serif-cn);
  font-size: 22px;
  line-height: 1.25;
}

.section-title::before {
  content: "■";
  font-family: var(--sans);
  font-size: 13px;
}

.section-title small {
  font-family: var(--serif-en);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

.board-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.board-link {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 10px;
  align-items: baseline;
  min-height: 58px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.board-link:hover,
.board-link:focus {
  background: var(--soft);
  color: var(--ink);
}

.board-code {
  font-family: var(--serif-en);
  font-size: 12px;
  color: var(--muted);
}

.board-name {
  font-family: var(--serif-cn);
  font-size: 18px;
  font-weight: 700;
}

.term-count {
  color: var(--quiet);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.archive-teaser {
  min-width: 0;
  padding: 14px;
  border-left: 1px solid var(--line);
}

.archive-teaser:first-child {
  border-left: 0;
}

.archive-thumb,
.archive-thumb-placeholder {
  display: block;
  aspect-ratio: 4 / 3;
  width: 100%;
  margin-bottom: 11px;
  border: 1px solid var(--line);
  background: var(--soft);
  overflow: hidden;
}

.archive-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.06);
  transition: filter 160ms ease;
}

.archive-thumb:hover img,
.archive-thumb:focus img {
  filter: grayscale(35%) contrast(1.03);
}

.archive-thumb-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--quiet);
  font-family: var(--serif-en);
  font-size: 12px;
  text-align: center;
}

.archive-thumb-placeholder::before,
.archive-thumb-placeholder::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--hair);
}

.archive-thumb-placeholder::before {
  top: 34%;
}

.archive-thumb-placeholder::after {
  top: 66%;
}

.archive-code {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.teaser-title {
  margin: 0 0 8px;
  font-family: var(--serif-cn);
  font-size: 22px;
  line-height: 1.25;
}

.teaser-title a {
  text-decoration: none;
}

.teaser-title a:hover,
.teaser-title a:focus {
  text-decoration: underline;
}

.teaser-excerpt {
  margin: 0;
  color: #333;
  font-size: 14px;
}

.latest-list,
.directory-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.latest-list li,
.directory-list li {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hair);
  align-items: baseline;
}

.latest-list a,
.directory-list a {
  text-decoration: none;
  font-family: var(--serif-cn);
  font-weight: 700;
}

.latest-list a:hover,
.directory-list a:hover {
  text-decoration: underline;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.search-form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 12px 0 0;
}

.search-field {
  min-width: 0;
  flex: 1;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.search-submit,
button,
input[type="submit"] {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
}

.search-submit:hover,
.search-submit:focus,
button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
  background: #444;
}

.archive-header,
.entry {
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
}

.archive-header {
  margin-bottom: 18px;
}

.archive-title,
.entry-title {
  margin: 0 0 10px;
  font-family: var(--serif-cn);
  font-size: 34px;
  line-height: 1.18;
}

.archive-description {
  max-width: 760px;
  color: var(--muted);
}

.post-list .entry {
  padding: 18px 0;
  border-bottom: 1px solid var(--hair);
}

.post-list .entry-title {
  font-size: 24px;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 14px;
}

.entry-content {
  max-width: 820px;
}

.entry-content h2,
.entry-content h3 {
  margin-top: 1.8em;
  font-family: var(--serif-cn);
  line-height: 1.35;
}

.entry-content blockquote {
  margin: 22px 0;
  padding: 8px 16px;
  border-left: 3px double var(--line);
  color: #333;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--line);
  padding: 8px;
}

.entry-featured {
  max-width: 820px;
  margin: 18px 0 20px;
  border: 1px solid var(--line);
}

.entry-featured img {
  display: block;
  width: 100%;
  filter: grayscale(100%) contrast(1.05);
}

.koyori-disclaimer {
  max-width: 820px;
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: var(--faint);
  color: var(--ink);
  font-size: 14px;
}

.pagination,
.nav-links,
.post-navigation {
  margin-top: 22px;
  font-size: 14px;
}

.page-numbers {
  display: inline-block;
  min-width: 30px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  text-align: center;
  text-decoration: none;
}

.page-numbers.current {
  background: var(--ink);
  color: var(--paper);
}

.empty-note {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--hair);
  color: var(--muted);
}

.site-footer {
  border-top: 4px double var(--line);
  padding: 14px 22px 18px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .site-shell {
    width: 100%;
    border-left: 0;
    border-right: 0;
  }

  .site-title {
    font-size: 38px;
  }

  .front-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .featured-grid,
  .board-index {
    grid-template-columns: 1fr;
  }

  .archive-teaser {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .archive-teaser:first-child {
    border-top: 0;
  }

  .latest-list li,
  .directory-list li {
    grid-template-columns: 86px 1fr;
  }

  .latest-list .term-count,
  .directory-list .term-count {
    grid-column: 2;
  }
}

@media (max-width: 560px) {
  .site-header,
  .site-main,
  .site-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .site-title {
    font-size: 32px;
  }

  .front-headline,
  .archive-title,
  .entry-title {
    font-size: 28px;
  }

  .issue-line {
    gap: 8px 14px;
  }

  .primary-nav ul {
    justify-content: flex-start;
  }

  .search-form {
    flex-direction: column;
  }

  .board-link {
    grid-template-columns: 64px 1fr auto;
    padding: 9px 10px;
  }
}
