/*
Theme Name: TencentCDC (Modernized)
Theme URI: 
Description: Modern responsive redesign for the Ginseng Seed Website.
Author: Antigravity
Version: 2.0
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #2e7d32;
    --primary-hover: #1b5e20;
    --bg-light: #f5f8f5;
    --bg-white: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #e2e8f0;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-hover: 0 12px 32px rgba(46, 125, 50, 0.15);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

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

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
}

ul {
    list-style: none;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

html, body {
    max-width: 100vw;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 1000;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

/* Fix for WordPress Admin Bar Overlap */
body.admin-bar .site-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.site-logo a {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-nav ul {
    display: flex;
    gap: 30px;
}

.site-nav a {
    color: var(--text-main);
    font-weight: 500;
    font-size: 16px;
    padding: 8px 0;
    position: relative;
}

.site-nav a:hover, .site-nav li.current-menu-item a {
    color: var(--primary-color);
}

.site-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.site-nav a:hover::after, .site-nav li.current-menu-item a::after {
    width: 100%;
}

/* Hero Banner */
.hero-banner {
    margin-top: 80px;
    height: 400px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 20px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content Area */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    padding-bottom: 60px;
    margin-top: 40px;
}

.main-layout > * {
    min-width: 0;
}

.main-layout.no-banner {
    margin-top: 120px;
}

/* Article Cards */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

.post-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

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

.post-thumb {
    height: 220px;
    overflow: hidden;
    background: #f0f0f0;
}

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

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

.post-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    gap: 12px;
}

.post-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-title a {
    color: var(--text-main);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.read-more {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(46, 125, 50, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    align-self: flex-start;
}

.read-more:hover {
    background: var(--primary-color);
    color: white;
}

/* Sidebar */
.sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
    position: relative;
    padding-bottom: 10px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.sidebar-widget ul li {
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 12px;
}

.sidebar-widget ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-widget a {
    color: var(--text-main);
    display: block;
}

.sidebar-widget a:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

.sidebar-widget img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-main);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.pagination span.current, .pagination a:hover {
    background: var(--primary-color);
    color: white;
}

/* Footer */
.site-footer {
    background: #1a252c;
    color: #a0aec0;
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 20px;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget a {
    color: #a0aec0;
}

.footer-widget a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
}

/* Single Post */
.single-post-content {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 40px;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    overflow-x: auto;
}

.single-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.single-header h1 {
    font-size: 32px;
    color: var(--text-main);
    margin-bottom: 15px;
}

.single-meta {
    color: var(--text-muted);
    font-size: 14px;
}

.single-meta span {
    margin-right: 15px;
}

.article-banner {
    width: 100%;
    text-align: left;
    margin-bottom: 30px;
}

.article-banner img {
    max-width: 100% !important;
    max-height: 400px !important;
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.entry-content {
    font-size: 16px;
    line-height: 1.8;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content h2, .entry-content h3 {
    margin: 30px 0 15px;
    color: var(--text-main);
}

/* Force responsive constraints on all post content */
.single-post-content {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.entry-content * {
    max-width: 100% !important;
}

.entry-content img, 
.entry-content iframe, 
.entry-content video, 
.entry-content table {
    max-width: 100% !important;
    height: auto !important;
}

/* Gallery Masonry Layout */
.gallery-masonry {
    column-count: 3;
    column-gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.gallery-item img {
    width: 100%;
    display: block;
    border-radius: var(--radius-md);
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.lightbox-close:hover {
    color: var(--primary-color);
}

@keyframes zoomIn {
    from {transform: scale(0.9); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

/* Homepage Teaser - Compact Collage */
.gallery-teaser-compact {
    margin: 40px 0;
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 40px;
}

.collage-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    flex: 0 0 50%;
}

.collage-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-md);
    transition: transform 0.3s ease;
}

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

.collage-text {
    flex: 1;
}

.collage-text h3 {
    font-size: 26px;
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 700;
}

.collage-text p {
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 15px;
}

.collage-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 10px 24px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.collage-btn:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46,125,50,0.3);
}

/* Image Anti-Theft Protection */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Homepage Teaser Responsive */
@media (max-width: 768px) {
    .gallery-teaser-compact {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    .collage-grid {
        flex: 0 0 100%;
        width: 100%;
        margin-bottom: 10px;
    }
    .collage-img {
        height: 120px;
    }
    .collage-text h3 {
        font-size: 22px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body, html {
        width: 100%;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .entry-content * {
        white-space: normal !important;
        word-break: break-word !important;
    }
    
    .entry-content table {
        display: block;
        overflow-x: auto;
    }

    .site-header {
        height: auto;
        padding: 15px 0;
        position: relative;
    }
    
    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
    
    .site-logo a {
        font-size: 22px;
    }
    
    .site-nav ul {
        gap: 12px 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .site-nav a {
        font-size: 15px;
    }
    
    .hero-banner {
        margin-top: 0;
        height: 260px;
        border-radius: 0;
    }
    
    .hero-content h1 {
        font-size: 28px;
        padding: 0 15px;
    }
    
    .hero-content p {
        font-size: 16px;
        padding: 0 15px;
    }
    
    .main-layout {
        display: block;
        gap: 30px;
        margin-top: 20px;
    }
    
    .main-layout.no-banner {
        margin-top: 20px;
    }
    
    .post-grid {
        grid-template-columns: 1fr;
    }
    
    .single-post-content {
        padding: 20px;
    }
    
    .single-header h1 {
        font-size: 24px;
    }
    
    .site-footer {
        padding: 30px 0 20px;
        margin-top: 30px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .footer-widget h3 {
        margin-bottom: 10px;
        font-size: 16px;
    }
    
    .footer-widget ul li {
        margin-bottom: 8px;
    }
    
    .pagination {
        gap: 5px;
        flex-wrap: wrap;
    }
    
    .pagination a, .pagination span {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .sidebar-widget img {
        max-width: 250px;
        margin: 0 auto;
        display: block;
    }
    
    #sidebar {
        display: none;
    }
    
    .mobile-wechat-fab {
        display: flex !important;
    }
    
    .gallery-masonry {
        column-count: 2;
        column-gap: 10px;
    }
    
    .gallery-item {
        margin-bottom: 10px;
    }
    
    .gallery-teaser {
        height: 200px;
        margin: 30px 0;
    }
    
    .teaser-overlay h2 {
        font-size: 20px;
    }
    
    .teaser-btn {
        padding: 8px 20px;
        font-size: 14px;
    }
}

/* Mobile WeChat FAB & Modal Base Styles */
.mobile-wechat-fab {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #07c160; /* WeChat Green */
    border-radius: 50%;
    color: white;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.4);
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.mobile-wechat-fab:active {
    transform: scale(0.95);
}

.wechat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wechat-modal-content {
    background: white;
    padding: 30px 20px;
    border-radius: 16px;
    text-align: center;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wechat-modal-content h3 {
    margin-bottom: 5px;
    color: var(--text-main);
}

.wechat-modal-content img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
}

.wechat-close-btn {
    padding: 10px 30px;
    background: #f0f0f0;
    color: var(--text-main);
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}