/* Varaha blog theme. Tokens mirror varaha-earth tailwind.config.js. */
:root {
    --primary: #0A3D3A;
    --primary-hover: #083331;
    --primary-dark: #051E1C;
    --primary-light: #E8F5F2;
    --primary-muted: #5A8A87;
    --accent: #D4A84B;
    --accent-hover: #C19A3D;
    --accent-soft: #F5EED6;
    --text: #1A2B2A;
    --text-muted: #5C6B6A;
    --border: #E2E8E7;
    --sage: #F7F5F0;
    --cream: #FAF8F5;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-card: 0 4px 12px -2px rgba(10, 61, 58, 0.08);
    --shadow-card-hover: 0 8px 24px -4px rgba(10, 61, 58, 0.15);
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--primary-dark); }
body {
    margin: 0;
    background: var(--cream);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--primary-dark); margin: 0 0 .5em; letter-spacing: -0.02em; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }
.site-main { padding-top: 72px; min-height: 70vh; }

/* Header (fixed, dark teal, blur on scroll) */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 72px;
    background: var(--primary-dark);
    transition: background-color .2s ease;
}
.site-header.scrolled {
    background: var(--primary-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; }
.logo img { height: 36px; width: auto; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { color: rgba(250, 248, 245, .75); font-weight: 500; font-size: .9375rem; position: relative; padding: 4px 0; }
.nav a:not(.btn):hover, .nav a.active { color: #fff; }
.nav a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px; background: var(--accent); }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; }

/* Buttons */
.btn { display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: .9375rem; padding: 10px 20px; border-radius: var(--radius-sm); transition: all .2s ease; cursor: pointer; border: 0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-light { background: var(--cream); color: var(--primary-dark); }
.btn-light:hover { background: var(--accent); color: var(--primary-dark); }

/* Hero */
.hero { background: var(--primary-dark); color: var(--cream); padding: 72px 0 80px; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 700; line-height: 1.1; }
.hero p { max-width: 640px; color: rgba(250, 248, 245, .75); font-size: 1.125rem; margin: 0; }
.section { padding-top: 56px; padding-bottom: 80px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); transition: box-shadow .3s ease, transform .3s ease; display: flex; flex-direction: column; }
.card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.card-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.tag { font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-muted); }
.lock { font-size: .75rem; font-weight: 600; background: var(--accent-soft); color: #7a5a14; padding: 2px 8px; border-radius: 999px; }
.card-title { font-size: 1.25rem; line-height: 1.35; margin-bottom: 8px; }
.card-title a { color: var(--primary-dark); }
.card-excerpt { color: var(--text-muted); margin: 0 0 16px; font-size: .9375rem; }
.card-foot { margin-top: auto; font-size: .8125rem; color: var(--text-muted); }

/* Post */
.post-head { padding: 56px 0 24px; }
.post-head h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 700; line-height: 1.15; margin-top: 10px; }
.lede { font-size: 1.25rem; color: var(--text-muted); }
.byline { color: var(--text-muted); font-size: .875rem; }
.post-hero { margin-bottom: 32px; }
.post-hero img { width: 100%; border-radius: var(--radius-lg); }
.post-hero figcaption, .gh-content figcaption { color: var(--text-muted); font-size: .8125rem; text-align: center; margin-top: 8px; }
.gh-content { padding-bottom: 80px; font-size: 1.125rem; }
.gh-content > * + * { margin-top: 1.25em; }
.gh-content h2 { font-size: 1.9rem; margin-top: 2em; }
.gh-content h3 { font-size: 1.4rem; margin-top: 1.6em; }
.gh-content a { color: var(--primary); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.gh-content blockquote { border-left: 3px solid var(--accent); margin-left: 0; padding-left: 20px; color: var(--text-muted); }
.gh-content img { border-radius: var(--radius-md); }
.gh-content pre { background: var(--primary-dark); color: var(--cream); padding: 16px; border-radius: var(--radius-md); overflow-x: auto; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.gh-content th, .gh-content td { border-bottom: 1px solid var(--border); padding: 10px 8px; text-align: left; }
.kg-width-wide { width: min(1080px, 100vw - 48px); margin-left: 50%; transform: translateX(-50%); }
.kg-width-full { width: 100vw; margin-left: 50%; transform: translateX(-50%); }

/* Buyer gate */
.gate { background: var(--primary-light); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; text-align: center; margin-top: 32px; }
.gate h3 { font-size: 1.4rem; }
.gate p { color: var(--text-muted); }
.gate-help { font-size: .875rem; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 24px; margin-top: 48px; font-weight: 600; }

/* Footer */
.site-footer { background: var(--primary-dark); color: var(--cream); padding: 56px 0 24px; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-logo { height: 36px; width: auto; }
.footer-note { color: rgba(255, 255, 255, .6); margin-top: 12px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.footer-links a { color: rgba(255, 255, 255, .6); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .5); font-size: .8125rem; }

/* Responsive */
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) {
    .grid { grid-template-columns: 1fr; }
    .burger { display: block; }
    .nav { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px 24px 28px; background: var(--primary-dark); }
    .nav.open { display: flex; }
    .hero { padding: 48px 0 56px; }
}

/* Ghost editor cards */
.kg-gallery-container { display: flex; flex-direction: column; gap: 12px; }
.kg-gallery-row { display: flex; flex-direction: row; justify-content: center; gap: 12px; }
.kg-gallery-image { flex: 1 1 0; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-md); }

.kg-bookmark-card { width: 100%; }
.kg-bookmark-container { display: flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; color: inherit; text-decoration: none !important; background: #fff; box-shadow: var(--shadow-card); }
.kg-bookmark-container:hover { box-shadow: var(--shadow-card-hover); }
.kg-bookmark-content { flex: 1; padding: 20px; display: flex; flex-direction: column; min-width: 0; }
.kg-bookmark-title { font-family: var(--font-display); font-weight: 600; color: var(--primary-dark); line-height: 1.35; }
.kg-bookmark-description { color: var(--text-muted); font-size: .9375rem; margin-top: 6px; max-height: 3.2em; overflow: hidden; }
.kg-bookmark-metadata { display: flex; align-items: center; margin-top: auto; padding-top: 14px; font-size: .8125rem; color: var(--text-muted); }
.kg-bookmark-icon { width: 20px; height: 20px; margin-right: 8px; border-radius: 3px; }
.kg-bookmark-author { font-weight: 500; }
.kg-bookmark-author::after { content: '\2022'; margin: 0 6px; }
.kg-bookmark-publisher { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kg-bookmark-thumbnail { position: relative; flex: 0 0 33%; }
.kg-bookmark-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
@media (max-width: 720px) { .kg-bookmark-thumbnail { display: none; } .kg-gallery-row { flex-direction: column; } }

/* Slim intro strip and featured post (home) */
.strip { background: var(--primary-dark); padding: 4px 0 22px; }
.strip h1 { color: rgba(250, 248, 245, .8); font-family: var(--font-body); font-size: 1rem; font-weight: 500; letter-spacing: 0; line-height: 1.4; margin: 0; }
.section-feed { padding-top: 32px; }
.featured { display: grid; grid-template-columns: 1.25fr 1fr; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); margin-bottom: 28px; transition: box-shadow .3s ease; }
.featured:hover { box-shadow: var(--shadow-card-hover); }
.featured-image { display: block; min-height: 100%; }
.featured-image img { width: 100%; height: 100%; min-height: 20rem; object-fit: cover; }
.featured-body { padding: 36px; display: flex; flex-direction: column; justify-content: center; }
.featured-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.2; margin-bottom: 12px; }
.featured-title a { color: var(--primary-dark); }
.featured-excerpt { color: var(--text-muted); margin: 0 0 16px; }
.featured .card-foot { margin: 0 0 20px; }
.featured .btn { align-self: flex-start; }
@media (max-width: 900px) {
    .featured { grid-template-columns: 1fr; }
    .featured-image img { min-height: 12rem; max-height: 16rem; }
    .featured-body { padding: 24px; }
}

/* Authors */
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--text-muted); font-size: .9375rem; margin-top: 16px; }
.author-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--primary-dark); font-weight: 600; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-initial { display: block; background: var(--primary-light); color: var(--primary); font-family: var(--font-display); font-weight: 700; text-align: center; font-size: 0; line-height: 0; overflow: hidden; text-transform: uppercase; }
.avatar-initial::first-letter { font-size: .8125rem; line-height: 28px; }
.author-name { text-transform: capitalize; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.card-foot .author-chip { font-size: .8125rem; }
.byline .avatar { width: 32px; height: 32px; }
.byline .avatar-initial::first-letter { line-height: 32px; font-size: .875rem; }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter { font-size: .875rem; font-weight: 600; color: var(--primary); padding: 7px 16px; border: 1px solid var(--border-strong, #d1d5db); border-radius: 999px; background: #fff; transition: all .2s ease; }
.filter:hover { border-color: var(--primary); color: var(--primary-hover); }
.filter.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Search button */
.search-btn { background: none; border: 0; color: rgba(250, 248, 245, .75); cursor: pointer; padding: 6px; display: inline-flex; align-items: center; border-radius: var(--radius-sm); }
.search-btn:hover { color: #fff; }

/* Share */
.share { display: flex; align-items: center; gap: 10px; padding-bottom: 56px; margin-top: -32px; }
.share-label { font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.share-link { font: inherit; font-size: .875rem; font-weight: 600; color: var(--primary); background: #fff; border: 1px solid var(--border-strong, #d1d5db); border-radius: 999px; padding: 6px 14px; cursor: pointer; text-decoration: none; }
.share-link:hover { border-color: var(--primary); }

/* Related posts */
.related { background: var(--sage); padding: 56px 0 72px; }
.related-title { font-size: 1.5rem; margin-bottom: 24px; }
