/*
Theme Name: AUV OpenMagic CN News
Theme URI: https://openmagic.cn/
Author: AUV
Description: Custom editorial information theme for OpenMagic.cn.
Version: 0.2.1
Requires at least: 5.9
Requires PHP: 7.4
Text Domain: auv-openmagic-cn
*/

:root {
  --bg: #f7f4ec;
  --paper: #fffdf7;
  --paper-soft: #f0eadf;
  --ink: #221b16;
  --muted: #7c7166;
  --line: #ded4c3;
  --brand: #0f8d78;
  --brand-2: #b45f2a;
  --accent: #1d4f8f;
  --radius: 3px;
  --shadow: 0 12px 34px rgba(78, 61, 40, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  line-height: 1.75;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.wrap { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: var(--paper); border-bottom: 3px double var(--line); position: sticky; top: 0; z-index: 20; }
.topbar { display: grid; grid-template-columns: 340px minmax(0, 1fr); align-items: center; gap: 24px; min-height: 104px; }
.brand { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 14px; width: fit-content; }
.brand-mark { width: 58px; height: 58px; display: block; }
.brand-title { display: block; font-size: 32px; font-weight: 800; letter-spacing: 0; }
.brand-sub { display: block; font-size: 14px; color: var(--muted); margin-top: -2px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; white-space: nowrap; }
.main-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 2px 12px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; }
.main-nav a { padding: 7px 0; color: #3c332c; border-bottom: 1px solid transparent; font-weight: 650; font-size: 13px; }
.main-nav a:hover { border-color: var(--brand); color: var(--brand); }
.header-ad { border-top: 1px solid var(--line); padding: 10px 0; background: #faf7ef; }
.ad-slot { display: flex; align-items: center; justify-content: center; min-height: 110px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); }
.ad-slot-header-ad img, .ad-slot-infeed-ad img { display: block; width: min(100%, 728px); height: auto; max-height: 90px; object-fit: contain; }
.ad-slot-header-ad iframe, .ad-slot-infeed-ad iframe { max-width: 100%; max-height: 90px; }
.widget .ad-slot { min-height: 280px; padding: 10px; }
.widget .ad-slot img { width: min(100%, 300px); height: auto; max-height: none; object-fit: contain; }
.hero { padding: 28px 0 10px; }
.magazine-hero { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: stretch; }
.lead-story, .panel, .post-card, .article-shell, .widget { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.lead-story { min-height: 350px; display: flex; align-items: center; border-top: 6px solid var(--ink); }
.lead-body { padding: 38px 42px; }
.eyebrow { display: inline-flex; width: fit-content; padding: 3px 8px; background: var(--brand); color: #fff; border-radius: 2px; font: 750 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; }
h1, h2, h3 { line-height: 1.22; letter-spacing: 0; }
.lead-title { font-size: clamp(34px, 4.6vw, 58px); margin: 18px 0 14px; max-width: 760px; }
.lead-excerpt { color: var(--muted); font-size: 17px; max-width: 720px; }
.btn { display: inline-flex; width: fit-content; align-items: center; justify-content: center; margin-top: 18px; padding: 9px 13px; border-radius: var(--radius); background: var(--ink); color: #fff; font: 760 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; }
.panel { padding: 22px; }
.panel-title { margin: 0 0 14px; font-size: 20px; border-bottom: 2px solid var(--ink); padding-bottom: 9px; }
.trend-list { display: grid; gap: 0; }
.trend-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.trend-item:last-child { border-bottom: 0; }
.trend-item strong { display: block; font-size: 16px; line-height: 1.35; }
.trend-item span, .meta { color: var(--muted); font: 12px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; padding: 20px 0 44px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 16px; border-bottom: 3px double var(--line); padding-bottom: 10px; }
.section-head h2 { margin: 0; font-size: 26px; }
.magazine-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.post-card { min-height: 210px; display: flex; flex-direction: column; }
.post-card.has-thumb .post-thumb { display: block; height: 150px; border-bottom: 1px solid var(--line); overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-body { padding: 18px; }
.cat { color: var(--brand); font: 800 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; }
.post-card h2, .post-card h3 { margin: 8px 0; font-size: 22px; }
.excerpt { color: #5d5148; font-size: 15px; margin-top: 9px; }
.sidebar { display: grid; gap: 16px; }
.widget { padding: 16px; overflow: hidden; }
.widget h2, .widget h3 { font-size: 17px; margin: 0 0 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.archive-hero { padding: 30px 0 8px; }
.archive-card { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-top: 6px solid var(--brand); border-radius: var(--radius); padding: 30px 34px; box-shadow: var(--shadow); }
.archive-card p { color: var(--muted); max-width: 720px; }
.article-shell { overflow: hidden; }
.article-cover img { width: 100%; max-height: 420px; object-fit: cover; display: block; }
.article-body { padding: min(48px, 6vw); background: var(--paper); }
.article-body h1 { font-size: clamp(32px, 4.3vw, 56px); margin: 12px 0 10px; }
.article-content { font-size: 19px; color: #332820; }
.article-content p { margin: 0 0 1.08em; }
.site-footer { border-top: 3px double var(--line); padding: 28px 0; background: #221b16; color: #eee6da; }
body.single .layout { display: block; width: min(900px, calc(100% - 32px)); }
body.single .article-shell { margin: 0 auto; }
body.single .sidebar { margin-top: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .topbar, .magazine-hero, .layout { display: block; }
  .brand { grid-template-columns: 48px minmax(0, 1fr); }
  .brand-mark { width: 48px; height: 48px; }
  .brand-title { font-size: 28px; }
  .brand-sub { white-space: normal; }
  .main-nav { justify-content: flex-start; margin: 12px 0 0; }
  .lead-body, .panel, .article-body { padding: 20px; }
  .magazine-grid { grid-template-columns: 1fr; }
  .sidebar { margin-top: 18px; }
  body.single .sidebar { grid-template-columns: 1fr; }
}
