/* ==========================================================================
   Announcement Banner
   Apple Store inspired - Minimalistisch, elegant
   ========================================================================== */

/* ==========================================================================
   Banner Container
   ========================================================================== */

.announcement-banner {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, #1e40af 0%, #0369a1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    min-height: 44px;
    box-sizing: border-box;
    z-index: 51; /* Über Header (z-50) wenn nötig */
}

/* Animation für Schließen */
.announcement-banner.is-closing {
    animation: bannerSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes bannerSlideUp {
    from {
        opacity: 1;
        max-height: 100px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    to {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Hidden State */
.announcement-banner.is-hidden {
    display: none !important;
}

/* ==========================================================================
   Content Container
   ========================================================================== */

.announcement-banner__content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: 1200px;
    width: 100%;
    position: relative;
}

/* ==========================================================================
   Text Styling
   ========================================================================== */

.announcement-banner__text {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #ffffff;
    text-align: center;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

/* Hervorgehobener Text (Datum) */
.announcement-banner__highlight {
    font-weight: 600;
}

/* Separator zwischen Sätzen */
.announcement-banner__separator {
    display: inline;
    margin: 0 2px;
}

/* ==========================================================================
   Link Styling
   ========================================================================== */

.announcement-banner__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    margin-left: 6px;
    white-space: nowrap;
    transition: opacity 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    padding-bottom: 1px;
}

.announcement-banner__link:hover {
    opacity: 0.9;
    border-bottom-color: rgba(255, 255, 255, 0.8);
}

.announcement-banner__icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.announcement-banner__link:hover .announcement-banner__icon {
    transform: translateX(2px);
}

/* ==========================================================================
   Close Button
   ========================================================================== */

.announcement-banner__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.15s ease;
}

.announcement-banner__close svg,
.announcement-banner__close i {
    width: 16px;
    height: 16px;
}

.announcement-banner__close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.announcement-banner__close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* ==========================================================================
   Header Offset wenn Banner sichtbar
   Der fixed Header muss nach unten verschoben werden
   ========================================================================== */

body.has-announcement-banner .site-header {
    top: var(--announcement-height, 44px);
}

/* Admin-Bar Korrektur */
body.admin-bar.has-announcement-banner .site-header {
    top: calc(var(--announcement-height, 44px) + 32px);
}

@media (max-width: 782px) {
    body.admin-bar.has-announcement-banner .site-header {
        top: calc(var(--announcement-height, 44px) + 46px);
    }
}

/* ==========================================================================
   Mobile Responsive (< 640px)
   ========================================================================== */

@media (max-width: 639px) {
    .announcement-banner {
        padding: 10px 16px;
        padding-right: 52px; /* Platz für Close-Button */
    }

    .announcement-banner__content {
        gap: 8px;
        flex-direction: column;
        align-items: center;
    }

    .announcement-banner__text {
        font-size: 13px;
        line-height: 1.4;
        text-align: center;
    }

    /* Auf Mobile: Text umbrechen */
    .announcement-banner__separator {
        display: block;
        height: 2px;
    }

    .announcement-banner__link {
        margin-left: 0;
        margin-top: 4px;
    }

    .announcement-banner__close {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
        width: 40px;
        height: 40px;
        background: transparent;
    }
}

/* ==========================================================================
   Prefers Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .announcement-banner {
        transition: none;
    }

    .announcement-banner.is-closing {
        animation: none;
        display: none;
    }

    .announcement-banner__icon,
    .announcement-banner__close,
    .announcement-banner__link {
        transition: none;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .announcement-banner {
        display: none !important;
    }
}
