/*
Theme Name: BuddyX Child
Theme URI: https://wbcomdesigns.com/downloads/buddyx-theme/
Description: BuddyX Child Theme
Author: Wbcom Designs
Author URI: https://wbcomdesigns.com
Template: buddyx
Version: 16.3
*/

/* Item */
#em-wrapper .em-events-list .em-item {
    background-color: #e5e5e5;
}

/* Link */
#em-wrapper .em-events-list a {
    background-color: #fefef5 !important;
}


/* Site header wrapper */
#page .site-header-wrapper {
    display: none;
}

/* Colophon */
#colophon {
    display: none;
}


/* Site sub header */
#page .site-sub-header {
    display: none;

}



/* Contenu pleine largeur (supprime les marges latérales) */
body #content,
body .site-content,
body .container,
body .bp-wrap,
body .buddypress .bp-wrap {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

:root {
    --color-bg-card: rgb(249, 247, 242);
    /* Beige Crème */
    --color-text-main: rgb(26, 47, 26);
    /* Vert Nuit */
    --color-text-sec: rgb(74, 93, 74);
    /* Vert Gris */
    --color-text-photo: rgb(255, 255, 255);
    /* Blanc */
    --color-cta: #FAB327;
    /* Orange Logo */
    --color-accent: rgb(139, 195, 74);
    /* Vert Tendre (Nav) */
    --color-header-bg: rgb(26, 47, 26);
    /* Header Card BG */
    --em-side-pad: 16px;
    --em-pill-gap: 10px;
}

html,
body {
    min-height: 100%;
    /* height: 100%; REMOVED to allow pull-to-refresh */
}

body {
    background-color: var(--color-bg-card);
    color: var(--color-text-main);
    font-family: 'Inter', sans-serif;
    /* Assumed font */
    margin: 0;
    padding: 0;
}

/* THEME OVERRIDES (Fix gap between header and content) */
.site-wrapper,
.site-main,
.site-content,
.site,
.entry-content {
    margin-top: 0 !important;
    overflow: visible !important;
    /* CRITICAL for sticky header to work */
}

.site-header-wrapper {
    padding-bottom: 0 !important;
}

.site-main {
    display: flex;
    flex-direction: column;
}

/* Fix for empty figure causing gap */
.entry-content .featured-media {
    margin-top: 0 !important;
    display: none;
    /* Hide if empty to be safe */
}

.em-card.em-landing {
    background: var(--color-bg-card);
    min-height: 100vh;
    /* Allow content to grow */
    display: flex;
    flex-direction: column;
    margin-top: 0 !important;
    padding-top: 0 !important;
    overflow: visible;
    /* Allow body scroll for Pull-to-Refresh */
}

/* HEADER IMAGE AREA */
.em-header-media {
    position: relative;
    width: 100%;
    height: 240px;
    /* Adjust as needed */
    overflow: hidden;
    border-radius: 0 0 20px 20px;
    /* Optional rounded bottom if desired, or flat */
}

.em-header-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* HEADER INFO CARD (Unused class removed) */

.em-dark-container h1 {
    margin: 10px 0 16px 0;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    color: var(--color-text-main);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    overflow-wrap: anywhere;
    /* Prevent long titles from breaking layout */
}

/* PILLS GRID */
.em-pills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--em-pill-gap);
    padding: 0 var(--em-side-pad);
}

.em-pill {
    background: #f9f7f2;
    color: #000;
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-width: 0;
    /* Allow grid items to shrink and ellipsize if needed */
}

.em-pill__icon {
    color: var(--color-header-bg);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.em-pill__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* HEADER DARK CONTAINER */
.em-dark-container {
    background-color: transparent;
    /* Transparent to show wave behind */
    margin: 0;
    border-radius: 0;
    position: relative;
    /* No longer sticky - separated from header */
    z-index: 205;
    /* Increase to sit ABOVE the sticky header's wave */
    /* Behind sticky header (200) but contains wave (-1) */
    overflow: visible;
    /* changed to visible to allow content? Actually hidden is fine if cards don't pop out */
    padding-bottom: 10px;
    border: none !important;
    box-shadow: none !important;
}



/* Water Effect */
.water-wrapper {
    position: absolute;
    bottom: 0px;
    margin-bottom: 0em;
    left: -50%;
    width: 200%;
    height: 250px;
    transition: transform 0.99s ease-out;
    pointer-events: none;
    z-index: 1;
    /* Behind content (not negative) */
}

#waveContainer {
    top: -85px;
}


/* Sticky Hero Wrapper (New) */
.em-sticky-hero-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 200;
    background-color: #8257c3;
    /* Purple background */
    overflow: hidden;
    /* Clip wave animation */
}

/* Old Sticky Header - Reset */
.em-item .em-landing .em-sticky-header {
    background-color: transparent !important;
    /* Managed by wrapper now */
    z-index: 201;
    /* Above wrapper if needed */
    position: relative;
    /* No longer sticky itself */
    top: auto;
    padding: 0 var(--em-side-pad);
    margin: 0;
    overflow: visible;
    border: none !important;
    box-shadow: none !important;
}

.water {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #FAB327 5%, #FFF 50%);
    /* Gradient se termine plus tôt */
    border-radius: 0;
    transform: translateY(60%);
    /* Reduced transition for responsive tilt compensation */
    transition: transform 0.5s ease-out;
}

.em-dark-content {
    position: relative;
    z-index: 2;
    /* Bring content above water */
    overflow: hidden;
    /* Clip wave animation overflow */
}

/* TABS NAVIGATION (Horizontal) */
.em-tabs-nav {
    display: flex;
    justify-content: space-around;
    padding: 0 10px 15px 10px;
    /* Reduced top padding */
    border-top: 1px solid #8257C3;
    margin-top: 20px;
    padding-top: 16px;
    position: relative;
    /* Ensure z-index works */
    z-index: 10;
    /* Above water */
}

.em-tab-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    gap: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-cta);
    text-shadow: 1px 1px 0 #fff, -1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: color 0.2s;
    padding-bottom: 8px;
    /* Space for border */
    border-bottom: 3px solid transparent;
    /* Placeholder for layout stability */
}

/* Tab styling - now using .active class instead of :checked */
.em-tab-label {
    cursor: pointer;
    transition: all 0.3s ease;
}

.em-tab-label.active {
    color: #8257C3 !important;
    border-bottom: 3px solid #8257C3 !important;
    opacity: 1 !important;
}



/* Info container (Date/Location) in sticky header */
.em-sticky-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--em-pill-gap);
    align-items: stretch;
    padding-top: 10px;
    margin-bottom: 0px;
    border: none !important;
    box-shadow: none !important;
    position: relative;
    /* Ensure z-index works */
    z-index: 10;
    /* Above water */
}

.em-pill--sticky {
    background: #f9f7f2;
    color: #000;
    border: none;

}

.em-pill--sticky .em-pill__icon {
    color: var(--color-header-bg);
}

/* Tabs inside sticky header */
.em-sticky-header .em-tabs-nav {
    margin-top: 10px;
    padding-bottom: 15px;
    border-top: none;
    /* remove border if desired */
}

/* CONTENT AREA */
.em-content-area {
    padding: 0;
    flex: 1;
    position: relative;
    z-index: 50;
    /* Au-dessus de la vague (-1), mais sous le header sticky (100) */
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-main);
    background-color: #FFF;
    overflow: visible;
    /* Critical for sliding effect */
}

.em-panels-wrapper {
    display: flex;
    width: 400%;
    /* 4 tabs = 400% */
    height: 100%;
    /* Full height of content area */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.em-tab-panel {
    width: 25%;
    /* 1/4 of the wrapper */
    height: 100%;
    /* Full height */
    overflow-y: auto;
    /* Independent scroll */
    flex-shrink: 0;
    padding: 24px 20px 160px 20px;
    /* Add bottom padding for CTA bar + Navbar */
    padding-top: 40px;
    /* Espace pour que le contenu commence sous le sticky header */
    box-sizing: border-box;
    /* We no longer use display: none; visibility: hidden; for transitions if we want them side-by-side */
    /* Instead, we translate the wrapper */

    /* Smooth fade at the top for sticky header junction */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 40px, black 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 40px, black 100%);
}

/* Panel-specific logic for visibility/interactivity if needed */

/* TRANSITION LOGIC */
input#tab-desc:checked~.em-content-area .em-panels-wrapper {
    transform: translateX(0);
}

input#tab-people:checked~.em-content-area .em-panels-wrapper {
    transform: translateX(-25%);
}

input#tab-chat:checked~.em-content-area .em-panels-wrapper {
    transform: translateX(-50%);
}

input#tab-map:checked~.em-content-area .em-panels-wrapper {
    transform: translateX(-75%);
}

/* BOOKING BAR */
.em-booking-bar {
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 80px;
    /* Lifted for TWD Navbar (5rem = 80px) */
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform .18s ease, opacity .18s ease;
    will-change: transform;
}

.em-booking-bar.is-hidden {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
}

.em-booking-btn {
    background: var(--color-cta);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}

/* BOOKING DRAWER TOGGLE (Checked Hack) */
#em-booking-toggle {
    position: absolute;
    left: -9999px;
}

.em-booking-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

#em-booking-toggle:checked~.em-booking-overlay {
    opacity: 1;
    pointer-events: auto;
}

.em-booking-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(86vh, 820px);
    background: #fff;
    border-radius: 16px 16px 0 0;
    z-index: 99999;
    transform: translateY(105%);
    transition: transform .18s ease;

    display: flex;
    flex-direction: column;
}

#em-booking-toggle:checked~.em-booking-drawer {
    transform: translateY(0);
}

.em-booking-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.em-booking-drawer__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.em-booking-drawer__close {
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, .12);
    background: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    font-weight: 700;
}

.em-booking-drawer__body {
    padding: 12px 14px 90px;
    overflow: auto;
    flex: 1;
}

/* Map panel content */
#em-map-panel-content {
    padding-top: 0em;

}

/* Event Image Rounded Corners */
.em-event-image {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;

}

.em-event-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}


.navigation-tab-bar {
    position: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    transition: padding-bottom 250ms cubic-bezier(0.42, 0, 0.58, 1);
    touch-action: manipulation;
    user-select: none;
    width: 100%;
    z-index: 999999999;
    height: 3.5rem;
    background-color: #b6f9e2;
    border-top: 1px solid #404040;
}

/* Styles moved from html.html */
/* Cacher la barre de r�servation sur l'onglet carte */
#tab-map:checked~.em-booking-bar {
    display: none !important;
}

.em-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.em-card-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.15) 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.em-card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
}

.em-card-icon {
    font-size: 40px;
    margin-bottom: 5px;
    line-height: 1;
}

.em-card-label {
    font-size: 11px;
    font-weight: 700;
    color: #333;
    text-transform: capitalize;
    margin-bottom: 2px;
}

.em-card-value {
    font-size: 10px;
    color: #666;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* FIX MOBILE LAYOUT */
@media (max-width: 768px) {
    #page {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* Fix GPX Map Width */
    .gpx-viewer-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    .panel-map canvas {
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .em-dark-container {
        top: 0 !important;
        margin-top: 0 !important;
    }
}

/* ========================================
   RESTORE NATIVE PAGE SCROLL + PULL-TO-REFRESH
   ======================================== */
html,
body {
    height: auto !important;
    min-height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Évite que la zone de contenu bloque le scroll global */
.em-content-area {
    overflow: visible !important;
}

/* Ajoute un espace invisible en haut pour permettre le pull-to-refresh */
body::before {
    content: '';
    display: block;
    height: 1px;
    width: 100%;
}

/* Force le body à avoir du contenu scrollable au-dessus */
body {
    padding-top: 1px !important;
}

/* ========================================
   SWIPER.JS FOR EVENT TABS
   ======================================== */
.em-swiper {
    width: 100%;
}

.em-swiper .swiper-slide {
    min-height: 70vh;
    /* Grande zone pour attraper le swipe */
    padding: 24px 20px 160px 20px;
    box-sizing: border-box;
    overflow-y: auto;
    /* Scroll vertical dans chaque slide */
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 20;
    /* Au-dessus de la vague (z-index: 1) */
    background-color: #FFF;
    /* Fond blanc pour masquer la vague */
}

/* Remove old transform-based panel switching */
.em-panels-wrapper {
    /* No longer using transform - Swiper handles it */
    transform: none !important;
    transition: none !important;
}

/* ========================================
   MAP DEEP LINK BUTTONS
   ======================================== */
.em-map-actions {
    padding: 20px;
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.em-map-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.em-map-btn__icon {
    font-size: 22px;
}

.em-map-btn--google {
    background: #4285F4;
}

.em-map-btn--google:hover {
    background: #357ae8;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
    transform: translateY(-2px);
}

/* Fix for Homepage Scroll issue: Add padding to body */
body {
    padding-bottom: 100px !important;
}

/* FORCE SCROLL ON HOMEPAGE: Override any 100vh lock */
html.home,
body.home,
html.blog,
body.blog {
    height: auto !important;
    min-height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: auto !important;
    overscroll-behavior-y: auto !important;
}

.em-map-btn--uber {
    background: #000000;
}

.em-map-btn--uber:hover {
    background: #333333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}