/* ────────────────────────────────
   CSS VARIABLEN & DESIGN TOKENS
────────────────────────────────── */
:root {
    /* Farben */
    --color-primary: #333;
    --color-primary-dark: #000;
    --color-secondary: darkslategrey;
    --color-background: whitesmoke;
    --color-surface: #fff;
    --color-header-bg: #f8f8f8;
    --color-border: lightgrey;

    /* Schatten */
    --shadow-subtle: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lifted: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-footer: 0 -2px 4px rgba(0, 0, 0, 0.1);

    /* Abstände */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Borders */
    --border-radius: 0.625rem;
    --border-width: 0.05rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;

    /* Z-Index Schichten */
    --z-header: 1000;
    --z-overlay: 900;
}

/* ────────────────────────────────
   GLOBAL RESET & BASICS
────────────────────────────────── */
html {
    box-sizing: border-box;
    overflow-x: clip;
    overflow-clip-margin: 8px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overscroll-behavior-x: none;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    background: var(--color-background);
    color: var(--color-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    overscroll-behavior-x: none;
}

/* ────────────────────────────────
   HEADER & NAVIGATION
────────────────────────────────── */
header {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: clamp(0.5rem, 2vw, 1.5rem);
    align-items: center;

    position: sticky;
    top: 0;
    z-index: var(--z-header);
    width: 100%;

    background: var(--color-header-bg);
    padding: 0.625rem 1.25rem;
    box-shadow: var(--shadow-subtle);
    backdrop-filter: blur(10px);
}

/* Logo */
#logo {
    height: 2.25rem;
    padding: var(--spacing-xs) 0;
    transition: transform var(--transition-fast);
}

#logo:hover {
    transform: scale(1.05);
}

/* Navigation */
nav {
    width: 100%;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    justify-content: flex-start;
}

nav li {
    margin: 0;
}

nav a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

nav a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ────────────────────────────────
   MAIN / IFRAME WRAPPER
────────────────────────────────── */
main {
    flex: 1;
    position: relative;
}

.app {
    height: 100%;
    animation: fadeIn 0.5s ease-out;
}

iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

/* ────────────────────────────────
   CARD STYLES & TYPOGRAPHY
────────────────────────────────── */
.card,
.card-mobile,
.card-blocked {
    background: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-subtle);
    transition: all var(--transition-medium);
}

.card {
    width: 64%;
    max-width: 1200px;
    margin: 5rem auto;
    padding: 2rem 4.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: justify;
}

.card:hover {
    box-shadow: var(--shadow-lifted);
    transform: translateY(-2px);
}

.card-mobile,
.card-blocked {
    width: calc(100% - 4rem);
    max-width: 24rem;
    margin: 1rem auto;
    padding: 1rem 2rem;
    text-align: justify;
    font-size: 1rem;
    line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4 {
    margin: 1.25rem 0;
    font-weight: 600;
    color: var(--color-primary-dark);
}

h1 {
    font-size: 2rem;
    text-align: center;
}

h2 {
    font-size: 1.5rem;
    text-align: center;
}

h3, h4 {
    text-align: left;
}

a {
    color: var(--color-secondary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Focus styles for accessibility
a:focus,
button:focus,
input:focus {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
} */

/* ────────────────────────────────
   IMPRESSUM & SPECIAL SECTIONS
────────────────────────────────── */
.impressum {
    text-align: left;
}

.impressum h2 {
    text-align: left;
}

/* ────────────────────────────────
   FOOTER
────────────────────────────────── */
footer {
    background: var(--color-header-bg);
    width: 100%;
    margin-top: auto;
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-footer);
    font-size: 1rem;
}

footer p {
    margin: 0.4rem 0;
}

footer a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

footer a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ────────────────────────────────
   MOBILE-SPECIFIC ELEMENTS
────────────────────────────────── */
.mobile,
.blocked,
#logo-mobile {
    display: none;
}

#logo-mobile {
    height: 2rem;
    max-width: 150px;
    margin: 0 auto;
    padding: var(--spacing-sm) 0;
}

.blocked {
    text-align: center;
    margin-top: 2rem;
}

/* ────────────────────────────────
   ANIMATIONS
────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ────────────────────────────────
   MOBILE BREAKPOINT
────────────────────────────────── */
@media (max-aspect-ratio: 1) {
    /* Hide app iframe, show mobile message */
    .app {
        display: none;
    }

    .mobile {
        display: block;
        animation: fadeIn 0.5s ease-out;
    }

    /* Hide desktop header, show mobile logo */
    header {
        display: none;
    }

    #logo-mobile {
        display: block;
        animation: fadeIn 0.5s ease-out;
    }

    /* Adjust card spacing for mobile */
    .card {
        width: calc(100% - 2rem);
        max-width: 28rem;
        padding: 1.25rem 1.5rem;
        margin: 1.5rem auto;
        font-size: 1rem;
    }

    h1 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin: 0.5rem 0;
    }

    h2 {
        font-size: 1.25rem;
    }
}

/* ────────────────────────────────
   TABLET BREAKPOINT
────────────────────────────────── */
@media (max-width: 768px) and (min-aspect-ratio: 1) {
    .card {
        width: 85%;
        padding: 1.5rem 2rem;
        margin: 3rem auto;
    }

    header {
        padding: 0.5rem 1rem;
    }

    nav ul {
        gap: 0.5rem 1rem;
    }
}

/* ────────────────────────────────
   UTILITY CLASSES
────────────────────────────────── */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: var(--spacing-md);
}

.mt-2 {
    margin-top: var(--spacing-lg);
}

.mt-3 {
    margin-top: var(--spacing-xl);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}