:root {
    /* Backgrounds */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --muted: #f5f5f5;
    
    /* Text colors */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    
    /* Interactive colors */
    --accent: #007acc;
    --accent-contrast: #ffffff;
    --link: #007acc;
    --link-hover: #005a99;
    
    /* UI elements */
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.02);
    --focus-ring: #007acc;
    
    /* Status colors */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    
    /* Code styling */
    --code-bg: #f8f9fa;
    --code-text: #333333;
}

[data-theme="dark"] {
    /* Backgrounds */
    --bg-primary: #1a1a1a;
    --bg-secondary: #222222;
    --muted: #2a2a2a;
    
    /* Text colors */
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #888888;
    
    /* Interactive colors */
    --accent: #4a9eff;
    --accent-contrast: #1a1a1a;
    --link: #4a9eff;
    --link-hover: #66b3ff;
    
    /* UI elements */
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.1);
    --focus-ring: #4a9eff;
    
    /* Status colors */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    
    /* Code styling */
    --code-bg: #1e1e1e;
    --code-text: #e0e0e0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: "Roboto Sans", sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

hr {
    border: none;
    height: 1px;
    background: var(--border);
    color: none;
}

main.main-wrapper {
    max-width: 650px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Post Card Styles - Much Smaller */
.post-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.post-card:hover {
    border-color: var(--text-tertiary);
}

/* Subtle featured styling - just a small accent */
.post-card.featured {
    border-top: 2px solid var(--accent);
}

/* Individual Post Styles - No Card, Direct on Background */
.post-article {
    background: transparent;
    border: none;
    margin-bottom: 2rem;
    padding: 0;
}

.post-image {
    width: 100%;
    background: var(--muted);
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Smaller aspect ratio for post cards */
.post-card .post-image {
    aspect-ratio: 2.5/1;
}

/* Larger aspect ratio for individual posts */
.post-article .post-image {
    aspect-ratio: 16/9;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Much more subtle featured badge */
.featured-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 0.6rem;
    font-weight: 500;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.post-content {
    padding: 1.25rem;
}

/* For individual post view, remove padding */
.post-article .post-content {
    padding: 1rem 0 0 0;
}

.post-meta {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-meta .authors {
    color: var(--text-secondary);
}

.post-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Individual post title larger */
.post-article .post-title {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}

.post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-title a:hover {
    color: var(--link);
}

.post-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

/* Individual post description larger */
.post-article .post-description {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.tag {
    background: var(--muted);
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.read-more {
    background: var(--accent);
    color: var(--accent-contrast);
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.read-more:hover {
    background: var(--link-hover);
}

.status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status.published {
    background: var(--success);
    color: white;
}

.status.draft {
    background: var(--warning);
    color: white;
}

/* Post Body Styling */
.post-body {
    margin-top: 2rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.post-body h1, 
.post-body h2, 
.post-body h3, 
.post-body h4, 
.post-body h5, 
.post-body h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.post-body h1 { font-size: 1.875rem; }
.post-body h2 { font-size: 1.5rem; }
.post-body h3 { font-size: 1.25rem; }
.post-body h4 { font-size: 1.125rem; }

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

.post-body pre, 
.post-body code {
    background: var(--code-bg);
    color: var(--code-text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 0.875rem;
}

.post-body code {
    padding: 0.125rem 0.25rem;
}

.post-body pre {
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-body pre code {
    background: none;
    border: none;
    padding: 0;
}

.post-body img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.post-body hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 3rem 0;
}

.post-body blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-body a {
    color: var(--link);
    text-decoration: none;
}

.post-body a:hover {
    text-decoration: underline;
}

/* Series Context and Selection */
.series-context,
.series-selection {
    background: var(--muted);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent);
}

.series-context a,
.series-selection a {
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
}

.series-context a:hover,
.series-selection a:hover {
    text-decoration: underline;
}

.or-standalone {
    color: var(--text-secondary);
    font-style: italic;
}

.back-link {
    display: flex;
    align-items: center;
    flex-direction: row;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:visited {
    color: var(--link);
    text-decoration: none;
}

.back-link:hover,
.back-link:focus {
    text-decoration: underline;
    color: var(--link-hover);
}

/* Posts List - Clean, Minimal Style */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Ensure all list items get separators */
.posts-list > *:not(:last-child),
.featured-grid > *:not(:last-child),
.series-grid > *:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
}

.no-results p {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
}

/* Main Links (on home page) */
.main-links-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

@media (max-width: 520px) {
    .main-links-container {
        grid-template-columns: 1fr;
    }
}

.main-link-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.main-link-card:hover {
    cursor: pointer;
}

.main-link-card span {
    margin: 0;
    transition: transform 0.2s ease;
}

.main-link-card:hover span {
    transform: translateX(4px);
}
