/* Blog Theme - Serious Tech (Clean) */
:root {
    --bg-color: #f5f5dc;
    --text-color: #1a2f1a;
    --accent-color: #2d4f2d;
    --card-bg: #eaead0;
    --border-color: #cfcfb4;
    --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    margin: 0;
    line-height: 1.6;
}

/* --- HEADER STYLES --- */

/* Base Header (Shared Styles) */
header {
    background: linear-gradient(135deg, #1a2f1a 0%, #2d4f2d 100%);
    color: #f5f5dc;
    border-bottom: 4px solid var(--text-color);
    position: relative;
    overflow: hidden;
}

/* Tech Texture Overlay */
header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(245, 245, 220, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 245, 220, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 2;
    margin: 0 auto;
}

/* Home Page Header (Big & Bold) */
header.home-header {
    padding: 4rem 1rem;
    text-align: center;
}

header.home-header .header-content {
    max-width: 800px;
}

header.home-header h1 {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

/* Article Page Header (Compact but Styled) */
header.article-header-bar {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header.article-header-bar h1 {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.25rem;
    /* Much smaller than home */
    margin: 0;
    font-weight: 700;
}

header.article-header-bar a {
    color: #f5f5dc;
    text-decoration: none;
    transition: opacity 0.2s;
}

header.article-header-bar a:hover {
    opacity: 0.8;
}

header.article-header-bar nav a {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-left: 1.5rem;
}

/* Cursor Animation */
h1 .cursor {
    display: inline-block;
    width: 12px;
    height: 2.5rem;
    background-color: #f5f5dc;
    animation: blink 1s step-end infinite;
    vertical-align: bottom;
    margin-left: 5px;
}

header.article-header-bar .cursor {
    height: 1.25rem;
    /* Adjust cursor size for small header */
    width: 8px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.intro-text {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.5);
    border-left: 5px solid var(--text-color);
    border-radius: 4px;
    font-size: 1.1rem;
}

/* Controls (Search & Filter) */
.controls {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    font-size: 1rem;
    border: 2px solid var(--text-color);
    background: transparent;
    color: var(--text-color);
    font-family: var(--font-mono);
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.5);
}

.category-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 8px 16px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: all 0.2s;
    text-transform: uppercase;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--text-color);
    color: var(--bg-color);
}

/* Article Grid */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 1rem;
}

.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 4px 4px 0px var(--text-color);
}

.article-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.article-title {
    font-size: 1.4rem;
    margin: 0 0 1rem 0;
    font-weight: 700;
}

.article-summary {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-more {
    font-weight: bold;
    font-family: var(--font-mono);
    border-bottom: 2px solid transparent;
    width: fit-content;
}

.article-card:hover .read-more {
    border-bottom-color: var(--text-color);
}

/* --- ARTICLE CONTENT STYLES --- */

.article-wrapper {
    max-width: 800px;
    margin: 3rem auto;
    padding: 0 1rem;
}

/* Article Hero (The Title Section) */
header.article-hero {
    background: transparent;
    text-align: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

header.article-hero::before {
    display: none;
}

.article-meta-header {
    font-family: var(--font-mono);
    color: var(--accent-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: block;
}

.article-hero h1 {
    font-family: var(--font-main);
    /* Readable font for title */
    font-size: 2.5rem;
    line-height: 1.2;
    color: var(--text-color);
    margin: 0;
    text-transform: none;
    /* Normal case for readability */
    letter-spacing: normal;
}

/* Main Content Typography */
.article-body {
    background: rgba(255, 255, 255, 0.5);
    /* Subtle container feel */
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    /* Comfortable reading size */
}

.article-body h2 {
    margin-top: 2rem;
    font-size: 1.5rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    /* Underline H2s */
    padding-bottom: 0.3rem;
    margin-bottom: 1rem;
}

.article-body h3 {
    margin-top: 1.5rem;
    font-size: 1.25rem;
    color: var(--accent-color);
}

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

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

/* Code Blocks & Copy Button */
.code-container {
    position: relative;
    background: #1a2f1a;
    border-radius: 6px;
    margin: 1.5rem 0;
    border: 1px solid var(--text-color);
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f1c0f;
    /* Slightly darker */
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #2d4f2d;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #f5f5dc;
}

.copy-btn {
    background: transparent;
    border: 1px solid #f5f5dc;
    color: #f5f5dc;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #f5f5dc;
    color: #1a2f1a;
}

pre {
    margin: 0;
    padding: 1rem;
    color: #f5f5dc;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    overflow-x: auto;
    white-space: pre-wrap;
    /* Wrap long lines */
}

/* Standalone pre blocks (not inside .code-container) */
.article-body > pre,
.article-body > pre code {
    background: #1a2f1a;
    color: #f5f5dc;
    border-radius: 6px;
    border: 1px solid var(--text-color);
    margin: 1.5rem 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-top: auto;
    background-color: var(--card-bg);
}

footer a {
    color: var(--text-color);
    font-weight: bold;
}

@media (max-width: 600px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .article-hero h1 {
        font-size: 2rem;
    }

    header.article-header-bar {
        padding: 1rem;
    }
}