@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');

/* ================================================================
   Téléphone Interactif — styles scopés dans .tel-interactif-wrapper
   ================================================================ */

.tel-interactif-wrapper {
    font-family: 'Noto Sans', sans-serif;
    overflow-x: hidden;
    width: 100%;
}

.tel-interactif-wrapper * {
    box-sizing: border-box;
    font-family: 'Noto Sans', sans-serif;
    margin: 0;
    padding: 0;
}

.tel-interactif-wrapper #container {
    display: flex;
    width: 100%;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    /*gap: 2rem;*/
    min-height: unset;
    overflow: hidden;
}

.tel-interactif-wrapper #container:has(#elementsDisplay:empty) {
    justify-content: center;
}

.tel-interactif-wrapper #container:has(#elementsDisplay:not(:empty)) {
    justify-content: center;
    align-items: flex-start;
}

.tel-interactif-wrapper #phoneSection {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
}

.tel-interactif-wrapper #phoneContainer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 400px;
    height: 480px;
}

.tel-interactif-wrapper #phoneContainer.phone-open {
    height: 750px;
}

.tel-interactif-wrapper #click-me {
    position: absolute;
    top: 45%;
    left: 25%;
    color: black;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    border: 2px black solid;
    padding: 5px 10px;
    cursor: none;
    pointer-events: none;
    z-index: 9999;
    background-color: white;
}

.tel-interactif-wrapper #elementsDisplay {
    flex: 0 0 auto;
    max-width: 480px;
    width: 480px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0 1rem;
}

.tel-interactif-wrapper #infoPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999999;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16vh 1rem 2rem;
    -webkit-overflow-scrolling: touch;
}

.tel-interactif-wrapper .infoPopupInner {
    position: relative;
    width: min(900px, 92vw);
    overflow: visible;
    background: #111;
    color: white;
    padding: 1rem;
    margin: auto;
    box-sizing: border-box;
}

.tel-interactif-wrapper .infoPopupContent {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 1.5rem;
}

.tel-interactif-wrapper .infoPopupControls {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 999999;
    background: transparent;
    margin-bottom: 0.5rem;
}

.tel-interactif-wrapper .infoPopupImage {
    max-width: min(400px, 100%);
    max-height: 450px;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.tel-interactif-wrapper .infoPopupImageContainer {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
    position: relative;
    width: 100%;
}

.tel-interactif-wrapper .infoPopupElements {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tel-interactif-wrapper .infoPopupTexts {
    color: white;
    width: 100%;
    max-width: 700px;
    text-align: center;
}

.tel-interactif-wrapper .infoPopupTitle > p:first-child {
    color: orange;
    font-size: 1.4rem;
}

.tel-interactif-wrapper .infoPopupTitle > p:last-child {
    margin-bottom: 2rem;
}

.tel-interactif-wrapper .infoPopupClose {
    background-color: #ffffff;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.tel-interactif-wrapper .infoPopupClose:hover > img {
    opacity: 0.5;
}

.tel-interactif-wrapper .infoPopupCloseButton {
    background: #fff;
    border: 0;
    padding: .5rem;
    cursor: pointer;
}

.tel-interactif-wrapper .infoPopupCloseButton:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: 3px;
}

.tel-interactif-wrapper .layer > img {
    position: absolute;
    width: 90%;
    pointer-events: none;
}

.tel-interactif-wrapper .layer {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 400px;
    height: 1px;
    background: transparent;
    border: 0;
    padding: 0;
    appearance: none;
}

.tel-interactif-wrapper #phoneContainer:not(.phone-open) .layer:first-of-type {
    height: 480px;
}

.tel-interactif-wrapper .layer:focus {
    outline: none !important;
    box-shadow: none !important;
}

.tel-interactif-wrapper .layer::-moz-focus-inner {
    border: 0;
}

.tel-interactif-wrapper .layer:focus-visible,
.tel-interactif-wrapper .layer.force-focus-ring {
    outline: 3px solid #0a84ff !important;
    outline-offset: 8px;
    box-shadow: none !important;
}

.tel-interactif-wrapper .layer-inactive {
    pointer-events: none;
}

.tel-interactif-wrapper .chemicalElement {
    flex-shrink: 0;
    height: 100px;
    width: 100px;
    padding: 4px;
    color: #111;
    background-color: white;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    border: 1px solid black;
}

.tel-interactif-wrapper .chemicalElement-display {
    cursor: pointer;
}

.tel-interactif-wrapper .chemicalElement-display:hover {
    filter: invert();
}

.tel-interactif-wrapper .chemicalElement-display:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: 3px;
}

.tel-interactif-wrapper .chemicalElement-display,
.tel-interactif-wrapper .layer-active {
    transition: transform .2s ease, filter .2s ease;
}

.tel-interactif-wrapper .elementInfos {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    border: white solid 1px;
    height: 100%;
    font-size: .7rem;
}

.tel-interactif-wrapper .atomicSymbol {
    font-size: 2rem;
    font-weight: bold;
    margin-top: -.5rem;
}

.tel-interactif-wrapper .atomicNumber {
    text-align: left;
    width: 100%;
    padding-left: .4rem;
}

.tel-interactif-wrapper .atomicName {
    margin-top: -.5rem;
}

.tel-interactif-wrapper .infoBox {
    position: relative;
    width: 100%;
    flex-direction: column;
    justify-content: center;
    flex-wrap: wrap;
}

.tel-interactif-wrapper .infoBoxTitle {
    text-align: center;
    margin-bottom: 10px;
    margin-top: 10px;
    font-size: 32px;
}

.tel-interactif-wrapper .infoBoxElements {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tel-interactif-wrapper .selectedLayer img {
    filter: grayscale(100%);
    transform: scale(1.2);
}

.tel-interactif-wrapper .layer-active img:hover {
    transform: scale(1.2);
}

.tel-interactif-wrapper .imgLayer {
    margin: auto;
    max-width: 100%;
    height: auto;
    display: block;
}

.tel-interactif-wrapper .sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tel-interactif-wrapper .infoBox[hidden],
.tel-interactif-wrapper #infoPopup[hidden] {
    display: none !important;
}

.tel-interactif-wrapper #openPhoneButton {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    color: transparent;
    cursor: pointer;
    z-index: 10000;
}

.tel-interactif-wrapper #openPhoneButton:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: 6px;
}

.tel-interactif-wrapper .layer:focus-visible img {
    outline: none;
}

@keyframes tel-pulse {
    from  { transform: scale3d(1, 1, 1); }
    50%   { transform: scale3d(1.05, 1.05, 1.05); }
    to    { transform: scale3d(1, 1, 1); }
}

.tel-interactif-wrapper .pulse {
    animation-name: tel-pulse;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-duration: 2s;
}

body.dialog-open {
    overflow: hidden;
}

/* Force le header Divi à passer sous le popup */
body.dialog-open #main-header,
body.dialog-open #main-header-bar,
body.dialog-open .et-fixed-header,
body.dialog-open #top-header,
body.dialog-open #wpadminbar {
    z-index: 1 !important;
}

@media (max-width: 840px) {

    .tel-interactif-wrapper #container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
        min-height: unset;
    }

    .tel-interactif-wrapper #phoneSection {
        width: 100%;
    }

    .tel-interactif-wrapper #elementsDisplay {
        width: 100%;
        max-width: 100%;
        padding: 0 0.5rem 1rem;
    }

    .tel-interactif-wrapper .infoPopupImageContainer:has(.mineral) {
        flex-direction: column;
    }

    .tel-interactif-wrapper .infoPopupTexts {
        text-align: center;
        width: 100%;
    }
}

#layerHint {
    text-align: center;
    font-size: 0.95rem;
    color: #555;
    padding: 0.6rem 1.2rem;
    background: #fff;
    border-left: 3px solid #333;
    margin: 0.75rem auto;
    border-radius: 2px;
    max-width: 400px;
    width: 100%;
    animation: fadeInHint 0.4s ease;
}

@media (max-width: 600px) {
    #layerHint {
        margin: 0.5rem auto;
        width: 90%;
        font-size: 0.85rem;
    }
}

@keyframes fadeInHint {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {

    .tel-interactif-wrapper #container {
        flex-direction: column;
        height: auto;
        min-height: min(120vw, 480px);
        justify-content: flex-start;
        align-items: center;
        padding: 0;
        gap: 0;
    }

    .tel-interactif-wrapper #phoneSection {
        width: 100%;
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .tel-interactif-wrapper #phoneContainer {
        width: 100%;
        max-width: 400px;
        height: min(120vw, 480px) !important;
    }

    .tel-interactif-wrapper #phoneContainer.phone-open {
        height: auto !important;
        min-height: min(200vw, 800px) !important;
    }

    .tel-interactif-wrapper .layer {
        width: 90%;
        max-width: 400px;
    }

    .tel-interactif-wrapper #phoneContainer:not(.phone-open) .layer:first-of-type {
        height: min(120vw, 480px);
    }

    .tel-interactif-wrapper #click-me {
        top: 1rem;
        left: 50%;
        transform: translateX(-50%);
    }

    .tel-interactif-wrapper #elementsDisplay {
        width: 100%;
        max-width: 100%;
        padding: 0 0.5rem 1rem;
        box-sizing: border-box;
        min-height: unset;
        height: auto;
        flex: 0 0 auto;
        justify-content: flex-start;
        z-index: 1;
        position: relative;
    }

    .tel-interactif-wrapper .infoBox {
        width: 100%;
        box-sizing: border-box;
    }

    .tel-interactif-wrapper .infoBoxElements {
        width: 100%;
        box-sizing: border-box;
        gap: 0.2rem;
        justify-content: center;
    }

    .tel-interactif-wrapper .chemicalElement {
        width: calc(31vw - 1rem);
        height: calc(31vw - 1rem);
        flex-shrink: 1;
        min-width: 0;
        font-size: 0.6rem;
    }

    .tel-interactif-wrapper .atomicSymbol {
        font-size: 1.3rem;
    }

    .tel-interactif-wrapper .infoBoxTitle {
        font-size: 1.2rem;
        margin: 0.3rem 0;
    }

    .tel-interactif-wrapper .imgLayer {
        display: none;
    }

    .tel-interactif-wrapper .infoPopupContent {
        flex-direction: column;
        align-items: center;
    }

    .tel-interactif-wrapper .infoPopupImageContainer {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .tel-interactif-wrapper .infoPopupDescription {
        padding-left: .5rem;
        padding-right: .5rem;
    }

    .tel-interactif-wrapper #infoPopup {
        padding-top: 4rem;
        padding-bottom: 4rem;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}