/**
 * Fiche événement TEC — surcharge après les CSS du plugin.
 */

/* -------------------------------------------------------------------------- */
/* Héros 2/3 texte + 1/3 image                                                */
/* -------------------------------------------------------------------------- */
.single-tribe_events .wng-event-hero {
    margin-bottom: var(--global_component_mb, 40px);
}

.single-tribe_events .wng-event-hero__title {
    margin-bottom: 20px;
}

.single-tribe_events .wng-event-hero__text {
    margin-top: 16px;
}

.single-tribe_events .wng-event-hero__content .tribe-events-schedule + .wng-event-hero__text {
    margin-top: 28px;
}

.single-tribe_events .wng-event-hero__text > * + * {
    margin-top: 28px;
}

.single-tribe_events .wng-event-hero__text > :last-child {
    margin-bottom: 0;
}

.single-tribe_events .wng-event-hero__image-wrap {
    margin-top: 24px;
}

.single-tribe_events .wng-event-hero__image-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

@media (min-width: 992px) {
    .single-tribe_events .wng-event-hero__image-wrap {
        margin-top: 0;
    }
}

/* -------------------------------------------------------------------------- */
/* Barre d'actions : inscription + calendrier                                  */
/* -------------------------------------------------------------------------- */
.single-tribe_events .wng-event-actions {
    margin-bottom: var(--global_component_mb, 40px);
}

.single-tribe_events .wng-event-actions[hidden] {
    display: none !important;
}

.single-tribe_events .wng-event-actions__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.single-tribe_events .wng-event-actions__subscribe,
.single-tribe_events .wng-event-actions__register {
    flex: 0 0 auto;
}

/* Style commun des boutons d'action (calendrier + inscription) */
.single-tribe_events .wng-event-actions__register .rtec-register-button-wrap,
.single-tribe_events .wng-event-actions__register .rtec-register-button,
.single-tribe_events .wng-event-actions__register .rtec-register-button-link,
.single-tribe_events .wng-event-actions__register .wng-event-register-trigger,
.single-tribe_events .wng-event-subscribe .tribe-common-c-btn-border.tribe-events-c-subscribe-dropdown__button.footer-top-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 150px;
    min-height: 48px;
    padding: 12px 24px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 12px;
    border: 2px solid var(--secondary_color);
    transition: 0.3s;
    background: transparent;
    color: var(--secondary_color);
    box-shadow: none;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--main_font);
    font-size: var(--body_font_size);
    font-weight: 500;
    line-height: 1.2;
}

.single-tribe_events .wng-event-actions__register .rtec-register-button-wrap:hover,
.single-tribe_events .wng-event-actions__register .rtec-register-button:hover,
.single-tribe_events .wng-event-actions__register .rtec-register-button-link:hover,
.single-tribe_events .wng-event-actions__register .wng-event-register-trigger:hover,
.single-tribe_events .wng-event-subscribe .tribe-common-c-btn-border.tribe-events-c-subscribe-dropdown__button.footer-top-btn-outline:hover,
.single-tribe_events .wng-event-subscribe .tribe-common-c-btn-border.tribe-events-c-subscribe-dropdown__button.footer-top-btn-outline:focus {
    background: var(--secondary_color);
    color: #fff;
}

.single-tribe_events .wng-event-rtec-panel[hidden] {
    display: none !important;
}

.single-tribe_events:not(.wng-event-registration--form-revealed):not(.wng-event-registration--login-revealed) #wng-event-rtec-panel {
    display: none !important;
}

.single-tribe_events.wng-event-registration--form-revealed #wng-event-rtec-panel,
.single-tribe_events.wng-event-registration--login-revealed #wng-event-rtec-panel {
    display: block !important;
}

.single-tribe_events .wng-event-rtec-panel {
    margin-bottom: var(--global_component_mb, 40px);
}

.single-tribe_events:not(.wng-event-registration--form-revealed):not(.wng-event-registration--login-revealed) .rtec .tribe-events-notices,
.single-tribe_events:not(.wng-event-registration--form-revealed):not(.wng-event-registration--login-revealed) .rtec .rtec-form-wrapper,
.single-tribe_events:not(.wng-event-registration--form-revealed):not(.wng-event-registration--login-revealed) .rtec .rtec-form-outer,
.single-tribe_events:not(.wng-event-registration--form-revealed):not(.wng-event-registration--login-revealed) .rtec .rtec-attendee-list-wrap,
.single-tribe_events:not(.wng-event-registration--form-revealed):not(.wng-event-registration--login-revealed) .rtec form,
.single-tribe_events:not(.wng-event-registration--form-revealed):not(.wng-event-registration--login-revealed) .wng-event-rtec-panel .rtec-form-wrapper,
.single-tribe_events:not(.wng-event-registration--form-revealed):not(.wng-event-registration--login-revealed) .wng-event-rtec-panel .rtec-form-outer,
.single-tribe_events:not(.wng-event-registration--form-revealed):not(.wng-event-registration--login-revealed) .wng-event-rtec-panel form:not(.members-access-error--login form):not(.wng-event-registration-login form) {
    display: none !important;
}

.single-tribe_events:not(.wng-event-registration--login-revealed) .wng-event-rtec-panel .wng-event-registration-login,
.single-tribe_events:not(.wng-event-registration--login-revealed) .wng-event-rtec-panel .members-access-error--login {
    display: none !important;
}

/* Masque l'image pleine largeur dupliquée dans le contenu (affichée dans le héros). */
.single-tribe_events .wng-event-body .tribe-block.tribe-block__featured-image,
.single-tribe_events .wng-event-body .wp-block-post-featured-image,
.single-tribe_events .wng-event-body .tribe-events-event-image {
	display: none !important;
}

.single-tribe_events .single-tribe-event-content:has(#wng-event-actions) .wng-event-body .wng-event-subscribe,
.single-tribe_events .single-tribe-event-content:has(#wng-event-actions) .tribe-blocks-editor > .wng-event-subscribe,
.single-tribe_events .single-tribe-event-content:has(#wng-event-actions) .tribe-blocks-editor .tribe-block__events-link.wng-event-subscribe {
	display: none !important;
}

/* -------------------------------------------------------------------------- */
/* Détails / Organisateur / Lieu — grille 3 + 3 + 6                          */
/* -------------------------------------------------------------------------- */
.single-tribe_events .tribe-events-meta-group,
.single-tribe_events .tribe-events-event-meta.primary,
.single-tribe_events .single-tribe-event-content .tribe-block.tribe-block__venue {
    float: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    clear: none !important;
    box-sizing: border-box;
}

.single-tribe_events .wng-event-meta__row {
    margin-left: calc(var(--grid_gutter, 30px) / -2);
    margin-right: calc(var(--grid_gutter, 30px) / -2);
}

.single-tribe_events .wng-event-meta__col {
    padding-left: calc(var(--grid_gutter, 30px) / 2);
    padding-right: calc(var(--grid_gutter, 30px) / 2);
    margin-bottom: var(--global_component_mb, 40px);
}

.single-tribe_events .wng-event-meta__stack--loaded {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.single-tribe_events .wng-event-meta__stack--loaded > .wng-event-meta__section,
.single-tribe_events .wng-event-meta__col .tribe-events-meta-group {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
}

.single-tribe_events .wng-event-meta__col--venue .tribe-block__venue__map,
.single-tribe_events .wng-event-meta__col--venue .tribe-events-venue-map,
.single-tribe_events .wng-event-meta__col--venue .wng-event-meta__map,
.single-tribe_events .wng-event-meta__col--venue .wng-event-meta__venue-map {
    margin-top: 20px;
    width: 100%;
}

@media (min-width: 992px) {
    .single-tribe_events .wng-event-meta__row > .wng-event-meta__col {
        margin-bottom: 0;
    }
}

/* Lieu dupliqué masqué quand le lieu est dans le bloc classique */
.single-tribe_events .wng-event-meta__stack--loaded ~ .tribe-block.tribe-block__venue .tribe-block__venue__meta,
.single-tribe_events .single-tribe-event-content:has(.wng-event-meta__stack--loaded) .tribe-block.tribe-block__venue .tribe-block__venue__meta {
    display: none !important;
}

.single-tribe_events .single-tribe-event-content .tribe-block.tribe-block__venue {
    border: none !important;
    margin-top: 0 !important;
    padding: 0 !important;
}

/* -------------------------------------------------------------------------- */
/* Liens méta & contenu                                                       */
/* -------------------------------------------------------------------------- */
.single-tribe_events .tribe-events-meta-group a,
.single-tribe_events .tribe-common a.tribe-events-c-subscribe-dropdown__list-item-link {
    color: var(--secondary_color) !important;
    text-decoration: none !important;
}

.single-tribe_events .tribe-events-meta-group a:hover,
.single-tribe_events .tribe-common a.tribe-events-c-subscribe-dropdown__list-item-link:hover {
    color: var(--secondary_color) !important;
    text-decoration: underline !important;
}

/* -------------------------------------------------------------------------- */
/* Bouton « Ajouter au calendrier »                                           */
/* -------------------------------------------------------------------------- */
.single-tribe_events .wng-event-subscribe .tribe-events-c-subscribe-dropdown__button.footer-top-btn-outline {
    min-width: 0;
}

.single-tribe_events .wng-event-subscribe .tribe-events-c-subscribe-dropdown__button-text {
    font-family: var(--main_font);
    font-size: var(--body_font_size);
    font-weight: 500;
    color: var(--secondary_color) !important;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.2;
}

.single-tribe_events .wng-event-subscribe .tribe-events-c-subscribe-dropdown__button-text:focus,
.single-tribe_events .wng-event-subscribe .tribe-events-c-subscribe-dropdown__button-text:focus-visible,
.single-tribe_events .wng-event-subscribe .tribe-events-c-subscribe-dropdown__button-text:active,
.single-tribe_events .tribe-events-c-subscribe-dropdown .tribe-events-c-subscribe-dropdown__button-text:focus, .single-tribe_events .tribe-events-c-subscribe-dropdown button.tribe-events-c-subscribe-dropdown__button-text:focus, .tribe-events .tribe-events-c-subscribe-dropdown .tribe-events-c-subscribe-dropdown__button-text:focus, .tribe-events .tribe-events-c-subscribe-dropdown button.tribe-events-c-subscribe-dropdown__button-text:focus {
    outline: none;
    box-shadow: none;
    border: none;
}

.single-tribe_events .wng-event-subscribe .tribe-events-c-subscribe-dropdown__export-icon {
    color: var(--secondary_color) !important;
    fill: currentColor;
}

.single-tribe_events .wng-event-subscribe .tribe-common-c-btn-border.tribe-events-c-subscribe-dropdown__button.footer-top-btn-outline {
    border: 2px solid var(--secondary_color) !important;
    border-radius: 12px;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: var(--secondary_color) !important;
}

.single-tribe_events .wng-event-subscribe .tribe-common-c-btn-border.tribe-events-c-subscribe-dropdown__button.footer-top-btn-outline:hover .tribe-events-c-subscribe-dropdown__button-text,
.single-tribe_events .wng-event-subscribe .tribe-common-c-btn-border.tribe-events-c-subscribe-dropdown__button.footer-top-btn-outline:hover .tribe-events-c-subscribe-dropdown__export-icon,
.single-tribe_events .wng-event-subscribe .tribe-common-c-btn-border.tribe-events-c-subscribe-dropdown__button.footer-top-btn-outline:hover svg {
    color: #fff !important;
    fill: currentColor;
}

.single-tribe_events.tribe-event-is-past .wng-event-subscribe {
    display: none !important;
}

/* Notifications d'inscription événement (quota, succès, erreur, déjà inscrit) */
.single-tribe_events .rtec .tribe-events-notices,
.single-tribe_events .rtec .rtec-success-message,
.single-tribe_events .rtec .rtec-error-message,
.single-tribe_events .wng-event-registration-remaining {
    text-align: left !important;
}

/* Quota d'inscriptions restantes (comptes collectifs) */
.single-tribe_events .wng-event-registration-remaining {
    margin: 0 0 16px;
    padding: 12px 16px;
}

.single-tribe_events .wng-event-registration-remaining__count {
    font-weight: 600;
}

/* Champs verrouillés du formulaire d'inscription événement */
.single-tribe_events .rtec input.wng-field-readonly,
.single-tribe_events .rtec textarea.wng-field-readonly,
.single-tribe_events .rtec input[readonly]:not([type="submit"]):not([type="button"]):not([type="hidden"]),
.single-tribe_events .rtec textarea[readonly],
.single-tribe_events .rtec input[aria-readonly="true"]:not([type="submit"]):not([type="button"]):not([type="hidden"]),
.single-tribe_events .rtec textarea[aria-readonly="true"] {
    background-color: var(--gris_clair, #f4f4f4);
    border-color: #d4d4d4;
    color: #6f6f6f!important;
    cursor: not-allowed;
    opacity: 1;
    box-shadow: none;
}

.single-tribe_events .rtec input.wng-field-readonly:focus,
.single-tribe_events .rtec textarea.wng-field-readonly:focus,
.single-tribe_events .rtec input[readonly]:not([type="submit"]):not([type="button"]):not([type="hidden"]):focus,
.single-tribe_events .rtec textarea[readonly]:focus,
.single-tribe_events .rtec input[aria-readonly="true"]:not([type="submit"]):not([type="button"]):not([type="hidden"]):focus,
.single-tribe_events .rtec textarea[aria-readonly="true"]:focus {
    border-color: #d4d4d4;
    outline: none;
    box-shadow: none;
}

/* Inscription événement : panneau login affiché au clic sur « Je m'inscris » */
.wng-event-registration-login {
    display: none;
    margin-top: 20px;
}

.single-tribe_events.wng-event-registration--login-revealed .wng-event-registration-login.is-visible,
.single-tribe_events.wng-event-registration--login-revealed #wng-event-registration-login {
    display: block !important;
}

.single-tribe_events.wng-event-registration--login-revealed .rtec .rtec-form-wrapper,
.single-tribe_events.wng-event-registration--login-revealed .rtec .rtec-form-outer,
.single-tribe_events.wng-event-registration--login-revealed .rtec form:not(.wng-event-registration-login form):not(.members-access-error--login form) {
    display: none !important;
}

.single-tribe_events .wng-event-registration-access,
.single-tribe_events .members-access-error--login {
    margin-top: 0;
}

/* Harmonise le panneau login RTEC avec le panneau intranet */
.single-tribe_events #wng-event-registration-login .members-access-error--login {
    max-width: 560px;
    margin: 0;
    padding: 28px;
    background: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 20px;
}

.single-tribe_events #wng-event-registration-login .members-access-error--login form {
    display: flex;
    flex-direction: column;
    row-gap: 14px;
    margin-bottom: 20px;
}

.single-tribe_events #wng-event-registration-login .members-access-error--login label {
    display: block;
    margin-bottom: 8px;
    color: var(--body_text_color);
    font-weight: 600;
}

.single-tribe_events #wng-event-registration-login .members-access-error--login .login-remember label {
    display: inline-flex;
    align-items: center;
    column-gap: 8px;
    margin-bottom: 0;
    font-weight: 400;
}

.single-tribe_events #wng-event-registration-login .members-access-error--login input[type="text"],
.single-tribe_events #wng-event-registration-login .members-access-error--login input[type="password"],
.single-tribe_events #wng-event-registration-login .members-access-error--login .members-login-password-field input {
    width: 100%;
    font-size: var(--body_font_size);
    border: 1px solid var(--body_text_color);
    border-radius: 20px;
    background: #f3f3f3;
    padding: 16px 18px;
    appearance: none;
    -webkit-appearance: none;
    transition: 0.3s;
    outline: none;
}

.single-tribe_events #wng-event-registration-login .members-access-error--login .members-login-password-field {
    position: relative;
    display: block;
}

.single-tribe_events #wng-event-registration-login .members-access-error--login .members-login-password-field input {
    padding-right: 52px;
}

.single-tribe_events #wng-event-registration-login .members-access-error--login input[type="text"]:focus,
.single-tribe_events #wng-event-registration-login .members-access-error--login input[type="password"]:focus,
.single-tribe_events #wng-event-registration-login .members-access-error--login .members-login-password-field input:focus {
    border-color: var(--secondary_color);
}

.single-tribe_events #wng-event-registration-login .members-access-error--login .login-submit input[type="submit"] {
    min-width: 150px;
    padding: 12px 24px;
    text-align: center;
    border-radius: 12px;
    border: 2px solid var(--secondary_color);
    transition: 0.3s;
    background: var(--secondary_color);
    color: #fff;
    box-shadow: none;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    font-size: var(--body_font_size);
    font-family: var(--main_font);
    line-height: normal;
}

.single-tribe_events #wng-event-registration-login .members-access-error--login .login-submit input[type="submit"]:hover {
    background: transparent;
    color: var(--secondary_color);
}

.single-tribe_events #wng-event-registration-login .members-access-error--login .btn.btn-outline {
    background: transparent;
    color: var(--secondary_color);
}

.single-tribe_events #wng-event-registration-login .members-access-error--login .btn.btn-outline:hover {
    background: var(--secondary_color);
    color: #fff;
}

/* RTEC : masquer « Déjà enregistré ? » et « Cancel my registration » */
.single-tribe_events .rtec .rtec-visitor-tools,
.single-tribe_events .rtec .rtec-visitor-tool-wrap,
.single-tribe_events .rtec .rtec-send-cancel-link-tool,
.single-tribe_events .rtec .rtec-cancel-registration-link,
.single-tribe_events .rtec .rtec-cancel-my-registration,
.single-tribe_events .rtec .rtec-logged-in-cancel,
.single-tribe_events .rtec .rtec-user-cancel-registration,
.single-tribe_events .rtec .rtec-already-registered-actions {
    display: none !important;
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */
.single-tribe_events .single-tribe-event-content {
    overflow-x: hidden;
    max-width: 100%;
}

.single-tribe_events .single-tribe-event-content .tribe-blocks-editor,
.single-tribe_events .single-tribe-event-content .tribe-events-content,
.single-tribe_events .single-tribe-event-content .tribe-common {
    max-width: 100%;
    box-sizing: border-box;
}

.single-tribe_events .single-tribe-event-content img,
.single-tribe_events .single-tribe-event-content .wp-block-image img,
.single-tribe_events .single-tribe-event-content iframe,
.single-tribe_events .single-tribe-event-content embed {
    max-width: 100%;
    height: auto;
}

.single-tribe_events .single-tribe-event-content .tribe-events-schedule__datetime {
    flex-wrap: wrap;
    word-break: break-word;
}

/* Espace entre la date/heure et l'image (uniquement si image présente) */
.single-tribe_events .single-tribe-event-content .tribe-events-event-image {
    margin-top: 40px;
}

.single-tribe_events .single-tribe-event-content .alignfull {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Contenu réservé aux membres (participants, galerie, fichiers) */
.single-tribe_events .event-membres-content {
    margin-top: var(--global_component_mb, 2rem);
}

.single-tribe_events .event-membres-gallery-section,
.single-tribe_events .event-membres-files-section {
    margin-bottom: var(--global_component_mb, 2rem);
}

.single-tribe_events .event-membres-gallery-section .gallery {
    margin-bottom: 0;
}

/* Carte Google Maps — format carré (padding-bottom : fiable avec iframe en position absolue) */
.single-tribe_events :is(.wng-event-meta__venue-map, .tribe-events-venue-map, .tribe-block__venue__map) {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    overflow: hidden;
}

.single-tribe_events :is(.wng-event-meta__venue-map, .tribe-events-venue-map, .tribe-block__venue__map) :is(iframe, [id^="tribe-events-gmap-"]) {
    position: absolute !important;
    top: 0;
    left: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    border: 0;
}
