/* ============================================================
   KREMLIMPRO — CSS ADDITIONNEL (child theme / CSS additionnel WP)
   - Arrondi des cadres réduit à 25% des valeurs max
   - Police du menu appliquée à tous les titres (sans changer taille/couleur)
   - Basé sur thème Dynamico + couleurs originales de la page
   ============================================================ */

/* ===== VARIABLES SITE ===== */
:root {
    /* Couleurs extraites de la page */
    --krem-primary:      #e84747;
    --krem-secondary:    #cb3e3e;
    --krem-tertiary:     #ae3535;
    --krem-black:        #000000;
    --krem-dark-gray:    #333333;
    --krem-gray:         #777777;
    --krem-light-gray:   #eeeeee;
    --krem-bg:           #ededef;   /* default-color du thème */
    --krem-white:        #ffffff;

    /* Arrondi : 25% d'un arrondi "fort" (on fixe à 4px comme base douce) */
    --krem-radius:       4px;
    --krem-radius-sm:    2px;
    --krem-radius-lg:    6px;      /* ex: cards, modales */

    /* Police du menu — appliquée aux titres */
    --krem-title-family:     inherit;
    --krem-title-weight:     700;
    --krem-title-transform:  uppercase;
    --krem-title-spacing:    0.05em;
}

/* ============================================================
   POLICE DU MENU → TOUS LES TITRES
   Sans modifier font-size ni color
   ============================================================ */
h1, h2, h3, h4, h5, h6,
.entry-title,
.page-title,
.widget-title,
.site-title,
.wp-block-heading,
.wp-block-post-title,
.wp-block-query-title,
.wp-block-cover__inner-container > h1,
.wp-block-cover__inner-container > h2,
.wp-block-cover__inner-container > h3,
.has-text-align-center.wp-block-heading,
.entry-header .entry-title,
.page-header .page-title,
.archive-header .archive-title,
.sidebar .widget-title,
.is-style-widget-title,
.comment-reply-title,
.comments-title,
.woocommerce-loop-product__title,
.woocommerce-page h1,
.woocommerce-page h2,
.em-calendar caption,
.em-events-head {
    font-family:     var(--krem-title-family) !important;
    font-weight:     var(--krem-title-weight) !important;
    text-transform:  var(--krem-title-transform) !important;
    letter-spacing:  var(--krem-title-spacing) !important;
    /* font-size et color intentionnellement NON modifiés */
}

/* ============================================================
   ARRONDI DES CADRES — 25%
   Cible tous les éléments qui ont des border-radius
   ============================================================ */

/* --- Cartes / articles / blocs --- */
.hentry,
.entry,
.post,
.page,
article,
.wp-block-group,
.wp-block-cover,
.wp-block-media-text,
.wp-block-columns,
.wp-block-column,
.wp-block-image img,
.wp-block-image figure,
.wp-block-gallery,
.wp-block-pullquote,
.wp-block-quote,
.wp-block-verse,
.wp-block-code,
.wp-block-preformatted,
.wp-block-table,
.wp-block-calendar,
.wp-block-latest-posts,
.wp-block-archives,
.wp-block-categories,
.wp-block-tag-cloud,
.wp-block-search,
.wp-block-social-links,
.wp-block-embed,
.wp-block-video,
.wp-block-audio,
.wp-block-file,
.wp-block-rss,
.wp-block-separator,
.wp-block-spacer {
    border-radius: var(--krem-radius) !important;
}

/* --- Images --- */
img,
.wp-post-image,
.attachment-thumbnail,
.attachment-medium,
.attachment-large,
.size-thumbnail,
.size-medium,
.size-large,
.alignleft img,
.alignright img,
.aligncenter img,
figure img,
.entry-thumbnail img,
.post-thumbnail img,
.featured-image img {
    border-radius: var(--krem-radius) !important;
}

/* --- Boutons --- */
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.wp-element-button,
.wp-block-button__link,
.wp-block-search__button,
.more-link,
.read-more,
a.button,
.btn,
.nav-links a,
.page-numbers a,
.page-numbers span {
    border-radius: var(--krem-radius) !important;
}

/* --- Inputs / formulaires --- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select,
.wp-block-search__input,
.search-field,
.comment-form input,
.comment-form textarea {
    border-radius: var(--krem-radius) !important;
}

/* --- Widgets / sidebar --- */
.widget,
.sidebar .widget,
.widget-area .widget,
.wp-block-widget-area,
.wp-block-legacy-widget {
    border-radius: var(--krem-radius-lg) !important;
}

/* Titres de widgets (conserve fond noir existant) */
.sidebar .widget .widget-title,
.is-style-widget-title {
    background-color: #000000e6;
    border-radius: var(--krem-radius) var(--krem-radius) 0 0 !important;
}

/* --- Navigation / Menu --- */
.primary-navigation-wrap {
    background-color: #000000e6;
}

.main-navigation .sub-menu,
.main-navigation ul ul,
#primary-menu .sub-menu {
    border-radius: 0 0 var(--krem-radius-lg) var(--krem-radius-lg) !important;
}

.main-navigation .sub-menu li:last-child a,
#primary-menu .sub-menu li:last-child a {
    border-radius: 0 0 var(--krem-radius) var(--krem-radius) !important;
}

/* --- Notices / alertes --- */
.notice,
.alert,
.wp-block-notice,
.wpcf7-response-output,
.comment-notes,
.logged-in-as {
    border-radius: var(--krem-radius) !important;
}

/* --- Modales / popups / overlays --- */
.mfp-content,
.mfp-container,
.fancybox-content,
.popup,
.modal,
.components-modal__content {
    border-radius: var(--krem-radius-lg) !important;
}

/* --- Événements (Events Manager) --- */
.em-event,
.em-events-list .event,
.em-booking-form,
.em-calendar table,
.em-calendar td,
.em-tickets,
.em-ticket {
    border-radius: var(--krem-radius) !important;
}

/* --- Tags / badges / meta --- */
.tag,
.label,
.badge,
.category-label,
.post-categories a,
.tags-links a,
.wp-block-tag-cloud a,
.entry-meta a,
.cat-links a {
    border-radius: var(--krem-radius-sm) !important;
}

/* --- Avatars --- */
.avatar,
img.avatar,
.comment-author img {
    border-radius: 50% !important;
    /* Les avatars restent ronds, c'est une convention UX */
}

/* ============================================================
   HOVER BOUTONS — conservé du CSS précédent
   ============================================================ */
.wp-element-button:hover,
.wp-block-button__link:hover,
.wp-block-search__button:hover {
    background-color: #e84747;
}

/* ============================================================
   MENU — Z-INDEX (reste devant tout)
   ============================================================ */
.primary-navigation-wrap {
    position: relative;
    z-index: 99999;
}

.primary-navigation-wrap .main-navigation,
#site-navigation {
    z-index: 99999;
    position: relative;
}

.main-navigation .sub-menu,
.main-navigation ul ul,
#primary-menu .sub-menu {
    z-index: 100000;
    position: absolute;
}

/* Page header passe DERRIÈRE le menu */
.page-header.entry-header,
header.page-header {
    position: relative;
    z-index: 1;
}

/* ============================================================
   LAYOUT — conservé
   ============================================================ */
.site,
.site-main {
    max-width: 1600px;
}

body.wide-theme-layout .site .site-footer,
body.wide-theme-layout .site .site-content {
    max-width: 1600px;
}

body.wide-theme-layout .site .header-main {
    max-width: calc(1600px + 3rem);
}

@media only screen and (min-width: 960px) {
    body.wide-theme-layout .site .primary-navigation-wrap .primary-navigation {
        max-width: 1550px;
    }
}

@media only screen and (min-width: 880px) {
    .has-sidebar .site-content .site-main {
        flex-basis: 75%;
        flex-grow: 1;
    }
    .has-sidebar .site-content .sidebar {
        flex-basis: 25%;
    }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--krem-bg); }
::-webkit-scrollbar-thumb {
    background: var(--krem-primary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--krem-secondary);
}
/* ============================================
   Z-INDEX GLOBAL - Hiérarchie
   ============================================ */

/* Le fond de page / cards ne doit pas créer de contexte d'empilement */
.wp-block-group,
.wp-block-column,
.wp-block-columns,
.entry-content,
.site-content,
.page-content,
article,
.div1,
.div2,
[class*="wp-block"] {
    /* NE PAS mettre position:relative + z-index ici
       sinon ça crée un nouveau contexte d'empilement
       qui bloque tout ce qui est à l'intérieur */
    isolation: auto !important;
}

/* ============================================
   MENU NAVIGATION - toujours devant tout
   ============================================ */
.primary-navigation-wrap,
.primary-navigation,
#site-navigation,
.main-navigation,
nav[class*="navigation"] {
    position: relative;
    z-index: 99999 !important;
    isolation: isolate;
}

/* Dropdown du menu nav */
.primary-navigation ul ul,
.main-navigation ul ul,
#primary-menu ul {
    z-index: 100000 !important;
    position: absolute !important;
}

/* ============================================
   DROPDOWN SAVE THE DATE - devant les cards
   ============================================ */

/* Le wrapper doit laisser déborder le dropdown */
.krem-std-wrapper {
    position: relative;
    width: 52px;
    height: 52px;
    overflow: visible !important;
}

.krem-std-em-real {
    position: absolute;
    top: 0;
    left: 0;
    width: 52px;
    height: 52px;
    z-index: 2;
    overflow: visible !important;
}

.krem-std-em-real .em-event-add-to-calendar {
    overflow: visible !important;
}

/* Dropdown EM au dessus de tout sauf le menu nav */
.krem-std-em-real .em-event-add-to-calendar ul {
    position: absolute !important;
    top: 56px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9999 !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
    min-width: 200px !important;
    border-radius: 4px !important;
    padding: 4px 0 !important;
    margin: 0 !important;
    list-style: none !important;
    pointer-events: all !important;
}

/* ============================================
   EMPECHE LES BLOCKS WP DE COUPER LE DROPDOWN
   ============================================ */
.wp-block-group:has(.krem-save-the-date),
.wp-block-column:has(.krem-save-the-date),
.entry-content:has(.krem-save-the-date) {
    overflow: visible !important;
    contain: none !important;
}

/* Tous les parents jusqu'à body */
body,
#page,
#content,
.site-content,
.entry-content,
main,
article {
    overflow: visible !important;
}
