/* ============================================
   FinanceDay — Dark Cyberpunk Theme
   Black · Charcoal · Electric Blue
   ============================================ */

:root {
    --bg-base:    #05070f;
    --bg-deep:    #080c18;
    --bg-surface: #0d1117;
    --bg-card:    #111827;
    --bg-card2:   #141d2e;
    --bg-hover:   #1c2740;
    --bg-input:   #0a0f1c;

    --accent:        #3b82f6;
    --accent-bright: #60a5fa;
    --accent-dim:    #2563eb;
    --accent-glow:   rgba(59,130,246,0.18);
    --accent-glow2:  rgba(59,130,246,0.08);

    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #475569;
    --text-accent:    #60a5fa;

    --border:        rgba(255,255,255,0.06);
    --border-accent: rgba(59,130,246,0.35);
    --border-hover:  rgba(59,130,246,0.6);

    --topbar-h:    58px;
    --catstrip-h:  44px;
    --max-w:       1280px;
    --radius:      10px;
    --radius-sm:   6px;
    --radius-lg:   14px;

    --font-head: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --shadow-card: 0 2px 16px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 20px rgba(59,130,246,0.15);
    --transition:  0.2s ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-base);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
::selection { background: var(--accent); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* Container */
.wrap {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== TOPBAR ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--topbar-h);
    background: rgba(5,7,15,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition);
}
.topbar.scrolled {
    box-shadow: 0 1px 30px rgba(0,0,0,0.6), 0 0 0 1px var(--border-accent);
}
.topbar-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* Burger */
.burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.burger:hover { background: var(--bg-hover); }
.burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: background var(--transition);
}
.burger:hover span { background: var(--accent-bright); }

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.03em;
    color: var(--text-primary);
    transition: color var(--transition);
}
.brand:hover { color: var(--accent-bright); }
.brand-mark {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 16px rgba(59, 130, 246, 0.4);
    border-radius: 50%;
}
.brand-name { white-space: nowrap; }

/* Top nav */
.topnav {
    display: none;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}
.topnav-link {
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.topnav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Promo btn */
.btn-promo {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
    color: #fff;
    border-radius: var(--radius-sm);
    transition: opacity var(--transition);
    white-space: nowrap;
}
.btn-promo:hover { opacity: 0.85; }

/* Login btn */
.btn-login {
    padding: 7px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-bright);
    border: 1px solid var(--border-accent);
    border-radius: 50px;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-login:hover {
    background: var(--accent-glow2);
    border-color: var(--border-hover);
    color: #fff;
}

/* User chip */
.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    transition: all var(--transition);
    color: var(--text-primary);
}
.user-chip:hover { border-color: var(--border-accent); background: var(--bg-hover); }
.user-chip-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.user-chip-letter {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff;
}
.user-chip-name {
    font-size: 13px;
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== CATEGORY STRIP ===== */
.catstrip {
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    height: var(--catstrip-h);
    overflow: hidden;
    position: sticky;
    top: var(--topbar-h);
    z-index: 190;
}
.catstrip-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.catstrip-inner::-webkit-scrollbar { display: none; }
.catpill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition);
}
.catpill:hover { color: var(--text-primary); background: var(--bg-hover); border-color: var(--border); }
.catpill.active { color: var(--accent-bright); background: var(--accent-glow2); border-color: var(--border-accent); }
.catpill-icon, .catpill-icon-wrap { width: 13px; height: 13px; display: inline-flex; align-items: center; }
.catpill-icon-wrap svg { width: 13px; height: 13px; }

/* ===== DRAWER ===== */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 290;
}
.drawer-overlay.open { display: block; }
.drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 300px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.drawer-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.drawer-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.drawer-close svg { width: 18px; height: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 0; }
.drawer-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 0 8px 8px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: all var(--transition);
}
.drawer-user:hover { border-color: var(--border-accent); }
.drawer-user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.drawer-user-letter {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: #fff;
}
.drawer-user-name { font-size: 14px; font-weight: 600; }
.drawer-user-sub { font-size: 12px; color: var(--text-secondary); }
.drawer-section-label {
    padding: 16px 16px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.drawer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.drawer-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.drawer-link-icon { width: 16px; height: 16px; flex-shrink: 0; display: inline-flex; }
.drawer-link-icon svg { width: 16px; height: 16px; }
.drawer-link-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 7px;
    border-radius: 10px;
}
.drawer-footer { padding: 16px; border-top: 1px solid var(--border); margin-top: 8px; }
.drawer-login { display: block; text-align: center; width: 100%; }
.drawer-logout { font-size: 13px; color: var(--text-muted); transition: color var(--transition); }
.drawer-logout:hover { color: #f87171; }

/* ===== SITE MAIN ===== */
.site-main { flex: 1; padding-bottom: 60px; }
.page-wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ===== GRID SECTION ===== */
.grid-section { max-width: var(--max-w); margin: 0 auto; padding: 32px 20px; }
.grid-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
}
.grid-section-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--text-primary); }
.grid-section-line { flex: 1; height: 1px; background: var(--border); }
.grid-section-more { font-size: 13px; font-weight: 500; color: var(--accent-bright); white-space: nowrap; transition: color var(--transition); }
.grid-section-more:hover { color: #fff; }

/* ===== ARTICLE CARDS ===== */
.articles-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.acard {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}
.acard:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow-glow), var(--shadow-card); }
.acard-img { display: block; width: 100%; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-card2); }
.acard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.acard:hover .acard-img img { transform: scale(1.04); }
.acard-no-img {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--bg-card2) 0%, var(--bg-hover) 100%);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.acard-no-img svg { width: 36px; height: 36px; opacity: 0.3; }
.acard-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.acard-meta { display: flex; align-items: center; gap: 8px; }
.acard-cat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-bright);
    background: var(--accent-glow2);
    padding: 3px 8px;
    border-radius: 4px;
}
.acard-cat svg { width: 11px; height: 11px; }
.acard-date { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.acard-title { font-family: var(--font-head); font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text-primary); transition: color var(--transition); }
.acard-title a { color: inherit; }
.acard:hover .acard-title a { color: var(--accent-bright); }
.acard-excerpt { font-size: 13px; color: var(--text-secondary); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.acard-author { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.acard-author-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.acard-author-letter {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.acard-author-name { font-size: 12px; font-weight: 500; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard-views { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.acard-views svg { width: 13px; height: 13px; }

/* ===== HERO CARD ===== */
.hero-card { max-width: var(--max-w); margin: 0 auto; padding: 28px 20px 0; }
.hero-card-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-height: 340px;
}
.hero-card-inner:hover { border-color: var(--border-accent); box-shadow: var(--shadow-glow); }
.hero-card-img { display: block; overflow: hidden; background: var(--bg-card2); }
.hero-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hero-card-inner:hover .hero-card-img img { transform: scale(1.03); }
.hero-card-body { padding: 36px 40px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.hero-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-bright);
    background: var(--accent-glow2);
    border: 1px solid var(--border-accent);
    padding: 4px 10px;
    border-radius: 4px;
    width: fit-content;
}
.hero-card-title { font-family: var(--font-head); font-size: 26px; font-weight: 700; line-height: 1.3; color: var(--text-primary); transition: color var(--transition); }
.hero-card-inner:hover .hero-card-title { color: var(--accent-bright); }
.hero-card-excerpt { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }
.hero-card-foot { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.hero-card-author { display: flex; align-items: center; gap: 8px; }
.hero-card-author-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.hero-card-author-letter {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff;
}
.hero-card-author-name { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.hero-card-views { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-muted); margin-left: auto; }
.hero-card-views svg { width: 14px; height: 14px; }
.hero-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: background var(--transition);
    width: fit-content;
}
.hero-card-cta:hover { background: var(--accent-dim); color: #fff; }
.hero-card-cta svg { width: 16px; height: 16px; }

/* ===== ARTICLE PAGE ===== */
.article-layout { max-width: 820px; margin: 0 auto; padding: 32px 20px; }
.article-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 28px; flex-wrap: wrap; }
.article-breadcrumb a { color: var(--text-secondary); transition: color var(--transition); }
.article-breadcrumb a:hover { color: var(--accent-bright); }
.article-breadcrumb svg { width: 14px; height: 14px; flex-shrink: 0; }
.article-header-block { margin-bottom: 28px; }
.article-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.article-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-bright);
    background: var(--accent-glow2);
    border: 1px solid var(--border-accent);
    padding: 4px 10px;
    border-radius: 4px;
}
.article-h1 { font-family: var(--font-head); font-size: 34px; font-weight: 700; line-height: 1.25; color: var(--text-primary); margin-bottom: 16px; }
.article-lead { font-size: 17px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 20px; }
.article-byline { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.article-byline-author { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); transition: color var(--transition); }
.article-byline-author:hover { color: var(--accent-bright); }
.article-byline-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.article-byline-letter {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #fff;
}
.article-byline-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.article-byline-date { font-size: 12px; color: var(--text-muted); }
.article-byline-views { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-muted); margin-left: auto; }
.article-byline-views svg { width: 14px; height: 14px; }
.article-cover { margin: 28px 0; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.article-cover img { width: 100%; max-height: 480px; object-fit: cover; }

/* Article body */
.article-body { font-size: 16px; line-height: 1.8; color: var(--text-secondary); }
.article-body h1,.article-body h2,.article-body h3,.article-body h4 { font-family: var(--font-head); color: var(--text-primary); margin: 28px 0 12px; line-height: 1.3; }
.article-body h2 { font-size: 24px; }
.article-body h3 { font-size: 20px; }
.article-body p { margin-bottom: 18px; }
.article-body a { color: var(--accent-bright); text-decoration: underline; text-decoration-color: var(--border-accent); }
.article-body a:hover { color: #fff; }
.article-body ul,.article-body ol { margin: 0 0 18px 24px; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 3px solid var(--accent);
    background: var(--bg-card2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-secondary);
}
.article-body pre,.article-body code { font-family: 'JetBrains Mono','Fira Code',monospace; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.article-body pre { padding: 16px; overflow-x: auto; margin-bottom: 18px; font-size: 13px; }
.article-body code { padding: 2px 6px; font-size: 13px; }
.article-body img { border-radius: var(--radius); margin: 20px 0; }

.article-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    margin-top: 32px;
    flex-wrap: wrap;
}
.reaction-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
}
.reaction-btn:hover { border-color: var(--border-accent); color: var(--text-primary); background: var(--bg-hover); }
.reaction-btn.active { border-color: var(--accent); color: var(--accent-bright); background: var(--accent-glow2); }
.reaction-btn svg { width: 16px; height: 16px; }
.share-group { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.share-btn:hover { border-color: var(--border-accent); color: var(--accent-bright); background: var(--bg-hover); }
.share-btn svg { width: 16px; height: 16px; }

/* Recommended */
.recommended-section { max-width: 820px; margin: 0 auto; padding: 0 20px 48px; }
.recommended-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 20px; padding-top: 8px; border-top: 1px solid var(--border); }
.recommended-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

/* ===== BREADCRUMB ===== */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-secondary); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--accent-bright); }

/* ===== PAGE HEADER ===== */
.page-header-block { padding: 40px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.page-header-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-bright); margin-bottom: 12px; }
.page-header-eyebrow svg { width: 14px; height: 14px; }
.page-header-h1 { font-family: var(--font-head); font-size: 36px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }
.page-header-sub { font-size: 16px; color: var(--text-secondary); }

/* ===== SEARCH ===== */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition);
    margin-bottom: 28px;
}
.search-bar:focus-within { border-color: var(--border-accent); }
.search-bar-icon { padding: 0 14px; color: var(--text-muted); display: flex; align-items: center; }
.search-bar-icon svg { width: 16px; height: 16px; }
.search-input { flex: 1; background: none; border: none; outline: none; font: inherit; font-size: 14px; color: var(--text-primary); padding: 12px 0; }
.search-input::placeholder { color: var(--text-muted); }
.search-submit { padding: 10px 20px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; border-left: 1px solid var(--border-accent); transition: background var(--transition); }
.search-submit:hover { background: var(--accent-dim); }

/* ===== FILTER TABS ===== */
.filter-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 28px; }
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all var(--transition);
}
.filter-tab:hover { border-color: var(--border-accent); color: var(--text-primary); }
.filter-tab.active { border-color: var(--accent); color: var(--accent-bright); background: var(--accent-glow2); }

/* ===== COURSES GRID ===== */
.courses-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 32px; }
.courses-featured { grid-template-columns: repeat(2,1fr); }
.course-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: inherit;
    transition: all var(--transition);
}
.course-card:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow-glow), var(--shadow-card); }
.courses-featured .course-card { border-color: var(--border-accent); }
.course-img { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-card2); }
.course-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.course-card:hover .course-img img { transform: scale(1.04); }
.course-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.course-school { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-bright); }
.course-title { font-family: var(--font-head); font-size: 15px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.courses-featured .course-title { font-size: 18px; }
.course-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.course-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.course-rating { display: flex; align-items: center; gap: 4px; color: #fbbf24; font-weight: 600; }
.reviews-count { color: var(--text-muted); font-weight: 400; }
.course-price { font-size: 15px; font-weight: 700; color: var(--accent-bright); margin-top: 8px; }
.course-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-bright);
    transition: all var(--transition);
}
.course-card:hover .course-cta { background: var(--accent); color: #fff; }
.course-cta svg { width: 14px; height: 14px; }

/* ===== SERVICES ===== */
.services-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 32px; }
.service-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}
.service-card:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.service-img { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-card2); }
.service-img img { width: 100%; height: 100%; object-fit: cover; }
.service-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.service-category { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-bright); }
.service-name { font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--text-primary); }
.service-desc { font-size: 13px; color: var(--text-secondary); }
.service-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.service-tag { font-size: 11px; color: var(--text-muted); background: var(--bg-surface); border: 1px solid var(--border); padding: 2px 8px; border-radius: 4px; }
.service-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg-surface); }
.service-visit { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--accent-bright); transition: color var(--transition); }
.service-visit:hover { color: #fff; }
.service-visit svg { width: 14px; height: 14px; }
.service-pricing { font-size: 12px; color: var(--text-muted); }

/* ===== BUSINESS TOOLS ===== */
.tools-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.tool-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}
.tool-card:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.tool-img { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-card2); }
.tool-img img { width: 100%; height: 100%; object-fit: cover; }
.tool-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.tool-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-bright); }
.tool-name { font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--text-primary); }
.tool-desc { font-size: 13px; color: var(--text-secondary); }
.tool-foot { padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg-surface); display: flex; align-items: center; justify-content: space-between; }
.tool-link { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--accent-bright); transition: color var(--transition); }
.tool-link:hover { color: #fff; }
.tool-link svg { width: 14px; height: 14px; }
.tool-free { font-size: 12px; color: #4ade80; font-weight: 500; }
.tool-paid { font-size: 12px; color: var(--text-muted); }

/* ===== ARTICLE WITH ASIDE ===== */
.article-with-aside { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.article-aside { position: sticky; top: calc(var(--topbar-h) + var(--catstrip-h) + 20px); }
.aside-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.aside-card-title {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.aside-card-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.aside-list { display: flex; flex-direction: column; gap: 12px; }
.aside-item { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.aside-item:last-child { border-bottom: none; padding-bottom: 0; }
.aside-item-title { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.4; transition: color var(--transition); }
.aside-item-title:hover { color: var(--accent-bright); }
.aside-item-views { font-size: 11px; color: var(--text-muted); }

/* ===== ADS ===== */
.ad-banner { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; position: relative; overflow: hidden; margin-bottom: 16px; }
.ad-label { display: block; font-size: 10px; text-align: center; color: var(--text-muted); padding: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.ad-banner img { width: 100%; border-radius: var(--radius-sm); }
.feed-ad-banner { grid-column: 1/-1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; text-align: center; overflow: hidden; }

/* ===== AUTHORS ===== */
.authors-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.author-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 16px; text-align: center; transition: all var(--transition); }
.author-card:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.author-card-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; border: 2px solid var(--border-accent); }
.author-card-letter {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; color: #fff;
    margin: 0 auto 12px;
}
.author-card-name { font-family: var(--font-head); font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.author-card-count { font-size: 12px; color: var(--text-muted); }
.author-hero {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 32px;
}
.author-hero-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border-accent); flex-shrink: 0; }
.author-hero-letter {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.author-hero-name { font-family: var(--font-head); font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.author-hero-bio { font-size: 14px; color: var(--text-secondary); }
.author-hero-stats { display: flex; gap: 24px; margin-top: 12px; }
.author-stat { font-size: 13px; color: var(--text-muted); }
.author-stat strong { color: var(--text-primary); font-weight: 700; }

/* ===== PROFILE ===== */
.profile-layout { max-width: 900px; margin: 0 auto; padding: 32px 20px; }
.profile-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border-accent); }
.profile-letter {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; color: #fff;
}
.profile-name { font-family: var(--font-head); font-size: 24px; font-weight: 700; }
.profile-role {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-bright);
    background: var(--accent-glow2);
    border: 1px solid var(--border-accent);
    padding: 3px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 6px;
}
.profile-stats { display: flex; gap: 20px; margin-top: 10px; }
.profile-stat { font-size: 13px; color: var(--text-muted); }
.profile-stat strong { color: var(--text-primary); font-weight: 700; }
.profile-actions { margin-left: auto; display: flex; gap: 10px; }
.profile-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.profile-tab { display: flex; align-items: center; gap: 6px; padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--transition); }
.profile-tab:hover { color: var(--text-primary); }
.profile-tab.active { color: var(--accent-bright); border-bottom-color: var(--accent); }

/* ===== FORMS ===== */
.form-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; }
.form-title { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.form-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--border-accent); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { appearance: none; cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }
.btn-secondary { background: var(--bg-card); color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-accent); color: var(--text-primary); }
.btn-danger { background: transparent; color: #f87171; border-color: rgba(248,113,113,0.3); }
.btn-danger:hover { background: rgba(248,113,113,0.1); }
.btn svg { width: 16px; height: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.flash-messages { margin-bottom: 16px; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.alert-success { background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.3); color: #4ade80; }
.alert-error { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.3); color: #f87171; }
.alert-warning { background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.3); color: #fbbf24; }
.alert-info { background: var(--accent-glow2); border: 1px solid var(--border-accent); color: var(--accent-bright); }

/* ===== AUTH ===== */
.auth-page {
    min-height: calc(100vh - var(--topbar-h) - var(--catstrip-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(59,130,246,0.18) 0%, transparent 70%),
                radial-gradient(ellipse 60% 40% at 80% 80%, rgba(99,102,241,0.1) 0%, transparent 60%),
                var(--bg-base);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(145deg, #131c2e 0%, #0f1621 100%);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 20px;
    padding: 44px 40px 36px;
    box-shadow: 0 0 60px rgba(59,130,246,0.08), 0 24px 60px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59,130,246,0.6), rgba(99,102,241,0.6), transparent);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-title { font-family: var(--font-head); font-size: 26px; font-weight: 800; color: var(--text-primary); text-align: center; margin-bottom: 6px; letter-spacing: -0.02em; }
.auth-sub { font-size: 14px; color: var(--text-secondary); text-align: center; margin-bottom: 32px; }
.auth-footer { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 24px; }
.auth-footer a { color: var(--accent-bright); font-weight: 500; }
.auth-footer a:hover { color: #fff; }

/* ===== SEO BLOCK ===== */
.seo-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 40px;
    overflow: hidden;
    max-height: 140px;
    position: relative;
    transition: max-height 0.4s ease;
}
.seo-block.expanded { max-height: 2000px; }
.seo-block:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--bg-card));
}
.seo-block-title { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
.seo-block-content { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.seo-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-bright);
    margin-top: 12px;
    padding-top: 8px;
    background: none;
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
    z-index: 1;
}
.seo-toggle:hover { color: #fff; }
.seo-toggle svg { width: 14px; height: 14px; transition: transform 0.3s; }
.seo-block.expanded .seo-toggle svg { transform: rotate(180deg); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: 0.3; }
.empty-state-title { font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-text { font-size: 14px; margin-bottom: 20px; }

/* ===== BACK LINK ===== */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-top: 32px; transition: color var(--transition); }
.back-link:hover { color: var(--accent-bright); }
.back-link svg { width: 16px; height: 16px; }

/* ===== FOOTER ===== */
.footer { background: var(--bg-deep); border-top: 1px solid var(--border); margin-top: auto; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 48px 20px 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand { margin-bottom: 14px; }
.footer-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; }
.footer-social { display: flex; gap: 8px; }
.social-btn {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.social-btn:hover { border-color: var(--border-accent); color: var(--accent-bright); }
.footer-col-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 14px; }
.footer-link { display: flex; align-items: center; font-size: 13px; color: var(--text-secondary); margin-bottom: 9px; transition: color var(--transition); }
.footer-link:hover { color: var(--accent-bright); }
.footer-bottom { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); padding-top: 24px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.footer-bottom-sep { opacity: 0.3; }

/* ===== 404 ===== */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; padding: 40px 20px; }
.error-code { font-family: var(--font-head); font-size: 120px; font-weight: 700; line-height: 1; background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 16px; }
.error-title { font-family: var(--font-head); font-size: 28px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }
.error-text { font-size: 15px; color: var(--text-secondary); margin-bottom: 28px; }

/* ===== UTILS ===== */
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.text-accent { color: var(--accent-bright); }
.text-muted { color: var(--text-muted); }
[data-lucide] svg, i[data-lucide] { display: inline-flex; vertical-align: middle; }

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) { .topnav { display: flex; } .burger { display: none; } }

@media (max-width: 1100px) {
    .articles-grid { grid-template-columns: repeat(2,1fr); }
    .courses-grid { grid-template-columns: repeat(2,1fr); }
    .services-grid { grid-template-columns: repeat(2,1fr); }
    .tools-grid { grid-template-columns: repeat(2,1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .article-with-aside { grid-template-columns: 1fr; }
    .article-aside { position: static; }
    .recommended-grid { grid-template-columns: repeat(2,1fr); }
    .authors-grid { grid-template-columns: repeat(3,1fr); }
    .hero-card-body { padding: 24px 28px; }
    .hero-card-title { font-size: 22px; }
}

@media (max-width: 768px) {
    :root { --topbar-h: 52px; }
    .hero-card-inner { grid-template-columns: 1fr; }
    .hero-card-img { aspect-ratio: 16/9; max-height: 220px; }
    .hero-card-body { padding: 20px; }
    .hero-card-title { font-size: 20px; }
    .articles-grid, .courses-grid, .courses-featured, .services-grid, .tools-grid { grid-template-columns: 1fr; }
    .authors-grid { grid-template-columns: repeat(2,1fr); }
    .recommended-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .page-header-h1 { font-size: 26px; }
    .article-h1 { font-size: 24px; }
    .error-code { font-size: 80px; }
    .author-hero { flex-direction: column; text-align: center; }
    .author-hero-stats { justify-content: center; }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-actions { margin: 0; }
}

@media (max-width: 480px) {
    .wrap, .grid-section, .page-wrap { padding-left: 12px; padding-right: 12px; }
    .auth-card { padding: 24px 20px; }
    .form-block { padding: 20px; }
}
