/* 
 * Adesina Mark Theme Styles
 * Utilizing modern CSS variables for Dark/Light mode support.
 */

/* ==========================================================================
   CSS Variables (Design Tokens)
   ========================================================================== */
:root, html.light {
    /* Colors */
    --bg-primary: #FFFFFF;
    --bg-surface: #F4F4F5;
    --text-primary: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    
    /* Brand Azure */
    --brand-primary: #0078D4;
    --brand-hover: #2B88D8;
    --brand-gradient: linear-gradient(135deg, #0078D4 0%, #4F46E5 100%);
    
    /* Code Blocks */
    --code-bg: #1E1E1E;
    --code-text: #D4D4D4;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html.dark {
    --bg-primary: #09090B;
    --bg-surface: #18181B; /* or #27272A */
    --text-primary: #E4E4E7;
    --text-muted: #A1A1AA;
    --border-color: #27272A;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 { font-size: 3rem; letter-spacing: -0.02em; }
h2 { font-size: 2.25rem; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }
p { margin-bottom: 1.5rem; }

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

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.glassmorphism {
    background: rgba(var(--bg-primary), 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

html.light .glassmorphism { background: rgba(255, 255, 255, 0.8); }
html.dark .glassmorphism { background: rgba(9, 9, 11, 0.8); }

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    color: var(--text-primary);
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
}

.main-navigation a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.main-navigation a:hover {
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.theme-toggle, .search-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.theme-toggle:hover, .search-toggle:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.menu-toggle { display: none; } /* Hidden on desktop */

/* ==========================================================================
   Buttons
   ========================================================================== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.button-primary {
    background: var(--brand-primary);
    color: #fff;
    border: none;
}

.button-primary:hover {
    background: var(--brand-hover);
    color: #fff;
    transform: translateY(-1px);
}

.button-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.button-outline:hover {
    border-color: var(--text-primary);
    background: var(--bg-surface);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-label {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 480px;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

/* Terminal Window Mockup */
.code-window {
    background: var(--code-bg);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
}

.window-header {
    background: #2D2D2D;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot.red { background: #FF5F56; }
.dot.yellow { background: #FFBD2E; }
.dot.green { background: #27C93F; }

.code-window pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
}

.code-window code {
    font-family: var(--font-mono);
    color: var(--code-text);
    font-size: 0.9rem;
}

/* ==========================================================================
   Article Cards
   ========================================================================== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.article-card {
    background: var(--bg-surface);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.05);
}

html.dark .article-card:hover {
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.article-card .post-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.article-card .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.article-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.entry-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cat-links a {
    color: var(--brand-primary);
    font-weight: 500;
}

.article-card .entry-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.article-card .entry-title a {
    color: var(--text-primary);
}

.article-card .entry-summary {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-more {
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}

/* ==========================================================================
   Single Article
   ========================================================================== */
.article-container {
    max-width: 800px;
    margin: 4rem auto;
}

.single-article .entry-header {
    margin-bottom: 3rem;
    text-align: center;
}

.single-article .entry-title {
    font-size: 2.5rem;
    margin: 1rem 0 2rem;
}

.single-article .entry-meta {
    justify-content: center;
    font-size: 1rem;
}

.single-article .post-thumbnail {
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 3rem;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr; /* Mobile */
    gap: 2rem;
}

/* Desktop Article Layout with Sidebar */
@media (min-width: 1024px) {
    .article-container { max-width: 1100px; }
    .article-layout {
        grid-template-columns: 200px 1fr;
        gap: 4rem;
    }
}

.article-sidebar.sticky {
    position: sticky;
    top: 100px;
    align-self: start;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.share-label, .toc-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.share-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all 0.2s;
}

.share-buttons a:hover {
    background: var(--brand-primary);
    color: #fff;
}

.entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content h2 { margin-top: 3rem; margin-bottom: 1.5rem; }
.entry-content h3 { margin-top: 2rem; margin-bottom: 1rem; }

.entry-content code {
    background: var(--bg-surface);
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.entry-content pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.entry-content pre code {
    background: transparent;
    color: var(--code-text);
    padding: 0;
}

.author-bio-box {
    background: var(--bg-surface);
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-top: 4rem;
    border: 1px solid var(--border-color);
}

.author-avatar img {
    border-radius: 50%;
}

.author-name {
    margin-bottom: 0.5rem;
}

.author-desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    margin-top: 6rem;
    border-top: 1px solid var(--border-color);
}

.newsletter-section {
    background: var(--bg-surface);
    padding: 4rem 0;
    text-align: center;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    padding: 4rem 0;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-tagline {
    color: var(--text-muted);
    margin-top: 1rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: var(--text-muted);
}

.footer-social a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==========================================================================
   Search Modal
   ========================================================================== */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.search-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.search-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.search-modal-content {
    position: relative;
    background: var(--bg-primary);
    width: 100%;
    max-width: 600px;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    border: 1px solid var(--border-color);
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.search-modal.active .search-modal-content {
    transform: translateY(0);
}

.search-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.search-modal input[type="search"] {
    width: 100%;
    font-size: 1.5rem;
    border: none;
    border-bottom: 2px solid var(--brand-primary);
    background: transparent;
    color: var(--text-primary);
    padding: 1rem 0;
    outline: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hero-container, .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-section {
        padding: 4rem 0;
        text-align: center;
    }
    
    .hero-subtitle {
        margin: 0 auto 2rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .main-navigation ul {
        display: none; /* Mobile menu logic handled in JS */
    }
    
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        color: var(--text-primary);
    }
    
    .newsletter-form {
        flex-direction: column;
    }
}
