/*
Theme Name: FENNI Theme
Theme URI: https://fenni.news
Template: generatepress
Description: FENNI child theme based on GeneratePress — CoinDesk/Bankless inspired layout
Author: FENNI Team
Version: 1.0.0
Text Domain: fenni-theme
*/

/* === Brand Colors === */
:root {
    /* legacy generatepress-fallback stub — dual-role tokens resolved per declaration below,
       see report for the No-Line-Rule tension already present in this file pre-port */
    --cb-navy: var(--fenni-text);        /* heading/accent-text role; background usages below reference var(--fenni-surface) directly */
    --cb-gold: var(--fenni-point-strong); /* text/link/border-accent role; fill usages below reference var(--fenni-point) directly */
    --cb-gold-dark: var(--fenni-point-strong);
    --cb-bg: var(--fenni-surface);
    --cb-card: var(--fenni-bg);
    --cb-text: var(--fenni-text);
    --cb-text-muted: var(--fenni-text-muted);
    --cb-border: var(--fenni-divider);
}

/* === Global === */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
    color: var(--cb-text);
    background-color: var(--cb-bg);
}

/* === Header — CoinDesk style === */
.site-header {
    background-color: var(--fenni-surface) !important;
    border-bottom: 3px solid var(--fenni-point-strong);
}

.site-header .site-title a,
.site-header .main-navigation a {
    color: var(--fenni-text) !important;
}

.site-header .main-navigation a:hover {
    color: var(--fenni-point-strong) !important;
}

/* === Logo === */
.site-logo img,
.custom-logo-link img {
    max-height: 45px;
    width: auto;
}

/* === Content Cards — Bankless style === */
.post-card,
article.post {
    background: var(--cb-card);
    border: 1px solid var(--cb-border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s;
}

article.post:hover {
    box-shadow: 0 4px 12px var(--fenni-shadow);
}

/* === Entry Title === */
.entry-title a {
    color: var(--fenni-text);
    text-decoration: none;
    font-weight: 700;
}

.entry-title a:hover {
    color: var(--fenni-point-strong);
}

/* === Category Tags === */
.cat-links a {
    background: var(--fenni-point);
    color: var(--fenni-point-contrast);
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
}

/* === Breadcrumb === */
.breadcrumb {
    font-size: 13px;
    color: var(--fenni-text-muted);
    padding: 12px 0;
    border-bottom: 1px solid var(--fenni-divider);
    margin-bottom: 24px;
}

/* === Single Post === */
.single .entry-content {
    font-size: 17px;
    line-height: 1.8;
    max-width: 720px;
}

.single .entry-content h2 {
    color: var(--fenni-text);
    margin-top: 2em;
    padding-bottom: 0.3em;
    border-bottom: 2px solid var(--fenni-point-strong);
}

/* === Sidebar — Bankless CTA style === */
.widget {
    background: var(--cb-card);
    border: 1px solid var(--cb-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.widget-title {
    color: var(--fenni-text);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--fenni-point-strong);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

/* === Footer === */
.site-footer {
    background-color: var(--fenni-surface);
    color: var(--fenni-text-muted);
}

.site-footer a {
    color: var(--fenni-point-strong);
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
    .single .entry-content {
        font-size: 16px;
        line-height: 1.7;
    }
    
    article.post {
        padding: 16px;
    }
}

/* === HOMEPAGE LAYOUT === */

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

/* Hero */
.cb-hero {
    background: var(--fenni-surface);
    padding: 80px 20px;
    text-align: center;
}

.cb-hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.cb-hero h1 {
    color: var(--fenni-text);
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.cb-gold-text {
    color: var(--fenni-point-strong);
}

.cb-hero-sub {
    color: var(--fenni-text-muted);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

/* Section */
.cb-section {
    padding: 48px 0;
}

.cb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--fenni-text);
}

.cb-section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--fenni-text);
    margin: 0;
}

.cb-view-all {
    color: var(--fenni-point-strong);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

/* Grid */
.cb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.cb-card {
    background: var(--fenni-bg);
    border: 1px solid var(--fenni-divider);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.cb-card:hover {
    box-shadow: 0 4px 16px var(--fenni-shadow);
    transform: translateY(-2px);
}

.cb-card-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

.cb-card-img {
    background: linear-gradient(135deg, var(--fenni-surface), var(--fenni-surface-2));
    min-height: 250px;
}

.cb-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-placeholder {
    background: linear-gradient(135deg, var(--fenni-surface) 0%, var(--fenni-surface-2) 100%);
    opacity: 0.7;
}

.cb-card-body {
    padding: 20px;
}

.cb-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.cb-tag {
    background: var(--fenni-point);
    color: var(--fenni-point-contrast);
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.cb-date {
    color: var(--fenni-text-muted);
    font-size: 13px;
}

.cb-card h3 {
    font-size: 18px;
    margin: 0 0 8px;
    line-height: 1.3;
}

.cb-card h3 a {
    color: var(--fenni-text);
    text-decoration: none;
}

.cb-card h3 a:hover {
    color: var(--fenni-point-strong);
}

.cb-card-featured h3 {
    font-size: 26px;
}

.cb-card p {
    color: var(--fenni-text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.cb-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--fenni-text-muted);
    padding: 60px 0;
    font-size: 16px;
}

/* Categories Bar */
.cb-categories-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px 0;
}

.cb-cat-pill {
    border: 2px solid var(--fenni-text);
    color: var(--fenni-text);
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.cb-cat-pill:hover {
    background: var(--fenni-text);
    color: var(--fenni-bg);
}

/* CTA — Bankless style */
.cb-cta {
    background: var(--fenni-surface);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    margin: 40px 0 60px;
}

.cb-cta h2 {
    color: var(--fenni-text);
    font-size: 32px;
    margin-bottom: 12px;
}

.cb-cta p {
    color: var(--fenni-text-muted);
    font-size: 16px;
    margin-bottom: 24px;
}

.cb-cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.cb-btn {
    padding: 12px 32px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s;
}

.cb-btn-primary {
    background: var(--fenni-point);
    color: var(--fenni-point-contrast);
}

.cb-btn-primary:hover {
    background: var(--fenni-point-strong);
}

.cb-btn-outline {
    border: 2px solid var(--fenni-text);
    color: var(--fenni-text);
    background: transparent;
}

.cb-btn-outline:hover {
    background: var(--fenni-text);
    color: var(--fenni-bg);
}

/* Mobile */
@media (max-width: 768px) {
    .cb-hero h1 { font-size: 32px; }
    .cb-hero { padding: 48px 20px; }
    .cb-grid { grid-template-columns: 1fr; }
    .cb-card-featured { grid-template-columns: 1fr; }
    .cb-card-featured h3 { font-size: 20px; }
    .cb-cta { padding: 40px 20px; }
    .cb-cta h2 { font-size: 24px; }
    .cb-cta-buttons { flex-direction: column; align-items: center; }
}


/* =====================================================================
   The following blocks were moved out of functions.php's inline <style>
   tags during the fenni-theme port (step 6). They are global (apply on
   every front-end page via wp_head/wp_footer), so style.css — the only
   stylesheet unconditionally enqueued on every template — is their home.
   ===================================================================== */

/* Premium Insight nav highlight — all pages */
a.nav-premium { color: var(--fenni-text) !important; font-weight: 700 !important; }
a.nav-premium:hover { color: var(--fenni-point-strong) !important; }

/* === FENNI Global GP Reset (was <style id="fenni-gp-reset"> in functions.php, only injected on
   wp_head when !is_front_page()) — the body:not(.home) clauses below are the CSS-only equivalent
   of that PHP guard (WP always adds body class "home" when is_front_page() is true), preserving
   the original behavior now that this lives in an unconditionally-enqueued stylesheet. === */
    html { scrollbar-gutter: stable; }

    /* Hide GP chrome on all custom pages */
    body:not(.page-template-fenni-page-v1):not(.home) .site-header,
    body:not(.page-template-fenni-page-v1):not(.home) #masthead,
    body:not(.page-template-fenni-page-v1):not(.home) .site-footer,
    body:not(.page-template-fenni-page-v1):not(.home) .entry-header,
    body:not(.page-template-fenni-page-v1):not(.home) .entry-meta,
    body:not(.page-template-fenni-page-v1):not(.home) .post-navigation,
    body:not(.page-template-fenni-page-v1):not(.home) #secondary,
    body:not(.page-template-fenni-page-v1):not(.home) #comments,
    body:not(.page-template-fenni-page-v1):not(.home) .breadcrumb,
    body:not(.page-template-fenni-page-v1):not(.home) .paging-navigation { display: none !important; }

    /* Neutralize GP containers */
    body:not(.page-template-fenni-page-v1):not(.home) #page,
    body:not(.page-template-fenni-page-v1):not(.home) .site-content,
    body:not(.page-template-fenni-page-v1):not(.home) .content-area,
    body:not(.page-template-fenni-page-v1):not(.home) .inside-article,
    body:not(.page-template-fenni-page-v1):not(.home) article.post,
    body:not(.page-template-fenni-page-v1):not(.home) article.page,
    body:not(.page-template-fenni-page-v1):not(.home) .page-header {
        max-width: none !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        float: none !important;
    }
    body:not(.page-template-fenni-page-v1):not(.home) .grid-container {
        max-width: none !important;
        width: 100% !important;
        padding: 0 !important;
    }
    body:not(.page-template-fenni-page-v1):not(.home)#page,
    body:not(.page-template-fenni-page-v1):not(.home) #page {
        width: 100% !important;
        max-width: 100% !important;
    }
    body:not(.page-template-fenni-page-v1):not(.home) .separate-containers .inside-article {
        padding: 0 !important;
    }
    /* Reset GP typography overrides */
    body:not(.page-template-fenni-page-v1):not(.home) .entry-content,
    body:not(.page-template-fenni-page-v1):not(.home) .entry-content * {
        color: inherit;
    }
    body:not(.page-template-fenni-page-v1):not(.home) .entry-content a {
        color: inherit;
        text-decoration: none;
    }
    /* GP sidebar reset */
    body:not(.page-template-fenni-page-v1):not(.home) .sidebar .widget,
    body:not(.page-template-fenni-page-v1):not(.home) #right-sidebar,
    body:not(.page-template-fenni-page-v1):not(.home) #left-sidebar { display: none !important; }

/* === FENNI Mobile Hamburger Menu (id="fenni-mobile-menu" in the old inline block) === */
    /* Hamburger Icon — injected into each page's nav-right */
    .cb-hamburger {
        display: none;
        width: 36px; height: 36px;
        align-items: center; justify-content: center;
        border-radius: 50%;
        background: var(--fenni-ghost);
        color: var(--fenni-text-muted);
        cursor: pointer;
        transition: all 200ms ease;
        border: none;
        padding: 0;
    }
    .cb-hamburger:hover { background: var(--fenni-point-glow); color: var(--fenni-point-strong); }
    .cb-hamburger svg { width: 20px; height: 20px; }

    /* Mobile Menu Overlay */
    .cb-mobile-overlay {
        display: none;
        position: fixed; inset: 0; z-index: 999;
        background: color-mix(in srgb, var(--fenni-bg) 95%, transparent);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 80px 32px 40px;
        overflow-y: auto;
    }
    .cb-mobile-overlay.open { display: flex; }
    .cb-mobile-close {
        position: absolute; top: 20px; right: 24px;
        width: 40px; height: 40px;
        display: flex; align-items: center; justify-content: center;
        border-radius: 50%;
        background: var(--fenni-ghost);
        color: var(--fenni-text-muted);
        cursor: pointer;
        border: none;
        transition: all 200ms ease;
    }
    .cb-mobile-close:hover { background: var(--fenni-point-glow); color: var(--fenni-point-strong); }
    .cb-mobile-close svg { width: 20px; height: 20px; }
    .cb-mobile-nav { display: flex; flex-direction: column; gap: 0; }
    .cb-mobile-nav a {
        display: block;
        padding: 16px 0;
        font-size: 18px;
        font-weight: 600;
        color: var(--fenni-text-secondary);
        text-decoration: none;
        border-bottom: 1px solid var(--fenni-divider);
        transition: all 200ms ease;
    }
    .cb-mobile-nav a:hover { color: var(--fenni-point-strong); }
    .cb-mobile-lang {
        margin-top: 32px;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .cb-mobile-lang a {
        display: flex; align-items: center; gap: 6px;
        padding: 8px 16px;
        background: var(--fenni-ghost);
        border-radius: 9999px;
        font-size: 14px;
        font-weight: 500;
        color: var(--fenni-text-secondary);
        text-decoration: none;
        transition: all 200ms ease;
    }
    .cb-mobile-lang a:hover, .cb-mobile-lang a.active { background: var(--fenni-point-glow); color: var(--fenni-point-strong); }
    .cb-mobile-lang-flag { font-size: 18px; }

    @media (max-width: 768px) {
        .cb-hamburger { display: flex; }
    }
