/* =========================================
   BLOG CSS - Vanilla CSS (No Dependencies)
   ========================================= */

/* CSS Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    line-height: 1.5;
    color: #27272a;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Selection */
::selection {
    background: #2563eb;
    color: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* =========================================
   Utility Classes
   ========================================= */

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-narrow {
    max-width: 65ch;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (min-width: 640px) {
    .sm-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .lg-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Spacing */
.m-0 { margin: 0; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.my-8 { margin-top: 2rem; margin-bottom: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }

/* Text */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.tracking-tight { letter-spacing: -0.025em; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Colors */
.text-white { color: #fff; }
.text-zinc-500 { color: #71717a; }
.text-zinc-600 { color: #52525b; }
.text-zinc-700 { color: #3f3f46; }
.text-zinc-800 { color: #27272a; }
.text-zinc-900 { color: #18181b; }
.text-blue-600 { color: #2563eb; }
.text-red-600 { color: #dc2626; }
.text-green-600 { color: #16a34a; }

.bg-white { background-color: #fff; }
.bg-zinc-50 { background-color: #fafafa; }
.bg-zinc-100 { background-color: #f4f4f5; }
.bg-zinc-800 { background-color: #27272a; }
.bg-zinc-900 { background-color: #18181b; }
.bg-blue-600 { background-color: #2563eb; }
.bg-red-600 { background-color: #dc2626; }
.bg-green-600 { background-color: #16a34a; }

/* Borders */
.border { border: 1px solid #e4e4e7; }
.border-t { border-top: 1px solid #e4e4e7; }
.border-b { border-bottom: 1px solid #e4e4e7; }
.border-zinc-200 { border-color: #e4e4e7; }
.border-zinc-300 { border-color: #d4d4d8; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* Shadow */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1); }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* Width/Height */
.w-full { width: 100%; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-48 { height: 12rem; }
.min-h-screen { min-height: 100vh; }
.max-w-none { max-width: none; }
.max-w-prose { max-width: 65ch; }

/* Object fit */
.object-cover { object-fit: cover; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

/* Z-index */
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* Transitions */
.transition {
    transition-property: color, background-color, border-color, box-shadow, transform;
    transition-duration: 150ms;
    transition-timing-function: ease-in-out;
}

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* =========================================
   Animations & Keyframes
   ========================================= */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation utilities */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.3s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.4s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Staggered animation delays */
.stagger-1 { animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation-delay: 0.4s; opacity: 0; }
.stagger-5 { animation-delay: 0.5s; opacity: 0; }

/* Hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 4px 10px -5px rgba(0,0,0,0.04);
}

.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================
   Component Styles
   ========================================= */

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #e4e4e7;
    position: sticky;
    top: 0;
    z-index: 50;
    animation: fadeInDown 0.4s ease-out;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #18181b;
    transition: color 0.2s ease, transform 0.2s ease;
}

.logo:hover {
    color: #2563eb;
    transform: scale(1.02);
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    font-size: 0.875rem;
    color: #52525b;
    transition: color 0.2s ease;
    position: relative;
    padding-bottom: 2px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #2563eb;
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #18181b;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 5rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, #fafafa 0%, #f0f9ff 50%, #faf5ff 100%);
    border-bottom: 1px solid #e4e4e7;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.03) 0%, transparent 50%);
    animation: pulse 8s infinite;
    pointer-events: none;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #18181b;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    animation: fadeInUp 0.6s ease-out;
    background: linear-gradient(135deg, #18181b 0%, #3f3f46 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.125rem;
    color: #52525b;
    max-width: 40rem;
    margin: 0 auto;
    line-height: 1.75;
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

@media (min-width: 768px) {
    .hero {
        padding: 6rem 1rem;
    }
    .hero-title { font-size: 3.5rem; }
    .hero-description { font-size: 1.25rem; }
}

/* Card */
.card {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: fadeInUp 0.5s ease-out backwards;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.15);
    border-color: #d4d4d8;
}

.card-image {
    width: 100%;
    height: 12rem;
    object-fit: cover;
    transition: opacity 0.3s ease, transform 0.4s ease;
    position: relative;
    z-index: 1;
    background: #f4f4f5;
}

.card:hover .card-image {
    transform: scale(1.05);
}

.card-image-wrapper {
    overflow: hidden;
    position: relative;
    background: #f4f4f5;
    min-height: 12rem;
}

/* Image placeholder skeleton */
.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f4f4f5 25%, #e4e4e7 50%, #f4f4f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 0;
}

/* Hide placeholder when image loaded */
.card-image-wrapper.img-loaded .image-placeholder {
    display: none;
}

.card-body {
    padding: 1.25rem;
    overflow: hidden;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #18181b;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.card-title a {
    transition: color 0.2s ease;
}

.card:hover .card-title,
.card:hover .card-title a {
    color: #2563eb;
}

.card-excerpt {
    font-size: 0.875rem;
    color: #52525b;
    line-height: 1.625;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #71717a;
}

/* Badge / Tag */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 9999px;
    background: #f4f4f5;
    color: #27272a;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge:hover {
    background: #2563eb;
    color: #fff;
    transform: scale(1.05);
    border-color: #2563eb;
}

.badge-outline {
    background: transparent;
    border: 1px solid #d4d4d8;
    color: #52525b;
}

.badge-outline:hover {
    background: #f4f4f5;
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn:hover::after {
    opacity: 1;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #27272a 0%, #3f3f46 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f4f4f5;
    color: #27272a;
}

.btn-secondary:hover {
    background: #e4e4e7;
}

.btn-outline {
    background: transparent;
    border: 1px solid #d4d4d8;
    color: #27272a;
}

.btn-outline:hover {
    background: #f4f4f5;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #52525b;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-text:hover {
    color: #2563eb;
    gap: 0.75rem;
}

.btn-text .icon {
    transition: transform 0.2s ease;
}

.btn-text:hover .icon {
    transform: translateX(-3px);
}

/* Page Title */
.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #18181b;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.page-title-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.page-subtitle {
    font-size: 1rem;
    color: #71717a;
    margin-top: 0.5rem;
}

.posts-count {
    text-align: center;
    font-size: 0.875rem;
    color: #a1a1aa;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e4e4e7;
}

@media (min-width: 640px) {
    .page-title {
        font-size: 2.25rem;
    }
}

/* Empty State */
.empty-state {
    border: 2px dashed #d4d4d8;
    border-radius: 0.75rem;
    padding: 3rem;
    text-align: center;
    color: #71717a;
    background: linear-gradient(135deg, #fafafa 0%, #f4f4f5 100%);
    animation: fadeIn 0.4s ease-out;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #27272a;
    margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid #d4d4d8;
    border-radius: 0.375rem;
    background: #fff;
    color: #18181b;
    transition: border-color 150ms, box-shadow 150ms;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    min-height: 8rem;
    resize: vertical;
}

.form-error {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-hint {
    color: #71717a;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #e4e4e7;
    border-radius: 0.375rem;
    background: #fff;
    color: #27272a;
    cursor: pointer;
    transition: all 150ms;
}

.pagination-btn:hover {
    background: #f4f4f5;
}

.pagination-btn.active {
    background: #18181b;
    color: #fff;
    border-color: #18181b;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
    color: #a1a1aa;
    padding: 3rem 1rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    margin-bottom: 1.5rem;
}

.footer-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.footer-tagline {
    font-size: 0.875rem;
    color: #71717a;
    margin-top: 0.25rem;
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.footer-link {
    color: #a1a1aa;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #fff;
}

.footer-divider {
    color: #52525b;
}

.footer-copyright {
    font-size: 0.75rem;
    color: #71717a;
}

.footer a {
    color: #d4d4d8;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: #fff;
}

/* =========================================
   Article / Prose Styles
   ========================================= */

.prose {
    max-width: 65ch;
    font-size: 1.125rem;
    line-height: 1.8;
    color: #27272a;
}

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    line-height: 1.8;
}

.prose p:first-child { margin-top: 0; }
.prose p:last-child { margin-bottom: 0; }

.prose h1, .prose h2, .prose h3, .prose h4 {
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.75em;
    line-height: 1.3;
    color: #18181b;
}

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

.prose a {
    color: #2563eb;
    text-decoration: underline;
}

.prose a:hover {
    color: #1d4ed8;
}

.prose strong, .prose b {
    font-weight: 600;
    color: #18181b;
}

.prose em, .prose i {
    font-style: italic;
}

.prose ul, .prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.75em;
}

.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    line-height: 1.75;
}

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

.prose blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1.25em;
    margin: 1.5em 0;
    font-style: italic;
    color: #52525b;
}

.prose pre {
    background: #f4f4f5;
    padding: 1.25em;
    border-radius: 0.5em;
    overflow-x: auto;
    margin: 1.5em 0;
}

.prose code {
    background: #f4f4f5;
    padding: 0.2em 0.4em;
    border-radius: 0.25em;
    font-size: 0.875em;
}

.prose img {
    max-width: 100%;
    height: auto;
    margin: 1.5em 0;
    border-radius: 0.5em;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.prose th, .prose td {
    border: 1px solid #e5e7eb;
    padding: 0.75em 1em;
    text-align: left;
}

.prose th {
    background: #f4f4f5;
    font-weight: 600;
}

.prose hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2em 0;
}

/* =========================================
   Dashboard Specific
   ========================================= */

.sidebar {
    width: 16rem;
    background: #18181b;
    color: #fff;
    min-height: 100vh;
    padding: 1.5rem 0;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid #27272a;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #a1a1aa;
    font-size: 0.875rem;
    transition: all 150ms;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #27272a;
    color: #fff;
}

.sidebar-link svg {
    width: 1.25rem;
    height: 1.25rem;
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.dashboard-main {
    flex: 1;
    background: #fafafa;
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #18181b;
}

/* Table */
.table-container {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 0.5rem;
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e4e4e7;
}

.table th {
    background: #fafafa;
    font-size: 0.75rem;
    font-weight: 600;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    font-size: 0.875rem;
    color: #27272a;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: #fafafa;
}

/* Alert */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    background: #fff;
    border-radius: 0.5rem;
    max-width: 32rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e4e4e7;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #18181b;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e4e4e7;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Stat Card */
.stat-card {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #18181b;
}

.stat-label {
    font-size: 0.875rem;
    color: #71717a;
    margin-top: 0.25rem;
}

/* =========================================
   Posts Section
   ========================================= */

.posts-section {
    padding: 4rem 0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #18181b;
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    margin: 0.75rem auto 0;
    border-radius: 2px;
}

/* Card Categories */
.card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    max-height: 4.5rem; /* Limit to roughly 2 rows */
    overflow: hidden;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    color: #71717a;
}

.loading-indicator.hidden {
    display: none;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e4e4e7;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* End Message */
.end-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: #a1a1aa;
    font-size: 0.875rem;
}

.end-message.hidden {
    display: none;
}

.end-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d4d4d8, transparent);
}

/* =========================================
   Article Styles
   ========================================= */

.article {
    max-width: 65ch;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .article-title {
        font-size: 2.5rem;
    }
}

.article-cover {
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: #71717a;
    margin-bottom: 1rem;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.article-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e4e4e7;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tags-label {
    font-size: 0.875rem;
    color: #71717a;
}

.related-posts {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e4e4e7;
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
}

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

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

/* Related posts uses 2 columns max */
.related-posts .posts-grid {
    grid-template-columns: 1fr;
}

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

/* =========================================
   Icons (SVG inline styles)
   ========================================= */

.icon {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: middle;
}

.icon-sm { width: 0.875rem; height: 0.875rem; }
.icon-lg { width: 1.25rem; height: 1.25rem; }
.icon-xl { width: 1.5rem; height: 1.5rem; }

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

@media (max-width: 768px) {
    .hero-title { font-size: 1.875rem; }
    .hero-description { font-size: 1rem; }
    
    .nav { display: none; }
    
    .sidebar { 
        position: fixed;
        left: -16rem;
        transition: left 200ms;
    }
    
    .sidebar.open { left: 0; }
    
    .dashboard-main { padding: 1rem; }
    
    .table-container { overflow-x: auto; }
}

/* =========================================
   Scroll to Top Button
   ========================================= */

.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 40;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.scroll-top-btn:active {
    transform: scale(0.95);
}

/* =========================================
   Print Styles
   ========================================= */

@media print {
    .header, .footer, .sidebar, .nav, .btn {
        display: none !important;
    }
    
    body {
        background: #fff;
        color: #000;
    }
    
    .prose {
        max-width: none;
    }
}
