/*
Theme Name: CryptoGazette Child
Theme URI: https://cryptogazette.com
Description: Premium crypto news child theme for CryptoGazette. World-class publication design inspired by CoinTelegraph, CoinDesk, and Decrypt.
Author: CryptoGazette
Author URI: https://cryptogazette.com
Template: kadence
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cryptogazette-child
Tags: dark-theme, news, magazine, crypto, kadence-child
*/

/* ============================================================
   CSS CUSTOM PROPERTIES — COLOR SYSTEM
   ============================================================ */
:root {
    /* Core Background */
    --bg-primary:       #0a0a0f;
    --bg-surface:       #12121a;
    --bg-surface-alt:   #1a1a28;
    --bg-surface-hover: #1f1f30;

    /* Borders */
    --border-primary:   #2a2a3a;
    --border-subtle:    #1e1e2e;
    --border-accent:    rgba(0, 212, 170, 0.3);

    /* Text */
    --text-primary:     #e8e8ed;
    --text-secondary:   #8888a0;
    --text-muted:       #555570;
    --text-inverse:     #0a0a0f;

    /* Accent Colors */
    --accent:           #00d4aa;
    --accent-hover:     #00b894;
    --accent-dim:       rgba(0, 212, 170, 0.1);
    --accent-dim-hover: rgba(0, 212, 170, 0.2);
    --accent-secondary: #6366f1;
    --accent-sec-dim:   rgba(99, 102, 241, 0.1);

    /* Semantic Colors */
    --bitcoin-gold:     #f7931a;
    --success:          #10b981;
    --success-dim:      rgba(16, 185, 129, 0.1);
    --danger:           #ef4444;
    --danger-dim:       rgba(239, 68, 68, 0.1);
    --warning:          #f59e0b;
    --warning-dim:      rgba(245, 158, 11, 0.1);

    /* Ticker */
    --ticker-bg:        #0d0d15;

    /* Typography */
    --font-headline:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs:   4px;
    --space-sm:   8px;
    --space-md:   16px;
    --space-lg:   24px;
    --space-xl:   32px;
    --space-2xl:  48px;
    --space-3xl:  64px;
    --space-4xl:  96px;

    /* Layout */
    --max-width:        1320px;
    --content-width:    720px;
    --header-height:    68px;
    --ticker-height:    42px;

    /* Radius */
    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.4), 0 0 0 1px var(--border-primary);
    --shadow-card-hover: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px var(--border-accent);
    --shadow-accent: 0 0 20px rgba(0, 212, 170, 0.15);

    /* Transitions */
    --transition-fast:   0.15s ease;
    --transition-base:   0.25s ease;
    --transition-slow:   0.4s ease;
    --transition-spring: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Glassmorphism */
    --glass-bg:     #0d0d15;
    --glass-border: rgba(42, 42, 58, 0.8);
    --glass-blur:   blur(20px) saturate(180%);
}

/* Light Mode Override */
[data-theme="light"] {
    --bg-primary:       #f5f5f7;
    --bg-surface:       #ffffff;
    --bg-surface-alt:   #f0f0f5;
    --bg-surface-hover: #e8e8f0;
    --border-primary:   #e0e0ea;
    --border-subtle:    #ebebf5;
    --text-primary:     #0a0a0f;
    --text-secondary:   #555570;
    --text-muted:       #8888a0;
    --ticker-bg:        #0a0a0f;
    --glass-bg:     rgba(245, 245, 247, 0.85);
    --glass-border: rgba(224, 224, 234, 0.8);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.08), 0 0 0 1px var(--border-primary);
    --shadow-card-hover: 0 8px 32px rgba(0,0,0,0.15), 0 0 0 1px var(--border-accent);
}

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--border-primary) var(--bg-primary); }

/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

img { max-width: 100%; height: auto; display: block; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headline);
    color: var(--text-primary);
    line-height: 1.2;
    font-weight: 700;
}

p { color: var(--text-secondary); margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: var(--space-lg); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.cg-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.cg-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.cg-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.cg-flex { display: flex; align-items: center; }
.cg-flex-between { display: flex; align-items: center; justify-content: space-between; }
.cg-flex-center { display: flex; align-items: center; justify-content: center; }

/* Screen reader only */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   PRICE TICKER BAR
   ============================================================ */
#cg-ticker {
    background: var(--ticker-bg);
    border-bottom: 1px solid var(--border-primary);
    height: var(--ticker-height);
    overflow: hidden;
    position: relative;
    z-index: 1001;
}

.cg-ticker-inner {
    display: flex;
    align-items: center;
    height: 100%;
}

.cg-ticker-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0 var(--space-md);
    background: var(--accent);
    height: 100%;
    white-space: nowrap;
    font-family: var(--font-headline);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-inverse);
    flex-shrink: 0;
    z-index: 2;
}

.cg-ticker-label svg { width: 14px; height: 14px; }

.cg-ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

.cg-ticker-content {
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    animation: cg-ticker-scroll 45s linear infinite;
    width: max-content;
}

.cg-ticker-content:hover { animation-play-state: paused; }

@keyframes cg-ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.cg-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 var(--space-lg);
    border-right: 1px solid var(--border-primary);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.cg-ticker-item:hover { background: var(--bg-surface); }

.cg-ticker-coin {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.cg-ticker-price {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.cg-ticker-change {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}
.cg-ticker-change.positive {
    color: var(--success);
    background: var(--success-dim);
}
.cg-ticker-change.negative {
    color: var(--danger);
    background: var(--danger-dim);
}

.cg-ticker-loading {
    padding: 0 var(--space-md);
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================================
   HEADER
   ============================================================ */
#cg-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--glass-border);
    transition: box-shadow var(--transition-base), background var(--transition-slow);
}

#cg-header.scrolled {
    box-shadow: var(--shadow-lg);
    background: #0a0a0f;
}

[data-theme="light"] #cg-header.scrolled {
    background: rgba(245, 245, 247, 0.95);
}

.cg-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: var(--space-lg);
}

/* Logo */
.cg-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    flex-shrink: 0;
}

.cg-logo-svg { width: 36px; height: 36px; }

.cg-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.cg-logo-name {
    font-family: var(--font-headline);
    font-weight: 800;
    font-size: 18px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.cg-logo-name span { color: var(--accent); }

.cg-logo-tagline {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Primary Navigation */
#cg-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cg-nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.cg-nav-list > li > a {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    font-family: var(--font-headline);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    text-decoration: none;
    position: relative;
    transition: color var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
}

.cg-nav-list > li > a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--accent);
    border-radius: var(--radius-full);
    transform: scaleX(0);
    transition: transform var(--transition-spring);
}

.cg-nav-list > li > a:hover {
    color: var(--text-primary);
    background: var(--accent-dim);
}

.cg-nav-list > li > a:hover::after,
.cg-nav-list > li.current-menu-item > a::after,
.cg-nav-list > li.current-menu-ancestor > a::after {
    transform: scaleX(1);
}

.cg-nav-list > li.current-menu-item > a,
.cg-nav-list > li.current-menu-ancestor > a {
    color: var(--accent);
}

/* Header Controls */
.cg-header-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.cg-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cg-icon-btn:hover {
    background: var(--accent-dim);
    border-color: var(--border-accent);
    color: var(--accent);
}

.cg-icon-btn svg { width: 18px; height: 18px; }

/* Mobile Hamburger */
#cg-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: none;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 8px;
    transition: all var(--transition-fast);
}

#cg-hamburger span {
    display: block;
    height: 2px;
    background: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

#cg-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
#cg-hamburger.open span:nth-child(2) { opacity: 0; transform: translateX(-8px); }
#cg-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================================
   MOBILE NAV DRAWER
   ============================================================ */
#cg-mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--bg-surface);
    z-index: 9999;
    overflow-y: auto;
    transition: right var(--transition-slow) cubic-bezier(0.16, 1, 0.3, 1);
    padding: var(--space-xl);
    border-left: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

#cg-mobile-nav.open { right: 0; }

.cg-mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-primary);
}

.cg-mobile-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-sm);
    line-height: 1;
}
.cg-mobile-close svg { width: 20px; height: 20px; }

.cg-mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cg-mobile-nav-list a {
    display: block;
    padding: 12px 16px;
    font-family: var(--font-headline);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.cg-mobile-nav-list a:hover,
.cg-mobile-nav-list .current-menu-item a {
    color: var(--accent);
    background: var(--accent-dim);
}

#cg-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
    backdrop-filter: blur(4px);
}

#cg-nav-overlay.open { opacity: 1; pointer-events: all; }

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
#cg-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.97);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    backdrop-filter: blur(10px);
}

#cg-search-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.cg-search-close {
    position: absolute;
    top: var(--space-xl);
    right: var(--space-xl);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    transition: color var(--transition-fast);
}
.cg-search-close:hover { color: var(--accent); }

.cg-search-form-wrap {
    width: 100%;
    max-width: 680px;
    padding: 0 var(--space-lg);
}

.cg-search-hint {
    font-family: var(--font-headline);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cg-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--border-primary);
    transition: border-color var(--transition-fast);
}

.cg-search-input-wrap:focus-within {
    border-color: var(--accent);
}

#cg-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-headline);
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 700;
    color: var(--text-primary);
    padding: var(--space-md) 0;
    caret-color: var(--accent);
}

#cg-search-input::placeholder { color: var(--text-muted); }

.cg-search-submit {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: var(--space-sm);
}
.cg-search-submit svg { width: 28px; height: 28px; }

#cg-search-results {
    margin-top: var(--space-xl);
    width: 100%;
    max-width: 680px;
    padding: 0 var(--space-lg);
}

.cg-search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.cg-search-result-item:hover { padding-left: var(--space-sm); }

.cg-search-result-img {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-surface-alt);
}

.cg-search-result-title {
    font-family: var(--font-headline);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.cg-search-result-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================================
   HERO SECTION — HOMEPAGE
   ============================================================ */
#cg-hero {
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid var(--border-primary);
}

.cg-hero-grid {
    display: grid;
    grid-template-columns: 60fr 40fr;
    gap: var(--space-lg);
    align-items: stretch;
}

/* Featured Article */
.cg-hero-feature {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-decoration: none;
    background: var(--bg-surface);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.cg-hero-feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.cg-hero-feature-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.cg-hero-feature:hover .cg-hero-feature-img {
    transform: scale(1.03);
}

.cg-hero-feature-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 10, 15, 0.97) 0%,
        rgba(10, 10, 15, 0.7) 40%,
        rgba(10, 10, 15, 0.1) 100%
    );
}

.cg-hero-feature-body {
    position: relative;
    z-index: 2;
    padding: var(--space-xl);
}

/* Hero Sidebar List */
.cg-hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.cg-hero-sidebar-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-fast);
    align-items: flex-start;
    flex: 1;
}

.cg-hero-sidebar-item:hover {
    background: var(--bg-surface-alt);
    border-color: var(--border-accent);
    transform: translateX(3px);
}

.cg-hero-sidebar-img {
    width: 80px;
    height: 64px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-surface-alt);
}

.cg-hero-sidebar-content { flex: 1; min-width: 0; }

.cg-hero-sidebar-title {
    font-family: var(--font-headline);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

/* ============================================================
   CATEGORY BADGE / PILL
   ============================================================ */
.cg-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-family: var(--font-headline);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all var(--transition-fast);
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0, 212, 170, 0.2);
    white-space: nowrap;
}

.cg-badge:hover {
    background: var(--accent);
    color: var(--text-inverse);
}

.cg-badge--bitcoin  { background: rgba(247, 147, 26, 0.1);  color: var(--bitcoin-gold);  border-color: rgba(247, 147, 26, 0.25); }
.cg-badge--ethereum { background: rgba(99, 102, 241, 0.1);  color: var(--accent-secondary); border-color: rgba(99, 102, 241, 0.25); }
.cg-badge--defi     { background: rgba(16, 185, 129, 0.1);  color: var(--success);  border-color: rgba(16, 185, 129, 0.25); }
.cg-badge--nft      { background: rgba(245, 158, 11, 0.1);  color: var(--warning);  border-color: rgba(245, 158, 11, 0.25); }
.cg-badge--analysis { background: rgba(239, 68, 68, 0.1);   color: var(--danger);   border-color: rgba(239, 68, 68, 0.25); }

/* ============================================================
   ARTICLE META
   ============================================================ */
.cg-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}

.cg-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cg-meta-item svg { width: 13px; height: 13px; }

.cg-meta--light .cg-meta-item { color: rgba(232, 232, 237, 0.6); }

/* ============================================================
   TRENDING BAR
   ============================================================ */
#cg-trending {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-primary);
    padding: var(--space-md) 0;
}

.cg-trending-inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.cg-trending-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-headline);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.cg-trending-label svg { width: 14px; height: 14px; }

.cg-trending-divider {
    width: 1px;
    height: 28px;
    background: var(--border-primary);
    flex-shrink: 0;
}

.cg-trending-scroll {
    overflow: hidden;
    flex: 1;
}

.cg-trending-list {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}
.cg-trending-list::-webkit-scrollbar { display: none; }

.cg-trending-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.cg-trending-item:hover {
    background: var(--accent-dim);
    border-color: var(--border-accent);
}

.cg-trending-num {
    font-family: var(--font-headline);
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
    min-width: 20px;
}

.cg-trending-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   CATEGORY SECTION HEADERS
   ============================================================ */
.cg-section {
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid var(--border-primary);
}

.cg-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    padding-left: var(--space-md);
    border-left: 3px solid var(--accent);
}

.cg-section-header.bitcoin-color    { border-left-color: var(--bitcoin-gold); }
.cg-section-header.ethereum-color   { border-left-color: var(--accent-secondary); }
.cg-section-header.defi-color       { border-left-color: var(--success); }
.cg-section-header.analysis-color   { border-left-color: var(--danger); }

.cg-section-title {
    font-family: var(--font-headline);
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.cg-view-all {
    font-family: var(--font-headline);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap var(--transition-spring);
}

.cg-view-all:hover { gap: 9px; }
.cg-view-all svg { width: 14px; height: 14px; }

/* ============================================================
   ARTICLE CARDS
   ============================================================ */
.cg-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.cg-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover), var(--shadow-accent);
    border-color: var(--border-accent);
}

/* Fade-in animation class */
.cg-card.fade-in-target {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow var(--transition-base), border-color var(--transition-base);
}

.cg-card.fade-in-target.visible {
    opacity: 1;
    transform: translateY(0);
}

.cg-card.fade-in-target:hover {
    transform: translateY(-4px);
}

.cg-card-img-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-surface-alt);
}

.cg-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cg-card:hover .cg-card-img { transform: scale(1.05); }

.cg-card-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: 1;
}

.cg-card-body {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex: 1;
}

.cg-card-title {
    font-family: var(--font-headline);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-fast);
}

.cg-card:hover .cg-card-title { color: var(--accent); }

.cg-card-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.cg-card-footer {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Placeholder image for cards without thumbnail */
.cg-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-surface-alt), var(--bg-surface));
}
.cg-card-placeholder svg { width: 48px; height: 48px; opacity: 0.2; }

/* ============================================================
   NEWSLETTER SECTION
   ============================================================ */
#cg-newsletter {
    padding: var(--space-4xl) 0;
    position: relative;
    overflow: hidden;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
}

.cg-newsletter-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 50%, rgba(0, 212, 170, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 50%, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.cg-newsletter-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cg-newsletter-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--accent-dim);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    font-family: var(--font-headline);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    margin-bottom: var(--space-xl);
}

.cg-newsletter-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: cg-pulse 2s ease-in-out infinite;
}

@keyframes cg-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.7); }
}

.cg-newsletter-title {
    font-family: var(--font-headline);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: var(--space-md);
    line-height: 1.15;
}

.cg-newsletter-title span { color: var(--accent); }

.cg-newsletter-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-xl);
}

.cg-newsletter-form {
    display: flex;
    gap: var(--space-sm);
    max-width: 480px;
    margin: 0 auto;
}

.cg-newsletter-input {
    flex: 1;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.cg-newsletter-input::placeholder { color: var(--text-muted); }

.cg-newsletter-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.cg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-headline);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all var(--transition-spring);
    text-decoration: none;
    white-space: nowrap;
}

.cg-btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
}

.cg-btn-primary:hover {
    background: var(--accent-hover);
    color: var(--text-inverse);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.35);
}

.cg-btn-secondary {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--border-accent);
}

.cg-btn-secondary:hover {
    background: var(--accent);
    color: var(--text-inverse);
}

.cg-newsletter-note {
    margin-top: var(--space-md);
    font-size: 12px;
    color: var(--text-muted);
}

/* Mailchimp plugin override */
#cg-newsletter .mc4wp-form-fields {
    display: flex;
    gap: var(--space-sm);
    max-width: 480px;
    margin: 0 auto;
}

#cg-newsletter .mc4wp-form-fields input[type="email"] {
    flex: 1;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

#cg-newsletter .mc4wp-form-fields input[type="email"]:focus {
    border-color: var(--accent);
}

#cg-newsletter .mc4wp-form-fields input[type="submit"] {
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-family: var(--font-headline);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-spring);
}

#cg-newsletter .mc4wp-form-fields input[type="submit"]:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* ============================================================
   FOOTER
   ============================================================ */
#cg-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-primary);
    padding-top: var(--space-4xl);
}

.cg-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-3xl);
    padding-bottom: var(--space-3xl);
    border-bottom: 1px solid var(--border-primary);
}

.cg-footer-brand { }

.cg-footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    text-decoration: none;
}

.cg-footer-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.cg-footer-social {
    display: flex;
    gap: var(--space-sm);
}

.cg-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.cg-social-btn:hover {
    background: var(--accent-dim);
    border-color: var(--border-accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.cg-social-btn svg { width: 16px; height: 16px; }

.cg-footer-col-title {
    font-family: var(--font-headline);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.cg-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.cg-footer-links a {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast), padding-left var(--transition-fast);
    display: block;
}

.cg-footer-links a:hover {
    color: var(--accent);
    padding-left: 4px;
}

.cg-footer-bottom {
    padding: var(--space-lg) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.cg-footer-copy {
    font-size: 13px;
    color: var(--text-muted);
}

.cg-footer-legal {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.cg-footer-legal a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.cg-footer-legal a:hover { color: var(--accent); }

.cg-powered-by {
    font-size: 12px;
    color: var(--text-muted);
}

.cg-powered-by a {
    color: var(--accent);
    text-decoration: none;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#cg-back-top {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

#cg-back-top.visible {
    opacity: 1;
    transform: translateY(0);
}

#cg-back-top:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

#cg-back-top svg { width: 20px; height: 20px; }

/* ============================================================
   SINGLE POST — ARTICLE LAYOUT
   ============================================================ */
.cg-single {
    padding: var(--space-2xl) 0 var(--space-4xl);
}

.cg-single-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: grid;
    grid-template-columns: 1fr var(--content-width) 1fr;
    gap: 0 var(--space-xl);
}

/* Hero Image */
.cg-article-hero {
    width: 100%;
    max-height: 520px;
    overflow: hidden;
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-2xl);
    position: relative;
    background: var(--bg-surface-alt);
}

.cg-article-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cg-article-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
}

/* Article Header */
.cg-article-header {
    margin-bottom: var(--space-xl);
}

.cg-article-title {
    font-family: var(--font-headline);
    font-size: clamp(26px, 3.5vw, 40px);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: var(--space-md) 0;
}

.cg-article-meta {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: var(--space-xl);
}

.cg-article-author {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cg-article-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--accent-dim);
    border: 2px solid var(--border-accent);
}

.cg-article-author-name {
    font-family: var(--font-headline);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.cg-article-date, .cg-article-reading-time {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.cg-article-date svg, .cg-article-reading-time svg { width: 14px; height: 14px; }

/* Share Buttons - Sticky Side */
.cg-share-sticky {
    position: sticky;
    top: calc(var(--header-height) + var(--space-xl));
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-sm);
    padding-right: var(--space-lg);
}

.cg-share-label {
    font-family: var(--font-headline);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.cg-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-spring);
    border: 1px solid var(--border-primary);
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
}

.cg-share-btn:hover { transform: scale(1.1); }
.cg-share-btn svg { width: 18px; height: 18px; }

.cg-share-twitter:hover  { background: #1da1f2; border-color: #1da1f2; color: white; }
.cg-share-facebook:hover { background: #1877f2; border-color: #1877f2; color: white; }
.cg-share-linkedin:hover { background: #0a66c2; border-color: #0a66c2; color: white; }
.cg-share-telegram:hover { background: #0088cc; border-color: #0088cc; color: white; }
.cg-share-whatsapp:hover { background: #25d366; border-color: #25d366; color: white; }
.cg-share-copy:hover     { background: var(--accent); border-color: var(--accent); color: var(--text-inverse); }

.cg-share-copy.copied { background: var(--success); border-color: var(--success); color: white; }

/* Article Content */
.cg-article-content {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-secondary);
}

.cg-article-content p {
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.cg-article-content h2, .cg-article-content h3, .cg-article-content h4 {
    font-family: var(--font-headline);
    color: var(--text-primary);
    margin: var(--space-xl) 0 var(--space-md);
    line-height: 1.25;
}

.cg-article-content h2 { font-size: 26px; font-weight: 800; }
.cg-article-content h3 { font-size: 21px; font-weight: 700; }
.cg-article-content h4 { font-size: 18px; font-weight: 600; }

.cg-article-content a { color: var(--accent); }
.cg-article-content a:hover { color: var(--accent-hover); }

.cg-article-content blockquote {
    border-left: 3px solid var(--accent);
    margin: var(--space-xl) 0;
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-surface-alt);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 18px;
    font-style: italic;
    color: var(--text-primary);
}

.cg-article-content ul, .cg-article-content ol {
    margin-bottom: var(--space-lg);
}

.cg-article-content li { margin-bottom: var(--space-sm); }

.cg-article-content img {
    border-radius: var(--radius-lg);
    margin: var(--space-xl) 0;
    box-shadow: var(--shadow-md);
}

.cg-article-content code {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-size: 14px;
    font-family: 'Fira Code', monospace;
    color: var(--accent);
}

.cg-article-content pre {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    overflow-x: auto;
    margin: var(--space-xl) 0;
}

.cg-article-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    color: var(--text-primary);
}

.cg-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-xl) 0;
    font-size: 14px;
}

.cg-article-content th, .cg-article-content td {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-primary);
    text-align: left;
}

.cg-article-content th {
    background: var(--bg-surface-alt);
    font-family: var(--font-headline);
    font-weight: 700;
    color: var(--text-primary);
}

/* Article Tags */
.cg-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin: var(--space-xl) 0;
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border-primary);
}

.cg-article-tag {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.cg-article-tag:hover {
    background: var(--accent-dim);
    border-color: var(--border-accent);
    color: var(--accent);
}

/* Author Box */
.cg-author-box {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    display: flex;
    gap: var(--space-lg);
    margin: var(--space-2xl) 0;
}

.cg-author-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--border-accent);
    background: var(--bg-surface);
}

.cg-author-name {
    font-family: var(--font-headline);
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.cg-author-role {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.cg-author-bio {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Related Posts */
.cg-related {
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--border-primary);
}

.cg-related-title {
    font-family: var(--font-headline);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
    letter-spacing: -0.02em;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.cg-breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    padding: var(--space-md) 0;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.cg-breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.cg-breadcrumbs a:hover { color: var(--accent); }
.cg-breadcrumbs .sep { color: var(--border-primary); }
.cg-breadcrumbs .current { color: var(--text-secondary); }

/* ============================================================
   ARCHIVE / CATEGORY PAGE
   ============================================================ */
.cg-archive-header {
    padding: var(--space-3xl) 0 var(--space-2xl);
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: var(--space-2xl);
}

.cg-archive-label {
    font-family: var(--font-headline);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.cg-archive-title {
    font-family: var(--font-headline);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.04em;
    margin-bottom: var(--space-md);
    line-height: 1.1;
}

.cg-archive-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.6;
}

.cg-archive-stats {
    margin-top: var(--space-md);
    font-size: 14px;
    color: var(--text-muted);
}

.cg-archive-stats strong { color: var(--accent); }

.cg-archive-grid {
    padding: 0 0 var(--space-3xl);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.cg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-2xl) 0;
}

.cg-page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    font-family: var(--font-headline);
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-surface);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.cg-page-link:hover,
.cg-page-link.current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-inverse);
}

.cg-page-link.dots {
    background: none;
    border-color: transparent;
    color: var(--text-muted);
    width: auto;
    padding: 0 var(--space-sm);
}

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.cg-search-header {
    padding: var(--space-3xl) 0 var(--space-2xl);
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: var(--space-2xl);
}

.cg-search-query {
    font-family: var(--font-headline);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 800;
    color: var(--text-primary);
    margin: var(--space-md) 0;
}

.cg-search-query span { color: var(--accent); }
.cg-search-count { font-size: 14px; color: var(--text-muted); }

/* ============================================================
   404 PAGE
   ============================================================ */
.cg-404 {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4xl) var(--space-lg);
    text-align: center;
}

.cg-404-inner { max-width: 560px; }

.cg-404-code {
    font-family: var(--font-headline);
    font-size: clamp(100px, 20vw, 180px);
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
}

.cg-404-title {
    font-family: var(--font-headline);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.cg-404-desc {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: var(--space-2xl);
}

/* ============================================================
   COMMENTS
   ============================================================ */
.cg-comments {
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--border-primary);
}

.cg-comments-title {
    font-family: var(--font-headline);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
}

.comment-list { list-style: none; padding: 0; }

.comment {
    background: var(--bg-surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.comment-author { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md); }
.comment-author img { border-radius: 50%; width: 40px; height: 40px; }
.comment-author .fn { font-weight: 600; color: var(--text-primary); }
.comment-meta { font-size: 12px; color: var(--text-muted); }
.comment-content p { color: var(--text-secondary); font-size: 14px; }
.children { padding-left: var(--space-xl); }

/* Comment Form */
#respond {
    background: var(--bg-surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-top: var(--space-xl);
}

#respond h3 {
    font-family: var(--font-headline);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

#respond input, #respond textarea {
    width: 100%;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition-fast);
    margin-bottom: var(--space-md);
}

#respond input:focus, #respond textarea:focus { border-color: var(--accent); }
#respond textarea { min-height: 120px; resize: vertical; }

#respond .form-submit input[type="submit"] {
    width: auto;
    background: var(--accent);
    color: var(--text-inverse);
    font-family: var(--font-headline);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-spring);
    margin: 0;
}

#respond .form-submit input[type="submit"]:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* ============================================================
   SEARCH FORM
   ============================================================ */
.cg-searchform {
    display: flex;
    gap: var(--space-sm);
}

.cg-searchform input[type="search"] {
    flex: 1;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.cg-searchform input[type="search"]:focus { border-color: var(--accent); }

.cg-searchform button {
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    cursor: pointer;
    font-family: var(--font-headline);
    font-weight: 700;
    transition: all var(--transition-spring);
}
.cg-searchform button:hover { background: var(--accent-hover); }

/* ============================================================
   KADENCE BLOCK OVERRIDES
   ============================================================ */
.wp-block-kadence-column,
.kb-blocks-column { background: transparent !important; }

/* Buttons */
.wp-block-button .wp-block-button__link,
.kb-button { border-radius: var(--radius-md) !important; }

/* Headings */
.kb-blocks-info-box-title { font-family: var(--font-headline) !important; }

/* Info box */
.kb-info-box-container {
    background: var(--bg-surface) !important;
    border-color: var(--border-primary) !important;
}

/* Override Kadence header if present */
#masthead, .site-header { display: none; }
#cg-header { display: block; }

/* ============================================================
   DARK MODE TOGGLE
   ============================================================ */
.cg-theme-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-primary);
    cursor: pointer;
    padding: 0;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
}

.cg-theme-toggle::after {
    content: '';
    position: absolute;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform var(--transition-spring);
}

[data-theme="light"] .cg-theme-toggle::after {
    transform: translateX(24px);
}

.cg-theme-icons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 5px;
    pointer-events: none;
    z-index: 1;
}

.cg-theme-icons svg {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.cg-sidebar-widget {
    background: var(--bg-surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.cg-widget-title {
    font-family: var(--font-headline);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* ============================================================
   LOADING STATES
   ============================================================ */
.cg-skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-surface-alt) 25%,
        var(--bg-surface-hover) 50%,
        var(--bg-surface-alt) 75%
    );
    background-size: 200% 100%;
    animation: cg-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes cg-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   RESPONSIVE — 1200px
   ============================================================ */
@media (max-width: 1200px) {
    .cg-footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .cg-footer-brand { grid-column: 1 / -1; }

    .cg-single-container {
        grid-template-columns: 60px 1fr;
    }

    .cg-share-sticky {
        padding-right: 0;
    }
}

/* ============================================================
   RESPONSIVE — 992px
   ============================================================ */
@media (max-width: 992px) {
    :root {
        --header-height: 60px;
    }

    #cg-nav { display: none; }
    #cg-hamburger { display: flex; }

    .cg-hero-grid {
        grid-template-columns: 1fr;
    }

    .cg-hero-feature { min-height: 360px; }

    .cg-hero-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .cg-hero-sidebar-item { flex: 1; min-width: 200px; }

    .cg-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }

    .cg-footer-brand { grid-column: 1 / -1; }

    .cg-single-container {
        grid-template-columns: 1fr;
    }

    .cg-share-sticky {
        position: static;
        flex-direction: row;
        justify-content: flex-start;
        margin: var(--space-lg) 0;
        padding: 0;
    }

    .cg-share-label { display: none; }
}

/* ============================================================
   RESPONSIVE — 768px
   ============================================================ */
@media (max-width: 768px) {
    .cg-grid-3 { grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
    .cg-grid-2 { grid-template-columns: 1fr; }

    .cg-footer-grid { grid-template-columns: 1fr; gap: var(--space-xl); }

    .cg-newsletter-form { flex-direction: column; }

    .cg-footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .cg-footer-legal { justify-content: center; }

    .cg-archive-title { font-size: 32px; }

    #cg-search-overlay { padding-top: 10vh; }

    .cg-author-box { flex-direction: column; align-items: center; text-align: center; }

    .cg-article-meta { flex-direction: column; align-items: flex-start; gap: var(--space-sm); }

    #cg-back-top { bottom: var(--space-md); right: var(--space-md); }
}

/* ============================================================
   RESPONSIVE — 480px
   ============================================================ */
@media (max-width: 480px) {
    :root {
        --ticker-height: 36px;
    }

    .cg-grid-3 { grid-template-columns: 1fr; }

    .cg-hero-sidebar { flex-direction: column; }

    .cg-hero-sidebar-item { flex: none; }

    .cg-logo-tagline { display: none; }

    .cg-article-title { font-size: 22px; }

    .cg-trending-item { padding: 5px 10px; }

    .cg-section { padding: var(--space-xl) 0; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    #cg-ticker, #cg-header, #cg-footer, .cg-share-sticky,
    #cg-back-top, #cg-trending { display: none !important; }

    body { background: white; color: black; }
    .cg-article-content { max-width: 100%; }
}

