/**
 * Meetles — Restyling de la vue Liste TEC (widget Elementor Events View)
 * v2.3.3 — Mise à jour basée sur la structure DOM réelle de TEC v6.
 *
 * Hiérarchie DOM (TEC v6 confirmée par inspection) :
 *   .tribe-events-calendar-list                                    (conteneur)
 *     .tribe-events-calendar-list__event-row                       (OUTER row, flex)
 *       .tribe-events-calendar-list__event-date-tag                (date "MER 7" — masqué)
 *       .tribe-events-calendar-list__event-wrapper                 (col droite)
 *         article.tribe-events-calendar-list__event                (INNER row, flex-direction: ROW-REVERSE !)
 *           .tribe-events-calendar-list__event-featured-image-wrapper (image — pousse à droite)
 *           .tribe-events-calendar-list__event-details                (texte + cta)
 *             header > datetime + h3 title
 *             .tribe-events-calendar-list__event-description
 *               <p>Description...</p>
 *               .tribe-event-city  (📍 ville)
 *             .tribe-events-c-small-cta (CTA reservation)
 *
 * Ce qu'on fait :
 *   - Cartes BuddyBoss (border, radius, hover lift)
 *   - Mois separateur discret
 *   - Cacher la colonne date-tag (la date est dans le datetime)
 *   - Forcer flex-direction: row sur .event (au lieu de row-reverse natif TEC)
 *     → l'image revient a gauche
 *   - Image: 110x110 carre arrondi, object-fit: cover
 *   - Placeholder "🎲" via ::before quand pas de jaquette
 *   - Description: line-clamp 2 sur le <p> SEUL (pas la wrapper, pour preserver
 *     l'affichage de la ville en dessous)
 *   - CTA reservation : pill BuddyBoss
 *   - Responsive ≤720px : image 80x80, CTA pleine largeur
 */

/* ─── Liste : grid 2 colonnes ────────────────────────────────── */
.tribe-events-calendar-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

/* ─── Mois séparateur — discret ──────────────────────────────── */
.tribe-events-calendar-list__month-separator {
    grid-column: 1 / -1;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--bb-content-secondary-text-color, #5b6975) !important;
    text-transform: capitalize !important;
    margin: 18px 0 4px !important;
    padding: 0 4px !important;
    background: transparent !important;
    border: none !important;
}
.tribe-events-calendar-list__month-separator-text {
    background: transparent !important;
    padding: 0 !important;
}

/* ─── Carte évènement (la outer row) ─────────────────────────── */
.tribe-events-calendar-list__event-row {
    background: var(--bb-content-background-color, #fff);
    border: 1px solid var(--bb-content-border-color, #e7e9ec);
    border-radius: 12px;
    padding: 16px;
    margin: 0;
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
    align-items: stretch;
    box-sizing: border-box;
    overflow: hidden;
}
.tribe-events-calendar-list__event-row:hover {
    border-color: var(--bb-primary-color, #385dff);
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    transform: translateY(-1px);
}

/* ─── 1) Cacher la colonne date "MER 7" ────────────────────── */
.tribe-events-calendar-list__event-date-tag {
    display: none !important;
}

/* ─── 2) event-wrapper prend toute la largeur ───────────────── */
.tribe-events-calendar-list__event-wrapper {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}

/* ─── 3) INNER row (article) : flex-direction ROW (pas row-reverse) ── */
.tribe-events-calendar-list__event {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 16px !important;
    align-items: flex-start !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* Reset des negative margins du systeme grid TEC (tribe-common-g-row--gutters)
   qui ressortaient l'image au-dela du padding du wrapper. */
.tribe-events-calendar-list__event.tribe-common-g-row--gutters {
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.tribe-events-calendar-list__event > .tribe-common-g-col {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ─── 4) Image à gauche, 110×110 carré arrondi ───────────────── */
.tribe-events-calendar-list__event-featured-image-wrapper {
    flex: 0 0 110px !important;
    width: 110px !important;
    max-width: 110px !important;
    height: 110px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bb-content-alternate-background-color, #f4f5f7);
    align-self: flex-start;
}
.tribe-events-calendar-list__event-featured-image-link {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}
.tribe-events-calendar-list__event-featured-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    border-radius: 0 !important;
    aspect-ratio: 1 / 1;
}

/* ─── 5) Placeholder "🎲" quand pas de jaquette ─────────────────
   On utilise :has() (support 92%+ navigateurs). Le ::before est inséré
   dans le flex container (article.event) avant les enfants → place
   gauche identique à l'image. */
.tribe-events-calendar-list__event:not(:has(.tribe-events-calendar-list__event-featured-image-wrapper))::before {
    content: "🎲";
    flex: 0 0 110px !important;
    width: 110px;
    height: 110px;
    background: var(--bb-content-alternate-background-color, #f4f5f7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    align-self: flex-start;
}

/* ─── 6) Bloc texte (details) ───────────────────────────────── */
.tribe-events-calendar-list__event-details {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tribe-events-calendar-list__event-header {
    margin: 0 0 6px;
}

.tribe-events-calendar-list__event-datetime-wrapper {
    margin: 0 0 4px !important;
    padding: 0 !important;
}
.tribe-events-calendar-list__event-datetime,
.tribe-events-calendar-list__event-datetime-wrapper time {
    font-size: 12px !important;
    color: var(--bb-content-secondary-text-color, #5b6975) !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.4 !important;
}

/* Lien vers la série d'événements (icône + nom de série) */
.tribe-events-calendar-series-archive__container {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    font-size: 11px;
}
.tribe-events-calendar-series-archive__link {
    color: var(--bb-content-secondary-text-color, #939597);
    text-decoration: none;
}

/* ─── 7) Titre ──────────────────────────────────────────────── */
.tribe-events-calendar-list__event-title {
    margin: 0 !important;
    line-height: 1.3 !important;
}
.tribe-events-calendar-list__event-title-link {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: var(--bb-headings-color, #1c2126) !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
    display: inline;
}
.tribe-events-calendar-list__event-title-link:hover {
    color: var(--bb-primary-color, #385dff) !important;
}
/* Emojis dans titres (🎲 etc.) — taille raisonnable */
.tribe-events-calendar-list__event-title-link img.emoji {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
}

/* ─── 8) Description : line-clamp sur <p> uniquement ──────────
   La description div contient AUSSI .tribe-event-city qu'on veut garder
   visible. Donc on clip seulement le <p>. */
.tribe-events-calendar-list__event-description {
    margin: 4px 0 6px !important;
    padding: 0 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: var(--bb-content-secondary-text-color, #5b6975) !important;
}
.tribe-events-calendar-list__event-description p {
    margin: 0 0 4px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    max-height: 3em;
}

/* ─── 9) Ville (📍) — petite ligne discrète ──────────────────── */
.tribe-event-city {
    font-size: 12px !important;
    color: var(--bb-content-secondary-text-color, #5b6975);
    margin-top: 4px;
}
.tribe-event-city small {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.tribe-event-city img.emoji {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
}

/* ─── 10) CTA Réservation — pill BuddyBoss + price/stock ──────── */
.tribe-events-c-small-cta.tribe-events-calendar-list__event-cost {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 8px !important;
}
.tribe-events-calendar-list .tribe-events-c-small-cta__link,
.tribe-events-calendar-list .tribe-common-c-btn {
    display: inline-block;
    border-radius: 999px !important;
    padding: 8px 18px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    background: var(--bb-primary-button-background-regular, #5867f5) !important;
    color: var(--bb-primary-button-text-regular, #fff) !important;
    border: none !important;
    transition: background .15s ease, transform .15s ease;
    text-decoration: none !important;
    line-height: 1.4 !important;
}
.tribe-events-calendar-list .tribe-events-c-small-cta__link:hover,
.tribe-events-calendar-list .tribe-common-c-btn:hover {
    background: var(--bb-primary-button-background-hover, #4858dd) !important;
    transform: translateY(-1px);
    color: #fff !important;
}
.tribe-events-c-small-cta__price {
    color: var(--bb-content-secondary-text-color, #939597);
    font-size: 12px !important;
}
.tribe-events-c-small-cta__stock {
    color: #2f9e44;
    font-size: 12px !important;
    font-weight: 500;
}

/* ─── 11) Featured tag ──────────────────────────────────────── */
.tribe-events-calendar-list__event-featured-text {
    background: #f0a020 !important;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    letter-spacing: .3px !important;
    display: inline-block !important;
}

/* ─── 12) Header Events Bar / nav ────────────────────────────── */
.tribe-events-c-events-bar,
.tribe-events-c-top-bar {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 0 16px !important;
}
.tribe-events-c-top-bar__today-button {
    border-radius: 999px !important;
    padding: 8px 18px !important;
}

/* ─── Responsive ≤ 720px ──────────────────────────────────── */
@media (max-width: 960px) {
    .tribe-events-calendar-list {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 720px) {
    .tribe-events-calendar-list__event-row {
        padding: 12px;
    }
    .tribe-events-calendar-list__event {
        gap: 12px !important;
    }
    .tribe-events-calendar-list__event-featured-image-wrapper {
        flex: 0 0 80px !important;
        width: 80px !important;
        max-width: 80px !important;
        height: 80px !important;
    }
    .tribe-events-calendar-list__event:not(:has(.tribe-events-calendar-list__event-featured-image-wrapper))::before {
        flex: 0 0 80px !important;
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
    .tribe-events-calendar-list__event-title-link {
        font-size: 15px !important;
    }
    .tribe-events-calendar-list .tribe-events-c-small-cta__link {
        flex: 1 1 100%;
        text-align: center;
    }
}
