/*
Theme Name: Epoch Magazine
Theme URI: https://www.epochaudio.cn/
Author: Epoch Audio
Author URI: https://www.epochaudio.cn/
Description: Epoch Audio 杂志编辑风主题：卷首语、产品、指南、唱片册、随笔与关于。自包含，无外部依赖。
Version: 1.0
Requires at least: 6.0
Tested up to: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: epoch-magazine
*/

/* ============================================================
   以下为 redesign 设计稿 CSS，逐字复制，token 与规则不得改动
   ============================================================ */

:root {
  --bg:      oklch(98% 0.004 95);
  --surface: oklch(100% 0.002 95);
  --fg:      oklch(20% 0.018 70);
  --muted:   oklch(48% 0.012 70);
  --border:  oklch(90% 0.006 95);
  --accent:  oklch(52% 0.10 28);

  --font-display: 'Iowan Old Style', 'Charter', 'Songti SC', 'STSong', Georgia, 'Noto Serif SC', serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', 'Menlo', 'Courier New', monospace;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 4rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--surface); }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--fg); color: var(--bg);
  padding: 0.5rem 1rem; font-size: 0.875rem; z-index: 10;
}
.skip-link:focus { left: 0; }

.wrap { max-width: 76rem; margin: 0 auto; padding: 0 var(--gutter); }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Masthead ---------- */
.masthead { border-bottom: 1px solid var(--border); }
.masthead-top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.masthead-brand { text-align: center; padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.masthead-brand h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 9vw, 6.5rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.masthead-brand .tagline {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.375rem);
  color: var(--muted);
}

.site-nav {
  display: flex; justify-content: center; flex-wrap: wrap;
  border-top: 1px solid var(--border);
}
.site-nav a {
  padding: 0.875rem 1.375rem;
  font-size: 0.9375rem;
  position: relative;
  color: var(--fg);
  transition: color 0.15s ease;
}
.site-nav a + a { border-left: 1px solid var(--border); }
.site-nav a::after {
  content: ""; position: absolute; left: 1.375rem; right: 1.375rem; bottom: 0.625rem;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s ease;
}
.site-nav a:hover::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: clamp(2.5rem, 6vw, 5rem) 0;
  align-items: end;
}
.hero-lede h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.28;
  font-weight: 700;
  margin-top: 1.25rem;
}
.hero-lede p {
  margin-top: 1.5rem;
  max-width: var(--measure);
  color: var(--muted);
}
.hero figure { margin: 0; }
.hero img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border);
}
.hero figcaption {
  margin-top: 0.625rem;
  display: flex; justify-content: space-between; gap: 1rem;
}

/* ---------- Sections ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--border); }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; margin-bottom: clamp(1.75rem, 4vw, 3rem); flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 700;
}

/* 产品 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
}
.product {
  border-top: 2px solid var(--fg);
  padding-top: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.product img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--border);
}
.product h3 {
  font-family: var(--font-display);
  font-size: 1.625rem; font-weight: 700; line-height: 1.25;
}
.product h3 .cn { margin-left: 0.375rem; }
.product p { color: var(--muted); max-width: var(--measure); }
.product dl {
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.04em; color: var(--muted);
  border-top: 1px solid var(--border);
}
.product dl div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border);
}
.product dl dt { color: var(--fg); }
.text-link {
  font-size: 0.9375rem;
  color: var(--fg);
  border-bottom: 1px solid var(--fg);
  padding-bottom: 1px;
  align-self: flex-start;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.text-link:hover { color: var(--accent); border-color: var(--accent); }

/* 指南列表 */
.guide-list { list-style: none; }
.guide-list li a, .guide-list li .row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: 1.25rem; align-items: baseline;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--border);
}
.guide-list li:first-child a, .guide-list li:first-child .row { border-top: 1px solid var(--border); }
.guide-index { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.guide-title {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 700; line-height: 1.4;
  transition: color 0.15s ease;
}
.guide-cat { display: block; margin-top: 0.25rem; }
.guide-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.guide-list a:hover .guide-title { color: var(--accent); }

/* 唱片册 */
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}
.album {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.75rem 1.5rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  min-height: 15rem;
  transition: border-color 0.15s ease;
}
.album:hover { border-color: var(--fg); }
.album .catalog { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.16em; color: var(--accent); text-transform: uppercase; }
.album h3 {
  font-family: var(--font-display);
  font-size: 1.375rem; font-weight: 700; line-height: 1.35;
}
.album .composer { color: var(--muted); font-size: 0.9375rem; }
.album .album-meta {
  margin-top: auto;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted);
  border-top: 1px solid var(--border); padding-top: 0.625rem;
}

/* 随笔引文 */
.pullquote { max-width: 44rem; margin: 0 auto; text-align: center; }
.pullquote blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.375rem, 3vw, 2rem);
  line-height: 1.5;
}
.pullquote cite {
  display: block; margin-top: 1.25rem;
  font-family: var(--font-mono); font-style: normal;
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}

/* 关于 */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.about-copy p { max-width: var(--measure); }
.about-copy p + p { margin-top: 1rem; }
.about-copy .muted { color: var(--muted); }
.qr-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.qr { width: 8.75rem; }
.qr img { width: 100%; height: auto; display: block; border: 1px solid var(--border); }
.qr figcaption { margin-top: 0.5rem; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em; color: var(--muted); line-height: 1.5; }
.about-links { margin-top: 1.75rem; display: flex; gap: 2rem; flex-wrap: wrap; }

/* Footer */
.site-footer {
  border-top: 2px solid var(--fg);
  margin-top: 2rem;
  padding: 2rem 0 2.5rem;
}
.footer-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap;
}
.footer-row .kicker a { color: var(--muted); }
.footer-row .kicker a:hover { color: var(--accent); }

@media (max-width: 56rem) {
  .hero, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .product-grid, .album-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-list li a, .guide-list li .row { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .guide-date { grid-column: 2; }
  .site-nav a + a { border-left: none; }
  .site-nav a { padding: 0.75rem 1rem; }
}

/* ============================================================
   以下为 WordPress 主题新增样式，沿用同一设计语言
   ============================================================ */

/* ---------- 导航（wp_nav_menu 输出 ul/li 结构） ---------- */
.site-nav ul { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; }
.site-nav li { display: flex; }
.site-nav li + li { border-left: 1px solid var(--border); }
.site-nav .current-menu-item > a,
.site-nav .current-cat > a { color: var(--accent); }

/* ---------- 区尾「全部文章」链接 ---------- */
.section-more { margin-top: 1.75rem; }

/* ---------- 整卡可点 ---------- */
a.album { color: inherit; }
.pullquote-link { display: block; }
.pullquote-link blockquote { transition: color 0.15s ease; }
.pullquote-link:hover blockquote { color: var(--accent); }

/* ---------- 归档 / 搜索 页头 ---------- */
.archive-head { margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.archive-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 1rem;
  overflow-wrap: break-word;
}
.archive-description { margin-top: 0.75rem; max-width: var(--measure); color: var(--muted); }

/* ---------- 文章内页 ---------- */
.single-head {
  text-align: center;
  max-width: 52rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(1.75rem, 4vw, 2.5rem);
}
.single-kicker a { color: var(--muted); transition: color 0.15s ease; }
.single-kicker a:hover { color: var(--accent); }
.single-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.2;
  margin-top: 1.25rem;
  overflow-wrap: break-word;
}
.single-author { margin-top: 1rem; }

.featured-image { max-width: 76rem; margin: 0 auto clamp(1.75rem, 4vw, 3rem); padding: 0 var(--gutter); }
.featured-image img { display: block; width: 100%; height: auto; border: 1px solid var(--border); }

/* ---------- 正文排版 ---------- */
.entry-content {
  max-width: 38rem;
  margin: 0 auto;
  padding: 0 var(--gutter) 2.5rem;
  overflow-wrap: break-word;
}
.entry-content p { margin: 0 0 1.25em; }
.entry-content h2,
.entry-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.35;
  margin: 2em 0 0.75em;
}
.entry-content h2 { font-size: 1.625rem; }
.entry-content h3 { font-size: 1.25rem; }
.entry-content h4,
.entry-content h5,
.entry-content h6 { margin: 1.5em 0 0.75em; line-height: 1.4; }
.entry-content blockquote {
  border-left: 2px solid var(--fg);
  margin: 1.5em 0;
  padding-left: 1.25em;
  font-family: var(--font-display);
  font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content img { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); }
/* 去除 WP 编辑器给图片容器加的默认外边距，统一由下方规则控制 */
.entry-content figure,
.entry-content .wp-caption,
.entry-content .wp-block-image { margin: 1.5em 0; max-width: 100%; }
.entry-content figcaption,
.entry-content .wp-caption-text {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.entry-content ul,
.entry-content ol { margin: 0 0 1.25em 1.5em; }
.entry-content li { margin-bottom: 0.375em; }
.entry-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.entry-content a:hover { color: var(--accent); }
.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
}
.entry-content pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin: 0 0 1.25em;
  overflow-x: auto;
}
.entry-content pre code { background: none; border: none; padding: 0; font-size: inherit; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.25em; font-size: 0.9375rem; }
.entry-content th,
.entry-content td { border-bottom: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; }
.entry-content th { font-weight: 600; }
.entry-content hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.entry-content .alignleft { float: left; margin-right: 1.25em; }
.entry-content .alignright { float: right; margin-left: 1.25em; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }

/* ---------- 文底：标签与篇目导航 ---------- */
.single-footer { max-width: 38rem; margin: 0 auto; padding: 0 var(--gutter) 3rem; }
.post-tags { margin-bottom: 1.5rem; }
.post-tags a { color: var(--muted); transition: color 0.15s ease; }
.post-tags a:hover { color: var(--accent); }

.posts-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
}
.posts-nav a {
  font-size: 0.9375rem;
  color: var(--fg);
  border-bottom: 1px solid var(--fg);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.posts-nav a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 评论区 ---------- */
.comments-area {
  max-width: 38rem;
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--border);
}
.comments-area .comments-title,
.comments-area .comment-reply-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.comment-list { list-style: none; margin-bottom: 2rem; }
.comment-list .comment { padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.comment-list .children { list-style: none; margin-left: 2rem; }
.comment-list .children .comment { border-bottom: none; border-top: 1px solid var(--border); }
.comment-author { display: flex; align-items: center; gap: 0.75rem; }
.comment-author .avatar { display: block; border-radius: 0; border: 1px solid var(--border); }
.comment-author .fn { font-weight: 600; font-style: normal; }
.comment-author .says { display: none; }
.comment-metadata {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.comment-metadata a { color: var(--muted); }
.comment-metadata a:hover { color: var(--accent); }
.comment-body p { margin: 0.75rem 0 0; }
.comment-awaiting-moderation { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.reply { margin-top: 0.5rem; }
.reply a,
.comment-edit-link {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.15s ease;
}
.reply a:hover,
.comment-edit-link:hover { color: var(--accent); }
.comment-notes { margin-bottom: 1.25rem; }

.comment-form label {
  display: block;
  margin-bottom: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  padding: 0.625rem 0.75rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s ease;
}
.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--fg); }
/* 全站唯一实心按钮：评论提交 */
.comment-form .submit {
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.75rem 1.75rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.comment-form .submit:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}

/* ---------- 搜索框 ---------- */
.search-form {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  max-width: 38rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.search-field {
  flex: 1;
  min-width: 12rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.375rem 0;
  font: inherit;
  color: var(--fg);
}
.search-field:focus { outline: none; border-bottom-color: var(--fg); }
.search-submit {
  background: none;
  border: none;
  border-bottom: 1px solid var(--fg);
  padding: 0 0 1px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--fg);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.search-submit:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: clamp(4rem, 10vw, 7rem) var(--gutter); }
.not-found-code {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 18vw, 9rem);
  font-weight: 700;
  line-height: 1;
}
.not-found-text { margin: 1.25rem 0 2rem; color: var(--muted); }
.not-found .text-link { display: inline-block; }

@media (max-width: 56rem) {
  .site-nav li + li { border-left: none; }
  .comment-list .children { margin-left: 1rem; }
}
