/* =========================================
   0. Global Brand Colors
   ========================================= */
:root {
    --brand-dark-green: #2F7074;
    --brand-light-green: #9DB8BB;
    --brand-text: #414343;
    --brand-accent: #F9C537;
    --brand-heading-dark: #A7872C;
}


/* =========================================
   1. Fix Mobile Text Overlay
   ========================================= */

@media only screen and (max-width: 768px) {

    /* Target ONLY our custom class on mobile AND ONLY on Homepage */
    body.home .glass-hover,
    body.home .glass-hover .elementor-widget-text-editor,
    body.home .glass-hover .elementor-heading-title,
    body.home .glass-hover .elementor-widget-heading {
        /* Reset positioning usually caused by absolute centering */
        position: relative !important;
        transform: none !important;
        left: auto !important;
        top: auto !important;

        /* Glassmorphism Styles using Brand Colors */
        /* Link background to Dark Green with opacity */
        background: rgba(47, 112, 116, 0.7);
        /* #2F7074 @ 70% opacity */

        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);

        /* Subtle border using Light Green */
        border: 1px solid rgba(157, 184, 187, 0.5);
        /* #9DB8BB @ 50% */

        /* Layout & Size: Make it smaller on mobile as requested */
        padding: 10px !important;
        width: 75% !important;
        /* Narrower to show more image */
        margin: -20px auto 10px auto !important;
        /* Less negative margin */
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);

        /* Text Colors */
        color: #fff;
        z-index: 10;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);

        /* Ensure flex alignment is preserved if overridden */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Shrink the text inside specifically for glass-hover */
    body.home .glass-hover .elementor-heading-title {
        font-size: 1.1rem !important;
        /* Smaller font */
        margin-bottom: 2px !important;
        line-height: 1.2 !important;
    }

    /* Ensure content inside doesn't override color if possible */
    body.home .glass-hover .elementor-widget-text-editor p {
        font-size: 0.85rem !important;
        /* Smaller paragraph text */
        color: #fff !important;
        margin: 0;
    }

    /* Headlines inside the box get the Accent color */
    body.home .glass-hover .elementor-widget-heading .elementor-heading-title {
        color: var(--brand-accent) !important;
        margin-bottom: 5px;
    }

    /* Ensure images have space below */
    body.home .glass-hover .elementor-image-carousel img {
        margin-bottom: 0;
    }
}


/* End Mobile Media Query */


/* =========================================
   3. Desktop Hover Effect: Fade Glass Overlay
   ========================================= */
@media only screen and (min-width: 769px) {

    /* Apply transition ONLY to our custom class AND ONLY on Homepage */
    body.home .glass-hover,
    body.home .glass-hover .elementor-widget-text-editor,
    body.home .glass-hover .elementor-heading-title,
    body.home .glass-hover .elementor-widget-heading {
        transition: all 0.4s ease-in-out;
        /* CRITICAL FIX: The user has 'pointer-events: none' in their Elementor CSS. 
           This prevents the mouse from triggering a hover state. We MUST re-enable it. */
        pointer-events: auto !important;
    }

    /* On hover, fade out almost completely so image shows through */
    body.home .glass-hover:hover,
    body.home .glass-hover:hover .elementor-widget-text-editor,
    body.home .glass-hover:hover .elementor-heading-title,
    body.home .glass-hover:hover .elementor-widget-heading {
        opacity: 0.1 !important;
        /* Force override */
        transform: scale(0.98);
        backdrop-filter: blur(0px) !important;
        -webkit-backdrop-filter: blur(0px) !important;
        background: rgba(255, 255, 255, 0.05) !important;
        /* Extremely faint background */
    }
}



/* =========================================
   2. Homepage: Light Green Background + Noise
   ========================================= */
body.home,
body.home .elementor-location-header,
body.home .site-header {
    background-color: var(--brand-light-green) !important;

    /* Subtle Noise Texture (SVG Data URI) */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* Ensure the main Elementor content wrapper is transparent so the body background shows */
body.home .elementor-section,
body.home .elementor-column,
body.home #content {
    background-color: transparent !important;
}


/* =========================================
   3.5 CRITICAL FIX: Reset Styles for Subpages
   ========================================= */
/* 
   Forcefully disable the glass/hover effects on the Tischtennis page (ID 6626) 
   and any other page that might accidentally have the 'home' class or 'glass-hover' elements.
*/
body.page-id-6626 .glass-hover,
body.page-id-6626 .elementor-widget-text-editor,
body.page-id-6626 .elementor-heading-title,
body.page-id-6626 .elementor-widget-heading,
body:not(.home) .glass-hover,
body:not(.home) .elementor-widget-text-editor,
body:not(.home) .elementor-heading-title {
    opacity: 1 !important;
    transform: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: transparent !important;
    pointer-events: auto !important;
    transition: none !important;
}

/* Double-ensure hover doesn't hide it either */
body.page-id-6626 .glass-hover:hover,
body.page-id-6626 .elementor-widget-text-editor:hover,
body:not(.home) .glass-hover:hover,
body:not(.home) .glass-hover:hover .elementor-widget-text-editor {
    opacity: 1 !important;
    background: transparent !important;
}


/* =========================================
   4. Header Contact Button (Animated)
   ========================================= */
/* Base Style (Normal State) */
.header-contact-btn .elementor-button {
    background-color: var(--brand-dark-green) !important;
    border: 3px solid var(--brand-accent) !important;
    border-radius: 12px !important;
    color: #fff !important;
    font-size: 16px !important;
    /* Fixed size */
    font-weight: bold !important;
    padding: 12px 25px !important;
    /* Fixed padding */
    transition: all 0.3s ease-in-out;
    animation: premium-pulse-gold 2s infinite;
    line-height: 1 !important;
}

/* Hover State */
.header-contact-btn .elementor-button:hover {
    transform: scale(1.05);
    background-color: var(--brand-dark-green) !important;
}

/* 
   CRITICAL FIX: Prevent Sticky Header from shrinking the button 
   The user's custom CSS targets 'elementor-sticky--effects .elementor-item'
   which might accidentally hit this if it's considered an item. 
   We force the values to stay the same.
*/
.elementor-sticky--effects .header-contact-btn .elementor-button,
.elementor-sticky--effects .header-contact-btn {
    padding: 12px 25px !important;
    /* Keep original padding */
    font-size: 16px !important;
    /* Keep original text size */
    min-height: auto !important;
    /* Allow it to be its natural height */
    transform: none !important;
    /* Stop any weird transforms */
    margin: 0 !important;
}

@keyframes premium-pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(249, 197, 55, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(249, 197, 55, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(249, 197, 55, 0);
    }
}


/* =========================================
   5. Tischtennis Gallery (Marquee + Popup)
   ========================================= */

/* Marquee Container */
.tt-gallery-marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: transparent;
    padding: 20px 0;

    /* NEW: Border and Shadow */
    border-top: 4px solid var(--brand-accent);
    border-bottom: 4px solid var(--brand-accent);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.tt-gallery-marquee-content {
    display: flex;
    gap: 20px;
    width: max-content;
    /* Create infinite loop animation */
    /* Note: We duplicate content via JS or manually twice to ensure fill */
    animation: tt-marquee-scroll 60s linear infinite;
    /* Slower */
}

/* Pause on hover for easier clicking */
.tt-gallery-marquee-container:hover .tt-gallery-marquee-content {
    animation-play-state: paused;
}

@keyframes tt-marquee-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Gallery Item Styling */
.tt-gallery-item {
    position: relative;
    /* NEW: Fixed Height instead of Width */
    height: 500px;
    /* Adjust as needed */
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    background: #000;
}

.tt-gallery-item:hover {
    transform: scale(1.02);
    z-index: 10;
}

.tt-gallery-item img {
    /* NEW: fill height, fit width */
    height: 100% !important;
    width: auto !important;
    max-width: none !important;
    /* CRITCAL: prevent responsive shrinking */
    display: block;
    object-fit: contain;
    /* Ensure full image is visible */
    object-position: center;
}

/* Play Icon Overlay */
.tt-gallery-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 24px;
}

.tt-gallery-item:hover .tt-gallery-overlay {
    opacity: 1;
}


/* Popup Modal */
#tt-gallery-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;

    /* Center Content */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Transition */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

#tt-gallery-popup.tt-popup-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tt-popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

/* Close Button */
#tt-popup-close {
    position: absolute;
    top: -40px;
    right: -40px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 100000;
}

/* Flipbook Container */
.tt-flipbook-container {
    position: relative;
    display: inline-block;
}

#tt-flipbook-canvas {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

/* Loading Spinner */
#tt-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: sans-serif;
    font-size: 14px;
    display: none;
    /* JS toggles this */
}

/* NEW: Navigation Arrows */
.tt-flip-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    font-size: 30px;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

.tt-flip-nav:hover {
    background: var(--brand-accent);
    color: #000;
}

/* Positioning */
.tt-prev {
    left: -60px;
}

.tt-next {
    right: -60px;
}

/* Show on hover of the container */
.tt-flipbook-container:hover .tt-flip-nav {
    opacity: 1;
}

/* On small screens, always show or adjust pos */
@media (max-width: 768px) {
    .tt-prev {
        left: 0;
    }

    .tt-next {
        right: 0;
    }

    .tt-flip-nav {
        opacity: 1;
        padding: 5px 10px;
        font-size: 20px;
    }
}

/* =========================================
   6. Mobile Optimization: Vertical Gallery
   ========================================= */
@media only screen and (max-width: 768px) {

    /* Container becomes fixed height viewport */
    .tt-gallery-marquee-container {
        height: 60vh;
        /* 60% of viewport height */
        width: 100%;
        overflow: hidden;
        /* Hide overflow */
        padding: 0;

        /* Change borders to vertical orientation maybe? Or keep top/bottom */
        border-top: 4px solid var(--brand-accent);
        border-bottom: 4px solid var(--brand-accent);
    }

    /* Content flows vertically */
    .tt-gallery-marquee-content {
        flex-direction: column;
        width: 100%;
        height: max-content;
        /* Allow it to grow */
        animation: tt-marquee-scroll-vert 30s linear infinite;
        /* Vertical Scroll */
        align-items: center;
        /* Center items horizontally */
        gap: 15px;
        /* Spacing between items */
    }

    /* Vertical Keyframes */
    @keyframes tt-marquee-scroll-vert {
        0% {
            transform: translateY(0);
        }

        100% {
            transform: translateY(-33.33%);
        }

        /* Loop 1/3 since we tripled content */
    }

    /* Disable horizontal animation */
    /* Handled by overwriting animation property above */

    /* Item Sizing */
    .tt-gallery-item {
        height: 250px;
        /* user requested smaller */
        width: auto !important;
        max-width: 90% !important;
        /* Ensure it fits screen width */
        margin: 0;
    }

    .tt-gallery-item img {
        height: 100% !important;
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain;
    }

    /* Adjust Arrows for Mobile Popup */
    .tt-prev {
        left: 10px;
    }

    .tt-next {
        right: 10px;
    }

    .tt-flip-nav {
        padding: 15px;
        font-size: 24px;
        opacity: 0.8;
        /* Always visible slightly */
        background: rgba(0, 0, 0, 0.4);
    }
}

/* =========================================
   7. Custom Team Members Section (REFINED V3)
   ========================================= */

.tt-team-wrapper {
    width: 100%;
    padding: 20px 0;
}

.tt-team-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 Columns */
    gap: 30px;
    width: 100%;
}

@media (max-width: 768px) {
    .tt-team-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }
}

/* Card Style (Glassmorphism - V3) */
.tt-team-card {
    display: block;
    /* Link wrapper */
    text-decoration: none;
    /* VERY transparent base (5%) to remove "hard white" look */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px);
    /* Strong blur */
    -webkit-backdrop-filter: blur(25px);

    /* NEW: Stronger, wider border */
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tt-team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
    /* Make border even more visible on hover */
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    /* Slightly more visible on hover */
}

/* Image Wrapper */
.tt-team-image {
    width: 100%;
    /* NEW: 600px height (was 450px) */
    height: 600px;
    overflow: hidden;
    background: transparent;
    /* No hard white background */
}

.tt-team-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    /* Default for faces */
    transition: transform 0.5s ease;
    display: block;
}

/* Specific Formatting for 2nd Person (Michael/Right) to show Balleimer */
/* We target the 2nd child in the grid */
.tt-team-card:nth-child(2) .tt-team-image img {
    object-position: bottom center;
    /* Show the bucket! */
}

.tt-team-card:hover .tt-team-image img {
    transform: scale(1.03);
}

/* Content Area */
.tt-team-content {
    padding: 30px;
    text-align: left;
    color: var(--brand-text);
}

/* Typography - Bolder & Bigger */
.tt-team-name {
    margin: 0 0 10px 0;
    font-size: 32px;
    /* Much bigger */
    font-weight: 900;
    /* Extra Bold */
    color: var(--brand-dark-green);
    line-height: 1.1;
    text-transform: uppercase;
    /* Optional stylization */
    letter-spacing: -0.5px;
}

.tt-team-role {
    margin: 0 0 20px 0;
    font-size: 20px;
    /* Bigger */
    font-weight: 800;
    /* Bolder */
    color: var(--brand-heading-dark);
    /* Darker gold/brown for contrast */
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.3;
}

.tt-team-desc {
    margin: 0;
    font-size: 18px;
    /* Bigger reading text */
    line-height: 1.6;
    color: #222;
    /* Darker for readability on glass */
    font-weight: 500;
}

/* Highlighted Text */
.tt-highlight {
    color: #d32f2f;
    font-weight: 900;
    text-decoration: underline;
    /* Make link obvious */
    text-decoration-color: rgba(211, 47, 47, 0.4);
}

.tt-team-card:hover .tt-highlight {
    color: #b71c1c;
    text-decoration-color: #b71c1c;
}

/* =========================================
   8. Mobile Optimization: Team Section
   ========================================= */
@media only screen and (max-width: 768px) {

    /* Reduce Image Height on Mobile to prevent "Full Height" look */
    .tt-team-image {
        height: 400px !important;
        /* Force override */
    }

    /* 2nd Person (Balleimer) adjustment for mobile if needed */
    .tt-team-card:nth-child(2) .tt-team-image img {
        object-position: bottom center;
        /* Keep looking at the bucket */
    }

    /* Reduce Content Padding/Gap */
    .tt-team-content {
        padding: 20px !important;
        /* Less whitespace */
    }

    .tt-team-name {
        font-size: 26px !important;
        /* Slightly smaller but still big */
        margin-bottom: 5px !important;
    }

    .tt-team-role {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }
}

/* =========================================
   9. Tooltip for Team Cards (Mytischtennis.de)
   ========================================= */
.tt-team-card {
    /* Ensure existing position relative if not set */
    position: relative;
}

.tt-team-card[href*="mytischtennis.de"]::after {
    content: "Link zu mytischtennis.de \2197";
    /* Arrow symbol */
    position: absolute;
    /* NEW: Positioned above the text area (bottom-right) */
    bottom: 70px;
    right: 20px;

    /* Small Glassmorphism */
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);

    color: var(--brand-dark-green);
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 50px;

    opacity: 0;
    transform: translateY(10px);
    /* Start slightly lower, slide up */
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 20;
    white-space: nowrap;
}

.tt-team-card:hover::after {
    opacity: 1;
    transform: translateY(0);
}