/*
Theme Name: 山河志 Shanhe Atlas
Description: 中国风景名胜图志。轻量响应式主题。
Version: 3.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: shanhe
*/

:root {
  color-scheme: light;
  --paper: #f4f9fd;
  --surface: #fff;
  --mist: #e7f3fc;
  --ink: #102f48;
  --muted: #49657a;
  --line: #d2e4f1;
  --blue: #155c8e;
  --blue-deep: #10486f;
  --accent: #2479ac;
  --serif: 'Songti SC', 'Noto Serif CJK SC', 'STSong', 'SimSun', Georgia, serif;
  --sans: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; }
a { color: inherit; }
button { font: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #2784be; outline-offset: 4px; }
.wrap { width: min(1280px, calc(100% - 96px)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 50; top: 8px; left: 8px; padding: 12px 18px; color: white; background: var(--blue); }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; flex: none; }
.brand-mark { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 13px; background: var(--blue); color: white; }
.brand-mark svg { width: 32px; height: 32px; }
.brand-text { font: 700 23px/1.03 var(--serif); letter-spacing: .08em; }
.brand-text small { display: block; margin-top: 5px; font: 700 8px/1 var(--sans); letter-spacing: .20em; }
.site-nav { display: flex; align-items: center; gap: clamp(15px, 3vw, 39px); font-size: 14px; }
.site-nav a { text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-cta { display: inline-flex; gap: 13px; align-items: center; padding: 8px 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--mist); color: var(--blue-deep); }

.hero { background: linear-gradient(135deg, #f3faff 0%, #e3f2fd 56%, #d7ebfb 100%); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: minmax(0, .86fr) minmax(0, 1.24fr); gap: clamp(30px, 4vw, 66px); align-items: center; padding-block: clamp(44px, 6vw, 90px); }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--blue-deep); font-weight: 750; font-size: 12px; letter-spacing: .14em; }
.eyebrow > span { background: var(--accent); width: 15px; height: 2px; flex: none; }
.hero h1 { font-size: clamp(53px, 6.6vw, 99px); letter-spacing: -.075em; margin: 15px 0 22px; }
.hero h1 span { display: block; color: var(--blue); }
.hero-deck { max-width: 25em; color: var(--muted); font-size: clamp(15px, 1.5vw, 18px); line-height: 1.85; }
.hero-search { display: flex; gap: 6px; margin-top: 23px; max-width: 440px; padding: 5px; border: 1px solid #b6d4ea; border-radius: 13px; background: white; box-shadow: 0 6px 24px #2045670b; }
.hero-search input { min-width: 0; width: 100%; padding: 6px 9px; border: 0; border-radius: 7px; font: inherit; color: var(--ink); }
.hero-search button { flex: none; }
.hero-directory { margin-top: 16px; }
.hero-image-link { display: block; position: relative; overflow: hidden; aspect-ratio: 1.42; border-radius: 20px; box-shadow: 0 22px 55px #123d6224; background: #c8dfef; }
.hero-image-link::after { content: ''; position: absolute; inset: auto 0 0; height: 36%; background: linear-gradient(transparent, #061d30b8); pointer-events: none; }
.hero-photo { height: 100%; width: 100%; object-fit: cover; }
.hero-caption { position: absolute; z-index: 1; bottom: 18px; left: 21px; color: white; font-size: clamp(19px, 2.1vw, 28px); font-weight: 750; }
.hero-caption small { display: block; font-size: 12px; letter-spacing: .09em; font-weight: 500; }
.hero-credit { margin-top: 9px; color: var(--muted); font-size: 12px; text-align: right; overflow-wrap: anywhere; }

.explore { padding-block: clamp(61px, 7vw, 100px) clamp(74px, 8vw, 116px); }
.section-heading { margin: 15px 0 28px; display: flex; justify-content: space-between; gap: 18px; align-items: end; }
.section-heading h2, .notes h2 { font-size: clamp(37px, 4.4vw, 67px); letter-spacing: -.045em; }
.section-heading p, .notes p:not(.eyebrow) { color: var(--muted); line-height: 1.8; }
.place-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.place-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; overflow: clip; }
.card-link { display: block; height: 100%; text-decoration: none; }
.card-link:focus-visible { outline-offset: -4px; }
.card-media { position: relative; aspect-ratio: 1.6; background: #dcecf8; overflow: hidden; }
.card-photo { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.illustration-tag { position: absolute; bottom: 9px; left: 9px; padding: 3px 8px; border-radius: 6px; background: #fff; color: var(--blue-deep); font-size: 11px; }
.card-link:hover .card-photo { transform: scale(1.045); }
.card-body { padding: 18px 45px 21px 19px; position: relative; }
.card-meta { color: var(--blue-deep); font-size: 12px; font-weight: 700; letter-spacing: .05em; }
.card-body h3 { font-size: clamp(21px, 2.15vw, 30px); margin-block: 8px 9px; }
.card-copy { color: var(--muted); font-size: 14px; line-height: 1.65; }
.card-arrow { display: grid; place-items: center; width: 29px; height: 29px; position: absolute; right: 13px; top: 19px; border: 1px solid var(--line); border-radius: 100px; font-size: 15px; }
.card-link:hover .card-arrow { background: var(--blue); color: white; border-color: var(--blue); }

.region-section { background: var(--mist); padding-block: clamp(34px, 6vw, 70px); border-block: 1px solid var(--line); }
.region-inner { display: grid; grid-template-columns: minmax(190px, .75fr) 2fr; gap: 25px; align-items: center; }
.region-inner h2 { font-size: clamp(29px, 4.1vw, 55px); letter-spacing: -.05em; }
.region-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.region-links a { display: flex; justify-content: space-between; gap: 4px; padding: 12px; color: var(--blue-deep); background: var(--surface); border-radius: 10px; border: 1px solid var(--line); text-decoration: none; }
.region-links a:hover { border-color: var(--accent); }
.notes { padding-block: clamp(54px, 7vw, 94px); }
.notes-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(26px, 7vw, 100px); align-items: center; }
.notes-photo { position: relative; border-radius: 17px; overflow: hidden; background: #dcecf8; }
.notes-photo img { width: 100%; aspect-ratio: 1.45; object-fit: cover; }
.notes-photo figcaption { position: absolute; left: 12px; bottom: 12px; background: var(--surface); color: var(--ink); border-radius: 100px; padding: 5px 10px; font-size: 11px; }
.notes h2 { margin-block: 14px 20px; }
.notes p:not(.eyebrow) { max-width: 29em; }
.text-link, .back-link { display: inline-flex; gap: 10px; color: var(--blue-deep); font-weight: 700; text-underline-offset: 5px; }
.text-link { margin-top: 19px; }
.text-link:hover, .back-link:hover { color: var(--accent); }
.site-footer { background: #123754; color: #eef7fd; padding-block: 38px; }
.footer-inner { display: flex; gap: 26px; justify-content: space-between; align-items: baseline; }
.footer-brand { font: 700 25px var(--serif); text-decoration: none; }
.footer-inner p, .photo-credits { margin-top: 7px; font-size: 13px; }
.photo-credits { max-width: 580px; }
.photo-credits summary { cursor: pointer; }
.photo-credits ul, .story-media ul { padding-left: 1.2em; overflow-wrap: anywhere; }

.archive { padding-block: 74px 100px; min-height: 62vh; }
.archive h1, .story h1 { font-size: clamp(40px, 5.5vw, 76px); letter-spacing: -.05em; margin: 13px 0 22px; }
.story { padding-block: clamp(37px, 6vw, 85px) 94px; }
.story-heading { max-width: 1120px; margin-inline: auto; }
.story-heading .eyebrow { margin-top: 26px; }
.story-deck { font-size: clamp(17px, 2.3vw, 23px); color: var(--muted); margin-bottom: 29px; }
.story-media { max-width: 1120px; margin: 25px auto 0; }
.story-photo { width: 100%; height: auto; max-height: 630px; aspect-ratio: 1.75; object-fit: cover; border-radius: 17px; }
.story-media figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.story-layout { max-width: 1120px; margin: 31px auto 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, .33fr); gap: clamp(25px, 5vw, 74px); align-items: start; }
.story-content { min-width: 0; font-size: clamp(16px, 1.8vw, 19px); line-height: 1.9; overflow-wrap: anywhere; }
.story-content h2 { margin: 35px 0 12px; font-size: clamp(26px, 3.2vw, 35px); }
.story-content > h2:first-child { margin-top: 0; }
.story-content p, .story-content ul { margin: 0 0 19px; }
.story-content a { text-underline-offset: 4px; }

@media (max-width: 880px) {
  .wrap { width: calc(100% - 48px); }
  .place-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .wrap { width: calc(100% - 36px); }
  .header-inner { min-height: 64px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mark svg { width: 27px; height: 27px; }
  .brand-text { font-size: 20px; }
  .site-nav { font-size: 12px; gap: 12px; }
  .site-nav .nav-cta { display: none; }
  .hero h1 { font-size: clamp(50px, 12vw, 67px); }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .section-heading p, .notes p:not(.eyebrow) { font-size: 14px; }
  .place-grid, .notes-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { flex-direction: column; gap: 10px; }
  .story-photo { aspect-ratio: 1.45; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.site-nav [aria-current="page"] { text-decoration: underline; text-underline-offset: .4em; }
.category-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.category-links a { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; text-decoration: none; font-size: 13px; }
.category-links a:hover { background: var(--blue); color: white; }
.directory, .member-page { padding-block: clamp(36px, 7vw, 92px); min-height: 65vh; }
.directory-heading h1, .member-intro h1 { font-size: clamp(43px, 6vw, 82px); letter-spacing: -.055em; }
.directory-heading p, .member-intro p { margin-top: 13px; color: var(--muted); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.breadcrumbs a { color: var(--blue-deep); text-underline-offset: 3px; }
.directory-tools { padding: clamp(19px, 4vw, 43px); border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(135deg,#edf7ff,#ddecfa); }
.directory-filter { display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; align-items: end; gap: 14px; margin-top: 25px; }
.directory-filter label, .member-form label, .comment-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.directory-filter input, .directory-filter select, .member-form input, .comment-form textarea { width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid #aecadd; border-radius: 8px; min-height: 45px; color: var(--ink); font: inherit; }
.directory-filter input, .directory-filter select, .member-form input { font-weight: 400; }
.action-button { display: inline-flex; align-items: center; justify-content: center; min-height: 45px; padding: 9px 17px; border-radius: 8px; background: var(--blue); border: 1px solid var(--blue); color: white; text-decoration: none; font-weight: 700; cursor: pointer; }
.action-button:hover { background: var(--blue-deep); }
.directory-results { margin-block: 24px 13px; display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 14px; }
.directory-results strong { color: var(--ink); }
.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.directory-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; overflow: clip; }
.directory-card a { display: block; height: 100%; text-decoration: none; border-radius: inherit; }
.directory-card a:focus-visible { outline-offset: -4px; }
.directory-card a:hover { background: #f4faff; }
.directory-card a:hover .card-photo { transform: scale(1.035); }
.directory-card-body { padding: 16px 18px 18px; }
.directory-card h2 { display: flex; justify-content: space-between; gap: 12px; font-size: clamp(22px, 2.1vw, 29px); margin-block: 8px; }
.directory-card h2 span { font: 400 16px var(--sans); color: var(--blue); }
.directory-card .card-copy { line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.directory-pages { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.directory-pages .page-numbers { padding: 6px 12px; border-radius: 7px; text-decoration: none; }
.directory-pages .current, .directory-pages a:hover { background: var(--blue); color: white; }
.directory-empty { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 22px; }
.directory-empty p { margin-top: 10px; }
.member-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: clamp(26px, 6vw, 84px); align-items: start; }
.member-panel, .discussion { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(18px, 4vw, 34px); }
.member-panel h2, .discussion h2 { font-size: clamp(27px, 3.5vw, 36px); margin-bottom: 12px; }
.member-panel > p { margin-bottom: 17px; }
.member-panel .text-link { margin-inline-start: 12px; }
.member-form { display: grid; gap: 12px; }
.member-form .action-button { justify-self: start; }
.form-hint { color: var(--muted); font-size: 13px; }
.form-error { color: #8a2b1f; padding: 9px 12px; background: #f5e8df; border-radius: 7px; }
.member-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.discussion { max-width: 710px; margin: 25px auto 0; }
.discussion-signin { margin-top: 14px; }
.discussion-signin a { margin-inline: .25em; }
.discussion .comment-reply-title { margin-top: 22px; font-size: 23px; }
.comment-form { margin-top: 10px; }
.comment-form textarea { display: block; resize: vertical; margin-top: 6px; }
.comment-form .form-hint, .comment-form .form-submit { margin-top: 9px; }
.comment-list { padding: 0; list-style: none; overflow-wrap: anywhere; }
.comment-list li { border-top: 1px solid var(--line); padding-block: 15px; }
.comment-list .comment-meta { font-size: 13px; color: var(--muted); }
.comment-list .comment-content { margin-top: 8px; }
.story-meta { display: flex; flex-wrap: wrap; gap: 9px; color: var(--blue-deep); font-size: 13px; }
.story-meta > * { padding: 4px 10px; border-radius: 7px; background: var(--mist); }
.story-related { padding: 19px; background: var(--mist); border: 1px solid var(--line); border-radius: 14px; }
.story-related h2 { font-size: 22px; }
.story-related ul { list-style: none; margin: 14px 0; padding: 0; }
.story-related li { border-bottom: 1px solid var(--line); }
.story-related li a { display: flex; justify-content: space-between; gap: 6px; padding-block: 8px; text-decoration: none; }
.story-related li a:hover { color: var(--accent); }
.story-related .text-link { margin-top: 0; font-size: 14px; }

@media (max-width: 880px) {
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-filter { grid-template-columns: 1fr 1fr; }
  .directory-search { grid-column: 1 / -1; }
  .directory-filter .action-button { justify-self: start; }
}
@media (max-width: 700px) {
  .hero-inner, .region-inner, .story-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-inner { gap: 27px; }
  .hero-image-link { aspect-ratio: 1.6; border-radius: 15px; }
}
@media (max-width: 600px) {
  .site-nav .nav-cta { display: inline-flex; padding: 4px 7px; }
  .site-nav { gap: 8px; }
  .directory-grid, .member-page { grid-template-columns: minmax(0, 1fr); }
  .directory-filter { gap: 10px; }
  .region-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explore .text-link { margin-top: 0; }
}
