/*
Theme Name: Muan Journal
Theme URI: https://muankeji.cn
Author: Muan
Description: A quiet, Chinese-first journal for notes, projects, and everyday work.
Version: 1.0.2
Text Domain: muan-journal
*/

:root {
  --paper: #edf2ed;
  --paper-light: #f7f8f4;
  --ink: #172722;
  --muted: #586862;
  --forest: #294f3f;
  --forest-deep: #173328;
  --red: #bd5237;
  --blue: #c2d8d8;
  --rule: rgba(23, 39, 34, .18);
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(37, 66, 52, .13) .55px, transparent .7px);
  background-size: 5px 5px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
}

.site-main {
  flex: 1 0 auto;
}

.site-footer {
  flex: 0 0 auto;
}

body.admin-bar {
  min-height: calc(100vh - 32px);
}

body::before {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image: radial-gradient(rgba(22, 40, 32, .1) .45px, transparent .7px);
  background-size: 7px 7px;
  opacity: .22;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 160ms cubic-bezier(.2, .75, .25, 1);
}

a:hover {
  color: var(--red);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

button,
input {
  font: inherit;
}

.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;
}

.skip-link {
  position: absolute;
  z-index: 30;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  color: var(--paper-light);
  background: var(--forest-deep);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-width {
  width: min(1240px, calc(100% - 64px));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 2;
  background: rgba(247, 248, 244, .87);
  border-bottom: 1px solid var(--rule);
}

.site-header-inner {
  display: grid;
  min-height: 76px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
}

.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  width: max-content;
  font-weight: 700;
  text-decoration: none;
}

.site-brand-cn {
  font-family: var(--serif);
  font-size: 22px;
}

.site-brand-latin {
  color: var(--forest);
  font-size: 14px;
  font-weight: 600;
}

.site-nav {
  display: flex;
  justify-content: flex-end;
  gap: 26px;
}

.site-nav a {
  font-size: 14px;
  text-decoration: none;
}

.site-search {
  display: flex;
  width: 148px;
  align-items: center;
  border-bottom: 1px solid rgba(23, 39, 34, .48);
}

.site-search input {
  width: 100%;
  min-width: 0;
  padding: 6px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline-offset: 2px;
}

.site-search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.site-search button {
  padding: 5px 0 5px 8px;
  color: var(--forest);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 13px;
}

.hero {
  position: relative;
  display: flex;
  min-height: 500px;
  align-items: flex-end;
  overflow: hidden;
  color: var(--paper-light);
  background: var(--forest-deep);
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  object-position: center 52%;
}

.hero-shade {
  background: rgba(14, 41, 31, .62);
}

.hero-inner {
  position: relative;
  display: grid;
  width: min(1240px, calc(100% - 64px));
  min-height: 500px;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: end;
  gap: 40px;
  margin-inline: auto;
  padding: 58px 0 64px;
}

.hero-copy {
  max-width: 760px;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: #d8e5dd;
  font-size: 13px;
}

.hero-kicker::before {
  width: 28px;
  height: 2px;
  content: "";
  background: var(--red);
}

.hero h1 {
  max-width: 740px;
  margin: 0;
  font-family: var(--serif);
  font-size: 60px;
  font-weight: 600;
  line-height: 1.23;
}

.hero-intro {
  margin: 20px 0 0;
  color: #d9e2dc;
  font-size: 17px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding-bottom: 4px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .7);
  font-size: 14px;
  text-decoration: none;
}

.hero-link:hover {
  color: #f3c2a7;
}

.hero-stamp {
  justify-self: end;
  align-self: end;
  margin: 0 0 8px;
  padding: 10px 13px;
  color: #f4d0bd;
  border: 1px solid rgba(244, 208, 189, .74);
  font-family: var(--serif);
  font-size: 13px;
  writing-mode: vertical-rl;
}

.home-content {
  padding: 78px 0 92px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ink);
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.section-head h2,
.archive-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.3;
}

.section-all {
  padding-bottom: 4px;
  color: var(--forest);
  font-size: 14px;
  text-decoration: none;
}

.journal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, .72fr);
  align-items: start;
  gap: 88px;
  padding-top: 6px;
}

.post-list {
  min-width: 0;
}

.post-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 24px;
  padding: 27px 0 29px;
  border-bottom: 1px solid var(--rule);
}

.post-row:last-child {
  border-bottom-color: transparent;
}

.post-category {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
}

.post-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.45;
}

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

.post-excerpt {
  max-width: 660px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.post-date {
  padding-top: 3px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.empty-posts {
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
}

.empty-posts h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.empty-posts p {
  margin: 0;
  color: var(--muted);
}

.empty-posts a {
  display: inline-block;
  margin-top: 18px;
  color: var(--forest);
  font-size: 14px;
}

.journal-aside {
  margin-top: 32px;
  padding-top: 15px;
  border-top: 3px solid var(--forest);
}

.aside-mark {
  display: block;
  margin: 4px 0 8px;
  color: var(--red);
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
}

.journal-aside h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.journal-aside p {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.aside-link {
  color: var(--forest);
  font-size: 13px;
  text-decoration: none;
}

.aside-rule {
  height: 1px;
  margin: 30px 0 20px;
  background: var(--rule);
  border: 0;
}

.journal-aside h4 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-list a {
  font-family: var(--serif);
  font-size: 16px;
  text-decoration: none;
}

.note-band {
  padding: 36px 0;
  background: rgba(194, 216, 216, .45);
  border-top: 1px solid rgba(41, 79, 63, .16);
  border-bottom: 1px solid rgba(41, 79, 63, .16);
}

.note-band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.note-band p {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
}

.note-band a {
  flex: 0 0 auto;
  color: var(--forest);
  font-size: 14px;
}

.site-footer {
  padding: 48px 0 38px;
  background: var(--forest-deep);
  color: var(--paper-light);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 48px;
}

.footer-brand {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
}

.footer-note {
  margin: 6px 0 0;
  color: #c9d7cf;
  font-size: 13px;
}

.footer-nav {
  display: flex;
  gap: 22px;
}

.footer-nav a {
  color: #e4ece6;
  font-size: 13px;
  text-decoration: none;
}

.footer-links {
  display: grid;
  justify-items: end;
  gap: 14px;
}

.footer-icp {
  color: #c9d7cf;
  font-size: 12px;
  line-height: 1.6;
  text-decoration: none;
}

.article-wrap,
.page-wrap,
.archive-wrap {
  width: min(920px, calc(100% - 64px));
  margin: 0 auto;
  padding: 76px 0 104px;
}

.back-link {
  color: var(--forest);
  font-size: 13px;
  text-decoration: none;
}

.article-head,
.page-head,
.archive-head {
  max-width: 760px;
  margin: 28px 0 42px;
}

.article-head h1,
.page-head h1 {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 600;
  line-height: 1.35;
}

.article-content,
.page-content {
  max-width: 720px;
  font-size: 17px;
  line-height: 1.95;
}

.article-content h2,
.page-content h2 {
  margin-top: 2em;
  font-family: var(--serif);
  font-size: 29px;
  line-height: 1.4;
}

.article-content a,
.page-content a {
  color: var(--forest);
}

.article-content blockquote {
  margin: 30px 0;
  padding: 4px 0 4px 22px;
  color: var(--forest);
  border-left: 3px solid var(--red);
  font-family: var(--serif);
  font-size: 21px;
}

.article-content img {
  height: auto;
  margin: 28px 0;
}

.article-content pre {
  overflow-x: auto;
  padding: 18px;
  color: #edf2ed;
  background: var(--forest-deep);
  font-size: 14px;
}

.article-pagination {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 58px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}

.archive-head {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink);
}

.archive-head p {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 13px;
}

.pagination {
  display: flex;
  gap: 18px;
  margin-top: 32px;
}

.pagination a,
.pagination span {
  color: var(--forest);
  font-size: 14px;
}

.not-found {
  min-height: 430px;
  padding-top: 74px;
}

.not-found h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 48px;
}

.not-found p {
  color: var(--muted);
}

@media (max-width: 900px) {
  .site-width,
  .hero-inner {
    width: min(100% - 48px, 760px);
  }

  .site-header-inner {
    grid-template-columns: auto minmax(0, 1fr) 132px;
    gap: 14px;
    padding: 14px 0;
  }

  .site-nav {
    justify-content: flex-end;
    gap: 15px;
  }

  .site-search {
    display: flex;
    width: 132px;
  }

  .journal-grid {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 42px;
  }
}

@media (max-width: 782px) {
  body.admin-bar {
    min-height: calc(100vh - 46px);
  }
}

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .site-width,
  .hero-inner {
    width: calc(100% - 36px);
  }

  .site-header-inner {
    grid-template-columns: minmax(0, 1fr) 128px;
    gap: 10px;
    padding: 12px 0 13px;
  }

  .site-brand {
    grid-row: 1;
    grid-column: 1;
  }

  .site-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 20px;
    overflow-x: auto;
    padding: 2px 0 4px;
    white-space: nowrap;
  }

  .site-nav a {
    font-size: 13px;
  }

  .site-search {
    grid-row: 1;
    grid-column: 2;
    width: 128px;
  }

  .hero,
  .hero-inner {
    min-height: 430px;
  }

  .hero-image {
    object-position: 53% center;
  }

  .hero-shade {
    background: rgba(14, 41, 31, .68);
  }

  .hero-inner {
    grid-template-columns: 1fr 32px;
    gap: 10px;
    padding: 42px 0 42px;
  }

  .hero-copy {
    max-width: 480px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero-intro {
    font-size: 15px;
  }

  .hero-stamp {
    padding: 7px 5px;
    font-size: 11px;
  }

  .home-content {
    padding: 56px 0 62px;
  }

  .section-head h2,
  .archive-head h1 {
    font-size: 28px;
  }

  .section-all {
    font-size: 12px;
    white-space: nowrap;
  }

  .journal-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .post-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 22px 0;
  }

  .post-date {
    grid-row: 1;
    padding: 0;
    text-align: left;
  }

  .post-title {
    font-size: 22px;
  }

  .journal-aside {
    margin-top: 8px;
  }

  .note-band {
    padding: 26px 0;
  }

  .note-band-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .note-band p {
    font-size: 19px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-nav {
    flex-wrap: wrap;
    gap: 14px 20px;
  }

  .footer-links {
    justify-items: start;
  }

  .article-wrap,
  .page-wrap,
  .archive-wrap {
    width: calc(100% - 36px);
    padding: 52px 0 68px;
  }

  .article-head h1,
  .page-head h1 {
    font-size: 36px;
  }

  .article-content,
  .page-content {
    font-size: 16px;
  }

  .not-found h1 {
    font-size: 38px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
