/* ============================================================================
   MATLOG CUSTOM STYLES
   Professional but minimal design
   ============================================================================ */

:root {
    /* Color Palette */
    --color-primary: #1e3a8a;      /* Deep blue - trust, professionalism */
    --color-primary-light: #3b82f6;
    --color-secondary: #06b6d4;     /* Cyan - tech, modern */
    --color-accent: #f59e0b;        /* Orange - energy, highlight */
    --color-text: #1f2937;          /* Dark gray */
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-bg: #ffffff;
    --color-bg-alt: #f9fafb;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
}

/* Compact header */
header.container {
    padding-top: 0.0rem;
    padding-bottom: 0.0rem;
}

header.container nav {
    padding: 0;
    min-height: unset;
}

header.container nav ul {
    margin-bottom: 0;
}
/* ============================================================================
   HERO SECTION
   ============================================================================ */

.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1e40af 100%);
    color: white;
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-lg);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

@media (min-width: 768px) {
    .hero-content {
        grid-template-columns: 1.2fr 1fr;
    }
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    color: white;
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.2rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}

.hero-description {
    font-size: 1.0rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-md);
    max-width: 600px;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Code Window Visual */
.code-window {
    background: #1f2937;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

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

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #fbbf24; }
.dot-green { background: #10b981; }

.window-content {
    padding: 1.5rem;
}

.window-content pre {
    margin: 0;
    background: transparent;
}

.window-content code {
    color: #e5e7eb;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================================================
   SECTION HEADERS
   ============================================================================ */

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--color-text);
}

.section-header p {
    font-size: 1.2rem;
    color: var(--color-text-muted);
}

.section-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
}

/* ============================================================================
   POST GRID
   ============================================================================ */

.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

@media (min-width: 768px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Clickable card wrapper */
.post-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Post card styling */
.post-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--spacing-md);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card-link:hover .post-card {
    border-color: var(--color-primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Post metadata */
.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.post-tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    background: var(--color-secondary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    display: inline-block;
}

/* Post title */
.post-card h3 {
    margin-bottom: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
    transition: color 0.2s;
}

.post-card-link:hover h3 {
    color: var(--color-primary);
}

/* Post excerpt */
.post-excerpt {
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
    flex-grow: 1;
}

/* Read more link */
.read-more {
    color: var(--color-primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.2s;
}

.post-card-link:hover .read-more {
    gap: 0.5rem;
}

/* ============================================================================
   TOPICS SECTION
   ============================================================================ */

.topics-section {
    background: var(--color-bg-alt);
    padding: var(--spacing-lg) var(--spacing-md);
    border-radius: 12px;
    margin: var(--spacing-xl) auto;
}

.topics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 768px) {
    .topics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.topic-card {
    text-align: center;
    padding: var(--spacing-md);
}

.topic-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.topic-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.topic-card p {
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ============================================================================
   CTA SECTION
   ============================================================================ */

.cta-section {
    margin: var(--spacing-xl) auto;
}

.cta-card {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1e40af 100%);
    color: white;
    padding: var(--spacing-lg);
    border-radius: 12px;
    text-align: center;
}

.cta-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: white;
}

.cta-card p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    color: rgba(255, 255, 255, 0.95);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: var(--spacing-lg);
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0f172a;
        --color-bg-alt: #1e293b;
        --color-text: #f1f5f9;
        --color-text-muted: #94a3b8;
        --color-border: #334155;
    }
    
    .code-window {
        background: #0f172a;
    }
    
    .window-header {
        background: #1e293b;
    }
}

/* ============================================================================
   CONTENT PAGES (About, etc.)
   ============================================================================ */

.page-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1e40af 100%);
    color: white;
    padding: var(--spacing-lg) 0;
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.page-header hgroup h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.page-header hgroup p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.content-page {
    max-width: 800px;
    margin: 0 auto;
}

.content-section {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md);
}

.content-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

.content-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.lead-paragraph {
    font-size: 1.0rem;
    line-height: 1.7;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

/* Vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--spacing-lg);
    padding-left: 2rem;
}

/* Dot on the line */
.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 3px solid var(--color-bg);
    box-shadow: 0 0 0 2px var(--color-primary);
    z-index: 1;
}

.timeline-year {
    display: inline-block;
    background: var(--color-secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Mobile */
@media (max-width: 768px) {
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline::before {
        left: 6px;
    }
    
    .timeline-item {
        padding-left: 1.5rem;
    }
    
    .timeline-dot {
        left: -1.5rem;
        width: 16px;
        height: 16px;
    }
}

/* Highlight Sections */
.highlight-section {
    background: var(--color-bg-alt);
    padding: var(--spacing-md);
    border-radius: 8px;
    border-left: 4px solid var(--color-secondary);
}

/* Feature Lists */
.feature-list {
    list-style: none;  /* Remove default bullets */
    padding-left: 0;
}

.feature-list li {
    padding-left: 2rem;
    position: relative;
    margin-bottom: 0.75rem;
    list-style: none;  /* Ensure no bullets */
}

.feature-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-secondary);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Tech Stack Grid */
.tech-stack-section {
    background: var(--color-bg-alt);
    padding: var(--spacing-lg);
    border-radius: 8px;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.tech-category {
    background: var(--color-bg);
    padding: var(--spacing-md);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.tech-category h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.tech-category p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* CTA Section (Light) */
.cta-section-light {
    background: var(--color-bg-alt);
    padding: var(--spacing-lg);
    border-radius: 8px;
    text-align: center;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: var(--spacing-md) 0;
}

.contact-list li {
    margin-bottom: 0.75rem;
    list-style: none;
}


/* ============================================================================
   LEGAL PAGES (Imprint, Privacy)
   ============================================================================ */

.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-sm);
}

.legal-page h1 {
    font-size: 2.0rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.legal-page h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.legal-page h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.legal-page p,
.legal-page ul {
    line-height: 1.7;
    color: var(--color-text);
    font-size: medium;
}

.legal-page small {
    color: var(--color-text-muted);
}

/* ============================================================================
   BLOG POST PAGES
   ============================================================================ */

/* Post Header (similar to page-header but with back link) */
.post-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1e40af 100%);
    color: white;
    padding: var(--spacing-lg) 0;  /* ← CHANGE THIS LINE */
}

.post-header-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);  /* ← ADD THIS LINE */
}

.back-link {
    margin-bottom: var(--spacing-sm);
}

.back-link a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.back-link a:hover {
    color: white;
}

.post-header hgroup h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: white;
    line-height: 1.2;
}

.post-header-meta {
    display: flex;
    gap: 0.75rem;               /* space between items (date, reading time, tags) */
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-sm);
}

.post-header-meta time,
.post-header-meta .reading-time {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
}

.post-header-meta .reading-time::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    margin: 0 0.5rem 0 0; /* small gap between dot and reading-time text */
    vertical-align: middle;
}

.post-header-tags {
    display: flex;
    gap: 0.5rem;
}

.post-excerpt-header {
    font-size: 1.2rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    font-style: italic;
    border-left: 3px solid rgba(255, 255, 255, 0.5);
    padding-left: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* ============================================================================
   BLOG POST CONTENT
   ============================================================================ */

/* Content Container - White card on subtle background */
.post-content-wrapper {
    background: var(--color-bg-alt);
    padding: var(--spacing-md) 0;
    margin-bottom: 0;
}

.post-content {
    background: var(--color-bg);
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin: 0 var(--spacing-md);  /* ← Simplified: horizontal margins on mobile */
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--color-text);
}

/* Center on desktop */
@media (min-width: 832px) {  /* 800px + 2 * 16px padding */
    .post-content {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Headings */

.post-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.post-content h1:first-child {
    margin-top: 0;
}


.post-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.post-content h2:first-child {
    margin-top: 0;
}

.post-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* Paragraphs and lists */
.post-content p {
    margin-bottom: 1rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.post-content li > ul,
.post-content li > ol {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Links */
.post-content a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--color-primary);
    transition: all 0.2s;
}

.post-content a:hover {
    color: var(--color-secondary);
    border-bottom-color: var(--color-secondary);
}

/* Inline code */
.post-content code {
    background: #f3f4f6;
    color: #1f2937;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    font-weight: 500;
}

/* Code blocks */
.post-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Blockquotes */
.post-content blockquote {
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-secondary);
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--color-text-muted);
    border-radius: 4px;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Images */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Paragraph containing image and caption */
.post-content p:has(> img) {
    margin-bottom: 0.5rem;  /* Reduce bottom margin */
}

/* Tighten spacing between image and caption within same paragraph */
.post-content p:has(> img) img {
    margin-bottom: 0.5rem;  /* Reduce space below image */
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.post-content th,
.post-content td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.post-content th {
    background: var(--color-bg-alt);
    font-weight: 600;
}

.post-content tr:hover {
    background: var(--color-bg-alt);
}

/* Horizontal rule */
.post-content hr {
    border: none;
    border-top: 2px solid var(--color-border);
    margin: 2rem 0;
}

/* Text formatting */
.post-content strong {
    font-weight: 600;
}

.post-content em {
    font-style: italic;
}

/* Image captions (must come AFTER general em rule) */
.post-content p:has(> img) > em:last-child {
    display: block;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 0;  /* No gap between image and caption */
}

/* Mobile */
@media (max-width: 768px) {
    .post-content {
        padding: var(--spacing-md);
    }
}


/* Post Footer */
.post-footer {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--color-border);
    text-align: center;
}

.post-footer p {
    color: var(--color-text-muted);
}

/* ============================================================================
   ARCHIVE PAGE
   ============================================================================ */

/* Year headers */
.year-header {
    font-size: 2rem;
    font-weight: 700;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--color-primary);
    color: var(--color-text);
}

.year-header:first-of-type {
    margin-top: 0;
}

/* Adjust post-grid for archive (allow 3 columns on wide screens) */
.content-page .post-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .content-page .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .content-page .post-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================================
   LOGO / BRANDING
   ============================================================================ */

.logo-text-only {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.4rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
}

.logo-brackets {
    color: var(--color-secondary);
    font-size: 1.6rem;
    font-weight: 400;
}

.logo-m {
    color: var(--color-primary);
    font-weight: 800;
    font-size: 2.0rem;
}

.logo-name {
    color: var(--color-text);
}

.logo-text-only:hover .logo-name {
    color: var(--color-primary);
}

.logo-text-only:hover .logo-m {
    color: var(--color-secondary);
}