/*
Theme Name: Chinese Poetry Hub
Description: A poetic WordPress theme with traditional Chinese cultural aesthetics for ChinesePoetryHub.com
Version: 1.0.0
*/

/* ============================================
   Google Fonts Import
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&family=Noto+Sans:wght@300;400;500;600&family=ZCOOL+XiaoWei&display=swap');

/* ============================================
   CSS Variables - Chinese Palette
   ============================================ */
:root {
    /* Colors */
    --ink-black: #1a1a1a;
    --ink-light: #3d3d3d;
    --vermillion: #c41e3a;
    --vermillion-dark: #a01830;
    --jade: #2d8a5e;
    --jade-light: #3aaa6e;
    --gold: #b8860b;
    --gold-light: #d4a017;
    --rice-white: #faf8f5;
    --cream: #f5f0e8;
    --warm-gray: #8b7355;
    --mist: #e8e4df;
    --cloud: rgba(250, 248, 245, 0.95);

    /* Typography */
    --font-serif: 'Noto Serif SC', 'Songti SC', 'SimSun', Georgia, serif;
    --font-sans: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-chinese: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;

    /* Borders */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--ink-black);
    background-color: var(--rice-white);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--vermillion); text-decoration: none; transition: color 0.25s; }
a:hover { color: var(--vermillion-dark); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--ink-black);
    line-height: 1.3;
    font-weight: 700;
}

/* ============================================
   Layout
   ============================================ */
.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.site-main { min-height: 60vh; }
.content-area { max-width: 800px; margin: 0 auto; }

/* ============================================
   Header - Ink Brush Style
   ============================================ */
.site-header {
    background: var(--cloud);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--mist);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(26,26,26,0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 0;
    gap: 2rem;
}

/* Seal logo */
.site-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-branding .seal {
    width: 40px;
    height: 40px;
    background: var(--vermillion);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: -1px;
    box-shadow: 0 2px 8px rgba(196,30,58,0.3);
    flex-shrink: 0;
}

.site-branding .site-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink-black);
    letter-spacing: -0.02em;
}

.site-branding .site-title a { color: inherit; }
.site-branding .site-description { display: none; }

/* Navigation */
.main-navigation { flex: 1; display: flex; justify-content: flex-end; }

.main-navigation ul {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.main-navigation li { position: relative; }

.main-navigation a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-light);
    border-radius: var(--radius-md);
    transition: all 0.25s;
    letter-spacing: 0.01em;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a {
    color: var(--vermillion);
    background: rgba(196,30,58,0.06);
}

.main-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--mist);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 48px rgba(26,26,26,0.12);
    min-width: 200px;
    padding: 0.5rem;
    z-index: 1001;
}

.main-navigation li:hover > .sub-menu { display: block; }
.main-navigation .sub-menu li a { padding: 0.5rem 0.75rem; font-size: 0.875rem; }

/* Mobile toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--ink-light);
}

.menu-toggle .hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    position: relative;
}
.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: currentColor;
    left: 0;
}
.menu-toggle .hamburger::before { top: -7px; }
.menu-toggle .hamburger::after { bottom: -7px; }

/* ============================================
   Hero Section - Traditional Ink Wash
   ============================================ */
.hero-section {
    position: relative;
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 40%, #1e3a5f 70%, #2d5a3d 100%);
    color: #fff;
    padding: 7rem 0 6rem;
    overflow: hidden;
    text-align: center;
}

/* Ink wash texture overlay */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(45,138,94,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(196,30,58,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(184,134,11,0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* Decorative Chinese cloud pattern */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 120px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C200,120 400,0 720,60 C1040,120 1240,0 1440,60 L1440,120 L0,120 Z' fill='%23faf8f5'/%3E%3C/svg%3E") no-repeat bottom center;
    background-size: cover;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero-section .chinese-characters {
    font-family: var(--font-chinese);
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.5em;
    margin-bottom: 1.5rem;
}

.hero-section h1 {
    color: #fff;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    text-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.hero-section .hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    max-width: 560px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

/* Decorative divider */
.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.hero-divider .line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

.hero-divider .dot {
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    display: inline-block;
    padding: 0.875rem 2.5rem;
    background: var(--vermillion);
    color: #fff !important;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(196,30,58,0.35);
}

.btn-primary:hover {
    background: var(--vermillion-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(196,30,58,0.4);
    color: #fff !important;
}

.btn-outline {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: 1.5px solid rgba(255,255,255,0.5);
    color: #fff !important;
    border-radius: 100px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.btn-outline:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.1);
    color: #fff !important;
}

/* ============================================
   Generator Section
   ============================================ */
.generator-section {
    padding: var(--space-xl) 0;
    background: var(--rice-white);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title .chinese {
    font-family: var(--font-chinese);
    font-size: 0.875rem;
    color: var(--warm-gray);
    letter-spacing: 0.3em;
    margin-bottom: 0.5rem;
}

.section-title h2 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.section-title p {
    color: var(--warm-gray);
    max-width: 500px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.generator-box {
    background: #fff;
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 4px 40px rgba(26,26,26,0.08);
    max-width: 680px;
    margin: 0 auto;
    border: 1px solid var(--mist);
}

.generator-form { display: flex; flex-direction: column; gap: 1.25rem; }

.generator-form label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ink-light);
    margin-bottom: 0.35rem;
    display: block;
    letter-spacing: 0.02em;
}

.generator-form input[type="text"],
.generator-form select {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 1.5px solid var(--mist);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--rice-white);
    transition: all 0.25s;
    color: var(--ink-black);
}

.generator-form input:focus,
.generator-form select:focus {
    outline: none;
    border-color: var(--jade);
    box-shadow: 0 0 0 4px rgba(45,138,94,0.1);
    background: #fff;
}

.generator-form .btn-generate {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--jade), var(--jade-light));
    color: #fff;
    border: none;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 20px rgba(45,138,94,0.3);
}

.generator-form .btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(45,138,94,0.4);
}

.generator-result {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f7f4, #faf8f5);
    border: 1px solid rgba(45,138,94,0.15);
    border-radius: 16px;
    display: none;
}

.generator-result.show { display: block; }

.generator-result .result-poem {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    line-height: 2.2;
    color: var(--ink-black);
    text-align: center;
    white-space: pre-line;
    margin-bottom: 1rem;
}

.generator-result .result-meaning {
    font-size: 0.9rem;
    color: var(--warm-gray);
    text-align: center;
    font-style: italic;
    line-height: 1.6;
}

/* ============================================
   Category Grid - Cards
   ============================================ */
.category-section {
    padding: var(--space-xl) 0;
    background: var(--cream);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.25rem 2rem;
    text-align: center;
    transition: all 0.35s;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--vermillion), var(--gold));
    opacity: 0;
    transition: opacity 0.35s;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(26,26,26,0.1);
    border-color: rgba(196,30,58,0.1);
}

.category-card:hover::before { opacity: 1; }

.category-card .card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--cream), var(--mist));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.category-card h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    font-size: 0.9rem;
    color: var(--warm-gray);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.category-card .card-link {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border: 1.5px solid var(--ink-black);
    color: var(--ink-black) !important;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.25s;
}

.category-card .card-link:hover {
    background: var(--ink-black);
    color: #fff !important;
}

/* ============================================
   CTA Section
   ============================================ */
.cta-section {
    background: linear-gradient(135deg, #1a1a2e, #2d5a3d);
    color: #fff;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(196,30,58,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(45,138,94,0.1) 0%, transparent 50%);
}

.cta-section h2 {
    color: #fff;
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.cta-section p {
    color: rgba(255,255,255,0.75);
    max-width: 500px;
    margin: 0 auto 2rem;
}

.cta-section .btn-primary {
    background: var(--gold);
    box-shadow: 0 4px 20px rgba(184,134,11,0.4);
}

.cta-section .btn-primary:hover {
    background: var(--gold-light);
    box-shadow: 0 8px 30px rgba(184,134,11,0.5);
}

/* ============================================
   Stats Bar
   ============================================ */
.stats-section {
    padding: 4rem 0;
    background: var(--rice-white);
    border-top: 1px solid var(--mist);
    border-bottom: 1px solid var(--mist);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-item .stat-number {
    font-family: var(--font-serif);
    font-size: 2.75rem;
    font-weight: 900;
    color: var(--vermillion);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-item .stat-label {
    font-size: 0.875rem;
    color: var(--warm-gray);
    letter-spacing: 0.05em;
}

/* ============================================
   Page Content
   ============================================ */
.page-header {
    background: linear-gradient(160deg, #1a1a2e, #2d5a3d);
    color: #fff;
    padding: 4rem 0 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C360,60 720,0 1440,30 L1440,60 L0,60 Z' fill='%23faf8f5'/%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
}

.page-header h1 {
    color: #fff;
    font-size: 2.75rem;
    margin-bottom: 0.75rem;
}

.page-header p {
    color: rgba(255,255,255,0.75);
    font-size: 1.1rem;
}

.page-content {
    padding: 4rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.page-content h2 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--mist);
}

.page-content h3 {
    font-size: 1.35rem;
    margin: 2rem 0 0.75rem;
}

.page-content p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    color: var(--ink-light);
}

.page-content ul, .page-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.page-content li {
    margin-bottom: 0.5rem;
    color: var(--ink-light);
}

.page-content blockquote {
    border-left: 4px solid var(--vermillion);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--cream);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--ink-black);
    color: rgba(255,255,255,0.6);
    padding: 4rem 0 2rem;
    margin-top: 0;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-widget h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    letter-spacing: 0.02em;
}

.footer-widget p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.5);
}

.footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget li { margin-bottom: 0.6rem; }

.footer-widget a {
    color: rgba(255,255,255,0.55);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-widget a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.35);
}

/* ============================================
   WooCommerce
   ============================================ */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    list-style: none;
    padding: 0;
}

.woocommerce ul.products li.product {
    background: #fff;
    border: 1px solid var(--mist);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    margin: 0;
    transition: all 0.35s;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(26,26,26,0.1);
    border-color: rgba(196,30,58,0.2);
}

.woocommerce ul.products li.product .price {
    color: var(--jade);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1rem 0;
}

.woocommerce ul.products li.product .button {
    background: var(--vermillion);
    color: #fff !important;
    border-radius: 100px;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    transition: all 0.25s;
}

.woocommerce ul.products li.product .button:hover {
    background: var(--vermillion-dark);
}

.woocommerce div.product .product_title {
    font-family: var(--font-serif);
    font-size: 2.25rem;
}

.woocommerce div.product p.price {
    color: var(--jade);
    font-size: 1.75rem;
    font-weight: 700;
}

.woocommerce div.product form.cart .button {
    background: var(--vermillion);
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.25s;
}

.woocommerce div.product form.cart .button:hover {
    background: var(--vermillion-dark);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: #fff;
        border-top: 1px solid var(--mist);
        padding: 1rem;
        box-shadow: 0 16px 48px rgba(26,26,26,0.1);
    }
    .main-navigation.toggled { display: block; }
    .main-navigation ul { flex-direction: column; align-items: flex-start; }
    .main-navigation a { width: 100%; padding: 0.75rem 1rem; }
    .main-navigation .sub-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
        background: var(--cream);
        margin-top: 0.25rem;
    }
    .hero-section { padding: 4rem 0 5rem; }
    .hero-section h1 { font-size: 2.25rem; }
    .generator-box { padding: 2rem 1.5rem; }
    .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-item .stat-number { font-size: 2rem; }
}

@media (max-width: 480px) {
    :root { --space-lg: 3rem; --space-xl: 4rem; }
    .category-grid { grid-template-columns: 1fr; }
    .site-container { padding: 0 1.25rem; }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-section h1,
.hero-section .hero-subtitle,
.hero-section .btn-primary {
    animation: fadeInUp 0.8s ease both;
}

.hero-section .hero-subtitle { animation-delay: 0.15s; }
.hero-section .btn-primary { animation-delay: 0.3s; }

/* ============================================
   Chinese Seal Stamp in Header
   ============================================ */
.site-seal {
    flex-shrink: 0;
    transition: transform 0.3s;
}
.site-seal:hover { transform: rotate(5deg) scale(1.05); }
