/*
Theme Name: Zhou Book
Theme URI: https://zhouaihong.com/
Author: zhouaihong
Description: A standalone reading-focused WordPress theme with book-like single article pages.
Version: 2.0.0
Text Domain: zhou-book
*/

:root {
  --zhou-ink: #232235;
  --zhou-muted: #667085;
  --zhou-link: #0878bd;
  --zhou-paper: #fffaf0;
  --zhou-bg: #f4f1ea;
  --zhou-line: #e4ded2;
  --zhou-max: 1320px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  color: var(--zhou-ink);
  background: #f7f8fb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", Arial, sans-serif;
  line-height: 1.72;
}
a { color: var(--zhou-link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #075f95; }
img { max-width: 100%; height: auto; }

.zhou-site-header {
  border-bottom: 1px solid #e5e7eb;
  background: rgba(255,255,255,.94);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.zhou-header-inner {
  width: min(var(--zhou-max), calc(100% - 40px));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.zhou-brand { display: flex; flex-direction: column; text-decoration: none; color: var(--zhou-ink); }
.zhou-brand-title { font-size: 22px; font-weight: 800; line-height: 1.15; }
.zhou-brand-desc { color: var(--zhou-muted); font-size: 13px; margin-top: 2px; }
.zhou-nav .menu { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.zhou-nav li { position: relative; margin: 0; }
.zhou-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  color: #344054;
  font-weight: 650;
  line-height: 1.2;
  padding: 8px 10px;
  text-decoration: none;
  white-space: nowrap;
}
.zhou-nav a:hover,
.zhou-nav a:focus { background: #f2f4f7; color: var(--zhou-link); outline: 0; }
.zhou-nav .menu-item-has-children > a::after {
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  content: "";
  height: 6px;
  margin-left: 7px;
  transform: rotate(45deg) translateY(-2px);
  width: 6px;
}
.zhou-nav .sub-menu {
  min-width: 176px;
  display: block;
  list-style: none;
  margin: 0;
  padding: 8px;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 40;
  background: rgba(255,255,255,.98);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(16,24,40,.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}
.zhou-nav .sub-menu::before {
  content: "";
  display: block;
  height: 10px;
  left: 0;
  position: absolute;
  right: 0;
  top: -10px;
}
.zhou-nav li:hover > .sub-menu,
.zhou-nav li:focus-within > .sub-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.zhou-nav .sub-menu a { width: 100%; justify-content: space-between; padding: 9px 10px; }
.zhou-nav .sub-menu .sub-menu { left: calc(100% + 8px); top: -8px; }

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
.zhou-header-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.zhou-header-search { display: flex; align-items: center; gap: 6px; }
.zhou-header-search-field {
  width: 210px;
  height: 38px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--zhou-ink);
  font: inherit;
  line-height: 38px;
}
.zhou-header-search-field:focus {
  border-color: var(--zhou-link);
  box-shadow: 0 0 0 3px rgba(8, 120, 189, .12);
  outline: 0;
}
.zhou-header-search-submit,
.zhou-lucky-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.zhou-header-search-submit { border: 0; background: #0878bd; color: #fff; cursor: pointer; }
.zhou-lucky-link { border: 1px solid #d0d5dd; background: #fff; color: #344054; }
.zhou-lucky-link:hover { border-color: #0878bd; color: #0878bd; }

.zhou-main {
  width: min(var(--zhou-max), calc(100% - 40px));
  margin: 42px auto 70px;
}
.zhou-page-title {
  margin: 0 0 26px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.15;
  letter-spacing: 0;
}
.zhou-page-description { color: var(--zhou-muted); margin: -14px 0 28px; }
.zhou-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.zhou-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  min-height: 220px;
  box-shadow: 0 12px 34px rgba(16,24,40,.05);
}
.zhou-card-title { margin: 0 0 10px; font-size: 25px; line-height: 1.28; }
.zhou-card-title a { color: var(--zhou-ink); text-decoration: none; }
.zhou-card-title a:hover { color: var(--zhou-link); }
.zhou-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--zhou-muted); font-size: 14px; margin-bottom: 14px; }
.zhou-excerpt { color: #475467; }
.zhou-pagination { margin-top: 34px; display: flex; gap: 10px; flex-wrap: wrap; }
.zhou-pagination .page-numbers {
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 7px 12px;
  background: #fff;
  text-decoration: none;
}
.zhou-pagination .current { background: #1d2939; color: #fff; border-color: #1d2939; }
.zhou-empty, .zhou-404 {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: clamp(28px, 5vw, 54px);
}
.search-form { display: flex; gap: 10px; flex-wrap: wrap; }
.search-field { min-width: min(420px, 100%); padding: 12px 14px; border: 1px solid #d0d5dd; border-radius: 6px; }
.search-submit, button, input[type="submit"] {
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  background: #0878bd;
  color: #fff;
  cursor: pointer;
}

.entry-content { font-size: 18px; }
.entry-content pre { overflow: auto; }
.entry-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.zhou-comments { width: min(1120px, calc(100% - 40px)); margin: 0 auto 70px; }
.zhou-comments-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: clamp(24px, 4vw, 42px); }
.comment-list { padding-left: 0; list-style: none; }
.comment-list .comment { border-top: 1px solid #edf0f2; padding-top: 18px; margin-top: 18px; }
.comment-body { color: #344054; }
.comment-meta { font-size: 14px; color: var(--zhou-muted); }
.comment-content { margin-top: 8px; }
.comment-respond textarea, .comment-respond input[type="text"], .comment-respond input[type="email"], .comment-respond input[type="url"] {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 12px 14px;
}

.zhou-site-footer { border-top: 1px solid #e5e7eb; background: #fff; }
.zhou-footer-inner { width: min(var(--zhou-max), calc(100% - 40px)); margin: 0 auto; padding: 28px 0; color: var(--zhou-muted); }

@media (max-width: 980px) {
  .zhou-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .zhou-header-tools { width: 100%; flex-wrap: wrap; align-items: stretch; margin-left: 0; }
  .zhou-header-search { flex: 1 1 260px; }
  .zhou-header-search-field { flex: 1 1 auto; width: 100%; min-width: 0; }
  .zhou-header-inner { width: min(100% - 24px, var(--zhou-max)); align-items: flex-start; flex-direction: column; padding: 14px 0; }
  .zhou-nav { width: 100%; }
  .zhou-nav .menu { align-items: stretch; gap: 6px 8px; }
  .zhou-nav li { position: static; }
  .zhou-nav .sub-menu {
    flex-basis: 100%;
    min-width: 100%;
    opacity: 1;
    pointer-events: auto;
    position: static;
    transform: none;
    transition: none;
    box-shadow: none;
    margin: 0 0 4px 12px;
    padding: 4px 0 4px 10px;
    border: 0;
    border-left: 2px solid #e5e7eb;
    border-radius: 0;
    background: transparent;
  }
  .zhou-nav .sub-menu::before { display: none; }
  .zhou-nav .sub-menu a { min-height: 34px; padding: 7px 8px; }
  .zhou-main { width: min(100% - 24px, var(--zhou-max)); margin-top: 26px; }
  .zhou-post-grid { grid-template-columns: 1fr; }
}
