/* ═══════════════════════════════════════════════
   BDBlogTimes — Magazine/Portal CSS
   Green accent, editorial design
   ═══════════════════════════════════════════════ */

:root {
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-200: #bbf7d0;
    --green-300: #86efac;
    --green-400: #4ade80;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-800: #166534;
    --green-900: #14532d;
    --green-950: #052e16;
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    --neutral-950: #0a0a0a;
    --bg: #ffffff;
    --text: var(--neutral-900);
    --text-muted: var(--neutral-500);
    --border: var(--neutral-200);
    --surface: var(--neutral-50);
}

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

body {
    font-family: 'Source Sans 3', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── TOPBAR ── */
.topbar { background: var(--green-950); color: var(--green-200); font-size: 0.78rem; padding: 6px 0; letter-spacing: 0.02em; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: var(--green-300); text-decoration: none; transition: color .2s; }
.topbar a:hover { color: #fff; }
.topbar-links { display: flex; gap: 18px; }

/* ── HEADER ── */
.header { background: #fff; border-bottom: 3px solid var(--green-600); padding: 18px 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 8px rgba(0,0,0,0.06); }
.header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: flex; align-items: baseline; gap: 4px; text-decoration: none; flex-shrink: 0; }
.logo-bd { font-family: 'Playfair Display', serif; font-weight: 900; font-size: 1.75rem; color: var(--green-700); letter-spacing: -0.02em; }
.logo-blog { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 1.75rem; color: var(--neutral-800); letter-spacing: -0.02em; }
.logo-times { font-family: 'Playfair Display', serif; font-weight: 400; font-style: italic; font-size: 1.4rem; color: var(--green-600); margin-left: 2px; }

/* ── NAV ── */
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a { font-size: 0.88rem; font-weight: 600; color: var(--neutral-700); text-decoration: none; padding: 6px 14px; border-radius: 6px; transition: all .2s; letter-spacing: 0.01em; }
.main-nav a:hover { background: var(--green-50); color: var(--green-700); }
.main-nav a.active { background: var(--green-600); color: #fff; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--neutral-700); padding: 4px; }

/* ── SEARCH HERO ── */
.search-hero { background: linear-gradient(135deg, var(--green-800) 0%, var(--green-950) 60%, #0c1f12 100%); padding: 52px 0 48px; position: relative; overflow: hidden; }
.search-hero::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2322c55e' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.search-hero .container { position: relative; z-index: 1; text-align: center; }
.search-hero h1 { font-family: 'Playfair Display', serif; font-size: 2.1rem; font-weight: 700; color: #fff; margin-bottom: 8px; letter-spacing: -0.01em; }
.search-hero h1 span { color: var(--green-400); }
.search-hero p { color: var(--green-200); font-size: 1.05rem; margin-bottom: 28px; font-weight: 300; }
.search-box input { width: 100%; padding: 16px 56px 16px 22px; border: 2px solid var(--green-500); border-radius: 12px; font-size: 1.05rem; font-family: 'Source Sans 3', sans-serif; background: #fff; color: var(--neutral-900); outline: none; transition: border-color .2s, box-shadow .2s; }
.search-box input::placeholder { color: var(--neutral-400); }
.search-box input:focus { border-color: var(--green-400); box-shadow: 0 0 0 4px rgba(34,197,94,0.15); }
.search-box button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: var(--green-600); border: none; border-radius: 8px; width: 44px; height: 44px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.search-box button:hover { background: var(--green-700); }
.search-box button svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2.5; }

/* ── SEARCH PAGE HERO (smaller) ── */
.search-page-hero { background: linear-gradient(135deg, var(--green-800), var(--green-950)); padding: 32px 0; }

/* ── PAGE HERO SM ── */
.page-hero-sm { background: linear-gradient(135deg, var(--green-800), var(--green-950)); padding: 32px 0 28px; }
.page-hero-sm h1 { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; color: #fff; margin-bottom: 6px; }
.page-hero-sm p { color: var(--green-200); font-size: 1rem; font-weight: 300; }
.breadcrumb { font-size: 0.82rem; color: var(--green-300); margin-bottom: 12px; }
.breadcrumb a { color: var(--green-300); text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }

/* ── TRENDING BAR ── */
.trending-bar { background: var(--green-50); border-bottom: 1px solid var(--green-100); padding: 12px 0; overflow: hidden; }
.trending-bar .container { display: flex; align-items: center; gap: 14px; }
.trending-label { font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green-700); background: var(--green-200); padding: 4px 10px; border-radius: 4px; flex-shrink: 0; display: flex; align-items: center; gap: 5px; }
.trending-label svg { width: 13px; height: 13px; }
.trending-keywords { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.trending-keywords::-webkit-scrollbar { display: none; }
.trending-keywords a { font-size: 0.82rem; color: var(--neutral-700); text-decoration: none; padding: 4px 12px; background: #fff; border: 1px solid var(--neutral-200); border-radius: 20px; white-space: nowrap; transition: all .2s; font-weight: 500; }
.trending-keywords a:hover { background: var(--green-600); color: #fff; border-color: var(--green-600); }

/* ── SECTION TITLES ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--neutral-200); }
.section-header h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: var(--neutral-900); position: relative; padding-left: 14px; }
.section-header h2::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; background: var(--green-500); border-radius: 2px; }
.section-header a { font-size: 0.85rem; font-weight: 600; color: var(--green-600); text-decoration: none; display: flex; align-items: center; gap: 4px; transition: color .2s; }
.section-header a:hover { color: var(--green-800); }

/* ── CATEGORY GRID ── */
.categories-section { padding: 48px 0 0; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 14px; }
.cat-card { background: #fff; border: 1px solid var(--neutral-200); border-radius: 10px; padding: 20px 16px; text-align: center; text-decoration: none; color: var(--neutral-800); transition: all .25s; position: relative; overflow: hidden; }
.cat-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--green-500); transform: scaleX(0); transition: transform .25s; }
.cat-card:hover { border-color: var(--green-300); box-shadow: 0 4px 16px rgba(22,163,74,0.1); transform: translateY(-2px); }
.cat-card:hover::after { transform: scaleX(1); }
.cat-icon { width: 44px; height: 44px; margin: 0 auto 10px; background: var(--green-50); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.cat-card h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.cat-card span { font-size: 0.75rem; color: var(--text-muted); }

/* ── MAIN CONTENT GRID ── */
.content-section { padding: 48px 0; }
.content-grid { display: grid; grid-template-columns: 1fr 340px; gap: 36px; }

/* ── BLOG CARDS ── */
.blog-list { display: flex; flex-direction: column; gap: 24px; }
.blog-card { display: grid; grid-template-columns: 220px 1fr; gap: 20px; background: #fff; border: 1px solid var(--neutral-200); border-radius: 12px; overflow: hidden; transition: all .25s; text-decoration: none; color: inherit; }
.blog-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.07); transform: translateY(-2px); }
.blog-thumb-placeholder { width: 100%; height: 100%; min-height: 170px; background: linear-gradient(135deg, var(--green-100), var(--green-50)); display: flex; align-items: center; justify-content: center; color: var(--green-400); font-size: 2.5rem; }
.blog-body { padding: 20px 20px 20px 0; display: flex; flex-direction: column; justify-content: center; }
.blog-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.blog-tag { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--green-700); background: var(--green-100); padding: 3px 8px; border-radius: 4px; }
.blog-date { font-size: 0.78rem; color: var(--text-muted); }
.blog-body h3 { font-family: 'Playfair Display', serif; font-size: 1.18rem; font-weight: 700; line-height: 1.35; margin-bottom: 8px; color: var(--neutral-900); }
.blog-body p { font-size: 0.9rem; color: var(--neutral-600); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── BLOG ARTICLE ── */
.blog-article-header { margin-bottom: 28px; }
.blog-article-header h1 { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; line-height: 1.3; color: var(--neutral-900); margin-top: 10px; }
.blog-excerpt { font-size: 1.1rem; color: var(--neutral-600); margin-top: 10px; line-height: 1.6; }
.blog-content { font-size: 1.02rem; line-height: 1.8; color: var(--neutral-800); }
.blog-content h2 { font-family: 'Playfair Display', serif; font-size: 1.4rem; margin: 28px 0 12px; color: var(--neutral-900); }
.blog-content h3 { font-size: 1.15rem; margin: 24px 0 10px; color: var(--neutral-900); }
.blog-content p { margin-bottom: 16px; }
.blog-content ul, .blog-content ol { margin: 12px 0 16px 24px; }
.blog-content li { margin-bottom: 6px; }
.blog-content a { color: var(--green-600); text-decoration: underline; }
.blog-content img { max-width: 100%; border-radius: 8px; margin: 16px 0; }
.blog-content blockquote { border-left: 4px solid var(--green-500); padding: 12px 20px; margin: 16px 0; background: var(--green-50); color: var(--neutral-700); border-radius: 0 8px 8px 0; }

/* ── KEYWORD ARTICLE ── */
.keyword-article { font-size: 1rem; line-height: 1.75; color: var(--neutral-800); margin-bottom: 36px; padding-bottom: 28px; border-bottom: 2px solid var(--border); }
.keyword-article h2 { font-family: 'Playfair Display', serif; font-size: 1.35rem; margin: 24px 0 10px; color: var(--neutral-900); }
.keyword-article h3 { font-size: 1.1rem; margin: 20px 0 8px; color: var(--neutral-900); }
.keyword-article p { margin-bottom: 14px; }
.keyword-article ul, .keyword-article ol { margin: 10px 0 14px 24px; }
.keyword-article li { margin-bottom: 5px; }

/* ── SIDEBAR ── */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.sidebar-card { background: #fff; border: 1px solid var(--neutral-200); border-radius: 12px; padding: 22px; }
.sidebar-card h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--green-500); display: flex; align-items: center; gap: 8px; }
.sidebar-card h3 svg { width: 18px; height: 18px; color: var(--green-600); }
.keyword-list { display: flex; flex-direction: column; gap: 6px; }
.keyword-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--neutral-700); font-size: 0.88rem; font-weight: 500; transition: all .2s; counter-increment: kw; }
.keyword-item:hover { background: var(--green-50); color: var(--green-700); }
.keyword-item::before { content: counter(kw, decimal-leading-zero); font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; font-weight: 500; color: var(--green-500); margin-right: 10px; }
.keyword-item .kw-count { font-size: 0.72rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.newsletter-card { background: linear-gradient(135deg, var(--green-700), var(--green-900)) !important; color: #fff; border: none !important; }
.newsletter-card h3 { color: #fff; border-bottom-color: var(--green-400) !important; }
.newsletter-card p { font-size: 0.88rem; color: var(--green-200); margin-bottom: 14px; line-height: 1.5; }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input { flex: 1; padding: 10px 14px; border: 1px solid var(--green-500); border-radius: 8px; font-size: 0.88rem; font-family: 'Source Sans 3', sans-serif; background: rgba(255,255,255,0.1); color: #fff; outline: none; }
.newsletter-form input::placeholder { color: var(--green-300); }
.newsletter-form button { padding: 10px 18px; background: var(--green-400); color: var(--green-950); border: none; border-radius: 8px; font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: background .2s; }
.newsletter-form button:hover { background: var(--green-300); }

/* Related posts in sidebar */
.related-posts { display: flex; flex-direction: column; gap: 12px; }
.related-post-item { text-decoration: none; display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--neutral-100); }
.related-post-item:last-child { border-bottom: none; }
.related-date { font-size: 0.75rem; color: var(--text-muted); }
.related-title { font-size: 0.9rem; color: var(--neutral-800); font-weight: 500; transition: color .2s; }
.related-post-item:hover .related-title { color: var(--green-700); }

/* ── KEYWORD SHOWCASE ── */
.keyword-showcase { padding: 0 0 48px; }
.kw-showcase-grid, .keyword-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.kw-showcase-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; text-decoration: none; color: inherit; transition: all .25s; }
.kw-showcase-item:hover { border-color: var(--green-400); background: var(--green-50); transform: translateY(-1px); }
.kw-showcase-item h4 { font-size: 0.92rem; font-weight: 600; color: var(--neutral-800); margin-bottom: 6px; }
.kw-showcase-item p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kw-sub { font-size: 0.72rem; color: var(--green-600); font-weight: 600; display: inline-block; margin-bottom: 4px; }

/* ── SUBCATEGORY FILTER ── */
.subcategory-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; align-items: center; }
.filter-label { font-size: 0.85rem; font-weight: 600; color: var(--neutral-600); }
.filter-chip { font-size: 0.82rem; padding: 5px 14px; border: 1px solid var(--neutral-200); border-radius: 20px; text-decoration: none; color: var(--neutral-600); transition: all .2s; background: #fff; }
.filter-chip:hover, .filter-chip.active { background: var(--green-600); color: #fff; border-color: var(--green-600); }

/* ── CSE RESULTS ── */
.cse-results-wrapper { margin-top: 24px; }
.cse-heading { font-family: 'Playfair Display', serif; font-size: 1.2rem; margin-bottom: 16px; color: var(--neutral-800); }
.keyword-seo-box { background: var(--green-50); border: 1px solid var(--green-200); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.keyword-seo-box h2 { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--green-800); margin-bottom: 10px; }
.keyword-description { font-size: 0.92rem; color: var(--neutral-700); line-height: 1.6; }
.keyword-description p { margin-bottom: 8px; }
.read-more-link { display: inline-block; margin-top: 8px; color: var(--green-600); font-weight: 600; text-decoration: none; font-size: 0.88rem; }
.read-more-link:hover { color: var(--green-800); }
.search-empty { text-align: center; padding: 60px 20px; }
.search-empty h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; margin-bottom: 8px; }
.search-empty p { color: var(--text-muted); }

/* ── STATIC PAGE ── */
.static-page-content { max-width: 800px; font-size: 1rem; line-height: 1.8; }
.static-page-content h2 { font-family: 'Playfair Display', serif; font-size: 1.4rem; margin: 28px 0 12px; }
.static-page-content p { margin-bottom: 14px; }

/* ── PAGINATION ── */
.pagination-wrap { margin-top: 32px; display: flex; justify-content: center; }
.pagination-wrap nav { display: flex; gap: 4px; }
.pagination-wrap .page-link { padding: 8px 14px; border: 1px solid var(--neutral-200); border-radius: 6px; font-size: 0.88rem; color: var(--neutral-700); text-decoration: none; transition: all .2s; }
.pagination-wrap .page-link:hover { background: var(--green-50); border-color: var(--green-400); }
.pagination-wrap .page-item.active .page-link { background: var(--green-600); color: #fff; border-color: var(--green-600); }

/* ── FOOTER ── */
.footer { background: var(--neutral-900); color: var(--neutral-400); padding: 48px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 36px; }
.footer h4 { font-family: 'Playfair Display', serif; color: #fff; font-size: 1rem; margin-bottom: 16px; }
.footer p { font-size: 0.85rem; line-height: 1.6; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--neutral-400); text-decoration: none; font-size: 0.85rem; transition: color .2s; }
.footer-links a:hover { color: var(--green-400); }
.footer-bottom { border-top: 1px solid var(--neutral-800); padding: 20px 0; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; }
.footer-bottom a { color: var(--green-400); text-decoration: none; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.cat-card, .blog-card, .kw-showcase-item { animation: fadeUp 0.5s ease both; }
.cat-card:nth-child(2) { animation-delay: .05s; }
.cat-card:nth-child(3) { animation-delay: .1s; }
.cat-card:nth-child(4) { animation-delay: .15s; }
.cat-card:nth-child(5) { animation-delay: .2s; }
.cat-card:nth-child(6) { animation-delay: .25s; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .content-grid { grid-template-columns: 1fr; }
    .blog-card { grid-template-columns: 1fr; }
    .blog-thumb-placeholder { min-height: 120px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; padding: 16px 20px; box-shadow: 0 8px 24px rgba(0,0,0,0.1); border-top: 1px solid var(--border); }
    .main-nav.open { display: flex; }
    .mobile-menu-btn { display: block; }
}
@media (max-width: 600px) {
    .search-hero h1 { font-size: 1.5rem; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }
    .kw-showcase-grid, .keyword-grid { grid-template-columns: 1fr; }
    .topbar .container { flex-direction: column; gap: 4px; text-align: center; }
}

/* ── COPY ICON ── */
.keyword-copy-wrap{display:inline-flex;align-items:center;gap:8px;}
.copy-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid var(--neutral-300,#d4d4d4);border-radius:6px;background:var(--neutral-50,#fafafa);cursor:pointer;transition:all 0.2s;padding:0;color:var(--neutral-400,#a3a3a3);flex-shrink:0;}
.copy-btn:hover{border-color:var(--green-400,#4ade80);background:var(--green-50,#f0fdf4);color:var(--green-600,#16a34a);}
.copy-btn.copied{border-color:var(--green-500,#22c55e);background:var(--green-500,#22c55e);color:#fff;}
.copy-btn svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;}
.copy-tooltip{font-size:0.72rem;color:var(--green-600,#16a34a);opacity:0;transition:opacity 0.2s;font-weight:500;}
.copy-tooltip.show{opacity:1;}
.search-box { width: 700px; max-width: 100%; margin: 0 auto; position: relative; }
.keyword-article h2, .keyword-article h3, .keyword-article h4 { color: var(--green-800, #166534) !important; }
.pagination-wrap svg { width: 16px; height: 16px; display: inline; }
.pagination-wrap nav > div:first-child { display: none; }
