/* Variables & Theme (Light Mode) */
:root {
    --header-min-height: 60px;
    --logo-size-desktop: 140px;
    --logo-size-mobile: 100px;
    --content-max-width: 63rem;
    --viewport-padding: 16px;
    
    /* Light Theme Palette */
    --bg-main:           #f8f9fa; /* Haupt-Hintergrund (Off-White) */
    --bg-card:           #ffffff; /* Karten-Hintergrund (Reines Weiß) */
    --bg-card-alt:       #f1f5f9; /* Code-Blöcke & Container (Helles Grau) */
    
    --text-main:         #4a5568; /* Fließtext (Dunkles Schiefergrau) */
    --text-heading:      #1a202c; /* Überschriften (Anthrazit) */
    --text-muted:        #718096; /* Metadaten & Footer (Mittleres Grau) */
    
    --border-color:      #e2e8f0;

    /* Blue Accents (Header & Links) */
    --flexoki-blue-50:   #E1ECEB;
    --flexoki-blue-200:  #92BFDB;
    --flexoki-blue-300:  #66A0C8;
    --flexoki-blue-500:  #3171B2;
    --flexoki-blue-700:  #1A4F8C;
    --flexoki-blue-800:  #163B66;

    --border-radius: 12px;
    
    /* Angepasste Schatten für hellen Hintergrund */
    --shadow-3d: 
        0 10px 20px rgba(0, 0, 0, 0.05),
        0 4px 6px rgba(0, 0, 0, 0.03);
    
    --transition-speed: 0.3s ease;
    --shadow-elevation-low: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-elevation-medium: 0 8px 16px rgba(0, 0, 0, 0.08);
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-main:           #100F0F;
    --bg-card:           #1C1B1A;
    --bg-card-alt:       #282726;

    --text-main:         #CECDC3;
    --text-heading:      #ffffff;
    --text-muted:        #B7B5AC;

    --border-color:      #333333;

    --shadow-3d:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.2),
        0 4px 6px rgba(0, 0, 0, 0.1);

    --shadow-elevation-low: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-elevation-medium: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 6px 12px;
    border-radius: 10px;
    transition: background var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

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

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: clamp(16px, 2vw, 18px);
    line-height: 1.6;
    color: var(--text-main);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    margin: 1.5rem 0;
    line-height: 1.2;
}

h1, h2, h3, .logo-text, code, pre {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

p {
    margin-bottom: 1.5rem;
}

blockquote {
    background-color: var(--bg-card);
    border-left: 6px solid;
    border-image: linear-gradient(to bottom, var(--flexoki-blue-300), var(--flexoki-blue-700)) 1;
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    border-radius: var(--border-radius);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);

    font-style: italic;
    color: var(--text-main);
}

.page-title {
    text-align: center;
    color: var(--text-heading);
    margin-bottom: 3rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.profile-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
    margin: 1rem auto 3rem auto;
    max-width: 985px;
    padding: 3px 1.5rem;
    align-items: center;
}

.profile-image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-3d);
    object-fit: cover;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border-color);
}

.profile-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-3d);
}

.profile-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.meta-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    align-items: baseline;
}

.meta-label {
    font-weight: 700;
    color: var(--text-heading);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    color: var(--text-main);
    line-height: 1.5;
}

.accent-line {
    display: block;
    margin: 2rem 0;
    letter-spacing: 0.02em;
    padding-left: 1rem;
    border-left: 4px solid;
    border-image: linear-gradient(to bottom, var(--text-heading), var(--text-muted)) 1;
    font-style: italic;
    font-weight: 500;
}

.accent-line::before {
    content: ">>";
    color: var(--flexoki-blue-500);
    font-weight: bold;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--flexoki-blue-500);
    outline-offset: 2px;
    border-radius: 4px;
}

#root,
#__next {
    isolation: isolate;
}

.wrapper {
    display: grid;
    grid-template-columns: 1fr min(75rem, calc(100% - 2rem)) 1fr;
    justify-content: center;
    padding-inline: var(--viewport-padding);
}

.wrapper > * {
    grid-column: 2;
}

.half-bleed {
    border-radius: 0;
    margin: 2rem 0;
}

.full-bleed {
    display: grid;
    grid-column: 1 / -1;
    height: auto;
    overflow: hidden;
}

.full-bleed img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Header & Navigation */
header {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    background: linear-gradient(145deg, var(--flexoki-blue-700) 0%, var(--flexoki-blue-800) 100%);
    min-height: var(--header-min-height);
    box-shadow: var(--shadow-elevation-medium);
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
}

.logo {
    width: var(--logo-size-desktop);
    height: auto;
}

.logo:hover {
    transform: translateY(-2px);
    border-color: #fff000;
    box-shadow: 
        0 10px 18px -2px rgba(0, 0, 0, 0.5), 
        0 4px 6px -2px rgba(0, 0, 0, 0.3), 
        inset 0 1px 3px rgba(255, 255, 255, 0.8);
}

.header-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 32px;
    gap: 28px;
}

.header-nav nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav ul {
    display: flex;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-nav a {
    display: inline-block;
    font-size: 1.08rem;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 10px;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background var(--transition-speed), transform var(--transition-speed), box-shadow var(--transition-speed);
}

.header-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevation-low);
}

.header-nav a.active {
    background: var(--flexoki-blue-500);
    font-weight: 700;
}

/* Card Designs & Blog Lists */
.homepage {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr)); 
    gap: 1.5rem;
    margin: 1rem 0;
}

.half-bleed-span {
    grid-column: 1 / -1; 
}

.half-bleed-span img {
    width: 100%;
    height: 350px; 
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1rem;
}

.modern-blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-3d);
    padding: 2rem;
    color: var(--text-main);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

/*
.modern-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elevation-medium);
}
*/

.modern-blog-card img {
    width: 100%;
    aspect-ratio: 16 / 9; 
    object-fit: cover;   
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: block;
}

.modern-blog-card p {
    margin: 0;
    line-height: 1.5;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.modern-blog-card a {
    margin-top: auto; 
    padding-top: 1rem;
    color: var(--flexoki-blue-500);
    text-decoration: none;
    font-weight: 600;
}

.modern-blog-card a:hover {
    color: var(--flexoki-blue-700);
    text-decoration: underline;
}

/* Horizontal Card (List Page) */
.blog-card {
    display: flex;
    flex-direction: row;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-3d);
    overflow: hidden;
    color: var(--text-main);
    width: 100%;
    margin-bottom: 1.5rem;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.blog-card__image {
    flex-shrink: 0;
    width: 180px;
    min-height: 140px;
    height: auto;
}

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

.blog-card__content {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.blog-card__title {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.blog-card__title a {
    color: var(--text-heading);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-speed);
}

.blog-card__title a:hover {
    color: var(--flexoki-blue-500);
}

/* About Page Specifics */
.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 2.8fr 1.2fr;
    gap: 2rem;
    align-items: stretch;
    margin: 2rem 0;
    padding: 0 1rem;
}

.about-grid > img {
    display: block;
    width: 100%;
    margin: 0 auto 2rem auto;
    object-fit: contain;
    border-radius: 4px;
    transition: transform var(--transition-speed);
}

.about-grid > ul {
    display: flex;
    flex-direction: column;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.2;
}

.content-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 3rem auto;
    padding: 0 1.5rem;
    max-width: 750px;
}

.content-stack h3 {
    color: var(--text-heading);
    font-size: 1.35rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.content-stack h3:first-of-type {
    margin-top: 0;
}

.content-stack p {
    color: var(--text-main);
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.content-stack p:last-child {
    margin-bottom: 0;
}

/* 7. Post Detail & Content Styling */
.post-content {
    padding: 2rem 1rem;
    background-color: var(--bg-main);
}

.post-header {
    text-align: center;
    background: var(--bg-card);
    padding: 1.5rem 2rem;
    margin: 1rem auto 4rem auto;
    max-width: 90%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-elevation-low);
}

.post-header h1 {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--text-heading);
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.post-date {
    color: var(--flexoki-blue-500);
    font-weight: 600;
}

.post-content p {
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.post-content h2 {
    color: var(--flexoki-blue-700);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    text-align: center;
}

/* Post Images */
img.center {
    display: block;
    width: 50%;
    height: auto;
    margin: 0 auto 2rem auto;
    border-radius: 6px;
    box-shadow: var(--shadow-elevation-low);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

img.center:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-elevation-medium);
}

/* Post Lists */
.post-content ul {
    width: fit-content;
    margin: 2rem auto;
    list-style: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    text-align: left;
    box-shadow: var(--shadow-elevation-low);
}

.post-content li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.post-content li::before {
    content: "›";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--flexoki-blue-500);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1.4;
}

/* Code Blocks */
pre {
    background-color: var(--bg-card-alt);
    color: var(--text-heading);
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    border: 1px solid var(--border-color);
    margin: 1.5rem 0;
    font-size: 0.9rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: normal;
}

/* Footer */
.site-footer {
    padding: 1.2rem 0;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    font-size: 0.9rem;
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    max-width: var(--content-max-width);
    margin: 0 auto;
    gap: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .logo {
        width: 130px;
        margin-left: 10px;
    }

    .header-nav {
        padding-right: 10px;
        gap: 14px;
    }
}

@media (max-width: 1024px) {
    header {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        padding: 16px 0;
    }

    .logo {
        width: var(--logo-size-mobile);
        margin: 0 auto 12px auto;
    }

    .header-nav {
        flex-direction: column;
        padding-right: 0;
        gap: 10px;
    }

    .header-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .wrapper {
        padding: 0 1rem;
    }

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

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

    .about-grid > img {
        height: auto;
        max-height: 300px;
    }

    .blog-card {
        flex-direction: column;
    }

    .blog-card__image {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 600px) {
    .post-content ul {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    img.center {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }

    .profile-image-wrapper {
        max-width: 250px;
        margin: 0 auto;
    }

    .meta-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}
