/* OpenClaw News Theme — style.css */
:root {
    --bg: #ffffff;
    --bg-alt: #f4f5f7;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --accent: #0099ff;
    --brand: #1a1a2e;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --max-w: 1200px;
    --radius: 8px;
}
html.dark {
    --bg: #0f0f1a;
    --bg-alt: #1a1a2e;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --border: #2d2d44;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* Utility */
.btn { display: inline-block; padding: 8px 20px; border: 1px solid var(--border); border-radius: var(--radius); font-size: .9rem; font-weight: 600; color: var(--text); background: var(--bg); cursor: pointer; transition: .2s; }
.btn:hover { background: var(--bg-alt); text-decoration: none; }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { opacity: .85; }

/* Breaking Bar */
.breaking-bar { background: var(--brand); color: #fff; font-size: .8rem; padding: 6px 16px; display: flex; align-items: center; gap: 12px; overflow: hidden; }
.breaking-label { background: #e11d48; padding: 2px 10px; border-radius: 3px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0; }
.breaking-text { white-space: nowrap; animation: scroll-left 20s linear infinite; }
@keyframes scroll-left { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* Header */
.site-header { background: var(--bg); border-bottom: 3px solid var(--brand); padding: 12px 0; position: sticky; top: 0; z-index: 100; }
html.dark .site-header { border-bottom-color: var(--accent); }
.header-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.site-logo img { max-height: 44px; }
.site-title-link { color: var(--text); }
.site-title-link:hover { text-decoration: none; }
.site-title { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 900; }
.site-desc { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav ul { list-style: none; display: flex; gap: 18px; }
.site-nav a { color: var(--text); font-weight: 500; font-size: .9rem; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.dark-toggle { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 4px; }
.nav-burger { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.mobile-nav { display: none; }
@media (max-width: 768px) {
    .site-nav ul { display: none; }
    .nav-burger { display: block; }
    .mobile-nav.open { display: block; background: var(--bg); padding: 12px 20px; border-bottom: 1px solid var(--border); }
    .mobile-nav ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
    .mobile-nav a { color: var(--text); font-weight: 500; }
}

/* Progress Bar */
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0; z-index: 9999; transition: width .1s; }

/* Main */
.site-main { max-width: var(--max-w); margin: 0 auto; padding: 24px 20px; }

/* Featured Section */
.featured-section { margin-bottom: 32px; }
.featured-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.featured-card { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 200px; background: var(--bg-alt); }
.featured-large { grid-row: span 2; min-height: 420px; }
.featured-card img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.featured-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 20px; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff; }
.featured-overlay h2 { font-family: var(--font-heading); font-size: 1.3rem; margin-top: 6px; }
.featured-large .featured-overlay h2 { font-size: 1.8rem; }
.featured-overlay a { color: #fff; }
.featured-meta { font-size: .8rem; opacity: .8; margin-top: 6px; }
.tag-badge { display: inline-block; background: var(--accent); color: #fff; font-size: .7rem; padding: 2px 10px; border-radius: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

@media (max-width: 768px) {
    .featured-grid { grid-template-columns: 1fr; }
    .featured-large { min-height: 260px; grid-row: auto; }
}

/* Content Grid (main + sidebar) */
.content-grid { display: grid; grid-template-columns: 1fr 320px; gap: 32px; }
@media (max-width: 900px) { .content-grid { grid-template-columns: 1fr; } }

/* Newsletter CTA */
.newsletter-cta { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; margin-bottom: 28px; }
.newsletter-cta h3 { font-family: var(--font-heading); margin-bottom: 6px; }
.newsletter-cta p { color: var(--text-muted); font-size: .9rem; margin-bottom: 12px; }

/* Posts Grid */
.section-title { font-family: var(--font-heading); font-size: 1.3rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--brand); }
html.dark .section-title { border-bottom-color: var(--accent); }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

/* Post Card */
.post-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.post-card-image { width: 100%; height: 180px; object-fit: cover; }
.post-card-content { padding: 16px; }
.post-card-tag { font-size: .7rem; font-weight: 600; text-transform: uppercase; color: var(--accent); letter-spacing: .5px; }
.post-card-title { font-family: var(--font-heading); font-size: 1.1rem; margin: 6px 0; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--accent); text-decoration: none; }
.post-card-excerpt { font-size: .85rem; color: var(--text-muted); margin-bottom: 10px; }
.post-card-meta { font-size: .75rem; color: var(--text-muted); display: flex; gap: 10px; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 32px; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.sidebar-widget { background: var(--bg-alt); border-radius: var(--radius); padding: 20px; }
.widget-title { font-family: var(--font-heading); margin-bottom: 12px; font-size: 1rem; }
.trending-list { list-style: none; counter-reset: trend; }
.trending-list li { counter-increment: trend; padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; font-size: .9rem; }
.trending-list li::before { content: counter(trend); font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; color: var(--accent); min-width: 24px; }
.trending-list a { color: var(--text); font-weight: 500; }
.trending-meta { font-size: .75rem; color: var(--text-muted); display: block; margin-top: 2px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; font-size: .8rem; color: var(--text); }
.tag-pill:hover { border-color: var(--accent); text-decoration: none; }
.tag-pill span { font-size: .7rem; color: var(--text-muted); }

/* Post Full */
.post-header { text-align: center; max-width: 720px; margin: 0 auto 24px; }
.post-title { font-family: var(--font-heading); font-size: 2.4rem; font-weight: 900; line-height: 1.2; margin: 12px 0; }
.post-excerpt { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 16px; }
.post-byline { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: .9rem; color: var(--text-muted); }
.author-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.post-byline a { color: var(--text); font-weight: 600; }
.post-feature-image { margin: 0 auto 32px; max-width: 960px; border-radius: var(--radius); overflow: hidden; }
.post-feature-image figcaption { font-size: .8rem; color: var(--text-muted); text-align: center; padding: 8px; }
.post-content-wrap { max-width: 720px; margin: 0 auto; }

/* Ghost Content */
.gh-content { font-size: 1.05rem; line-height: 1.75; }
.gh-content h2, .gh-content h3, .gh-content h4 { font-family: var(--font-heading); margin: 1.5em 0 .5em; }
.gh-content p { margin-bottom: 1.2em; }
.gh-content img { border-radius: var(--radius); margin: 1.5em auto; }
.gh-content blockquote { border-left: 3px solid var(--accent); padding-left: 16px; font-style: italic; color: var(--text-muted); margin: 1.5em 0; }
.gh-content pre { background: var(--bg-alt); padding: 16px; border-radius: var(--radius); overflow-x: auto; margin: 1.5em 0; }
.gh-content code { font-size: .9em; }
.gh-content a { text-decoration: underline; }
.gh-content figcaption { font-size: .8rem; color: var(--text-muted); text-align: center; margin-top: 6px; }
.kg-width-wide { margin-left: -80px; margin-right: -80px; max-width: calc(100% + 160px); }
.kg-width-full { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); max-width: 100vw; }
@media (max-width: 900px) { .kg-width-wide { margin-left: 0; margin-right: 0; max-width: 100%; } }

/* Share Buttons */
.share-buttons { display: flex; align-items: center; gap: 10px; margin: 24px 0; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: .9rem; }
.share-btn { padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: .8rem; font-weight: 600; color: var(--text); background: var(--bg-alt); cursor: pointer; }
.share-btn:hover { border-color: var(--accent); text-decoration: none; }

/* Post Tags */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }

/* Author Box */
.author-box { display: flex; gap: 16px; align-items: center; margin: 32px 0; padding: 24px; background: var(--bg-alt); border-radius: var(--radius); }
.author-box img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.author-box h4 { margin-bottom: 4px; }
.author-box p { font-size: .85rem; color: var(--text-muted); }

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

/* Tag / Author Header */
.tag-header, .author-header { text-align: center; margin-bottom: 32px; }
.tag-header h1, .author-header h1 { font-family: var(--font-heading); font-size: 2rem; }
.post-count { font-size: .9rem; color: var(--text-muted); }
.author-avatar-lg { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; }

/* Error Page */
.error-page { text-align: center; padding: 80px 20px; }
.error-code { font-family: var(--font-heading); font-size: 6rem; color: var(--accent); }
.error-msg { font-size: 1.2rem; color: var(--text-muted); margin: 12px 0 24px; }

/* Footer */
.site-footer { background: var(--brand); color: #fff; padding: 40px 20px; margin-top: 48px; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-col h4 { margin-bottom: 8px; font-size: 1rem; }
.footer-col p { font-size: .85rem; opacity: .8; }
.footer-col nav ul { list-style: none; }
.footer-col nav a { color: #fff; opacity: .8; font-size: .85rem; }
.footer-col nav a:hover { opacity: 1; }
.footer-bottom { max-width: var(--max-w); margin: 24px auto 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); display: flex; justify-content: space-between; font-size: .8rem; opacity: .7; }
.powered-by a { color: #fff; text-decoration: underline; }
@media (max-width: 768px) {
    .footer-inner { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 6px; }
}

/* Koenig editor width classes */
.kg-width-wide {
    max-width: min(1040px, 96vw);
    margin-left: auto;
    margin-right: auto;
}
.kg-width-full {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}
.kg-width-wide img,
.kg-width-full img {
    width: 100%;
}
