/* Base Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* HTML & Body */
html {
    font-size: 16px;
    /* Optimierung: Smooth Behavior erst via JS-Klasse aktivieren, um "Fahrt" beim Neuladen zu verhindern */
    scroll-behavior: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* Aktiviert das Einrasten beim Scrollen auf der Y-Achse */
    scroll-snap-type: y mandatory;
}

html.smooth-scroll {
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    html {
        scroll-snap-type: none;
        height: auto;
        overflow-y: auto;
    }
}

body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    overflow-x: hidden;
}

/* Accessibility - Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-md);
    color: var(--color-text-primary);
}

h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

/* =========================================
   ACCESSIBILITY: CUSTOM FOCUS STYLES
   ========================================= */
:focus-visible {
    outline: 2px solid var(--color-brand-mint);
    outline-offset: 4px;
    border-radius: 2px;
    box-shadow: 0 0 0 4px rgba(104, 184, 149, 0.2); /* Glow effect */
}

/* Remove default outline for mouse users if :focus-visible is supported */
:focus:not(:focus-visible) {
    outline: none;
}

/* Lists */
ul, ol {
    list-style: none;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

/* Section */
.section {
    padding: var(--spacing-5xl) 0;
    background: transparent;
}

.section-dark {
    background-color: var(--color-bg-dark);
    color: var(--color-text-inverse);
}

.section-dark h2,
.section-dark h3,
.section-dark h4 {
    color: var(--color-text-inverse);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-4xl);
}

.section-subtitle {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffffff; /* Increased contrast for readability */
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Added shadow for better visibility */
}

.section-title {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-lg);
}

.section-description {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.section-dark .section-description {
    color: var(--color-gray-300);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    position: relative;
    background: rgba(6, 10, 12, 0.45);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--color-white);
    overflow: hidden;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.btn-primary > * {
    position: relative;
    z-index: 2;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        var(--color-brand-mint),
        var(--color-brand-teal),
        var(--color-brand-pastel),
        var(--color-brand-mint)
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 1;
    pointer-events: none;
    z-index: 1;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background:
        conic-gradient(
            from var(--glow-angle, 0deg),
            rgba(255, 255, 255, 0) 0deg,
            var(--color-brand-teal) 30deg,
            var(--color-brand-mint) 90deg,
            var(--color-brand-pastel) 150deg,
            var(--color-brand-mint) 210deg,
            var(--color-brand-teal) 270deg,
            rgba(255, 255, 255, 0) 330deg,
            rgba(255, 255, 255, 0) 360deg
        ) border-box;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.25s ease;
    animation: glowChase 2.4s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 20px rgba(83, 179, 127, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-primary:hover::before { opacity: 0.6; }
.btn-primary:hover::after { opacity: 1; }

.btn-secondary {
    background-color: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.btn-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.btn-large {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: var(--font-size-lg);
}

/* Card Buttons (optional per card via content.json) */
.card-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-md);
}

.card-buttons .btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-sm);
}

/* Forms */
input,
textarea,
select {
    width: 100%;
    padding: var(--spacing-md);
    font-family: inherit;
    font-size: var(--font-size-base);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    background-color: var(--color-white);
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
}

label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }

/* =========================================
   Global Fullscreen Slide Logic (Responsive)
   ========================================= */
.hero-section,
.services-section,
.space-detail-section,
.campus-transition-section,
.about-section {
    /* 1. Die Sektion füllt immer mindestens den ganzen Bildschirm */
    min-height: 100vh;
    /* Unterstützung für mobile Browser (Adressleiste) */
    min-height: 100dvh; 
    
    width: 100%;
    position: relative;
    
    /* 2. Inhalt wird vertikal zentriert (schön für Desktop) */
    display: flex;
    flex-direction: column;
    justify-content: center;
    
    /* 3. Kein störendes Margin */
    margin: 0;
    padding: 0;
    
    /* 4. Video-Hintergründe bleiben innerhalb der Box */
    overflow: hidden;
}

/* =========================================
   Mobile Anpassungen (Damit alles sichtbar bleibt)
   ========================================= */
@media (max-width: 1024px) {
    .services-section,
    .space-detail-section {
        /* Auf Tablets/Handys darf die Sektion wachsen, wenn der Text lang ist */
        height: auto !important;
        display: block; /* Flexbox deaktivieren, damit normales Scrollen geht */
        
        /* Etwas Abstand oben/unten, damit Inhalte nicht am Rand kleben */
        padding-top: 80px !important;
        padding-bottom: 80px !important;
        
        /* Erlaubt, dass Inhalte über den Rand fließen (Scrollen) */
        overflow: visible; 
    }
}

/* =========================================
   Scroll Snap Logic (Dynamic Scrolling)
   ========================================= */

/* Alle Hauptsektionen sollen einrasten */
.hero-section,
.campus-transition-section,
.campus-highlight-section,
.about-section,
.services-section,
.features-section,
.location-section,
.space-detail-section,
.contact-section,
.footer {
    scroll-snap-align: start;
    scroll-snap-stop: always; /* Zwingt den Browser, an jeder Sektion anzuhalten */
}

/* Ausnahme für die Navigation/Logo-Band, damit sie nicht übersprungen wird */
.logo-menu-band {
    scroll-snap-align: start;
}

/* Auf Mobile: Falls Inhalte länger als der Screen sind, ist 'proximity' oft besser als 'mandatory' */
@media (max-width: 1024px) {
    html {
        scroll-snap-type: y proximity;
    }
}
