/**
 * Outpost - CSS Styles
 * Clean, typography-focused design
 */

/* ========================================
   CSS Variables & Base
   ======================================== */

:root {
    /* Colors */
    --bg: #fafaf9;
    --bg-alt: #f5f5f4;
    --card: #ffffff;
    --text: #1c1917;
    --text-muted: #78716c;
    --text-light: #a8a29e;
    --border: #e7e5e4;
    --border-light: #f5f5f4;
    
    /* Accent - can be overridden per-site */
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    
    /* Typography */
    --font-heading: Georgia, 'Times New Roman', serif;
    --font-body: Georgia, 'Times New Roman', serif;
    --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Sizing */
    --container-max: 1200px;
    --content-max: 680px;
    --sidebar-width: 320px;
    --spacing: 24px;
    --radius: 8px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* ========================================
   Reset & Base
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

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

a:hover {
    color: var(--accent-dark);
}

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

/* ========================================
   Layout
   ======================================== */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--spacing);
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: calc(var(--spacing) * 2);
}

.container-narrow {
    max-width: var(--content-max);
    display: block;
}

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

/* ========================================
   Header
   ======================================== */

.site-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing) 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--spacing);
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-logo {
    flex-shrink: 0;
}

.site-logo img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.site-logo-small img {
    width: 40px;
    height: 40px;
}

.site-branding-text {
    display: flex;
    flex-direction: column;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

.site-title a:hover {
    color: var(--accent);
}

.site-tagline {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.site-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.site-header-minimal {
    border-bottom: none;
    padding-bottom: 0;
    gap: 12px;
}

.back-link {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.back-link:hover {
    color: var(--accent);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========================================
   Search
   ======================================== */

.search-form-header {
    display: flex;
    align-items: center;
    gap: 0;
}

.search-form-header input[type="search"] {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    background: var(--card);
    color: var(--text);
    width: 180px;
    transition: border-color 0.2s, width 0.2s;
}

.search-form-header input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
    width: 220px;
}

.search-form-header input[type="search"]::placeholder {
    color: var(--text-light);
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--bg-alt);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.search-btn:hover {
    background: var(--border);
    color: var(--text);
}

.search-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.search-link:hover {
    color: var(--accent);
}

/* Search results page */
.search-page {
    padding: var(--spacing) 0;
}

.search-page-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: var(--spacing);
}

.search-form-large {
    display: flex;
    gap: 12px;
    margin-bottom: var(--spacing);
}

.search-form-large input[type="search"] {
    flex: 1;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    transition: border-color 0.2s;
}

.search-form-large input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
}

.search-form-large input[type="search"]::placeholder {
    color: var(--text-light);
}

.search-results-count {
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: calc(var(--spacing) * 1.5);
    padding-bottom: var(--spacing);
    border-bottom: 1px solid var(--border);
}

.search-link-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.search-link-mobile:hover {
    color: var(--accent);
}

@media (max-width: 600px) {
    .search-form-header {
        display: none;
    }
    
    .search-link-mobile {
        display: flex;
    }
    
    .site-nav {
        gap: 8px;
    }
    
    .search-form-large {
        flex-direction: column;
    }
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    background: var(--bg-alt);
    color: var(--text);
}

.btn:hover {
    background: var(--border);
    color: var(--text);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-dark);
    color: white;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

/* ========================================
   Post List
   ======================================== */

.post-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing) * 1.5);
}

.post-card {
    padding-bottom: calc(var(--spacing) * 1.5);
    border-bottom: 1px solid var(--border);
}

.post-card:last-child {
    border-bottom: none;
}

.post-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

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

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

.post-meta {
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    background: var(--bg-alt);
    color: var(--text-muted);
    border-radius: 20px;
    transition: all 0.2s;
}

.tag:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* ========================================
   Badges
   ======================================== */

.badge {
    font-family: var(--font-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
}

.badge-gated {
    background: #fef3c7;
    color: #92400e;
}

.badge-subscribers {
    background: #dbeafe;
    color: #1e40af;
}

/* ========================================
   Single Post
   ======================================== */

.post-single {
    max-width: var(--content-max);
}

.post-header {
    margin-bottom: calc(var(--spacing) * 1.5);
    position: relative;
    z-index: 2;
}

.post-single .post-title {
    font-size: 2.25rem;
    margin-bottom: 16px;
}

.post-single .post-meta {
    margin-bottom: 16px;
}

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

.post-featured-image {
    margin-bottom: calc(var(--spacing) * 1.5);
    border-radius: var(--radius);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    display: block;
}

/* ========================================
   Video Embeds
   ======================================== */

.post-video {
    margin-bottom: calc(var(--spacing) * 1.5);
}

.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: var(--bg-alt);
    border-radius: var(--radius);
    overflow: hidden;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ========================================
   Post Content (Prose)
   ======================================== */

.prose {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.75em;
    letter-spacing: -0.02em;
}

.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.125rem; }

.prose p {
    margin-bottom: 1.5em;
}

.prose ul, .prose ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.prose li {
    margin-bottom: 0.5em;
}

.prose blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.5em;
    margin: 2em 0;
    font-style: italic;
    color: var(--text-muted);
}

.prose pre {
    background: var(--text);
    color: #f5f5f4;
    padding: 1.5em;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1.5em;
    font-size: 0.875rem;
    line-height: 1.6;
}

.prose code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 4px;
}

.prose pre code {
    background: none;
    padding: 0;
}

.prose img {
    border-radius: var(--radius);
    margin: 1.5em 0;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3em 0;
}

.prose a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose strong {
    font-weight: 700;
}

/* ========================================
   Content Gate
   ======================================== */

.content-gate {
    text-align: center;
    padding: calc(var(--spacing) * 3) var(--spacing);
    background: linear-gradient(180deg, transparent 0%, var(--bg-alt) 100%);
    border-radius: var(--radius);
    margin-top: calc(var(--spacing) * -2);
    position: relative;
}

.content-gate::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg, transparent 0%, var(--bg) 100%);
    pointer-events: none;
}

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

.gate-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: var(--spacing);
}

.content-gate h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.content-gate p {
    color: var(--text-muted);
    margin-bottom: var(--spacing);
}

.gate-form {
    max-width: 400px;
    margin: 0 auto;
}

.gate-form input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.gate-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.gate-form button {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.gate-form button:hover {
    background: var(--accent-dark);
}

.gate-note {
    margin-top: var(--spacing);
    color: var(--text-light);
    font-size: 0.875rem;
}

/* ========================================
   Post Footer
   ======================================== */

.post-footer {
    margin-top: calc(var(--spacing) * 2);
    padding-top: calc(var(--spacing) * 2);
    border-top: 1px solid var(--border);
}

.share-box {
    text-align: center;
    margin-bottom: calc(var(--spacing) * 2);
}

.share-box p {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius);
    color: white;
}

.share-twitter { background: #1da1f2; }
.share-twitter:hover { background: #0c8de4; color: white; }

.share-linkedin { background: #0077b5; }
.share-linkedin:hover { background: #006399; color: white; }

/* ========================================
   Subscribe Box
   ======================================== */

.subscribe-box {
    background: var(--card);
    padding: var(--spacing);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.subscribe-box h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.subscribe-box p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscribe-form input {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.9375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.subscribe-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.subscribe-form button {
    width: 100%;
    padding: 12px 20px;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
}

.subscribe-form button:hover {
    background: var(--accent-dark);
}

.subscribe-box-inline {
    text-align: center;
}

.subscribe-form-inline {
    max-width: 400px;
    margin: 0 auto;
}

/* Large subscribe form (dedicated page) */
.subscribe-box-large {
    max-width: 500px;
    margin: 0 auto;
    padding: calc(var(--spacing) * 2);
    text-align: center;
}

.subscribe-box-large h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 12px;
}

.subscribe-description {
    font-size: 1.125rem;
    margin-bottom: var(--spacing);
}

.subscribe-about {
    font-size: 0.9375rem;
    color: var(--text-muted);
    padding: var(--spacing);
    background: var(--bg-alt);
    border-radius: var(--radius);
    margin-bottom: var(--spacing);
}

.subscribe-form-large {
    flex-direction: column;
}

.subscribe-form-large .form-group {
    margin-bottom: 12px;
}

.subscribe-form-large input {
    width: 100%;
}

.subscribe-form-large button {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
}

.subscribe-note {
    margin-top: var(--spacing);
    color: var(--text-light);
}

/* Subscribe widget success message */
.subscribe-success-message {
    text-align: center;
    padding: 16px;
    background: #ecfdf5;
    color: #059669;
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.subscribe-success-message .success-checkmark {
    display: inline-block;
    font-weight: bold;
    margin-right: 4px;
}

.subscribe-success-message small {
    color: #047857;
}

.subscribe-author {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    margin-top: calc(var(--spacing) * 1.5);
    padding-top: calc(var(--spacing) * 1.5);
    border-top: 1px solid var(--border);
}

.subscribe-author .author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.subscribe-author strong {
    display: block;
    margin-bottom: 4px;
}

.subscribe-author p {
    font-size: 0.875rem;
    margin: 0;
}

/* ========================================
   Subscribe Page
   ======================================== */

.subscribe-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subscribe-container {
    width: 100%;
    max-width: 600px;
    padding: var(--spacing);
}

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

.subscribe-success {
    text-align: center;
}

.subscribe-success h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 12px;
}

.subscribe-success p {
    color: var(--text-muted);
    margin-bottom: var(--spacing);
}

.success-icon {
    width: 60px;
    height: 60px;
    background: #10b981;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto var(--spacing);
}

.subscribe-success-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto var(--spacing);
    display: block;
}

/* ========================================
   Download Box
   ======================================== */

.download-box {
    display: flex;
    align-items: center;
    gap: var(--spacing);
    padding: var(--spacing);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: calc(var(--spacing) * 2);
}

.download-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.download-info {
    flex: 1;
}

.download-info strong {
    display: block;
    color: var(--text);
    margin-bottom: 2px;
}

.download-info span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.download-box .btn {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .download-box {
        flex-direction: column;
        text-align: center;
    }
    
    .download-box .btn {
        width: 100%;
    }
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
}

.about-text {
    background: var(--card);
    padding: var(--spacing);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.about-text p {
    margin: 0;
}

.about-box {
    background: var(--card);
    padding: var(--spacing);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.about-box .author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
}

.about-box h4 {
    font-family: var(--font-heading);
    margin-bottom: 8px;
}

.about-box p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin: 0;
}

/* ========================================
   Sidebar Tag Cloud
   ======================================== */

.sidebar-tag-cloud {
    background: var(--card);
    padding: var(--spacing);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.sidebar-tag-cloud h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 12px;
}

.tag-cloud-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: calc(var(--spacing) * 2);
    padding-top: var(--spacing);
    border-top: 1px solid var(--border);
    font-family: var(--font-ui);
    font-size: 0.875rem;
}

.pagination-info {
    color: var(--text-muted);
}

.pagination-prev,
.pagination-next {
    color: var(--accent);
}

/* ========================================
   Tag Header
   ======================================== */

.tag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing);
    padding-bottom: var(--spacing);
    border-bottom: 1px solid var(--border);
}

.tag-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
}

.tag-clear {
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    text-align: center;
    padding: calc(var(--spacing) * 3);
    color: var(--text-muted);
}

/* ========================================
   Messages
   ======================================== */

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: var(--spacing);
    font-family: var(--font-ui);
    font-size: 0.9375rem;
}

.success-message {
    background: #ecfdf5;
    color: #059669;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: var(--spacing);
    font-family: var(--font-ui);
    font-size: 0.9375rem;
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    grid-column: 1 / -1;
    text-align: center;
    padding: calc(var(--spacing) * 2) 0;
    margin-top: calc(var(--spacing) * 2);
    border-top: 1px solid var(--border);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-links {
    margin-top: 8px;
}

.footer-links a {
    color: var(--text-muted);
    margin: 0 8px;
}

.footer-links a:hover {
    color: var(--accent);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 600px) {
    html {
        font-size: 16px;
    }
    
    .container {
        padding: 16px;
    }
    
    .post-single .post-title {
        font-size: 1.75rem;
    }
    
    .subscribe-form {
        flex-direction: column;
    }
    
    .subscribe-form button {
        width: 100%;
    }
}

/* ========================================
   Dark Mode
   ======================================== */

.dark-mode {
    --bg: #0f0f0f;
    --bg-alt: #1a1a1a;
    --card: #1a1a1a;
    --text: #e5e5e5;
    --text-muted: #a3a3a3;
    --text-light: #737373;
    --border: #2e2e2e;
    --border-light: #252525;
}

.dark-mode .prose pre {
    background: #0a0a0a;
}

.dark-mode .prose code {
    background: var(--bg-alt);
}

.dark-mode .content-gate {
    background: linear-gradient(180deg, transparent 0%, var(--bg-alt) 100%);
}

.dark-mode .content-gate::before {
    background: linear-gradient(180deg, transparent 0%, var(--bg) 100%);
}

.dark-mode .gate-form input {
    background: var(--bg);
    color: var(--text);
}

.dark-mode .subscribe-form input {
    background: var(--bg);
    color: var(--text);
}

.dark-mode .badge-gated {
    background: rgba(254, 243, 199, 0.15);
    color: #fcd34d;
}

.dark-mode .badge-subscribers {
    background: rgba(219, 234, 254, 0.15);
    color: #93c5fd;
}

.dark-mode .success-icon {
    background: #059669;
}

.dark-mode .error-message {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.dark-mode .success-message {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.dark-mode .subscribe-success-message {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.dark-mode .search-form-header input[type="search"] {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.dark-mode .search-form-header input[type="search"]::placeholder {
    color: var(--text-light);
}

.dark-mode .search-btn {
    background: var(--bg-alt);
    border-color: var(--border);
    color: var(--text-muted);
}

.dark-mode .search-btn:hover {
    background: var(--border);
    color: var(--text);
}

.dark-mode .search-form-large input[type="search"] {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.dark-mode .search-form-large input[type="search"]::placeholder {
    color: var(--text-light);
}

/* Auto dark mode - follows system preference */
/* ========================================
   Cookie Consent Banner
   ======================================== */

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 16px var(--spacing);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-consent.visible {
    transform: translateY(0);
}

.cookie-consent-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing);
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 280px;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.cookie-consent-text a {
    color: var(--accent);
    text-decoration: underline;
}

.cookie-consent-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-consent .btn {
    padding: 10px 20px;
    font-size: 0.8125rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background: var(--bg-alt);
    border-color: var(--text-muted);
    color: var(--text);
}

@media (max-width: 600px) {
    .cookie-consent-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-consent-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode cookie banner */
.dark-mode .cookie-consent {
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

@media (prefers-color-scheme: dark) {
    body[data-auto-dark="true"] {
        --bg: #0f0f0f;
        --bg-alt: #1a1a1a;
        --card: #1a1a1a;
        --text: #e5e5e5;
        --text-muted: #a3a3a3;
        --text-light: #737373;
        --border: #2e2e2e;
        --border-light: #252525;
    }
    
    body[data-auto-dark="true"] .prose pre {
        background: #0a0a0a;
    }
    
    body[data-auto-dark="true"] .prose code {
        background: var(--bg-alt);
    }
    
    body[data-auto-dark="true"] .content-gate {
        background: linear-gradient(180deg, transparent 0%, var(--bg-alt) 100%);
    }
    
    body[data-auto-dark="true"] .content-gate::before {
        background: linear-gradient(180deg, transparent 0%, var(--bg) 100%);
    }
    
    body[data-auto-dark="true"] .gate-form input {
        background: var(--bg);
        color: var(--text);
    }
    
    body[data-auto-dark="true"] .subscribe-form input {
        background: var(--bg);
        color: var(--text);
    }
    
    body[data-auto-dark="true"] .badge-gated {
        background: rgba(254, 243, 199, 0.15);
        color: #fcd34d;
    }
    
    body[data-auto-dark="true"] .badge-subscribers {
        background: rgba(219, 234, 254, 0.15);
        color: #93c5fd;
    }
    
    body[data-auto-dark="true"] .success-icon {
        background: #059669;
    }
    
    body[data-auto-dark="true"] .error-message {
        background: rgba(239, 68, 68, 0.15);
        color: #fca5a5;
    }
    
    body[data-auto-dark="true"] .success-message {
        background: rgba(16, 185, 129, 0.15);
        color: #6ee7b7;
    }
    
    body[data-auto-dark="true"] .subscribe-success-message {
        background: rgba(16, 185, 129, 0.15);
        color: #6ee7b7;
    }
    
    body[data-auto-dark="true"] .cookie-consent {
        box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    }
}

