/*
Theme Name: 南步村 · 岭南水乡
Theme URI: https://wp.gdcx168.com/
Author: 南步村数字乡村展示平台
Author URI: https://wp.gdcx168.com/
Description: 为广州市番禺区新造镇南步村定制的单页展示主题：千年古村 · 岭南水乡 · 湾区智核邻畔。包含村史源流、大事记、水乡风貌、时代新篇等版块，内置滚动显现动画、数字统计、响应式布局。
Version: 1.1.3
Requires at least: 5.0
Tested up to: 6.7
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nanbu
Tags: one-column, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   南步村主题样式
   配色：墨绿（黛青）× 赤陶朱砂 × 宣纸暖白
   ========================================================================== */

:root {
    --ink: #243B35;        /* 墨绿主色 */
    --deep: #16241F;       /* 深墨 */
    --accent: #C1502E;     /* 赤陶朱砂 */
    --accent-dark: #9C3E22;
    --gold: #B98A2F;       /* 鎏金点缀 */
    --bg: #F7F4EC;         /* 宣纸暖白 */
    --paper: #FFFFFF;
    --text: #2E2A26;
    --muted: #6F6A63;
    --line: #E5DFD2;
    --shadow: 0 10px 30px rgba(36, 59, 53, 0.10);
    --radius: 10px;
    --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "Microsoft YaHei", serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--serif);
    color: var(--text);
    line-height: 1.9;
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
}

/* 锚点定位时为固定导航留出空间 */
section[id] {
    scroll-margin-top: 76px;
}

/* --------------------------------------------------------------------------
   顶部导航
   -------------------------------------------------------------------------- */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 5%;
    transition: background 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease;
    background: linear-gradient(rgba(22, 36, 31, 0.35), rgba(22, 36, 31, 0));
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 18px rgba(36, 59, 53, 0.12);
    padding: 10px 5%;
    backdrop-filter: blur(8px);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    transition: color 0.35s ease;
}

.site-header.scrolled .brand {
    color: var(--ink);
}

.brand .brand-name {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 4px;
}

.brand .brand-sub {
    font-size: 0.8rem;
    letter-spacing: 2px;
    opacity: 0.85;
    border-left: 1px solid currentColor;
    padding-left: 10px;
}

.site-header.scrolled .brand .brand-sub {
    color: var(--muted);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 兼容后台自定义菜单输出的 ul/li 结构 */
.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav li {
    margin: 0;
}

.site-nav a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1rem;
    letter-spacing: 2px;
    padding: 6px 14px;
    border-radius: 999px;
    transition: color 0.3s ease, background 0.3s ease;
}

.site-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.site-header.scrolled .site-nav a {
    color: var(--text);
}

.site-header.scrolled .site-nav a:hover {
    color: var(--accent);
    background: rgba(193, 80, 46, 0.08);
}

/* --------------------------------------------------------------------------
   首屏 Hero
   -------------------------------------------------------------------------- */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    padding: 120px 20px 80px;
    background:
        linear-gradient(rgba(22, 36, 31, 0.45), rgba(22, 36, 31, 0.62)),
        var(--hero-img, url('https://image.pollinations.ai/prompt/aerial%20view%20of%20Lingnan%20water%20town%20village%20rivers%20boats%20banyan%20trees%20sunset%20Guangzhou%20China%20cinematic?width=1920&height=1080&nologo=true&seed=1107')) center/cover no-repeat,
        var(--deep);
}

.hero .eyebrow {
    font-size: 0.95rem;
    letter-spacing: 6px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 22px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.hero .eyebrow::before,
.hero .eyebrow::after {
    content: "";
    width: 36px;
    height: 1px;
    background: rgba(255, 255, 255, 0.55);
}

.hero h2 {
    font-size: clamp(3rem, 8vw, 5.2rem);
    letter-spacing: 22px;
    text-indent: 22px; /* 抵消末字间距，视觉居中 */
    margin-bottom: 14px;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.hero .hero-sub {
    font-size: clamp(1.1rem, 2.4vw, 1.45rem);
    letter-spacing: 8px;
    text-indent: 8px;
    color: var(--gold);
    margin-bottom: 26px;
    font-weight: 400;
}

.hero .hero-desc {
    font-size: 1.05rem;
    font-weight: 300;
    max-width: 640px;
    margin: 0 auto 38px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero .hero-desc p {
    margin: 0;
}

.hero .btn {
    display: inline-block;
    padding: 14px 44px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-size: 1.05rem;
    letter-spacing: 4px;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(156, 62, 34, 0.45);
    transition: background 0.3s ease, transform 0.3s ease;
}

.hero .btn:hover {
    background: var(--accent-dark);
    transform: translateY(-3px);
}

.hero .scroll-hint {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-decoration: none;
    animation: hintFloat 2.4s ease-in-out infinite;
}

.hero .scroll-hint::after {
    content: "";
    display: block;
    width: 1px;
    height: 26px;
    margin: 8px auto 0;
    background: linear-gradient(rgba(255, 255, 255, 0.75), transparent);
}

@keyframes hintFloat {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 8px); }
}

/* --------------------------------------------------------------------------
   数据统计带
   -------------------------------------------------------------------------- */

.stats-band {
    background: var(--ink);
    color: #fff;
    padding: 46px 5%;
}

.stats-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat .stat-num {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1.2;
}

.stat .stat-num small {
    font-size: 1.1rem;
    margin-left: 2px;
}

.stat .stat-label {
    font-size: 0.92rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.75);
}

/* --------------------------------------------------------------------------
   通用内容区块
   -------------------------------------------------------------------------- */

.section {
    padding: 90px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.section--paper {
    background: var(--paper);
    max-width: none;
}

.section--paper > .section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: clamp(1.7rem, 3.4vw, 2.3rem);
    color: var(--ink);
    letter-spacing: 3px;
    margin-bottom: 18px;
}

.section-title .title-accent {
    color: var(--accent);
}

.section-lead {
    text-align: center;
    color: var(--muted);
    max-width: 780px;
    margin: 0 auto 54px;
}

.section-lead p {
    margin: 0 0 14px;
}

.section-lead p:last-child {
    margin-bottom: 0;
}

.section-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 54px;
    color: var(--gold);
}

.section-ornament::before,
.section-ornament::after {
    content: "";
    width: 70px;
    height: 1px;
    background: var(--line);
}

.section-ornament .diamond {
    width: 8px;
    height: 8px;
    background: var(--gold);
    transform: rotate(45deg);
}

/* --------------------------------------------------------------------------
   两列图文
   -------------------------------------------------------------------------- */

.two-column {
    display: flex;
    flex-wrap: wrap;
    gap: 48px;
    align-items: center;
}

.two-column.reverse {
    flex-direction: row-reverse;
}

.text-box {
    flex: 1;
    min-width: 300px;
}

.text-box h3 {
    font-size: 1.55rem;
    color: var(--ink);
    margin-bottom: 16px;
    letter-spacing: 2px;
    padding-left: 14px;
    border-left: 4px solid var(--accent);
}

.text-box p {
    color: var(--muted);
    margin-bottom: 15px;
    text-align: justify;
}

.img-box {
    flex: 1;
    min-width: 300px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    background: #EDE8DC;
}

.img-box img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
}

.img-box:hover img {
    transform: scale(1.05);
}

.img-box figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 26px 18px 12px;
    color: #fff;
    font-size: 0.85rem;
    letter-spacing: 2px;
    background: linear-gradient(transparent, rgba(22, 36, 31, 0.72));
}

/* --------------------------------------------------------------------------
   大事记时间轴
   -------------------------------------------------------------------------- */

.timeline {
    position: relative;
    max-width: 860px;
    margin: 70px auto 0;
    padding-left: 26px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(var(--gold), var(--ink));
    opacity: 0.35;
}

.timeline-item {
    position: relative;
    padding: 0 0 34px 26px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -26px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
}

.timeline-item .tl-year {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.timeline-item .tl-year em {
    font-style: normal;
    color: var(--gold);
    font-weight: 400;
    margin-left: 8px;
    font-size: 0.85rem;
}

.timeline-item p {
    color: var(--muted);
    max-width: 640px;
}

/* --------------------------------------------------------------------------
   特色小卡（水乡风貌）
   -------------------------------------------------------------------------- */

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 28px;
    margin-top: 60px;
}

.feature-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 26px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}

.feature-card .fc-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(193, 80, 46, 0.1);
    color: var(--accent);
}

.feature-card h4 {
    font-size: 1.2rem;
    color: var(--ink);
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   亮点大卡（时代新篇）
   -------------------------------------------------------------------------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.card {
    background: var(--paper);
    padding: 38px 30px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: 0 4px 18px rgba(36, 59, 53, 0.06);
    border-top: 3px solid transparent;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    border-top-color: var(--accent);
    box-shadow: var(--shadow);
}

.card .card-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: var(--gold);
}

.card h4 {
    color: var(--accent);
    font-size: 1.3rem;
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.card p {
    color: var(--muted);
    font-size: 0.97rem;
}

/* --------------------------------------------------------------------------
   到访指引
   -------------------------------------------------------------------------- */

.visit-strip {
    margin-top: 70px;
    background: var(--ink);
    border-radius: var(--radius);
    color: #fff;
    padding: 36px 5%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 26px;
}

.visit-item .vi-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 8px;
}

.visit-item p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.93rem;
}

/* --------------------------------------------------------------------------
   最新动态（后台发布的文章）
   -------------------------------------------------------------------------- */

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.news-card {
    background: var(--paper);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(36, 59, 53, 0.06);
    border-top: 3px solid transparent;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(36, 59, 53, 0.13);
    border-top-color: var(--gold);
}

.news-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--deep);
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.news-card:hover .news-thumb img {
    transform: scale(1.05);
}

.news-thumb-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 30% 40%, rgba(185, 138, 47, 0.35), transparent 55%),
        radial-gradient(circle at 70% 65%, rgba(193, 80, 46, 0.28), transparent 50%),
        var(--deep);
}

.news-body {
    padding: 22px 24px 26px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-body time {
    font-size: 0.82rem;
    color: var(--gold);
    letter-spacing: 1.5px;
}

.news-body h4 {
    margin: 8px 0 10px;
    font-size: 1.15rem;
    letter-spacing: 1px;
    line-height: 1.5;
}

.news-body h4 a {
    color: var(--ink);
    text-decoration: none;
    transition: color 0.25s ease;
}

.news-body h4 a:hover {
    color: var(--accent);
}

.news-body p {
    color: var(--muted);
    font-size: 0.95rem;
    text-align: justify;
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */

.site-footer {
    background: var(--deep);
    color: rgba(255, 255, 255, 0.82);
    text-align: center;
    padding: 44px 20px 36px;
    margin-top: 60px;
}

.site-footer .footer-brand {
    font-size: 1.2rem;
    letter-spacing: 5px;
    color: #fff;
    margin-bottom: 10px;
}

.site-footer p {
    font-size: 0.88rem;
    line-height: 2;
}

.site-footer .footer-divider {
    width: 60px;
    height: 2px;
    background: var(--gold);
    margin: 18px auto;
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   通用内页（文章 / 页面）
   -------------------------------------------------------------------------- */

.page-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 130px 20px 80px;
}

.page-wrap .entry-title {
    color: var(--ink);
    font-size: 1.9rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.page-wrap .entry-meta {
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 28px;
}

.page-wrap .entry-content {
    background: var(--paper);
    border-radius: var(--radius);
    padding: 38px 40px;
    box-shadow: 0 4px 18px rgba(36, 59, 53, 0.05);
}

.page-wrap .entry-content p {
    margin-bottom: 18px;
    text-align: justify;
}

.page-wrap .entry-content h2,
.page-wrap .entry-content h3 {
    color: var(--ink);
    margin: 26px 0 12px;
}

.page-wrap .entry-content img {
    border-radius: 6px;
}

.page-wrap .entry-content blockquote {
    border-left: 4px solid var(--gold);
    padding: 8px 18px;
    color: var(--muted);
    margin: 18px 0;
    background: rgba(185, 138, 47, 0.06);
}

/* --------------------------------------------------------------------------
   滚动显现动画
   -------------------------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

.reveal-d1 { transition-delay: 0.12s; }
.reveal-d2 { transition-delay: 0.24s; }
.reveal-d3 { transition-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero .scroll-hint { animation: none; }
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        gap: 8px;
        padding: 14px 4%;
        background: rgba(22, 36, 31, 0.45);
    }

    .site-header.scrolled {
        flex-direction: column;
        padding: 10px 4%;
    }

    .site-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }

    .site-nav a {
        font-size: 0.88rem;
        padding: 4px 10px;
        letter-spacing: 1px;
    }

    .hero h2 {
        letter-spacing: 10px;
        text-indent: 10px;
    }

    .hero .hero-sub {
        letter-spacing: 4px;
        text-indent: 4px;
    }

    .section {
        padding: 66px 6%;
    }

    .two-column {
        gap: 34px;
    }

    .timeline {
        margin-top: 50px;
    }

    .page-wrap .entry-content {
        padding: 26px 22px;
    }
}
