/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dreamcore color palette */
    --primary-color: #9d8cff;
    /* For text and solid fills: #9d8cff is 2.4-2.8:1 against white and the
       light backgrounds. Borders and gradients keep the lighter shade. */
    --primary-strong: #5b47d6;
    --primary-dark: #7c6bdb;
    --primary-light: #c4b8ff;
    --secondary-color: #94a3b8;
    --text-color: #2d2640;
    --text-light: #5a4d6e;
    --text-lighter: #8a7fa3;
    --bg-color: #faf8ff;
    --bg-light: #f3eeff;
    --bg-lighter: #ebe4fa;
    --bg-dark: #1a1525;
    --bg-darker: #0d0a12;
    --border-color: #e0d4f5;
    --border-light: #f0e8ff;
    --accent-color: #7dd3c0;
    --error-color: #f5a0b8;

    /* Dreamcore special colors */
    --dream-lavender: #c9b8ff;
    --dream-pink: #ffc8dd;
    --dream-blue: #a8d8ff;
    --dream-mint: #b8f5e0;
    --dream-cream: #fff5e6;
    --dream-glow: rgba(157, 140, 255, 0.4);

    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Dreamy shadows with color */
    --shadow-sm: 0 2px 8px rgba(157, 140, 255, 0.1);
    --shadow-md: 0 4px 20px rgba(157, 140, 255, 0.15), 0 2px 8px rgba(255, 200, 221, 0.1);
    --shadow-lg: 0 10px 40px rgba(157, 140, 255, 0.2), 0 4px 12px rgba(168, 216, 255, 0.1);
    --shadow-xl: 0 20px 60px rgba(157, 140, 255, 0.25), 0 10px 20px rgba(255, 200, 221, 0.15);
    --shadow-glow: 0 0 30px rgba(157, 140, 255, 0.3), 0 0 60px rgba(255, 200, 221, 0.2);

    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dreamcore Animations */
@keyframes dreamFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(0.5deg); }
    50% { transform: translateY(-4px) rotate(-0.5deg); }
    75% { transform: translateY(-10px) rotate(0.3deg); }
}

@keyframes dreamPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.02); }
}

@keyframes dreamGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes dreamGlow {
    0%, 100% { box-shadow: var(--shadow-md), 0 0 20px rgba(157, 140, 255, 0.2); }
    50% { box-shadow: var(--shadow-lg), 0 0 40px rgba(157, 140, 255, 0.35); }
}

@keyframes dreamOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    33% {
        transform: translate(30px, -20px) scale(1.1);
        opacity: 0.5;
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.4;
    }
}

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    background: var(--bg-color);
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(201, 184, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 200, 221, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(168, 216, 255, 0.08) 0%, transparent 60%);
    background-attachment: fixed;
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
}

/* Dreamy floating orbs background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 10% 10%, rgba(157, 140, 255, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 90% 90%, rgba(255, 200, 221, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(184, 245, 224, 0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
    animation: dreamPulse 8s ease-in-out infinite;
}


/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-strong);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--primary-color-light, #3b82f6);
    outline-offset: 2px;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
.header {
    background: linear-gradient(135deg, rgba(250, 248, 255, 0.85) 0%, rgba(243, 238, 255, 0.85) 100%);
    border-bottom: 1px solid rgba(201, 184, 255, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    box-shadow: 0 4px 30px rgba(157, 140, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
    transition: var(--transition);
}

.header:hover {
    background: linear-gradient(135deg, rgba(250, 248, 255, 0.95) 0%, rgba(243, 238, 255, 0.95) 100%);
    box-shadow: 0 8px 40px rgba(157, 140, 255, 0.15), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.navbar {
    padding: 1rem 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.02em;
    transition: var(--transition);
    text-shadow: 0 0 20px rgba(157, 140, 255, 0);
}

.logo:hover {
    color: var(--primary-strong);
    transform: translateY(-2px);
    text-shadow: 0 0 25px rgba(157, 140, 255, 0.4);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-strong);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-strong);
    border-radius: 2px;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s ease;
}

/* Search Styles */
.nav-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 2rem;
}

.nav-search-input {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem;
    width: 250px;
    transition: var(--transition);
    background: var(--bg-light);
    color: var(--text-color);
}

.nav-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--bg-color);
}

.nav-search-icon {
    position: absolute;
    right: 0.75rem;
    width: 18px;
    height: 18px;
    color: var(--text-lighter);
    pointer-events: none;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-result-item {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--bg-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-category {
    font-size: 0.75rem;
    color: var(--primary-strong);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.search-result-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.search-result-excerpt {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

.search-result-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

.search-result-view-all {
    display: block;
    padding: 1rem;
    text-align: center;
    color: var(--primary-strong);
    font-weight: 600;
    text-decoration: none;
    border-top: 1px solid var(--border-light);
}

.search-result-view-all:hover {
    background: var(--bg-light);
}

/* Search Page Styles */
.search-page {
    padding: 4rem 0;
}

.search-page-header {
    margin-bottom: 3rem;
}

.search-page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.search-input-wrapper {
    position: relative;
    max-width: 600px;
    margin: 2rem 0;
    display: flex;
    align-items: center;
}

.search-input-wrapper input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input-wrapper .nav-search-icon {
    position: absolute;
    right: 1.5rem;
    width: 20px;
    height: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-lighter);
    pointer-events: none;
}

.search-results-container {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.search-result-card {
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.search-result-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.search-result-card .search-result-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.search-result-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.search-result-card h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.search-result-card h3 a:hover {
    color: var(--primary-strong);
}

.search-result-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.search-result-link {
    color: var(--primary-strong);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.search-result-link:hover {
    color: var(--primary-dark);
}

.search-no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.search-no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.search-no-results p {
    color: var(--text-light);
}

.search-no-results a {
    color: var(--primary-strong);
    text-decoration: none;
    font-weight: 600;
}

.search-no-results a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .nav-wrapper {
        flex-wrap: wrap;
    }
    
    .nav-search-wrapper {
        order: 3;
        width: 100%;
        margin: 1rem 0 0 0;
        display: none;
    }
    
    .nav-menu.active ~ .nav-search-wrapper,
    .nav-search-wrapper.active {
        display: flex;
    }
    
    .nav-search-input {
        width: 100%;
        font-size: 0.85rem;
        padding: 0.5rem 2rem 0.5rem 0.75rem;
    }
    
    .nav-menu {
        order: 2;
    }
    
    .search-results-dropdown {
        left: 0;
        right: 0;
        margin-top: 0.25rem;
    }
    
    .search-input-wrapper {
        max-width: 100%;
    }
}

/* Hero Section - Dreamcore Redesign */
.hero {
    background: linear-gradient(180deg, var(--bg-color) 0%, var(--bg-light) 50%, rgba(201, 184, 255, 0.1) 100%);
    padding: 8rem 0 6rem;
    border-bottom: 1px solid rgba(201, 184, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 30% 30%, rgba(201, 184, 255, 0.15) 0%, transparent 35%),
        radial-gradient(circle at 70% 70%, rgba(255, 200, 221, 0.12) 0%, transparent 35%),
        radial-gradient(circle at 50% 20%, rgba(168, 216, 255, 0.1) 0%, transparent 40%);
    animation: dreamPulse 12s ease-in-out infinite;
    pointer-events: none;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 5rem;
    align-items: center;
}

.hero-left {
    max-width: 700px;
}

.hero-tagline {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-strong);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.hero-heading {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--text-color);
    margin-bottom: 2rem;
    text-shadow: 0 2px 20px rgba(157, 140, 255, 0.15);
}

.hero-heading-accent {
    color: var(--primary-strong);
    position: relative;
    display: inline-block;
    text-shadow: 0 0 40px rgba(157, 140, 255, 0.4), 0 2px 10px rgba(157, 140, 255, 0.2);
}

.hero-heading-accent::after {
    content: '';
    position: absolute;
    bottom: 0.15em;
    left: 0;
    right: 0;
    height: 0.25em;
    background: linear-gradient(90deg, var(--dream-lavender), var(--dream-pink), var(--dream-blue));
    opacity: 0.5;
    z-index: -1;
    border-radius: 4px;
    filter: blur(2px);
}

.hero-description {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    line-height: 1.75;
    color: var(--text-light);
    margin-bottom: 3rem;
    max-width: 600px;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.hero-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dream-pink) 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(157, 140, 255, 0.4), 0 0 40px rgba(255, 200, 221, 0.2);
    position: relative;
    overflow: hidden;
}

.hero-cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.hero-cta-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(157, 140, 255, 0.5), 0 0 60px rgba(255, 200, 221, 0.3);
}

.hero-cta-primary:hover::before {
    left: 100%;
}

.hero-cta-primary svg {
    transition: transform 0.3s ease;
}

.hero-cta-primary:hover svg {
    transform: translateX(4px);
}

.hero-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.hero-cta-secondary:hover {
    background: var(--bg-light);
    color: var(--primary-strong);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.hero-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-visual {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: linear-gradient(145deg, var(--bg-dark) 0%, #1a1525 100%);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 80px rgba(157, 140, 255, 0.15);
    border: 1px solid rgba(201, 184, 255, 0.2);
    animation: dreamFloat 6s ease-in-out infinite;
}

.hero-code-block {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    line-height: 1.8;
    color: #e2e8f0;
}

.code-line {
    margin-bottom: 0.5rem;
}

.code-line.indent {
    padding-left: 2rem;
}

.code-comment {
    color: #8a7fa3;
}

.code-keyword {
    color: #c9b8ff;
}

.code-function {
    color: #a8d8ff;
}

.code-string {
    color: #b8f5e0;
}

.hero-visual-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(157, 140, 255, 0.1) 0%, rgba(255, 200, 221, 0.05) 50%, transparent 100%);
    border-radius: var(--radius-xl);
    pointer-events: none;
}

@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 4rem;
        text-align: center;
    }
    
    .hero-left {
        max-width: 100%;
    }
    
    .hero-description {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-cta {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 6rem 0 4rem;
    }
    
    .hero-container {
        gap: 3rem;
    }
    
    .hero-visual {
        padding: 2rem;
    }
    
    .hero-code-block {
        font-size: 0.875rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-cta-primary,
    .hero-cta-secondary {
        text-align: center;
    }
    
    .hero-cta-secondary {
        border-bottom: none;
        border-top: 1px solid var(--border-light);
        padding-top: 1rem;
        margin-top: 0.5rem;
    }
}

.hero-buttons {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.hero-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-buttons .btn svg {
    transition: transform 0.3s ease;
}

.hero-buttons .btn:hover svg {
    transform: translateX(4px);
}

@media (prefers-reduced-motion: no-preference) {
    .hero-buttons {
        animation: fadeInUp 0.8s ease-out 0.6s both;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.4);
    border: 2px solid transparent;
}

.btn-primary:hover {
    background: #059669;
    transform: translateY(-3px);
    box-shadow: 0 12px 24px 0 rgba(16, 185, 129, 0.5);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.2);
}

/* Sections */
section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    text-shadow: 0 2px 15px rgba(157, 140, 255, 0.1);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--dream-lavender), var(--dream-pink));
    border-radius: 2px;
    opacity: 0.7;
}

.section-header-alt {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-top: 1rem;
}

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

.view-all {
    color: var(--primary-strong);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.view-all:hover {
    color: var(--primary-dark);
}

/* Featured Posts */
.featured-posts {
    background: linear-gradient(180deg, var(--bg-color) 0%, var(--bg-light) 50%, rgba(201, 184, 255, 0.08) 100%);
    position: relative;
    overflow: hidden;
}

.featured-posts::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--dream-lavender), var(--dream-pink), var(--dream-blue), transparent);
    opacity: 0.5;
}

.featured-posts::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -10%;
    width: 40%;
    height: 60%;
    background: radial-gradient(circle, rgba(255, 200, 221, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(250, 248, 255, 0.95) 100%);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(201, 184, 255, 0.25);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(201, 184, 255, 0.05) 0%, rgba(255, 200, 221, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
    border-radius: var(--radius-lg);
}

.post-card:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: var(--shadow-xl), 0 0 50px rgba(157, 140, 255, 0.15);
    border-color: rgba(201, 184, 255, 0.5);
}

.post-card:hover::before {
    opacity: 1;
}

.post-card.featured {
    grid-column: span 2;
}

.post-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--bg-lighter);
}

.post-card.featured .post-image {
    height: 400px;
}

.post-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
    pointer-events: none;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-card:hover .post-image img {
    transform: scale(1.08);
}

.post-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dream-pink) 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(157, 140, 255, 0.3);
    z-index: 2;
}

.post-content {
    padding: 1.5rem;
}

.post-date {
    font-size: 0.875rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-card.featured .post-title {
    font-size: 2rem;
}

.post-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    color: var(--primary-strong);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--primary-dark);
}

/* Latest Posts */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-item {
    display: flex;
    gap: 2rem;
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.post-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
    transform: translateX(4px);
}

.post-item-image {
    width: 300px;
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

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

.post-item-content {
    flex: 1;
}

.post-item-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0 1rem;
}

.post-item-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-item-title a:hover {
    color: var(--primary-strong);
}

.post-item-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.post-item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.read-time {
    position: relative;
    padding-left: 1rem;
}

.read-time::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
}

/* Featured Posts Category Filter */
.category-filter {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    padding: 1.5rem 0;
    border-bottom: 2px solid var(--border-light);
}

.category-filter .filter-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(201, 184, 255, 0.3);
    border-radius: var(--radius);
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.4s ease;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.category-filter .filter-btn:hover {
    border-color: var(--dream-lavender);
    color: var(--primary-strong);
    background: rgba(201, 184, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(157, 140, 255, 0.2);
}

.category-filter .filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dream-pink) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 20px rgba(157, 140, 255, 0.4);
}

.category-filter .filter-btn.active:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
}

.post-card.filtered-out {
    display: none;
}

@media (max-width: 768px) {
    .category-filter {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 1rem 0;
        margin-bottom: 2rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .category-filter::-webkit-scrollbar {
        height: 4px;
    }
    
    .category-filter::-webkit-scrollbar-track {
        background: var(--bg-light);
    }
    
    .category-filter::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }
    
    .category-filter .filter-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        flex-shrink: 0;
    }
}

/* Topics Section */
.topics-section {
    background: var(--bg-light);
    padding: 5rem 0;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.topic-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 248, 255, 0.9) 100%);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    text-align: center;
    border: 1px solid rgba(201, 184, 255, 0.2);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(201, 184, 255, 0.1) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.topic-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(157, 140, 255, 0.15);
    border-color: rgba(201, 184, 255, 0.5);
}

.topic-card:hover::before {
    opacity: 1;
}

.topic-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.topic-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.topic-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.topic-link {
    color: var(--primary-strong);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    display: inline-block;
}

.topic-link:hover {
    color: var(--primary-dark);
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1525 50%, #2d1f3d 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.newsletter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(157, 140, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 200, 221, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(168, 216, 255, 0.1) 0%, transparent 60%);
    animation: dreamPulse 10s ease-in-out infinite;
}

.newsletter .container {
    position: relative;
    z-index: 1;
}

.newsletter-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.newsletter-text {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-content > div {
    margin-bottom: 0;
}

.newsletter-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-primary);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.newsletter-privacy {
    margin-top: 1rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Footer */
.footer {
    background: linear-gradient(180deg, var(--bg-darker) 0%, #0a0710 100%);
    color: white;
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--dream-lavender), var(--dream-pink), var(--dream-blue), transparent);
    opacity: 0.4;
}

.footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 10% 0%, rgba(157, 140, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 100%, rgba(255, 200, 221, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

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

.footer-description {
    opacity: 0.8;
    line-height: 1.6;
}

.footer-heading {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-social {
    list-style: none;
}

.footer-social li {
    margin-bottom: 0.5rem;
}

.footer-social a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-social a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

/* Injected via script.js on all pages — NHMO Ohio CTA */
.footer-nhm-cta {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1.25rem 1rem;
    margin-bottom: 0.25rem;
}

.footer .footer-nhm-cta {
    margin-top: 0;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-nhm-cta-text {
    max-width: 40rem;
    margin: 0 auto;
    line-height: 1.65;
    font-size: 0.9375rem;
    opacity: 0.92;
}

.footer-nhm-cta-text a {
    color: var(--dream-lavender);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-nhm-cta-text a:hover {
    color: #fff;
}

/* Minimal footers (no .footer class) */
footer:not(.footer) .footer-nhm-cta {
    padding: 0 0 1rem 0;
    margin-bottom: 0;
}

footer:not(.footer) .footer-nhm-cta-text a {
    color: var(--dream-lavender, #c9b8ff);
}

/* Blog Page */
.blog-header {
    background: var(--bg-light);
    padding: 4rem 0;
    text-align: center;
}

.blog-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.blog-header p {
    font-size: 1.125rem;
    color: var(--text-light);
}

.blog-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-strong);
    color: white;
}

/* Blog Post Page */
.post-header {
    background: var(--bg-light);
    padding: 4rem 0;
    text-align: center;
}

.post-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.post-meta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--text-light);
    margin-top: 1rem;
    font-size: 0.95rem;
}

.post-author {
    display: inline-block;
    font-weight: 500;
}

.post-body {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 20px;
    font-size: 1.125rem;
    line-height: 1.8;
}

.post-body p {
    margin-bottom: 1.75rem;
    line-height: 1.8;
    color: var(--text-color);
}

.post-body img {
    width: 100%;
    height: auto; /* keeps the width/height attributes' ratio, not their pixels */
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

/* The article's photo (images/blog/<slug>.webp). AI-generated, so it says so. */
.post-hero {
    margin: 0 0 2rem;
}

.post-hero img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin: 0;
}

.post-hero figcaption {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.post-body h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 3rem 0 1.5rem;
    color: var(--text-color);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.post-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    color: var(--text-color);
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.post-body h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

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

.post-body li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.post-body kbd {
    background: var(--bg-dark);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.875em;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.post-body code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    /* Long commands and paths in running text wrapped past the screen edge on phones. */
    overflow-wrap: anywhere;
}

.post-body a {
    overflow-wrap: anywhere;
}

.post-body pre {
    background: var(--bg-dark);
    color: white;
    padding: 1.5rem;
    padding-top: 3rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 2rem 0;
    position: relative;
}

.post-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    overflow-wrap: normal;
}

/* Copy Code Button */
.copy-code-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.copy-code-btn:active {
    transform: translateY(0);
}

.copy-code-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.copy-code-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.post-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 2rem;
    margin: 2.5rem 0;
    font-style: italic;
    color: var(--text-light);
    font-size: 1.125rem;
    background: var(--bg-light);
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    border-left-width: 4px;
}

/* TLDR Section */
.tldr-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tldr-box h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-strong);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tldr-box ul {
    margin: 0;
    padding-left: 1.5rem;
}

.tldr-box li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: var(--text-color);
}

.tldr-box li:last-child {
    margin-bottom: 0;
}

.tldr-box strong {
    color: var(--text-color);
    font-weight: 600;
}

/* About Page */
.about-hero {
    background: var(--bg-light);
    padding: 4rem 0;
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 20px;
}

.about-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
}

.about-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* Contact Page */
.contact-hero {
    background: var(--bg-light);
    padding: 4rem 0;
    text-align: center;
}

.contact-content {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 20px;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background: white;
        width: 100%;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        /* visibility keeps the closed, off-screen menu out of the tab order
           and the accessibility tree; it flips after the slide-out ends. */
        visibility: hidden;
        transition: left 0.3s ease, visibility 0s linear 0.3s;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
        visibility: visible;
        transition: left 0.3s ease, visibility 0s;
    }


    .topics-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }

    .post-card.featured {
        grid-column: span 1;
    }

    .post-card.featured .post-image {
        height: 250px;
    }

    .post-item {
        flex-direction: column;
    }

    .post-item-image {
        width: 100%;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .post-header h1 {
        font-size: 2rem;
    }

    .post-body {
        margin: 2rem auto;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }
}


/* Article columns sit in grid/flex parents whose min-width:auto let a wide
   <pre> stretch the whole page past a phone screen; the pre scrolls instead. */
.post-body,
.post-content {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.post-body pre {
    max-width: 100%;
}

/* Images carry width/height attributes (for layout stability); CSS width
   without a height rule must not stretch them to the attribute height. */
img {
    max-width: 100%;
    height: auto;
}
