/**
 * WordPress-specific CSS overrides
 * Fixes conflicts between WordPress defaults and Drupal theme CSS
 */

/* Reset WordPress block defaults */
.wp-block-group,
.wp-block-group__inner-container,
.wp-block-columns,
.wp-block-column {
    margin: 0;
    padding: 0;
}

/* Ensure body uses theme fonts, not WP defaults */
body {
    font-family: "bebas-neue-pro", sans-serif;
    font-size: 18px;
    font-size: 1.125rem;
    line-height: 24px;
    line-height: 1.5rem;
    font-weight: 400;
    margin: 0;
    padding: 0;
}

/* Remove WP admin bar offset */
html {
    margin-top: 0 !important;
}

/* WordPress adds margins to paragraphs/headings in content */
.main-content p,
.main-content h1,
.main-content h2,
.main-content h3,
.main-content h4 {
    max-width: none;
}

/* Fix WordPress widget styling in footer */
.site-footer .widget {
    margin: 0;
    padding: 0;
}

.site-footer .widget h2,
.site-footer .widget h3 {
    color: #232323;
}

.site-footer .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer .widget ul li {
    margin: 0;
    padding: 5px 0;
}

.site-footer .widget ul li a {
    color: #232323;
    text-decoration: none;
}

.site-footer .widget ul li a:hover {
    text-decoration: underline;
}

/* Ensure menu ul/li styling from theme takes precedence */
#headermenu .menu-wrapper ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Neutralize WordPress layout classes that leak through block content */
.is-layout-flex {
    display: block !important;
    gap: unset !important;
}

.is-layout-grid {
    display: block !important;
    gap: unset !important;
}

/* Remove WP global styles CSS variables injected inline */
body .wp-site-blocks {
    all: unset;
}

/* Hide WordPress default widgets (Archives, Categories) on all pages */
.widget_archive,
.widget_categories,
.widget_recent_entries,
.widget_recent_comments,
.widget_meta,
aside .wp-block-archives,
aside .wp-block-categories {
    display: none !important;
}

/* WordPress image defaults override */
img {
    max-width: 100%;
    height: auto;
}

/* Remove WordPress speculative loading styles */
.wp-block-archives,
.wp-block-categories {
    display: none;
}

/* ============================================ */
/* Footer fixes                                  */
/* ============================================ */

/* Ensure footer content sits above the skewed :before pseudo-element (z-index: 2) */
.region-footer > * {
    position: relative;
    z-index: 3;
}

/* On mobile the footer padding shrinks to 20px but the :before extends to ~50px,
   so increase top padding to clear the skewed decoration */
@media (max-width: 960px) {
    .region-footer {
        padding-top: 55px !important;
    }
}

/* ============================================ */
/* Header: hide "Über uns" submenu               */
/* ============================================ */
/* sanitize_title('Über uns') = 'uber-uns' (or 'ueber-uns' with de_DE locale) */
#headermenu li.submenu #uber-uns,
#headermenu li.submenu #uber-uns ~ ul,
#headermenu li.submenu a label[for="uber-uns"],
#headermenu li.submenu #ueber-uns,
#headermenu li.submenu #ueber-uns ~ ul,
#headermenu li.submenu a label[for="ueber-uns"] {
    display: none !important;
}

/* ============================================ */
/* Impressionen Page                             */
/* ============================================ */

/* Override Drupal flexbox centering that shrink-wraps child widths on inner pages */
body:not(.path-frontpage) #main-wrapper .region-content {
    align-items: stretch;
}

/* Header area stays inside normal container */
.impressionen-page {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 20px 10px;
}

.impressionen-header h1 {
    font-family: "bebas-neue-pro", sans-serif;
    font-weight: 600;
    font-size: 80px;
    font-size: 5rem;
    line-height: 1;
    color: #232323;
    margin: 0 0 12px;
    letter-spacing: -2px;
}

.impressionen-header p {
    font-size: 20px;
    font-size: 1.25rem;
    color: #888;
    margin: 0;
}

/* Full-width section breaks out of layout container */
.impressionen-fullwidth {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 50px 0 60px;
    background: #0a0a0a;
    overflow: hidden;
}

/* Alternate background for visual rhythm */
.impressionen-fullwidth--alt {
    background: #111;
}

/* Event label */
.impressionen-event-label {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 20px;
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.impressionen-event-label .impressionen-event-name {
    font-family: "bebas-neue-pro", sans-serif;
    font-weight: 600;
    font-size: 30px;
    font-size: 1.875rem;
    letter-spacing: 0.5px;
}

.impressionen-event-label .brand-weiss { color: #fff; }
.impressionen-event-label .brand-gruen { color: #7cfb30; }

.impressionen-event-label small {
    font-family: "AmaticSC", sans-serif;
    font-size: 22px;
    font-size: 1.375rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Slider */
.impressionen-slider {
    position: relative;
}

.impressionen-slider .slick-track {
    display: flex;
    align-items: center;
}

.impressionen-slider .slick-slide {
    margin: 0 5px;
}

/* Slide inner - width set via CSS custom property from PHP getimagesize() */
.impressionen-slide-inner {
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    background: transparent;
    height: 420px;
    width: var(--slide-w, 300px);
}

/* Shimmer: grey pulsing placeholder at correct dimensions */
@keyframes impressionen-shimmer {
    0% { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.impressionen-slide-inner.is-loading {
    background: #1a1a1a;
}

.impressionen-slide-inner.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, #1a1a1a 0%, #222 40%, #1a1a1a 80%);
    background-size: 600px 100%;
    animation: impressionen-shimmer 1.8s ease-in-out infinite;
    border-radius: 5px;
}

/* Override WP global img rule for slider images */
.impressionen-slide-inner img {
    display: block;
    height: 420px;
    width: auto;
    max-width: none;
    object-fit: cover;
    filter: brightness(0.85);
    transition: transform 0.5s ease, filter 0.5s ease, opacity 0.5s ease;
}

/* While loading: image invisible behind shimmer */
.impressionen-slide-inner.is-loading img {
    opacity: 0;
}

/* Loaded: fade in smoothly */
.impressionen-slide-inner.is-loaded img {
    opacity: 1;
}

.impressionen-slide:hover .impressionen-slide-inner img {
    transform: scale(1.04);
    filter: brightness(1);
}

/* Video slides - green highlight to stand out */
.impressionen-slide-video {
    cursor: pointer;
    border: 2px solid rgba(124, 251, 48, 0.6);
    box-shadow: 0 0 20px rgba(124, 251, 48, 0.25), 0 0 40px rgba(124, 251, 48, 0.08);
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    z-index: 1;
}

.impressionen-slide:hover .impressionen-slide-video {
    box-shadow: 0 0 30px rgba(124, 251, 48, 0.4), 0 0 60px rgba(124, 251, 48, 0.12);
}

/* Video hover: animated scale-up */
.impressionen-slide-video.is-hovered {
    transform: scale(1.25);
    z-index: 10;
    border-color: #7cfb30;
    box-shadow: 0 0 40px rgba(124, 251, 48, 0.5), 0 0 80px rgba(124, 251, 48, 0.15);
}

.impressionen-slider.has-video-hover .slick-list {
    overflow: visible;
}

.impressionen-slide-video video {
    display: block;
    height: 420px;
    width: auto;
    max-width: none;
    object-fit: cover;
    filter: brightness(0.85);
    transition: filter 0.5s ease;
}

.impressionen-slide-video.is-hovered video {
    filter: brightness(1);
}

/* Video expand overlay */
.video-expand-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9998;
    cursor: pointer;
    animation: videoFadeIn 0.2s ease;
}

.video-expand-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #7cfb30;
    box-shadow: 0 0 40px rgba(124, 251, 48, 0.2);
    animation: videoScaleIn 0.25s ease;
}

@keyframes videoScaleIn {
    from { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes videoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.video-expand-container video {
    display: block;
    max-height: 80vh;
    max-width: 90vw;
    width: auto;
    height: auto;
}

/* Edge speed indicators */
.impressionen-edge-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8%;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.impressionen-edge-left {
    left: 0;
    background: linear-gradient(to right, rgba(124, 251, 48, 0.08), transparent);
}

.impressionen-edge-right {
    right: 0;
    background: linear-gradient(to left, rgba(124, 251, 48, 0.08), transparent);
}

.impressionen-edge-indicator.active {
    opacity: 1;
}

/* Gradient fade edges */
.impressionen-fullwidth::before,
.impressionen-fullwidth::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    z-index: 2;
    pointer-events: none;
}

.impressionen-fullwidth::before {
    left: 0;
    background: linear-gradient(to right, #0a0a0a, transparent);
}

.impressionen-fullwidth::after {
    right: 0;
    background: linear-gradient(to left, #0a0a0a, transparent);
}

.impressionen-fullwidth--alt::before {
    background: linear-gradient(to right, #111, transparent);
}

.impressionen-fullwidth--alt::after {
    background: linear-gradient(to left, #111, transparent);
}

/* CTA Section */
.impressionen-cta {
    background: #0a0a0a;
    padding: 80px 20px;
    text-align: center;
}

.impressionen-cta::before,
.impressionen-cta::after {
    display: none;
}

.impressionen-cta-inner {
    max-width: 600px;
    margin: 0 auto;
}

.impressionen-cta h2 {
    font-family: "bebas-neue-pro", sans-serif;
    font-weight: 600;
    font-size: 40px;
    font-size: 2.5rem;
    color: #fff;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
}

.impressionen-cta p {
    font-size: 18px;
    font-size: 1.125rem;
    color: #888;
    margin: 0 0 30px;
}

.impressionen-cta-btn {
    display: inline-block;
    padding: 14px 36px;
    background: #7cfb30;
    color: #0a0a0a;
    font-family: "bebas-neue-pro", sans-serif;
    font-weight: 600;
    font-size: 20px;
    font-size: 1.25rem;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.impressionen-cta-btn:hover {
    background: #6ae020;
    transform: translateY(-2px);
}

@media (max-width: 1024px) {
    .impressionen-slide-inner {
        height: 340px;
        width: calc(var(--slide-w, 300px) * 340 / 420);
    }

    .impressionen-slide-inner img,
    .impressionen-slide-video video {
        height: 340px;
    }
}

@media (max-width: 768px) {
    .impressionen-header h1 {
        font-size: 50px;
        font-size: 3.125rem;
    }

    .impressionen-slide-inner {
        height: 280px;
        width: calc(var(--slide-w, 300px) * 280 / 420);
    }

    .impressionen-slide-inner img,
    .impressionen-slide-video video {
        height: 280px;
    }

    .impressionen-event-label {
        flex-direction: column;
        gap: 2px;
    }

    .impressionen-fullwidth::before,
    .impressionen-fullwidth::after {
        width: 30px;
    }

    .impressionen-cta h2 {
        font-size: 30px;
        font-size: 1.875rem;
    }
}

@media (max-width: 480px) {
    .impressionen-slide-inner {
        height: 220px;
        width: calc(var(--slide-w, 300px) * 220 / 420);
    }

    .impressionen-slide-inner img,
    .impressionen-slide-video video {
        height: 220px;
    }

    .impressionen-fullwidth {
        padding: 35px 0 45px;
    }
}

