/*
Theme Name: Mittelstand Flow Blog
Theme URI: https://nextmittelstand.ai/blog
Author: NextMittelstand AI Consulting
Author URI: https://nextmittelstand.ai
Description: A custom theme matching the NextMittelstand AI landing page.
Version: 1.0.0
Text Domain: mittelstand-flow-blog
*/

/* ----------------------------- Design System & Variables ----------------------------- */
:root {
    --radius: 0.75rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
    --radius-3xl: 1.5rem;
    
    /* Colors (using exact OKLCH values matching landing page) */
    --background: oklch(0.995 0.002 250);
    --foreground: oklch(0.18 0.025 260);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.18 0.025 260);
    --primary: oklch(0.22 0.04 258);
    --primary-foreground: oklch(0.985 0.003 250);
    --secondary: oklch(0.965 0.008 250);
    --secondary-foreground: oklch(0.22 0.04 258);
    --muted: oklch(0.97 0.006 250);
    --muted-foreground: oklch(0.5 0.02 258);
    --accent: oklch(0.62 0.16 248);
    --accent-foreground: oklch(0.99 0.003 250);
    --border: oklch(0.92 0.01 255);
    --input: oklch(0.92 0.01 255);
    --ring: oklch(0.62 0.16 248);
}

/* ----------------------------- Global Styles ----------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

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

.container-page {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 1200px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

@media (min-width: 768px) {
    .container-page {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.font-serif {
    font-family: "Instrument Serif", ui-serif, Georgia, serif;
    font-weight: 400;
    font-style: italic;
    letter-spacing: -0.02em;
}

/* ----------------------------- Header / Navbar ----------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background-color: rgba(253, 253, 254, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.site-header.scrolled {
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    background-color: rgba(253, 253, 254, 0.8);
}

.navbar-container {
    display: flex;
    height: 4rem;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.logo-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: linear-gradient(to bottom right, var(--primary), oklch(0.32 0.08 258));
    color: var(--primary-foreground);
}

.logo-icon {
    width: 1rem;
    height: 1rem;
}

.logo-text {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--foreground);
}

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

@media (min-width: 768px) {
    .nav-menu-desktop {
        display: flex;
    }
}

.nav-link {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-cta {
    display: none;
    align-items: center;
    gap: 0.375rem;
    border-radius: 9999px;
    background-color: var(--primary);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-foreground);
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    .btn-cta {
        display: inline-flex;
    }
}

.btn-cta:hover {
    background-color: oklch(0.28 0.04 258);
    box-shadow: 0 10px 15px -3px rgba(34, 42, 58, 0.2);
}

.btn-arrow {
    width: 0.875rem;
    height: 0.875rem;
}

.mobile-menu-toggle-btn {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background-color: var(--card);
    color: var(--foreground);
    cursor: pointer;
}

@media (min-width: 768px) {
    .mobile-menu-toggle-btn {
        display: none;
    }
}

.mobile-menu-toggle-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Mobile Menu Dropdown */
.mobile-menu-dropdown {
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    background-color: rgba(253, 253, 254, 0.95);
    padding-top: 1rem;
    padding-bottom: 1rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@media (min-width: 768px) {
    .mobile-menu-dropdown {
        display: none !important;
    }
}

.mobile-menu-links {
    display: flex;
    flex-col: column;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    color: var(--foreground);
}

.mobile-btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: var(--primary);
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-foreground);
}

/* ----------------------------- Blog Hero ----------------------------- */
.blog-hero {
    position: relative;
    overflow: hidden;
    padding-top: 5rem;
    padding-bottom: 4rem;
    text-align: center;
}

.blog-hero-radial {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(ellipse 80% 50% at 50% -10%, oklch(0.95 0.04 250 / 0.6), transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.blog-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.blog-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background-color: rgba(253, 253, 254, 0.6);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    backdrop-filter: blur(4px);
}

.blog-eyebrow-accent {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background-color: var(--accent);
}

.blog-title {
    margin-top: 1.5rem;
    font-size: 2.75rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--foreground);
}

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

.blog-description {
    margin-top: 1.25rem;
    font-size: 1.125rem;
    color: var(--muted-foreground);
    text-wrap: pretty;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* ----------------------------- Blog Grid ----------------------------- */
.blog-section {
    padding-bottom: 6rem;
}

.blog-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

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

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

.blog-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border);
    background-color: var(--card);
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(226, 232, 240, 0.9);
}

/* Accent line at bottom of card */
.blog-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.blog-card:hover::after {
    transform: scaleX(1);
}

.blog-card-image-link {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: var(--secondary);
    position: relative;
}

.blog-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* Fallback / Placeholder image */
.blog-card-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--secondary), oklch(0.92 0.02 248));
    color: var(--accent);
}

.blog-card-placeholder-icon {
    width: 2.5rem;
    height: 2.5rem;
    opacity: 0.6;
}

.blog-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.5rem;
}

.blog-card-date {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.blog-card-title {
    margin-top: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--foreground);
}

.blog-card-title a {
    color: inherit;
}

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

.blog-card-excerpt {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.6;
    flex: 1;
}

.blog-card-excerpt p {
    margin-bottom: 0;
}

.blog-card-link {
    margin-top: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
}

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

/* Pagination */
.pagination {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
}

.pagination .nav-links {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.pagination .page-numbers {
    display: inline-grid;
    place-items: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background-color: var(--card);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    transition: all 0.2s ease;
}

.pagination .page-numbers:hover, .pagination .page-numbers.current {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.pagination .page-numbers.dots {
    border: none;
    background-color: transparent;
    color: var(--muted-foreground);
}

/* ----------------------------- Single Post ----------------------------- */
.single-post-container {
    max-width: 760px;
    margin: 4rem auto 6rem auto;
}

.post-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

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

.post-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--foreground);
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .post-header h1 {
        font-size: 3.5rem;
    }
}

.post-meta {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.post-meta-sep {
    color: var(--border);
}

.single-post-thumbnail {
    border-radius: var(--radius-2xl);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 3rem;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.03);
}

.single-post-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
}

.post-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: oklch(0.28 0.02 260); /* slightly darker than body for readability */
}

.post-content p {
    margin-bottom: 1.75rem;
}

.post-content h2, .post-content h3, .post-content h4 {
    color: var(--foreground);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.post-content h2 { font-size: 1.75rem; }
.post-content h3 { font-size: 1.375rem; }

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

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

.post-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.25rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--muted-foreground);
}

/* Post Navigation */
.post-navigation {
    margin-top: 5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .post-navigation {
        grid-template-columns: 1fr 1fr;
    }
}

.nav-box {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background-color: var(--card);
}

.nav-box:hover {
    border-color: rgba(226, 232, 240, 0.9);
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.04);
}

.nav-box-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted-foreground);
    margin-bottom: 0.375rem;
}

.nav-box-title {
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--foreground);
}

.nav-box-title:hover {
    color: var(--accent);
}

/* ----------------------------- Footer ----------------------------- */
.site-footer {
    border-top: 1px solid var(--border);
    background-color: rgba(245, 247, 250, 0.6);
    padding-top: 3.5rem;
}

.footer-grid {
    display: grid;
    gap: 2.5rem;
    grid-template-columns: 1fr;
    padding-bottom: 3.5rem;
}

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

.footer-col-double {
    grid-column: span 1;
}

@media (min-width: 768px) {
    .footer-col-double {
        grid-column: span 2;
    }
}

.footer-desc {
    margin-top: 1rem;
    max-width: 24rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.5;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-col-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

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

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.footer-bottom-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

@media (min-width: 768px) {
    .footer-bottom-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* ----------------------------- Cookie Consent Banner ----------------------------- */
.wp-cookie-consent {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    width: calc(100% - 3rem);
    max-width: 24rem;
    animation: wpFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.wp-cookie-consent-card {
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border);
    background-color: var(--card);
    padding: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(20, 25, 38, 0.25);
}

.wp-cookie-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
}

.wp-cookie-text {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--muted-foreground);
}

.wp-cookie-actions {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.wp-cookie-btn-decline {
    border-radius: 9999px;
    border: 1px solid var(--border);
    background-color: var(--background);
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground);
    cursor: pointer;
    transition: background-color 0.2s;
}

.wp-cookie-btn-decline:hover {
    background-color: var(--secondary);
}

.wp-cookie-btn-accept {
    border-radius: 9999px;
    border: none;
    background-color: var(--primary);
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-foreground);
    cursor: pointer;
    transition: background-color 0.2s;
}

.wp-cookie-btn-accept:hover {
    background-color: oklch(0.28 0.04 258);
}

/* ----------------------------- Blog CTA Section ----------------------------- */
.blog-cta {
    padding-top: 5rem;
    padding-bottom: 5rem;
    background-color: var(--secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.blog-cta-container {
    max-width: 650px;
    margin: 0 auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.blog-cta-title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.blog-cta-text {
    font-size: 1rem;
    color: var(--muted-foreground);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.blog-cta-btn {
    display: inline-flex !important;
    padding: 0.75rem 1.75rem !important;
    font-size: 0.9375rem !important;
}

