/* =============================================
   PULZE CMS – Global Styles
   ============================================= */

/* Alpine.js – vor dem Laden ausblenden */
[x-cloak] {
    display: none !important;
}

/* Sanftes Scrollen */
html {
    scroll-behavior: smooth;
}

/* Optimierte Typografie */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* =============================================
   ANIMATIONEN (Intersection Observer)
   ============================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* =============================================
   HEADER – Floating Pill Navigation
   ============================================= */
#main-header {
    background-color: transparent;
    border-bottom-color: transparent;
    box-shadow: none;
    border-radius: 0;
    max-width: none;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    top: 0;                       /* ← Standard: klebt ganz oben */
    transition: 
        top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        border-radius 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.4s ease,
        box-shadow 0.4s ease,
        backdrop-filter 0.4s ease;
}

/* Pill-Form beim Scrollen – jetzt mit top: 16px */
.header-scrolled {
    max-width: 720px;
    top: 16px;                    /* ← Abstand vom oberen Rand! */
    margin-left: auto;
    margin-right: auto;
    background-color: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 9999px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

/* Dark Mode – Floating Pill */
.dark .header-scrolled {
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Breite */
@media (max-width: 768px) {
    .header-scrolled {
        max-width: 90%;
    }
}


/* =============================================
   MEGAMENÜ – Hover-Erweiterung
   ============================================= */
@media (min-width: 1024px) {
    .group:hover .group-hover\:opacity-100 {
        opacity: 1;
        visibility: visible;
    }

    .group > .absolute::before {
        content: '';
        position: absolute;
        top: -10px;
        left: 0;
        right: 0;
        height: 10px;
    }
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
.dark ::-webkit-scrollbar-thumb {
    background: #374151;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* =============================================
   SELECTION
   ============================================= */
::selection {
    background-color: rgba(59, 130, 246, 0.2);
    color: inherit;
}
.dark ::selection {
    background-color: rgba(59, 130, 246, 0.3);
}

/* =============================================
   ACCESSIBILITY
   ============================================= */
:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* =============================================
   TEXT BALANCING
   ============================================= */
h1, h2, h3, h4, .balance-text {
    text-wrap: balance;
}

/* =============================================
   HEADER-WRAPPER – Floating Pill mit Rahmen
   ============================================= */
#header-wrapper {
    background-color: transparent;
    border: 2px solid transparent;          /* unsichtbarer Rahmen, damit Transition weich */
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
    margin: 0 auto;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: 
        border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        margin 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.4s ease,
        box-shadow 0.4s ease,
        backdrop-filter 0.4s ease,
        border-color 0.4s ease;
}

/* Pill-Form beim Scrollen */
.header-scrolled {
    max-width: 740px;                       /* ← etwas schmaler als der Inhalt */
    margin-top: 16px;                       /* ← Abstand nach oben */
    margin-left: auto;
    margin-right: auto;
    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08); /* ← DER RAHMEN */
    border-radius: 24px;                    /* ← abgerundete Ecken */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Dark Mode */
.dark .header-scrolled {
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .header-scrolled {
        max-width: 94%;
        border-radius: 20px;
        margin-top: 10px;
    }
}