/* ==========================================================================
   OfficeTricks Design System — Excel Emerald Pro (Default Live Theme)
   Includes multi-theme token architecture & responsive Google AdSense zones
   ========================================================================== */

:root,
[data-theme="emerald"] {
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --heading-weight: 800;
    --heading-tracking: -0.02em;

    --bg-primary: #f3f7f4;
    --bg-subtle: #e7f0ea;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;

    --text-primary: #0f291e;
    --text-secondary: #3f594c;
    --text-muted: #647d70;

    --accent: #107c41;
    --accent-hover: #0b5c2f;
    --accent-secondary: #0d9488;
    --accent-amber: #fbbf24;
    --accent-coral: #107c41;
    --accent-mint: #6ee7b7;
    --accent-light: rgba(16, 124, 65, 0.1);
    --accent-gradient: linear-gradient(135deg, #107c41 0%, #0d9488 100%);
    --brand-mark-bg: linear-gradient(135deg, #107c41 0%, #059669 100%);
    --brand-mark-color: #ffffff;

    --topbar-bg: #0a3620;
    --topbar-text: #d1fae5;
    --topbar-link: #fde68a;

    --header-bg: rgba(255, 255, 255, 0.96);
    --header-border: #d5e3da;
    --header-shadow: 0 2px 12px rgba(15, 41, 30, 0.05);

    --hero-bg: linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
               linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px),
               linear-gradient(135deg, #07331d 0%, #107c41 65%, #0f766e 100%);
    --hero-text: #ffffff;
    --hero-lead: #d1fae5;
    --hero-hl-1: #fde68a;
    --hero-hl-2: #6ee7b7;
    --hero-btn-bg: #ffffff;
    --hero-btn-text: #0b5c2f;
    --hero-radius: 14px;
    --stats-overlap: 1.25rem;

    --border: #d5e3da;
    --radius-card: 12px;
    --radius-widget: 12px;
    --radius-pill: 8px;
    --radius-input: 10px;

    --shadow: 0 2px 8px rgba(15, 41, 30, 0.05);
    --shadow-hover: 0 12px 26px rgba(16, 124, 65, 0.14);
    --stat-shadow: 0 4px 14px rgba(15, 41, 30, 0.06);

    --tag-bg: rgba(16, 124, 65, 0.1);
    --tag-text: #107c41;

    --code-bg: #0c2117;
    --code-text: #e2f5ea;

    --footer-bg: #082918;
    --footer-text: #a7cbb7;
    --footer-heading: #ffffff;
    --footer-link-hover: #6ee7b7;
}

/* Optional alternate themes (only selectable when allow_theme_switcher=true locally) */
[data-theme="findost"] {
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --heading-weight: 800;
    --heading-tracking: -0.022em;
    --bg-primary: #ffffff;
    --bg-subtle: #f6f4ff;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #14103a;
    --text-secondary: #58537c;
    --text-muted: #7c76a3;
    --accent: #6d28d9;
    --accent-hover: #5b21b6;
    --accent-secondary: #14b8a6;
    --accent-amber: #f59e0b;
    --accent-coral: #f43f6e;
    --accent-mint: #5eead4;
    --accent-light: rgba(109, 40, 217, 0.1);
    --accent-gradient: linear-gradient(135deg, #6d28d9 0%, #f43f6e 100%);
    --brand-mark-bg: linear-gradient(135deg, #6d28d9 0%, #f43f6e 100%);
    --brand-mark-color: #ffffff;
    --topbar-bg: #14103a;
    --topbar-text: #d9d4ff;
    --topbar-link: #f59e0b;
    --header-bg: rgba(255, 255, 255, 0.94);
    --header-border: #ece8ff;
    --header-shadow: 0 4px 20px rgba(20, 16, 58, 0.06);
    --hero-bg: radial-gradient(circle at 15% 20%, rgba(244, 63, 110, 0.35), transparent 42%),
               radial-gradient(circle at 85% 12%, rgba(20, 184, 166, 0.35), transparent 42%),
               linear-gradient(160deg, #14103a 0%, #3b1d8f 68%, #6d28d9 100%);
    --hero-text: #ffffff;
    --hero-lead: #d9d4ff;
    --hero-hl-1: #f59e0b;
    --hero-hl-2: #5eead4;
    --hero-btn-bg: #f59e0b;
    --hero-btn-text: #14103a;
    --hero-radius: 28px;
    --stats-overlap: -2.4rem;
    --border: #ece8ff;
    --radius-card: 22px;
    --radius-widget: 20px;
    --radius-pill: 9999px;
    --radius-input: 9999px;
    --shadow: 0 10px 30px rgba(20, 16, 58, 0.06);
    --shadow-hover: 0 18px 40px rgba(109, 40, 217, 0.16);
    --stat-shadow: 0 12px 36px rgba(20, 16, 58, 0.11);
    --tag-bg: rgba(244, 63, 110, 0.11);
    --tag-text: #e11d48;
    --code-bg: #14103a;
    --code-text: #f3f0ff;
    --footer-bg: #14103a;
    --footer-text: #bdb6f0;
    --footer-heading: #ffffff;
    --footer-link-hover: #f59e0b;
}

[data-theme="editorial"] {
    --font-body: 'Inter', Georgia, sans-serif;
    --font-heading: 'Georgia', Cambria, serif;
    --heading-weight: 700;
    --heading-tracking: -0.015em;
    --bg-primary: #faf7f2;
    --bg-subtle: #f2ece2;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #78716c;
    --accent: #c2410c;
    --accent-hover: #9a3412;
    --accent-light: rgba(194, 65, 12, 0.1);
    --accent-gradient: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
    --brand-mark-bg: #1c1917;
    --brand-mark-color: #faf7f2;
    --topbar-bg: #1c1917;
    --topbar-text: #e7e5e4;
    --topbar-link: #fdba74;
    --header-bg: #faf7f2;
    --header-border: #dfd8cc;
    --header-shadow: none;
    --hero-bg: linear-gradient(145deg, #1c1917 0%, #292524 65%, #431407 100%);
    --hero-text: #faf7f2;
    --hero-lead: #d6d3d1;
    --hero-hl-1: #fdba74;
    --hero-hl-2: #fde68a;
    --hero-btn-bg: #ea580c;
    --hero-btn-text: #ffffff;
    --hero-radius: 8px;
    --stats-overlap: 1.25rem;
    --border: #e2dbd0;
    --radius-card: 8px;
    --radius-widget: 8px;
    --radius-pill: 4px;
    --radius-input: 6px;
    --shadow: 0 1px 3px rgba(28, 25, 23, 0.05);
    --shadow-hover: 0 10px 24px rgba(28, 25, 23, 0.1);
    --stat-shadow: 0 2px 8px rgba(28, 25, 23, 0.06);
    --tag-bg: #f5ebe1;
    --tag-text: #9a3412;
    --code-bg: #1c1917;
    --code-text: #f5f5f4;
    --footer-bg: #1c1917;
    --footer-text: #a8a29e;
    --footer-heading: #faf7f2;
    --footer-link-hover: #fdba74;
}

[data-theme="saas"] {
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --heading-weight: 700;
    --heading-tracking: -0.02em;
    --bg-primary: #f8fafc;
    --bg-subtle: #eff6ff;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.1);
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    --brand-mark-bg: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    --brand-mark-color: #ffffff;
    --topbar-bg: #0f172a;
    --topbar-text: #cbd5e1;
    --topbar-link: #38bdf8;
    --header-bg: rgba(255, 255, 255, 0.92);
    --header-border: #e2e8f0;
    --header-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    --hero-bg: linear-gradient(135deg, #0f172a 0%, #1e3a8a 58%, #2563eb 100%);
    --hero-text: #ffffff;
    --hero-lead: #dbeafe;
    --hero-hl-1: #fde047;
    --hero-hl-2: #7dd3fc;
    --hero-btn-bg: #ffffff;
    --hero-btn-text: #1e3a8a;
    --hero-radius: 20px;
    --stats-overlap: -2rem;
    --border: #e2e8f0;
    --radius-card: 16px;
    --radius-widget: 16px;
    --radius-pill: 9999px;
    --radius-input: 12px;
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 14px 30px rgba(37, 99, 235, 0.12);
    --stat-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    --tag-bg: rgba(37, 99, 235, 0.1);
    --tag-text: #2563eb;
    --code-bg: #0f172a;
    --code-text: #f1f5f9;
    --footer-bg: #0f172a;
    --footer-text: #94a3b8;
    --footer-heading: #ffffff;
    --footer-link-hover: #38bdf8;
}

[data-theme="midnight"] {
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --heading-weight: 700;
    --heading-tracking: -0.02em;
    --bg-primary: #0b1120;
    --bg-subtle: #111827;
    --bg-surface: #131c31;
    --bg-card: #131c31;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-light: rgba(129, 140, 248, 0.15);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #ec4899 100%);
    --brand-mark-bg: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --brand-mark-color: #ffffff;
    --topbar-bg: #060913;
    --topbar-text: #94a3b8;
    --topbar-link: #818cf8;
    --header-bg: rgba(11, 17, 32, 0.9);
    --header-border: rgba(255, 255, 255, 0.09);
    --header-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --hero-bg: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.32), transparent 45%),
               radial-gradient(circle at 80% 15%, rgba(236, 72, 153, 0.25), transparent 42%),
               linear-gradient(160deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
    --hero-text: #f8fafc;
    --hero-lead: #cbd5e1;
    --hero-hl-1: #fbbf24;
    --hero-hl-2: #5eead4;
    --hero-btn-bg: #6366f1;
    --hero-btn-text: #ffffff;
    --hero-radius: 20px;
    --stats-overlap: -2rem;
    --border: rgba(255, 255, 255, 0.09);
    --radius-card: 16px;
    --radius-widget: 16px;
    --radius-pill: 9999px;
    --radius-input: 9999px;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 16px 36px rgba(99, 102, 241, 0.22);
    --stat-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    --tag-bg: rgba(129, 140, 248, 0.16);
    --tag-text: #a5b4fc;
    --code-bg: #060913;
    --code-text: #e2e8f0;
    --footer-bg: #060913;
    --footer-text: #94a3b8;
    --footer-heading: #f8fafc;
    --footer-link-hover: #818cf8;
}

/* ==========================================================================
   Base Reset & Responsive Safeguards
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: clip;
    width: 100%;
}

h1, h2, h3, h4, h5, .brand-text {
    font-family: var(--font-heading);
    font-weight: var(--heading-weight);
    letter-spacing: var(--heading-tracking);
    color: var(--text-primary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

a:hover {
    color: var(--accent-hover);
}

img, iframe, embed, object, video {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
}

figure.wp-caption {
    max-width: 100% !important;
    height: auto !important;
    margin: 1.5rem 0;
}

figure.wp-caption figcaption {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.45rem;
}

/* Optional Local Dev Theme Bar */
.theme-switcher-bar {
    background: #0b0f19;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.8rem;
    position: relative;
    z-index: 1020;
}
.theme-bar-inner { max-width: 1280px; margin: 0 auto; padding: 0.45rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.theme-pills-group { display: flex; align-items: center; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.theme-pills-group::-webkit-scrollbar { display: none; }
.theme-bar-label { font-weight: 700; color: #94a3b8; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.theme-pill { display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.08); color: #cbd5e1; border: 1px solid rgba(255,255,255,0.12); border-radius: 9999px; padding: 0.28rem 0.72rem; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.theme-pill.active { background: #ffffff; color: #0f172a; border-color: #ffffff; font-weight: 700; }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.swatch-findost { background: linear-gradient(135deg, #6d28d9, #f43f6e); }
.swatch-emerald { background: #107c41; }
.swatch-editorial { background: #c2410c; }
.swatch-saas { background: #2563eb; }
.swatch-midnight { background: #818cf8; }

/* ==========================================================================
   Brand Sub-Topbar & Sticky Site Header
   ========================================================================== */
.brand-topbar {
    background: var(--topbar-bg);
    color: var(--topbar-text);
    font-size: 0.83rem;
    padding: 0.42rem 1.25rem;
}

.brand-topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.brand-topbar a {
    color: var(--topbar-link);
    font-weight: 700;
}

.brand-topbar a:hover {
    text-decoration: underline;
    color: var(--topbar-link);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--header-shadow);
    padding: 0.8rem 1.25rem;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.header-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none !important;
    flex-shrink: 0;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--brand-mark-bg);
    color: var(--brand-mark-color);
    display: inline-grid;
    place-items: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px var(--accent-light);
}

.brand-text {
    color: var(--text-primary);
}

.brand-text .highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 420px;
    min-width: 180px;
}

.search-box input {
    width: 100%;
    padding: 0.62rem 1.15rem;
    font-size: 0.9rem;
    font-family: inherit;
    border-radius: var(--radius-input);
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.search-box input:focus {
    background: var(--bg-surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: 380px;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
    display: none;
    z-index: 1050;
}

.search-results-dropdown a {
    display: block;
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.search-results-dropdown a:last-child {
    border-bottom: none;
}

.search-results-dropdown a:hover {
    background: var(--bg-subtle);
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    flex-shrink: 0;
}

.nav-links a {
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a.nav-cta-pill {
    background: var(--accent-gradient);
    color: #ffffff !important;
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    box-shadow: 0 4px 14px var(--accent-light);
}

.nav-links a.nav-cta-pill:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.mobile-menu-btn {
    display: none;
    background: var(--bg-subtle);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Main Layout & Hero Section
   ========================================================================== */
.main-content {
    max-width: 1280px;
    margin: 2rem auto 3.5rem;
    padding: 0 1.25rem;
    min-height: 75vh;
    width: 100%;
}

.hero-banner {
    background: var(--hero-bg);
    background-size: 28px 28px, 28px 28px, 100% 100%;
    color: var(--hero-text);
    border-radius: var(--hero-radius);
    padding: 3.4rem 2.5rem 3.2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-pill {
    display: inline-block;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 0.35rem 0.95rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 1.1rem;
}

.hero-banner h1 {
    color: var(--hero-text);
    font-size: clamp(2rem, 4.4vw, 3.3rem);
    line-height: 1.14;
    margin-bottom: 1rem;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

.hero-hl-amber { color: var(--hero-hl-1); }
.hero-hl-teal { color: var(--hero-hl-2); }

.hero-banner p {
    font-size: 1.1rem;
    color: var(--hero-lead);
    max-width: 680px;
    margin: 0 auto 1.75rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.btn-hero-primary {
    background: var(--hero-btn-bg);
    color: var(--hero-btn-text) !important;
    padding: 0.72rem 1.65rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-hero-outline {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    padding: 0.7rem 1.55rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.95rem;
}

.btn-hero-outline:hover {
    background: rgba(255, 255, 255, 0.2);
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
    margin-top: var(--stats-overlap);
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 5;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-widget);
    padding: 1.2rem 1rem;
    text-align: center;
    box-shadow: var(--stat-shadow);
}

.stat-card b {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
}

.stat-card span {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ==========================================================================
   Section Headings, Category Tiles & Post Cards
   ========================================================================== */
.section-header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.55rem;
    font-weight: var(--heading-weight);
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
    gap: 1.1rem;
    margin-bottom: 2.75rem;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1.25rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: var(--shadow);
    color: var(--text-primary);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

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

.cat-ico {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.c1 { background: linear-gradient(135deg, #107c41, #34d399); }
.c2 { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.c3 { background: linear-gradient(135deg, #d97706, #fbbf24); }
.c4 { background: linear-gradient(135deg, #e11d48, #fb7185); }
.c5 { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.c6 { background: linear-gradient(135deg, #4f46e5, #818cf8); }

.cat-meta {
    min-width: 0;
}

.cat-meta strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

.cat-meta small {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Content + Sidebar Grid (340px right column = 300px exact inner width for AdSense) */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2.25rem;
    align-items: start;
    width: 100%;
}

.main-col, .article-container {
    min-width: 0;
    max-width: 100%;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr));
    gap: 1.4rem;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
    min-width: 0;
    position: relative;
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
}

.post-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.post-cat-tag {
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.73rem;
    font-weight: 700;
    padding: 0.2rem 0.62rem;
    border-radius: var(--radius-pill);
}

.post-card .date {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.post-card h3 {
    font-size: 1.14rem;
    line-height: 1.38;
    margin-bottom: 0.7rem;
}

.post-card h3 a {
    color: var(--text-primary);
}

.post-card h3 a:hover {
    color: var(--accent);
}

.post-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.15rem;
    flex: 1;
}

.post-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    font-size: 0.86rem;
    font-weight: 700;
}

.post-card.is-hidden-card {
    display: none;
}

.load-more-wrap {
    margin-top: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.btn-load-more {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-pill);
    padding: 0.75rem 1.75rem;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, filter 0.18s ease;
}

.btn-load-more:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.btn-load-secondary {
    background: var(--bg-subtle);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.72rem 1.35rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-load-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==========================================================================
   Article View & Rich Typography
   ========================================================================== */
.article-container {
    background: var(--bg-surface);
    padding: 2.5rem;
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    min-width: 0;
}

.article-header {
    margin-bottom: 1.85rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.35rem;
}

.article-header h1 {
    font-size: clamp(1.65rem, 3.2vw, 2.25rem);
    line-height: 1.28;
    margin-bottom: 0.9rem;
    overflow-wrap: break-word;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.article-body {
    font-size: 1.04rem;
    line-height: 1.8;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-break: break-word;
}

.article-body > * {
    max-width: 100%;
}

.article-body h2 {
    font-size: 1.5rem;
    margin: 2.1rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--accent-light);
}

.article-body h3 {
    font-size: 1.25rem;
    margin: 1.6rem 0 0.75rem;
}

.article-body p {
    margin-bottom: 1.25rem;
}

.article-body ul, .article-body ol {
    margin: 0.85rem 0 1.35rem 1.6rem;
}

.article-body li {
    margin-bottom: 0.45rem;
}

.article-body table {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.article-body td, .article-body th {
    border: 1px solid var(--border);
    padding: 0.55rem 0.75rem;
    font-size: 0.92rem;
}

.info-note {
    background: var(--bg-subtle);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1.4rem 0;
}

pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 2.3rem 1.2rem 1.2rem;
    border-radius: 12px;
    overflow-x: auto;
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 1.6rem 0;
    position: relative;
    border: 1px solid var(--border);
    max-width: 100%;
    white-space: pre;
}

code {
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em;
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.16rem 0.42rem;
    border-radius: 5px;
    word-break: break-word;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
    word-break: normal;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.55rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.74rem;
    font-family: var(--font-body);
    padding: 0.25rem 0.68rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.copy-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* ==========================================================================
   Sidebar Widgets & Always-On Google AdSense Zones
   ========================================================================== */
.sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    width: 100%;
}

.sidebar-sticky-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 5.2rem;
}

.widget {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-widget);
    padding: 20px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.6rem;
    color: var(--text-primary);
}

.widget-cat-list {
    list-style: none;
}

.widget-cat-list li {
    margin-bottom: 0.65rem;
}

.widget-cat-list li:last-child {
    margin-bottom: 0;
}

.widget-cat-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.2rem 0;
}

.widget-cat-list a:hover {
    color: var(--accent);
}

.widget-cat-list .badge {
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.14rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.recent-post-item {
    margin-bottom: 0.9rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed var(--border);
}

.recent-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recent-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.38;
    display: block;
    margin-top: 0.18rem;
}

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

/* Google AdSense Zones — Always Enabled, Responsive, Zero Blank Placeholders */
.adsense-container,
.adsense-sidebar-container,
.google-auto-placed {
    display: block;
    width: 100%;
    max-width: 100%;
    text-align: center;
    clear: both;
}

.adsense-container,
.google-auto-placed {
    margin: 1.5rem auto;
}

.adsense-sidebar-container {
    margin: 0 auto;
}

ins.adsbygoogle {
    display: block;
    width: 100%;
    max-width: 100%;
}

/* Official AdSense rule: collapse unfilled slots cleanly so blank boxes never appear */
ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}

.adsense-container:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.adsense-sidebar-container:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.widget-adsense:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 3.5rem 1.25rem 1.8rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto 2.25rem;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2.25rem;
}

.footer-brand {
    color: var(--footer-heading);
    font-size: 1.35rem;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.brand-mark-sm {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--brand-mark-bg);
    color: var(--brand-mark-color);
    font-size: 0.9rem;
}

.footer-col h4 {
    color: var(--footer-heading);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--footer-text);
    font-size: 0.9rem;
}

.footer-col a:hover {
    color: var(--footer-link-hover);
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    font-size: 0.85rem;
    opacity: 0.85;
}

/* ==========================================================================
   Responsive Breakpoints (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 1024px) {
    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar-sticky-group {
        position: static;
    }

    .stats-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 860px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .search-box {
        max-width: 100%;
        width: 100%;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links a {
        padding: 0.55rem 0.65rem;
        border-radius: 8px;
    }

    .nav-links a:hover {
        background: var(--bg-subtle);
    }

    .nav-links a.nav-cta-pill {
        text-align: center;
        margin-top: 0.25rem;
    }
}

@media (max-width: 640px) {
    .brand-topbar {
        font-size: 0.76rem;
        padding: 0.38rem 0.85rem;
    }

    .brand-topbar-inner {
        justify-content: center;
        text-align: center;
    }

    .main-content {
        margin: 1.25rem auto 2.5rem;
        padding: 0 0.85rem;
    }

    .hero-banner {
        padding: 2.3rem 1.2rem 2.4rem;
        border-radius: 14px;
    }

    .stats-strip {
        margin-top: 1rem;
        padding: 0;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.95rem 0.7rem;
    }

    .stat-card b {
        font-size: 1.3rem;
    }

    .article-container {
        padding: 1.25rem 1rem;
        border-radius: 12px;
    }

    .widget {
        padding: 16px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
}
