/*
Theme Name:     Informapic with Hello Elementor
Theme URI:      https://informapic.fr
Template:       hello-elementor
Author:         Informapic
Author URI:     http://informapic.fr
Version:        1.0
*/


html{
    scroll-padding-top: calc(var(--wp-admin--admin-bar--height) + 30px);
}

button, .elementor-button, .elementor-button-link {
    cursor: pointer;
}
/*****************/ 
/*  ADMIN BAR    */
/*****************/ 
/* AFFICHE LE EDIT CORRESPONDANT AU TYPE DE POST */ 
body.elementor-page #wp-admin-bar-edit,
body:not(.elementor-page) #wp-admin-bar-elementor_edit_page
{
    display: none;
}

/* CUSTOM LINK IN ADMIN BAR */
#wp-admin-bar-custom_menu > .ab-item:before {
    content: "\e904";
    font-family: eicons;
    top: 3px;
    font-size: 18px;
}

#wp-admin-bar-wp-logo{
    display: none;
}

/*****************/ 
/*  VITAL THEME  */
/*****************/ 

/* Corrige le max-width de la zone de commentaires pour les pages */
.page #comments,
.page .comments-area {
    margin: 0 auto;
    max-width: min(100%, 1140px);
}

/* Corrige le menu HTMEGA pour que les sous-menu soient accessibles via la touche "tab" */
.htbuilder-nav .menu-item-has-children:focus-within .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
}

/*****************/ 
/*  WOOCOMMERCE  */
/*****************/ 
/* Applique le style Hello aussi pour les pages produits en Elementor */
body.single-product .site-main {
    margin-inline-end: auto;
    margin-inline-start: auto;
    width: 100%;
}
@media (max-width: 575px) {
    body.single-product .site-main {
        padding-inline-end: 10px;
        padding-inline-start: 10px;
    }
}
@media (min-width: 576px) {
    body.single-product .site-main {
        max-width: 500px;
    }
}
@media (min-width: 768px) {
    body.single-product .site-main {
        max-width: 600px;
    }
}
@media (min-width: 992px) {
    body.single-product .site-main {
        max-width: 800px;
    }
}
@media (min-width: 1200px) {
    body.single-product .site-main {
        max-width: 1140px;
    }
}


/*****************/ 
/*  CUSTOMIZER   */
/*****************/ 
.customizer-elementor-color-selector {
    display: flex;
    flex-wrap: wrap;
}

.customizer-elementor-color input {
    display: none;
}
        
.customizer-elementor-color-choice {
    cursor: pointer;
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ccc;
    position: relative;
    margin-right: 5px;
}

.customizer-elementor-color.custom .customizer-elementor-color-choice {
    border-radius: 50%;
    background: conic-gradient(
        red,
        orange,
        yellow,
        green,
        blue,
        indigo,
        violet
    );
}

.customizer-elementor-color input:checked + .customizer-elementor-color-choice::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0,0,0,.6);
}

li.customize-control-elementor_color_radio + li.customize-control-color{
    display: none;
}

li.customize-control-elementor_color_radio:has(.customizer-elementor-color.custom input:checked) + li.customize-control-color{
    display: list-item;
} 

.customizer-helper-button .dashicons-editor-help{
    vertical-align: text-top;
    margin-right: 5px;
}
.customizer-helper{
    display:none; 
    margin-top:10px; 
    padding: 10px; 
    background: white; 
    border:1px solid #b7b7b7;
    border-radius: 5px;
    font-style: normal;
}

.customizer-range-value {
    position: absolute;
    font-weight: bold;
    color: white;
    background: var(--e-button-context-color);
    border-radius: 5px;
    padding: 5px;
    right: 20px;
    margin-top: -30px;
}

/*****************/ 
/*     MODAL     */
/*****************/ 

.informapic-modal {
  border: none;
  border-radius: 5px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: none;
}

.informapic-modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.informapic-modal .modal-container{
    display: flex;
    flex-direction: column;
    width: 100%;
}

.informapic-modal .modal-container:has(iframe){
    height: 100%;
}

.informapic-modal .header{
    display: flex; 
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid silver;
    background: white;
}

.informapic-modal .header .title{
    flex-grow: 2;
}
.informapic-modal .title, 
.informapic-modal .content  {
    padding: 10px;
}
.informapic-modal .close i.fas{
    pointer-events: none;
}
.informapic-modal .buttons{
    display: flex;
    flex-direction: row-reverse;
}
.informapic-modal .content{
    max-height: 80vh;
    overflow-y: auto;
    background: white;
}
.informapic-modal .header:has(.no-title) {
    background: transparent;
    border: none;
}
.informapic-modal .modal-container:fullscreen .content{
    max-height: 100%;
}
.informapic-modal .modal-container:fullscreen {
    border-radius: 0;
}

/* SURCHARGE GLOBAL-MODAL */
body:has(.global-modal[open]){
    overflow: hidden;
}
.global-modal {
    background: none;
    width: 100%!important; /* Important > pour surcharger la largeur du widget */
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
}
.global-modal .no-title+.buttons{
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1; /* Pour passer au-dessus de .content */
}
.global-modal .buttons button{
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    background-color: #3b3b3bff;
}
.global-modal .buttons button.close {
    background-color: red;
}
.global-modal .content{
    width: 100%;
    height: 100%;
    max-height: 100%;
    padding: 0;
    margin: auto;
}
.global-modal iframe {
    width: 100%;
    border: none; 
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.informapic-modal[open] {
    animation: modal-in 0.25s ease-out;
}
