/* ============================================
   CashFlowHacks — Standalone PHP/HTML Theme
   ============================================ */
:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #5eead4;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-dark: #0f172a;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 1200px;
    --content-width: 760px;
    --sidebar-width: 340px;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-body);
    color: var(--text);
    line-height: 1.7;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 0.75em;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }
p { margin-bottom: 1.25em; }
ul, ol { margin-bottom: 1.25em; padding-left: 1.5em; }
li { margin-bottom: 0.5em; }
blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.25em;
    margin: 1.5em 0;
    color: var(--text-light);
    font-style: italic;
}

.site-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.site-main {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 3rem;
    padding: 3rem 0;
}
.site-main.no-sidebar {
    grid-template-columns: 1fr;
    max-width: var(--content-width);
    margin: 0 auto;
}
@media (max-width: 1024px) {
    .site-main { grid-template-columns: 1fr; }
}

/* Header */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
}
.site-branding { display: flex; align-items: center; gap: 0.75rem; }
.site-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}
.site-logo span { color: var(--accent); }
.site-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: none;
}
@media (min-width: 768px) { .site-tagline { display: block; } }

.main-navigation { display: flex; align-items: center; gap: 2rem; }
.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
}
.nav-menu a {
    color: var(--text);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 0;
    position: relative;
}
.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}
.nav-menu a:hover::after,
.nav-menu .current-menu-item a::after { width: 100%; }
.nav-cta {
    background: var(--primary);
    color: #fff !important;
    padding: 0.625rem 1.25rem !important;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
}
.nav-cta:hover { background: var(--primary-dark); }
.nav-cta::after { display: none !important; }
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
@media (max-width: 768px) {
    .main-navigation .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 0;
    }
    .main-navigation .nav-menu.active { display: flex; }
    .main-navigation .nav-menu li { border-bottom: 1px solid var(--border-light); }
    .main-navigation .nav-menu a { display: block; padding: 0.875rem 0; }
    .mobile-menu-toggle { display: block; }
    .nav-cta { display: none; }
}

/* Breadcrumbs */
.breadcrumbs {
    background: var(--bg-alt);
    padding: 0.75rem 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
}
.breadcrumbs a { color: var(--text-light); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { margin: 0 0.5rem; color: var(--border); }
.breadcrumbs .current { color: var(--text); font-weight: 500; }

/* Entry Header */
.entry-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-light); }
.entry-title { font-size: 2.25rem; line-height: 1.2; margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.entry-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.entry-meta .author { display: flex; align-items: center; gap: 0.5rem; }
.entry-meta .author img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.category-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}
.category-badge:hover { background: var(--primary); color: #fff; }
.entry-featured-image { margin: 1.5rem 0 2rem; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.entry-featured-image img { width: 100%; height: auto; object-fit: cover; }

/* Entry Content */
.entry-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text);
}
.entry-content h2 { margin-top: 2.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border-light); }
.entry-content h3 { margin-top: 2rem; color: var(--primary-dark); }
.entry-content a { color: var(--primary); border-bottom: 1px solid var(--primary-light); transition: all 0.2s ease; }
.entry-content a:hover { border-bottom-color: var(--primary); background: rgba(13, 148, 136, 0.05); }
.entry-content a.external-link::after { content: '↗'; font-size: 0.75em; margin-left: 0.25em; opacity: 0.6; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9375rem; }
.entry-content th, .entry-content td { padding: 0.875rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.entry-content th { background: var(--bg-alt); font-weight: 600; text-transform: uppercase; font-size: 0.8125rem; letter-spacing: 0.05em; }
.entry-content tr:hover td { background: var(--bg-alt); }
.entry-content code { background: var(--bg-alt); padding: 0.2em 0.4em; border-radius: 4px; font-size: 0.9em; color: var(--danger); }
.entry-content pre { background: var(--bg-dark); color: #e2e8f0; padding: 1.25rem; border-radius: var(--radius); overflow-x: auto; margin: 1.5rem 0; }

/* Ad Units */
.ad-unit {
    text-align: center;
    margin: 2rem 0;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    position: relative;
}
.ad-unit::before {
    content: 'Advertisement';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg);
    padding: 0 0.75rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}
.ad-unit.ad-incontent { margin: 2.5rem 0; }
.ad-unit.ad-sidebar { margin: 0 0 1.5rem; min-height: 250px; }
.ad-unit.ad-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    min-height: 90px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-radius: 0;
    z-index: 90;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}
.ad-unit.ad-sticky-footer::before { display: none; }
.ad-close {
    position: absolute;
    top: -28px;
    right: 0;
    background: var(--bg-dark);
    color: #fff;
    border: none;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
}

/* Share Bar */
.share-bar-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1rem;
    z-index: 99;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.share-bar-wrapper.visible { transform: translateY(0); }
.share-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
    flex-wrap: wrap;
}
.share-bar-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-light);
    margin-right: 0.5rem;
    white-space: nowrap;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: #fff; }
.share-btn.pinterest { background: #E60023; }
.share-btn.pinterest:hover { background: #bd001c; }
.share-btn.reddit { background: #FF4500; }
.share-btn.reddit:hover { background: #cc3700; }
.share-btn.threads { background: #000000; }
.share-btn.threads:hover { background: #333333; }
.share-btn.facebook { background: #1877F2; }
.share-btn.facebook:hover { background: #166fe5; }
.share-btn.copy { background: var(--text-light); }
.share-btn.copy:hover { background: var(--text); }
.share-btn.copied { background: var(--success) !important; }

/* Related Posts */
.related-posts { margin: 3rem 0; padding: 2rem 0; border-top: 1px solid var(--border); }
.related-posts-title { font-size: 1.25rem; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.related-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 768px) { .related-posts-grid { grid-template-columns: 1fr; } }
.related-post-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
}
.related-post-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: var(--primary-light); }
.related-post-card img { width: 100%; height: 160px; object-fit: cover; }
.related-post-card .card-body { padding: 1rem; }
.related-post-card .card-category {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.related-post-card .card-title { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; margin: 0; color: var(--text); }
.related-post-card:hover .card-title { color: var(--primary); }

/* Sidebar */
.site-sidebar { position: sticky; top: 100px; align-self: start; }
.widget {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 0.625rem 0; border-bottom: 1px solid var(--border-light); }
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--text); font-weight: 500; font-size: 0.9375rem; }
.widget a:hover { color: var(--primary); }

.widget-newsletter {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
}
.widget-newsletter .widget-title { color: #fff; border-bottom-color: rgba(255,255,255,0.3); }
.widget-newsletter p { color: rgba(255,255,255,0.9); font-size: 0.9375rem; margin-bottom: 1rem; }
.widget-newsletter input[type="email"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}
.widget-newsletter button {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}
.widget-newsletter button:hover { background: var(--accent-hover); }

/* Archive */
.archive-header { text-align: center; padding: 3rem 0 2rem; background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg) 100%); margin-bottom: 2rem; border-bottom: 1px solid var(--border); }
.archive-title { font-size: 2.5rem; margin-bottom: 0.5rem; }
.archive-description { color: var(--text-light); max-width: 600px; margin: 0 auto; }

/* Post Grid */
.posts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
@media (max-width: 768px) { .posts-grid { grid-template-columns: 1fr; } }
.post-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}
.post-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.post-card img { width: 100%; height: 220px; object-fit: cover; }
.post-card .card-body { padding: 1.25rem; }
.post-card .card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.post-card .card-title { font-size: 1.125rem; font-weight: 700; line-height: 1.4; margin-bottom: 0.75rem; }
.post-card .card-excerpt { font-size: 0.9375rem; color: var(--text-light); line-height: 1.6; margin: 0; }

/* Homepage */
.hero-section { padding: 4rem 0; background: linear-gradient(135deg, var(--bg-alt) 0%, #fff 100%); text-align: center; }
.hero-title { font-size: 3rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -0.03em; }
.hero-title span { color: var(--primary); }
.hero-tagline { font-size: 1.25rem; color: var(--text-light); max-width: 600px; margin: 0 auto 2rem; }
.hero-cta { display: inline-flex; gap: 1rem; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-alt); color: var(--text); }

.category-hub { padding: 3rem 0; }
.category-hub-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-top: 2rem; }
@media (max-width: 1024px) { .category-hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .category-hub-grid { grid-template-columns: 1fr; } }
.category-hub-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text);
}
.category-hub-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-6px); border-color: var(--primary-light); }
.category-hub-card .hub-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}
.category-hub-card h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.category-hub-card p { font-size: 0.875rem; color: var(--text-light); margin: 0; }

/* Footer */
.site-footer {
    background: var(--bg-dark);
    color: #94a3b8;
    padding: 3rem 0 0;
    margin-top: 4rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; padding-bottom: 3rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
@media (max-width: 1024px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .footer-logo { font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 1rem; }
.footer-brand .footer-logo span { color: var(--primary-light); }
.footer-brand p { font-size: 0.9375rem; line-height: 1.7; margin-bottom: 1.5rem; max-width: 320px; }
.footer-social { display: flex; gap: 0.75rem; }
.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    font-weight: 700;
}
.footer-social a:hover { background: var(--primary); transform: translateY(-3px); }
.footer-column h4 { color: #fff; font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1.25rem; }
.footer-column ul { list-style: none; padding: 0; margin: 0; }
.footer-column li { margin-bottom: 0.75rem; }
.footer-column a { color: #94a3b8; font-size: 0.9375rem; transition: color 0.2s ease; }
.footer-column a:hover { color: #fff; }
.footer-bottom {
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8125rem;
}
.footer-bottom a { color: #94a3b8; }
.footer-bottom a:hover { color: #fff; }

/* TOC */
.toc-wrapper {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}
.toc-wrapper h4 { font-size: 1rem; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.toc-wrapper ul { list-style: none; padding: 0; margin: 0; }
.toc-wrapper li { padding: 0.375rem 0; font-size: 0.9375rem; }
.toc-wrapper a { color: var(--text-light); }
.toc-wrapper a:hover { color: var(--primary); }

/* Utilities */
.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;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* Print */
@media print {
    .site-header, .site-sidebar, .share-bar-wrapper, .ad-unit, .site-footer { display: none !important; }
    .site-main { grid-template-columns: 1fr !important; }
}
