/*
Theme Name: Obzervi Blog
Theme URI: https://obzervi.com/
Author: DigiFlow LLC
Author URI: https://digiflow.nyc
Description: Lightweight blog theme for Obzervi, matching the obzervi.com design. Reuses the main site stylesheet and fonts; adds blog list + single-post styling.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: obzervi-blog
*/

/* =========================================================
   Blog-specific styles. The shared site stylesheet
   (https://obzervi.com/assets/style.min.css) is enqueued first
   and defines the :root design tokens used below.
   ========================================================= */

.blog-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* Offset the fixed header for the WordPress admin bar (logged-in users only) */
.admin-bar .header { top: 32px; }
.admin-bar .mobile-menu { top: 88px; }
.page-blog .header-nav .nav-link[aria-current="page"],
.page-blog .mobile-menu a[aria-current="page"],
.page-blog .footer-links a[aria-current="page"] {
    color: var(--red);
    font-weight: 600;
}
@media screen and (max-width: 782px) {
    .admin-bar .header { top: 46px; }
}
@media screen and (max-width: 768px) {
    .admin-bar .mobile-menu { top: 102px; }
}
@media screen and (max-width: 600px) {
    /* WordPress hides the admin bar < 600px when scrolled, but reserves 46px at top */
    .admin-bar .header { top: 46px; }
}

/* ---- Category sub-nav ---- */
.blog-cats { border-bottom: 1px solid var(--border); background: var(--surface); }
.blog-cats-inner { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; max-width: 1120px; margin: 0 auto; padding: 16px 32px; }
.blog-cat {
    font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--text-muted); text-decoration: none; padding: 8px 16px; border: 1px solid var(--border);
    border-radius: 20px; transition: all 0.15s;
}
.blog-cat:hover { color: var(--navy); border-color: #c5c4e0; background: var(--surface2); }
.blog-cat.active { color: #fff; background: var(--red); border-color: var(--red); }

/* ---- Featured post (blog home) ---- */
.blog-feature {
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; margin-bottom: 48px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; text-decoration: none; transition: all 0.2s;
}
.blog-feature:hover { border-color: #c5c4e0; box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.blog-feature-media { min-height: 320px; background: linear-gradient(150deg, var(--dark) 0%, var(--navy) 100%); position: relative; }
.blog-feature-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.blog-feature-body { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.blog-feature-body h2 { font-size: 28px; font-weight: 700; color: var(--navy); letter-spacing: -0.03em; line-height: 1.2; margin: 0 0 12px; }
.blog-feature-body p { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin: 0 0 14px; }

.blog-section-title { font-size: 22px; font-weight: 700; color: var(--navy); letter-spacing: -0.02em; margin: 8px 0 22px; }

/* ---- Browse by topic ---- */
.blog-topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 8px; }
.blog-topic-card {
    display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px; text-decoration: none; transition: all 0.2s;
}
.blog-topic-card:hover { border-color: #c5c4e0; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.blog-topic-card h3 { font-size: 17px; font-weight: 700; color: var(--navy); margin: 4px 0 8px; letter-spacing: -0.01em; }
.blog-topic-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin: 0 0 14px; flex: 1; }

@media (max-width: 768px) {
    .blog-feature { grid-template-columns: 1fr; }
    .blog-feature-media { min-height: 180px; }
    .blog-feature-body { padding: 28px 24px; }
    .blog-topic-grid { grid-template-columns: 1fr; }
}

/* ---- Blog index: post grid ---- */
.blog-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
    margin-top: 8px;
}
.blog-card {
    display: flex; flex-direction: column; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    text-decoration: none; transition: all 0.2s;
}
.blog-card:hover { border-color: #c5c4e0; box-shadow: var(--shadow-md); transform: translateY(-3px); }
.blog-card-thumb { display: block; width: 100%; height: 200px; aspect-ratio: auto; object-fit: cover; background: var(--surface2); }
.blog-card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.blog-card-cat { font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--red); margin-bottom: 10px; }
.blog-card h2, .blog-card h3 { font-size: 18px; font-weight: 700; color: var(--navy); letter-spacing: -0.02em; line-height: 1.3; margin: 0 0 10px; }
.blog-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin: 0 0 16px; }
.blog-card-meta { margin-top: auto; font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
.blog-card-more { color: var(--red); font-weight: 600; font-size: 13px; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }

/* ---- Pagination ---- */
.blog-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; flex-wrap: wrap; }
.blog-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
    padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
    color: var(--navy); text-decoration: none; font-size: 14px; font-weight: 600; transition: all 0.15s;
}
.blog-pagination .page-numbers:hover { border-color: #c5c4e0; background: var(--surface2); }
.blog-pagination .page-numbers.current { background: var(--red); color: #fff; border-color: var(--red); }

/* ---- Single post ---- */
.post-single { max-width: 760px; margin: 0 auto; }
.post-meta-bar { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-bottom: 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.post-meta-bar .post-cat { color: var(--red); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.post-featured { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-md); margin: 8px 0 32px; }

/* Table of contents */
.post-toc { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px; margin: 8px 0 32px; }
.post-toc-title { font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--red); margin-bottom: 12px; }
.post-toc ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.post-toc li { margin: 0 0 9px; break-inside: avoid; }
.post-toc a { color: var(--navy); text-decoration: none; font-size: 14px; line-height: 1.4; }
.post-toc a:hover { color: var(--red); text-decoration: underline; }

/* Share buttons */
.post-share { display: flex; align-items: center; gap: 10px; margin: 36px 0 8px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.post-share-label { font-family: var(--mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin-right: 4px; }
.post-share-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--navy); cursor: pointer; transition: all 0.15s; text-decoration: none; }
.post-share-btn:hover { border-color: var(--red); color: var(--red); background: var(--surface2); }
.post-share-btn .lucide-icon { width: 18px; height: 18px; }
.post-share-btn.copied { border-color: var(--green); color: var(--green); }

/* Author box */
.post-author { display: flex; gap: 18px; align-items: flex-start; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; margin: 32px 0; }
.post-author-avatar { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; }
.post-author-name { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.post-author-body p { font-size: 14px; color: var(--text-muted); line-height: 1.65; margin: 0; }

.post-content { font-size: 16px; color: var(--text-muted); line-height: 1.8; }
.post-content h2 { scroll-margin-top: 90px; }
.post-content h3 { scroll-margin-top: 90px; }
.post-content > * + * { margin-top: 18px; }
.post-content h2 { font-size: 24px; font-weight: 700; color: var(--navy); letter-spacing: -0.02em; line-height: 1.25; margin: 36px 0 12px; }
.post-content h3 { font-size: 19px; font-weight: 700; color: var(--navy); margin: 28px 0 10px; }
.post-content p { margin: 0 0 16px; }
.post-content a { color: var(--red); font-weight: 600; text-decoration: none; }
.post-content a:hover { text-decoration: underline; }
.post-content strong { color: var(--navy); font-weight: 600; }
.post-content ul, .post-content ol { margin: 0 0 18px; padding-left: 24px; }
.post-content li { margin: 6px 0; }
.post-content ul { list-style: none; padding-left: 0; }
.post-content ul li { position: relative; padding-left: 24px; }
.post-content ul li::before { content: "\2713"; position: absolute; left: 0; top: 1px; color: var(--green); font-weight: 700; font-size: 13px; }
.post-content blockquote { border-left: 3px solid var(--red); background: var(--surface2); padding: 16px 20px; border-radius: 8px; margin: 22px 0; font-style: italic; color: var(--navy); }
.post-content img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.post-content code { font-family: var(--mono); font-size: 0.9em; background: var(--surface2); padding: 2px 6px; border-radius: 4px; color: var(--navy); }
.post-content pre { background: var(--dark); color: #e8e8f5; padding: 18px 20px; border-radius: 10px; overflow-x: auto; font-family: var(--mono); font-size: 13px; }
.post-content pre code { background: none; color: inherit; padding: 0; }

/* End-of-post CTA */
.post-cta {
    margin-top: 40px; background: linear-gradient(135deg, var(--dark) 0%, var(--navy) 100%);
    border-radius: var(--radius); padding: 32px 36px; text-align: center; color: #fff;
}
.post-cta h3 { font-size: 22px; font-weight: 700; color: #fff; margin: 0 0 8px; letter-spacing: -0.02em; }
.post-cta p { font-size: 14px; color: rgba(255,255,255,0.65); margin: 0 0 20px; }

@media (max-width: 960px) { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
    .blog-wrap { padding: 0 20px; }
    .blog-grid { grid-template-columns: 1fr; }
    .post-content { font-size: 15px; }
    .post-content h2 { font-size: 21px; }
}
