/* ═══════════════════════════════════════════════════
   TinhBMI Theme — Main Stylesheet
   Aesthetic: Clean, organic/natural health tool
   ═══════════════════════════════════════════════════ */

:root {
    --bg: #f4f7f2;
    --bg-card: #ffffff;
    --text: #1a2e1a;
    --text-2: #4a6b4a;
    --text-3: #7a9a7a;
    --accent: #2d8a4e;
    --accent-light: #e8f5e9;
    --accent-dark: #1b5e30;
    --border: #d4e5d4;
    --shadow-sm: 0 1px 3px rgba(45,138,78,0.06);
    --shadow: 0 2px 16px rgba(45,138,78,0.08);
    --shadow-lg: 0 8px 32px rgba(45,138,78,0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --max-w: 1100px;
    --header-h: 72px;
}

/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-dark); }

/* ── Header ──────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(45,138,78,0.25);
}

.logo-icon svg { width: 20px; height: 20px; }
.logo-icon.small { width: 32px; height: 32px; border-radius: 8px; }
.logo-icon.small svg { width: 17px; height: 17px; }

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}
.logo-text span { color: var(--accent); }

/* Nav */
.nav-list {
    list-style: none;
    display: flex;
    gap: 6px;
}

.nav-list li a {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-list li a:hover,
.nav-list li.current-menu-item a,
.nav-list li.current_page_item a {
    color: var(--accent-dark);
    background: var(--accent-light);
}

/* Mobile toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ── Hero ────────────────────────────────────────── */
.hero {
    padding: 60px 24px 80px;
    background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
}

.hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--text);
}

.hero-title .highlight {
    color: var(--accent);
    position: relative;
}

.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--accent-light);
    border-radius: 3px;
    z-index: -1;
}

.hero-desc {
    font-size: 17px;
    color: var(--text-2);
    line-height: 1.7;
    max-width: 460px;
}

.hero-calculator {
    max-width: 520px;
}

/* ── Sections ────────────────────────────────────── */
.section {
    padding: 80px 24px;
}

.section-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 48px;
    color: var(--text);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
}

.section-header .section-title {
    text-align: left;
    margin-bottom: 0;
}

.section-more {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

/* Info grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.info-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.info-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.info-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.info-card p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
}

/* Tools grid */
.section-tools {
    background: #fff;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.tool-card {
    display: block;
    padding: 32px 28px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--bg);
    transition: all 0.3s;
    text-decoration: none;
}

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

.tool-emoji {
    font-size: 36px;
    display: block;
    margin-bottom: 16px;
}

.tool-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.tool-card p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 16px;
}

.tool-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

/* ── Blog Grid ───────────────────────────────────── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.blog-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.blog-card-thumb {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--accent-light);
}

.blog-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

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

.blog-card-nothumb {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: var(--accent-light);
}

.blog-card-body {
    padding: 22px 24px;
}

.blog-card-meta {
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 8px;
    font-weight: 500;
}

.blog-card-body h2, .blog-card-body h3 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

.blog-card-body h2 a, .blog-card-body h3 a {
    color: var(--text);
}
.blog-card-body h2 a:hover, .blog-card-body h3 a:hover {
    color: var(--accent);
}

.blog-card-body p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
}

/* Horizontal blog card */
.blog-card.horizontal {
    display: grid;
    grid-template-columns: 260px 1fr;
}

.blog-card.horizontal .blog-card-thumb {
    aspect-ratio: auto;
    height: 100%;
}

.read-more {
    display: inline-block;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-3);
    font-size: 16px;
}

/* ── Page Header ─────────────────────────────────── */
.page-header {
    padding: 48px 24px 40px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.page-header.compact {
    padding: 20px 24px;
    text-align: left;
}

.page-header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-2);
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 12px;
}

.breadcrumbs a { color: var(--text-3); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 6px; }
.breadcrumbs .current { color: var(--text-2); }

/* ── Content Layout ──────────────────────────────── */
.content-wrapper {
    padding: 40px 24px;
}

.content-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.content-inner.single-col {
    grid-template-columns: 1fr;
    max-width: 780px;
}

/* ── Single Post ─────────────────────────────────── */
.single-post, .single-page {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 48px 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.post-header { margin-bottom: 32px; }

.post-meta {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 12px;
}

.post-cat {
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.post-title, .page-main-title {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text);
}

.page-main-title { margin-bottom: 32px; }

.post-featured-image {
    margin-bottom: 32px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
}

/* Post content prose */
.post-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
}

.post-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 800;
    margin: 40px 0 16px;
    color: var(--text);
}

.post-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 32px 0 12px;
}

.post-content p { margin-bottom: 18px; }

.post-content ul, .post-content ol {
    margin: 0 0 18px 24px;
}

.post-content li { margin-bottom: 6px; }

.post-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--accent-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-2);
}

.post-content img {
    border-radius: var(--radius-sm);
    margin: 24px 0;
}

.post-content a {
    color: var(--accent);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
}

.post-content th, .post-content td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: left;
}

.post-content th {
    background: var(--accent-light);
    font-weight: 600;
}

/* Post footer */
.post-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.post-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-2);
    margin-right: 6px;
}

.post-tags a:hover {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.post-share {
    font-size: 13px;
    color: var(--text-3);
}

.post-share a {
    margin-left: 12px;
    font-weight: 600;
}

/* Related posts */
.related-posts {
    margin-top: 48px;
}

.related-posts h2 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 24px;
}

/* ── Sidebar ─────────────────────────────────────── */
.content-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
}

.widget {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.widget-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-tools {
    list-style: none;
}

.widget-tools li {
    margin-bottom: 8px;
}

.widget-tools li a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    transition: all 0.2s;
}

.widget-tools li a:hover {
    background: var(--accent-light);
    color: var(--accent-dark);
}

/* TOC widget */
.toc-widget ul {
    list-style: none;
}

.toc-widget ul li {
    margin-bottom: 6px;
}

.toc-widget ul li a {
    font-size: 13px;
    color: var(--text-2);
    display: block;
    padding: 4px 0;
    border-left: 2px solid transparent;
    padding-left: 12px;
}

.toc-widget ul li a:hover,
.toc-widget ul li a.active {
    color: var(--accent);
    border-color: var(--accent);
}

/* ── Pagination ──────────────────────────────────── */
.pagination {
    text-align: center;
    margin-top: 40px;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.pagination .page-numbers.current {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.pagination .page-numbers:hover:not(.current) {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── 404 ─────────────────────────────────────────── */
.error-404 {
    text-align: center;
    padding: 120px 24px;
}

.error-code {
    font-family: 'Playfair Display', serif;
    font-size: 120px;
    font-weight: 900;
    color: var(--border);
    line-height: 1;
    display: block;
    margin-bottom: 16px;
}

.error-404 h1 {
    font-size: 28px;
    margin-bottom: 12px;
}

.error-404 p {
    color: var(--text-2);
    margin-bottom: 24px;
}

.btn-back, .no-content .btn-back {
    display: inline-block;
    padding: 12px 28px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-back:hover {
    background: var(--accent-dark);
    color: white;
    transform: translateY(-1px);
}

/* No content */
.no-content {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.no-content h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.no-content p {
    color: var(--text-2);
    margin-bottom: 24px;
}

/* ── Footer ──────────────────────────────────────── */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 60px 24px 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    text-decoration: none;
}

.footer-about p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-col ul {
    list-style: none;
}

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

.footer-col ul li a {
    font-size: 14px;
    color: var(--text-2);
}

.footer-col ul li a:hover {
    color: var(--accent);
}

.footer-disclaimer {
    font-size: 13px;
    color: var(--text-3);
    line-height: 1.6;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--text-3);
}

/* ── Search Form ─────────────────────────────────── */
.search-form-wrapper {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--accent); }

.search-btn {
    padding: 10px 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover { background: var(--accent-dark); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-title { font-size: 36px; }
    .hero-desc { margin: 0 auto; }
    .hero-calculator { margin: 0 auto; }

    .info-grid, .tools-grid, .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-card.horizontal {
        grid-template-columns: 1fr;
    }

    .content-inner {
        grid-template-columns: 1fr;
    }

    .content-sidebar {
        position: static;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 640px) {
    :root { --header-h: 60px; }

    .mobile-toggle { display: flex; }

    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
        box-shadow: var(--shadow);
    }

    .main-nav.open { display: block; }

    .nav-list {
        flex-direction: column;
        gap: 4px;
    }

    .nav-list li a {
        display: block;
        padding: 12px 16px;
    }

    .hero { padding: 40px 20px 60px; }
    .hero-title { font-size: 30px; }
    .section { padding: 60px 20px; }
    .section-title { font-size: 26px; }

    .single-post, .single-page {
        padding: 28px 22px;
    }

    .post-title, .page-main-title {
        font-size: 28px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .page-title { font-size: 28px; }
}
