/* Magenta Theme - Swiss/Typographic Style */
:root {
    --color-bg: #f8fafc; /* slate-50 */
    --color-text: #0f172a; /* slate-900 */
    --color-text-muted: #475569; /* slate-600 */
    --color-accent: #c026d3; /* fuchsia-600 */
    --color-border: #0f172a;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.5;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { margin-top: 0; } /* Fixes alignment issues */

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

/* Layout Utilities */
.container { max-width: 1150px; margin: 0 auto; padding: 0 20px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 900px) {
    .grid { grid-template-columns: 8fr 4fr; gap: 60px; }
}

/* Header */
.brand-bar { height: 8px; background: var(--color-border); position: sticky; top: 0; z-index: 100; }
.site-header { 
    background: #fff; border-bottom: 2px solid var(--color-border); 
    padding: 0; position: sticky; top: 8px; z-index: 90; 
}
.header-inner { height: 80px; display: flex; justify-content: space-between; align-items: center; }

.logo { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 1.5rem; letter-spacing: -0.05em; line-height: 1; }
.logo img { height: 32px; width: auto; }

/* NAVIGATION FIXES */
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links ul { display: flex; align-items: center; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav-links li { margin: 0; padding: 0; }
.nav-links a { font-weight: 700; font-size: 0.9rem; text-transform: none; letter-spacing: 0.02em; }

.subscribe-btn {
    background: var(--color-border); color: #fff; padding: 8px 16px;
    font-weight: 700; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em;
    margin-left: 10px;
}
.subscribe-btn:hover { background: var(--color-accent); color: #fff; }

/* Hero (Featured) */
.hero-section { padding: 60px 0; border-bottom: 2px solid var(--color-border); margin-bottom: 60px; }
.featured-pill { 
    background: var(--color-accent); color: white; 
    display: inline-block; padding: 4px 12px; border-radius: 999px; 
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 24px;
}
.hero-title { font-size: 3.5rem; font-weight: 900; line-height: 0.95; letter-spacing: -0.04em; margin: 0 0 30px 0; }
.hero-excerpt { font-size: 1.4rem; color: var(--color-text-muted); padding-left: 24px; border-left: 4px solid var(--color-accent); margin-bottom: 40px; font-weight: 500; }
.btn-arrow { 
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--color-border); color: #fff; 
    padding: 12px 24px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85rem;
}
.btn-arrow:hover { background: var(--color-accent); }

/* Feed */
.section-title { font-size: 2rem; font-weight: 900; margin-bottom: 40px; letter-spacing: -0.03em; padding-bottom: 15px; border-bottom: 1px solid #e2e8f0; }
.post-card { margin-bottom: 60px; }
.post-meta { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: #94a3b8; margin-bottom: 10px; letter-spacing: 0.05em; }
.post-title { font-size: 1.8rem; font-weight: 800; line-height: 1.1; margin: 0 0 15px 0; letter-spacing: -0.02em; }
.post-excerpt { color: var(--color-text-muted); font-size: 1.05rem; margin-bottom: 15px; }
.read-more { font-weight: 700; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 4px; }

/* Sidebar Widgets */
.sidebar-widget { margin-bottom: 40px; }
.widget-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px; margin-bottom: 20px; }

/* News Items */
.news-item { margin-bottom: 20px; }
.news-date { font-size: 0.65rem; font-weight: 700; color: var(--color-accent); text-transform: uppercase; margin-bottom: 4px; }
.news-link { font-weight: 700; display: block; line-height: 1.3; font-size: 0.95rem; }
.news-link:hover { text-decoration: underline; text-decoration-thickness: 2px; }

/* Footer */
.site-footer { border-top: 2px solid var(--color-border); margin-top: 60px; padding: 60px 0; background: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 40px; }

/* 3-Column Layout: Brand takes 50%, Links take 25% each */
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }

.footer-col h5 { 
    font-weight: 700; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
    margin-bottom: 16px; 
    margin-top: 0; /* Ensures alignment with Logo */
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 12px; font-size: 0.9rem; font-weight: 500; color: var(--color-text-muted); }
.footer-col a:hover { color: var(--color-accent); }

/* GHOST CONTENT STYLES */
.gh-content p { margin-bottom: 1.5em; }
.gh-content h2 { font-size: 1.8rem; font-weight: 800; margin-top: 2em; margin-bottom: 0.8em; letter-spacing: -0.02em; }
.gh-content h3 { font-size: 1.4rem; font-weight: 800; margin-top: 1.5em; margin-bottom: 0.5em; }
.gh-content ul { list-style: disc; padding-left: 1.5em; margin-bottom: 1.5em; }
.gh-content li { margin-bottom: 0.5em; }
.gh-content strong { font-weight: 800; color: var(--color-text); }
.gh-content a { text-decoration: underline; text-underline-offset: 4px; color: var(--color-accent); font-weight: 700; }

/* NATIVE BLOCKQUOTE STYLE */
.gh-content blockquote {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    border-left: 4px solid var(--color-accent);
    padding-left: 24px;
    font-style: italic;
    margin: 2em 0;
}

/* ==========================================================================
   MAGENTA: DENSITY UPGRADE
   ========================================================================== */

/* --- Layout Grids --- */

.layout-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

@media (min-width: 1024px) {
    .layout-split {
        grid-template-columns: 2fr 1fr; /* 2/3 Main, 1/3 Sidebar */
        gap: 6rem;
    }
}

/* --- The Bento Grid (2x2) -> Upgrade to 3-Col --- */
.post-feed-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .post-feed-grid {
        grid-template-columns: 1fr 1fr; /* 2 Columns */
        column-gap: 2rem;
        row-gap: 3rem;
    }
}

@media (min-width: 1024px) {
    .post-feed-grid {
        grid-template-columns: 1fr 1fr 1fr; /* 3 Columns */
    }
}

/* --- Compact Card (For Grids) --- */
.post-card-compact {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-top: 2px solid var(--color-border); /* Hard top border only */
    padding-top: 1rem;
    transition: all 0.2s ease;
}

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

.post-card-compact .post-card-meta {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.post-card-compact .post-card-title {
    font-size: 1.25rem; /* H4 size */
    line-height: 1.3;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

/* Optional: Hide excerpts on compact cards for maximum density */
.post-card-compact .post-card-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-text-muted);
    /* Removed line-clamp to allow full 300-char excerpts */
}

/* --- The Sidebar Ticker (Terminal Style) --- */
.sidebar-ticker-container {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    /* The "Hard Shadow" effect */
    box-shadow: 8px 8px 0 0 var(--color-border); 
}

.sidebar-ticker-header {
    background: var(--color-border);
    color: #fff;
    padding: 0.5rem 1rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

.sidebar-ticker-scroll {
    max-height: 60vh; /* Keeps it contained */
    overflow-y: auto;
    padding: 1rem;
}

/* Custom Scrollbar for the Ticker */
.sidebar-ticker-scroll::-webkit-scrollbar {
    width: 6px;
}
.sidebar-ticker-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.sidebar-ticker-scroll::-webkit-scrollbar-thumb {
    background: var(--color-border);
}

.ticker-item {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.ticker-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.ticker-date {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
    font-family: monospace; /* Terminal vibe */
}

.ticker-link {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    display: block;
    text-decoration: none;
    color: var(--color-text);
}

.ticker-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}


/* ==========================================================================
   GHOST MANDATORY CLASSES (REQUIRED FOR VALIDATION)
   ========================================================================== */

.kg-width-wide {
    grid-column: 1 / -1;
    width: 100%;
}

.kg-width-full {
    grid-column: 1 / -1;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.kg-width-full img {
    width: 100%;
}

/* Ensure images inside content fit */
.kg-image {
    max-width: 100%;
    height: auto;
}

/* Captions */
.kg-gallery-card + .kg-gallery-card,
.kg-image-card + .kg-image-card {
    margin-top: 2rem;
}

figcaption {
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* ==========================================================================
   MAGENTA OVERRIDES FOR GHOST SIGNUP CARD
   Forces the native 'subscribe' box to match the Neo-Brutalist theme.
   ========================================================================== */

.kg-signup-card {
    background: #fff; /* Kill the default grey */
    border: 2px solid var(--color-border);
    box-shadow: 8px 8px 0 0 var(--color-border); /* The "Magenta" hard shadow */
    border-radius: 0; /* Sharp corners */
    padding: 3rem 2rem;
    margin: 4rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* The Headline */
.kg-signup-card-title {
    font-family: var(--font-sans);
    font-size: 2rem; /* Tamed down from the massive default */
    font-weight: 900;
    line-height: 1;
    margin-bottom: 1rem;
    color: var(--color-text);
    letter-spacing: -0.03em;
}

/* The Description text */
.kg-signup-card-description {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 2rem;
    max-width: 600px;
}

/* The Input Form Wrapper */
.kg-signup-card-form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 480px;
    flex-wrap: wrap; /* Safety for mobile */
}

/* The Email Input Field */
.kg-signup-card-input {
    flex: 1;
    border: 2px solid var(--color-border);
    background: #fff;
    padding: 0.75rem 1rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
    border-radius: 0; /* Brutalist */
    outline: none;
    min-width: 200px;
}

.kg-signup-card-input:focus {
    border-color: var(--color-accent);
}

/* The Button */
.kg-signup-card-button {
    background: var(--color-accent);
    color: white;
    border: 2px solid var(--color-accent); /* Match border to bg */
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border-radius: 0; /* Brutalist */
    cursor: pointer;
    transition: all 0.2s ease;
    height: auto; /* Fix Ghost default height issues */
}

.kg-signup-card-button:hover {
    background: var(--color-text);
    border-color: var(--color-text);
}

/* The "No spam" disclaimer */
.kg-signup-card-disclaimer {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

/* ==========================================================================
   MAGENTA: SEARCH MODAL GLOW (GHOST OVERRIDE)
   ========================================================================== */

#sodo-search-root .sodo-search-box {
    box-shadow: 0 0 30px var(--color-accent) !important;
    border: 2px solid var(--color-accent) !important;
}


/* ==========================================================================
   MOBILE NAVIGATION FIX: THE HORIZONTAL TICKER
   Replaces the vertical stack with a swipeable toolbar.
   ========================================================================== */

@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .hero-excerpt { font-size: 1.1rem; }
    
    .site-header { position: relative; }
    
    .header-inner { 
        height: auto; 
        flex-direction: column; 
        align-items: flex-start; /* Left Align Everything */
        padding: 15px 20px;
        gap: 15px;
    }

    .logo {
        width: 100%;
        font-size: 1.4rem;
        /* Ensure the logo text doesn't wrap awkwardly */
        white-space: nowrap;
    }

    /* THE HORIZONTAL SCROLL BAR */
    .nav-links { 
        width: 100%;
        display: flex; 
        flex-direction: row; 
        gap: 20px; 
        align-items: center;
        
        /* Enable Horizontal Scrolling */
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
        
        /* Cosmetic separation */
        border-top: 1px solid #e2e8f0;
        padding-top: 15px;
        
        /* Hide Scrollbar */
        scrollbar-width: none; /* Firefox */
    }
    .nav-links::-webkit-scrollbar { display: none; } /* Chrome/Safari */

    .nav-links ul { 
        display: flex;
        flex-direction: row; 
        gap: 20px; 
    }
    
    .subscribe-btn {
        margin-left: 0;
        /* Ensure button doesn't shrink */
        flex-shrink: 0;
    }
}