@font-face {
    font-family: 'Avenir';
    src: url('../assets/fonts/Avenir.ttc') format('truetype');
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;
    font-family: 'Avenir', 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
    --sidebar-width: clamp(34px, 5vw, 57px);
    --school-panel-width: min(25vw, 256px);
    --ensa-blue: #001c8d;
    --ensa-white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at top, #1b2735 0%, #090a0f 60%, #000 100%);
    color: #fff;
}

.sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    padding-bottom: 28px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ensa-blue);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    z-index: 950;
    pointer-events: auto;
}

.sidebar>* {
    border-bottom: 1px solid rgba(255, 255, 255, 0.464);
    cursor: pointer;
}

.sidebar__logo {
    width: 100%;
    background: none;
    display: grid;
    place-items: center;
    margin: 0 auto;
    padding: 18px 0;
    border-top: none;
    color: inherit;
    border-left: none;
    border-right: none;
}

.sidebar__icon {
    width: 40px;
    height: 40px;
    color: var(--ensa-white);
    background-color: currentColor;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: 72%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: 72%;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.sidebar__icon--logo {
    mask-image: url('../assets/images/svg/picto_menu_ensa.svg');
    -webkit-mask-image: url('../assets/images/svg/picto_menu_ensa.svg');
}

.sidebar__icon--list {
    mask-image: url('../assets/images/svg/picto_menu_liste.svg');
    -webkit-mask-image: url('../assets/images/svg/picto_menu_liste.svg');
}

.sidebar__logo.is-active,
.sidebar__list.is-active {
    background: var(--ensa-white);
}

.sidebar__logo.is-active .sidebar__icon,
.sidebar__list.is-active .sidebar__icon {
    background-color: var(--ensa-blue);
    color: var(--ensa-blue);
}

.sidebar__logo.is-active,
.sidebar__list.is-active .sidebar__list-summary {
    color: var(--ensa-blue);
}

.sidebar__list {
    color: inherit;
    padding: 18px 0;
}

.sidebar__list-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0px 4px;
    width: 100%;
}

.sidebar__list-summary::-webkit-details-marker {
    display: none;
}

.sidebar__list-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100%;
    flex: 1;
    overflow: hidden;
}

.sidebar__list-items {
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sidebar__list-item.is-hidden {
    display: none;
}

.sidebar__list-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.sidebar__list-button:is(:hover, :focus-visible) {
    background: rgb(255 255 255);
    /* box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08); */
}

.sidebar__list-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 28, 141, 0.25);
}

.sidebar__list-item.is-active .sidebar__list-button {
    background: rgba(0, 28, 141, 0.12);
    border-color: rgba(0, 28, 141, 0.32);
}

.sidebar__list-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex: 0 0 20px;
    background-image: url('../assets/images/png/ensa_points.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.sidebar__list-label {
    flex: 1;
    line-height: 1.35;
}

.sidebar__list-empty {
    padding: 0;
    color: rgba(0, 28, 141, 0.6);
    font-size: 13px;
}

.school-panel {
    position: absolute;
    top: 0;
    left: var(--sidebar-width);
    width: var(--school-panel-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgb(255 255 255 / 90%);
    color: #000000;
    box-shadow: 20px 0 40px rgba(0, 0, 0, 0.28);
    transform: translateX(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease;
    z-index: 940;
}

@media (max-width: 768px) {
    .school-panel {
        width: 75vw;
    }
}

.home-panel {
    position: absolute;
    top: 0;
    left: var(--sidebar-width);
    width: var(--school-panel-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    box-shadow: 20px 0 40px rgba(0, 0, 0, 0.28);
    transform: translateX(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease;
    z-index: 920;
    background: rgb(255 255 255 / 90%);
}

.home-panel.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.home-panel__inner {
    position: relative;
    display: grid;
    padding: 10vh 0 3vh;
    align-items: start;
    justify-items: center;
    gap: 3%;
}

.home-panel__logo {
    width: 80%;
}

.home-panel_text {
    width: 80%;
    color: #000000;
}

.school-panel.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.school-panel__inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10vh 0 3vh;
    gap: 20px;
    height: 100%;
}

.school-panel__search {
    padding: 0 9%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel-close {
    position: absolute;
    top: 12px;
    right: -8%;
    width: 2em;
    height: 2em;
    border-radius: 50%;
    border: none;
    background: var(--ensa-blue);
    color: var(--ensa-white);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.panel-close:focus-visible {
    outline: 2px solid var(--ensa-white);
    outline-offset: 2px;
}

.school-panel__search-label {
    font-size: 0.8em;
    text-transform: uppercase;
}

.school-panel__search-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 25px;
    border: 1px solid #2226a4;
    background: rgb(255 255 255);
    color: #000000;
    font-size: 15px;
    transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.school-panel__search-input::placeholder {
    color: rgba(0, 28, 141, 0.55);
}

.school-panel__search-input:focus {
    outline: none;
    border-color: rgba(0, 28, 141, 0.4);
    background: rgba(0, 28, 141, 0.12);
    box-shadow: 0 0 0 2px rgba(0, 28, 141, 0.14);
}

.school-panel__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar__list-items::-webkit-scrollbar {
    width: 6px;
}

.sidebar__list-items::-webkit-scrollbar-thumb {
    background: rgba(0, 28, 141, 0.22);
    border-radius: 999px;
}

.sidebar__list-items::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar__icon {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 30px;
    color: var(--ensa-white);
    background-color: currentColor;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: 72%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: 72%;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.sidebar__icon::before,
.sidebar__icon::after {
    content: none !important;
}


.sidebar__icon--list::after {
    display: none;
}

.sidebar__icon--info::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid currentColor;
}

.sidebar__icon--info::after {
    content: 'i';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: currentColor;
}

.sidebar__icon-button--info {
    margin-top: 0;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#globeViz {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
}

.tooltip {
    color: #000;
    position: fixed;
    min-width: 25%;
    max-width: 32%;
    max-height: 60vh;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: 0.01em;
    transform: translate(-50%, 0) scale(0.97);
    transform-origin: 50% 50%;
    pointer-events: none;
    overflow-y: auto;
    opacity: 0;
    z-index: 1000;
}

.tooltip strong {
    font-size: 1.2rem;
}

.tooltip.visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.04);
    pointer-events: auto;
}

.tooltip--below {
    transform: translate(-50%, 0) scale(0.97);
    transform-origin: 50% 0%;
}

.tooltip--below.visible {
    transform: translate(-50%, 0) scale(1.04);
}

.tooltip__line,
.tooltip__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tooltip__link {
    color: var(--ensa-blue);
    text-decoration: none;
}

.tooltip__link:hover,
.tooltip__link:focus-visible {
    text-decoration: underline;
}

.tooltip__icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-block;
    background-color: currentColor;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
}

.tooltip__icon--link {
    mask-image: url('../assets/images/svg/ensa-link-icon.svg');
    -webkit-mask-image: url('../assets/images/svg/ensa-link-icon.svg');
}

.tooltip__icon--city {
    mask-image: url('../assets/images/svg/ensa-location-icon.svg');
    -webkit-mask-image: url('../assets/images/svg/ensa-location-icon.svg');
}

.tooltip__tag-list {
    margin-top: 22px;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 180px;
    overflow-y: auto;
}

.tooltip__tag-block .tag {
    display: inline-block;
}

.tag--bullet {
    position: relative;
    padding-left: 14px;
}

.tag--bullet::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ensa-blue);
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.tooltip__tag-desc {
    font-size: 14px;
    line-height: 1.45;
}

.tooltip__tag-list::-webkit-scrollbar {
    width: 6px;
}

.tooltip__tag-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
}

.tooltip.error {
    background: rgba(134, 25, 25, 0.92);
}

/* .tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 12px;
    height: 12px;
    background: rgb(255 255 255);
    transform: translate(-50%, 0) rotate(45deg);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
} */

.tooltip--below::after {
    top: -8px;
    bottom: auto;
}

@media (max-width: 768px) {
    .tooltip {
        font-size: 14px;
        padding: 16px 20px;
        min-width: 160px;
    }
}

.noscript-warning {
    position: absolute;
    top: 24px;
    left: 24px;
    max-width: 320px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
}

.tag-filter-bar {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 12px 24px;
    border-radius: 999px;
    background: rgba(4, 7, 13, 0.78);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    z-index: 900;
    width: 100vw;
}

.tag-filter-button {
    --tag-color: var();
    --tag-color: var(--ensa-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 22px;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.04);
    color: #f5f7ff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease, border-color 200ms ease, color 200ms ease;
}

/* INDICATEUR */

.tag-filter-indicator {
    position: relative;
    width: 22px;
    height: 22px;
    pointer-events: none;
    flex: 0 0 auto;
    align-self: center;
}

/* cercle extÃ©rieur */
.tag-filter-indicator__outer {
    position: absolute;
    inset: 0;
    /* top: 0; right: 0; bottom: 0; left: 0; */
    border-radius: 50%;
    background-image: url('../assets/images/png/ensa_points.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 2px 8px rgba(10, 13, 22, 0.4);
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.tag-filter-label {
    pointer-events: none;
}

.tag-filter-button:is(:hover, :focus-visible) {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.35);
}

.tag-filter-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 12px 24px rgba(0, 0, 0, 0.35);
}

.tag-filter-button.is-active {
    background: var(--tag-color);
    /* color: #0a0d16; */
    border-color: var(--tag-color);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: clamp(42px, 11vw, 56px);
    }

    .sidebar {
        width: var(--sidebar-width);
        padding: 10px 0;
        /* gap: 8px; */
        background: linear-gradient(180deg, #1627a8 0%, #0b135c 100%);
        border-right: 1px solid rgba(255, 255, 255, 0.16);
    }

    .sidebar>* {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .sidebar__list {
        padding: 0;
    }

    .sidebar__logo,
    .sidebar__list-summary {
        padding: 12px 0;
    }

    .sidebar__icon {
        width: 24px;
        height: 24px;
    }

    .sidebar__list-items {
        max-height: calc(100vh - 240px);
    }

    .tag-filter-bar {
        left: var(--sidebar-width);
        bottom: 24px;
        transform: none;
        flex-direction: column;
        align-items: center;
        width: calc(100vw - var(--sidebar-width));
        padding: 0;
        gap: 10px;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .tag-filter-button {
        justify-content: flex-start;
        gap: 10px;
        padding: 8px 14px;
        min-height: 36px;
        font-size: 1rem;
        letter-spacing: 0.08em;
        border-color: rgba(255, 255, 255, 0.6);
        background: rgba(7, 16, 36, 0.7);
    }

    .tag-filter-indicator {
        width: 18px;
        height: 18px;
    }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(27, 39, 53, 0.95) 0%, rgba(9, 10, 15, 0.98) 60%, rgba(0, 0, 0, 0.98) 100%);
    z-index: 1200;
    transition: opacity 240ms ease, visibility 240ms ease;
}

.loading-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-overlay__card {
    display: grid;
    gap: 12px;
    padding: 24px 28px;
    border-radius: 16px;
    background: rgba(7, 16, 36, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    text-align: center;
    min-width: min(320px, 80vw);
}

.loading-overlay__spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.9);
    animation: globe-spin 1s linear infinite;
    margin: 0 auto;
}

.loading-overlay__title {
    margin: 0;
    font-size: 16px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.loading-overlay__hint {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}

@keyframes globe-spin {
    to {
        transform: rotate(360deg);
    }
}