/* Plugin "Carte des implantations" (Templates/Implantation/Map.html).
   Valeurs alignées sur les tokens de tc_theme (_variables.scss), dupliquées
   ici en CSS brut faute de build scss pour ce package. */

:root {
    --color-primary: #660F28;
    --color-secondary: #EEE7DD;
    --color-secondary-light: #F8F5F1;
    --color-dark: #3b3b3b;
    --color-black: #000;
    --color-white: #fff;
}

.frame-type--tcimplantations_map header {
    margin: 0;
}

.frame-type--tcimplantations_map > .container {
    max-width: 100%;
    width: 100%;
}

.implantation-map-section {
    padding-block: 64px 0;
}

.implantation-map {
    --implantation-map-border: #1a1a1a;
    --implantation-map-muted: #6b6b6b;
}

.implantation-map__stage {
    position: relative;

    height: 362px;
}

@media screen and (min-width: 768px) {
    .implantation-map__stage {
        height: 610px;
    }
}
@media screen and (min-width: 1080px) {
    .implantation-map__stage {
        height: 760px;
    }
}

.implantation-map__canvas {
    position: relative;
    max-width: 610px;
    margin-inline: auto;
    margin-right: -154px;

    overflow: hidden;
}

@media screen and (min-width: 768px) {
    .implantation-map__canvas {
        max-width: 860px;
        margin-right: -220px;
    }
}
@media screen and (min-width: 1080px) {
    .implantation-map__canvas {
        margin-right: -348px;

        max-width: 1325px;
    }
}
@media screen and (min-width: 1300px) {
    .implantation-map__canvas {
        margin-right: -220px;
    }
}
@media screen and (min-width: 1680px) {
    .implantation-map__canvas {
        margin-right: 0;
    }
}

.implantation-map__canvas > svg {
    display: block;
    width: 100%;
    height: auto;
}

.implantation-map__point {
    cursor: pointer;
}

/* Marqueur : pictogramme du type, à droite ou à gauche du point.
   left/top (centre du point) et --implantation-point-offset sont posés par le JS. */
.implantation-map__marker {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 2px;

    color: #1a1a1a;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0);
    border-radius: 0;
    cursor: pointer;

    width: 32px;
    height: 32px;

    transition: background-color 0.2s ease, color 0.2s ease, border 0.2 ease-in;
}

.implantation-map__marker--right {
    transform: translate(calc(var(--implantation-point-offset, 4px) + 6px), -50%);
}

.implantation-map__marker--left {
    transform: translate(calc(-100% - var(--implantation-point-offset, 4px) - 6px), -50%);
}

.implantation-map__marker:hover {
    border-color: var(--color-black);

    transition: border 0.2 ease-in;;
}

.implantation-map__marker.is-active {
    color: #ffffff;
    background: #000;
}

.implantation-map__marker:focus-visible {
    outline: 2px solid rgba(40, 40, 40, 0.25);
    outline-offset: 2px;
}

@media screen and (min-width: 768px) {
    .implantation-map__marker {
        width: 55px;
        height: 55px;
    }
}

.implantation-type-icon {
    display: block;
    flex-shrink: 0;

    /* width: auto;
    min-width: 30px;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    min-height: 24px; */

    transform: scale(0.8);
}

@media screen and (min-width: 768px) {
    .implantation-type-icon {
        height: auto;
        max-height: 24px;
        max-width: 31px;

        transform: none;
    }
}

/* Encart de l'implantation active */
.implantation-map__cards {
    position: absolute;
    top: calc(100% - 28px);
    left: 18px;
    z-index: 4;
    
    padding: 0;

    width: calc(100% - 36px);
}

/* Desktop : l'encart se superpose à la carte, en haut à gauche */
@media (min-width: 992px) {
    .implantation-map__cards {
        display: flex;
        flex-direction: column;
        justify-content: center;
        top: 0;
        left: max(24px, calc((100% - 1200px) / 2));
        
        width: 330px;
        height: 100%;
    }
}

.implantation-map__card {
    max-width: 100%;
    width: 100%;
    margin-inline: auto;

    background: var(--color-white);
    border: 1px solid var(--color-black);
}

@media (min-width: 992px) {
    .implantation-map__card {
        max-width: 330px;
    }
}

.implantation-map__card-header {
    display: flex;
    align-items: center;
    gap: 2rem;

    padding: 15px 20px;
    margin: 0;
    border-bottom: 1px solid var(--color-black);
}

@media screen and (min-width: 992px) {
    .implantation-map__card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;

        padding: 25px;
    }
}

.implantation-map__card-header-infos {
    line-height: 1.25;
}

.implantation-map__card-title {
    margin: 0;

    font-size: 2rem;
    line-height: 1.2;
    text-transform: uppercase;
}

.implantation-map__card-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    
    width: 200px;
    height: 70px;
}

.implantation-map__card-logo img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
}

.implantation-map__card-city,
.implantation-map__card-surface {
    margin: 0;
}

.implantation-map__card-city {
    font-size: clamp(1.2rem, 1.3vw, 1.6rem);
}

.implantation-map__card-surface {
    font-size: 2rem;
}

.implantation-map__card-infos {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem 2px;

    margin: 0;
    padding: 20px;

    border-bottom: 1px solid var(--implantation-map-border);
}

@media screen and (min-width: 992px) {
    .implantation-map__card-infos {
        gap: 2.8rem;

        padding: 30px;
    }
}

.implantation-map__card-info {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 0 0 48%;

    padding-block: 6px;
}

@media screen and (min-width: 768px) {
    .implantation-map__card-info {
        flex: 0 0 33%;
    }
}
@media screen and (min-width: 992px) {
    .implantation-map__card-info {
        flex: 0 0 100%;
    }
}

.implantation-map__card-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 37px;
    height: 30px;
    flex-shrink: 0;

}

.implantation-map__card-info-icon img {
    display: block;
    width: auto;
    height: auto;
    object-fit: contain;
}

.implantation-map__card-info-text {
    display: flex;
    flex-direction: column;

    line-height: 1.2;
}

.implantation-map__card-info-subtitle {
    font-size: clamp(1rem, 1.1vw, 1.4rem);
}

.implantation-map__card-info-title {
    font-size: clamp(1.2rem, 1.35vw, 1.6rem);
}

.implantation-map__card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;

    width: 100%;
    box-sizing: border-box;

    font-size: 1.4rem;
    color: inherit;
    text-decoration: none;
}

.implantation-map__card-link::after {
    content: '';
    width: 6px;
    height: 6px;
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
    transform: rotate(45deg);
    transition: 0.3s ease-out;
}

.implantation-map__card-link:hover,
.implantation-map__card-link:focus,
.implantation-map__card-link:focus-visible {
    color: var(--color-primary);

    text-decoration: none;
}

.implantation-map__card-link:hover::after {
    transform: translateX(5px) rotate(45deg);
    transition: 0.3s ease-out;
}

.implantation-map__card-link span {
    position: relative;
}

.implantation-map__card-link span::before {
    content: "";
    position: absolute;
    top: calc(100% + 6px);
    left: 0;

    width: 0;
    height: 1px;

    background-color: var(--color-primary);

    transition: 0.3s ease-out;
}

.implantation-map__card-link:hover span::before {
    width: calc(100% + 21px);
}

/* Légende */
.implantation-map__legend {
    position: relative;
    z-index: 2;

    margin: 0;
    padding: 20px 24px;
    background: var(--color-secondary-light);
}

.implantation-map__legend-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 40px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.implantation-map__legend-item {
    display: flex;
    align-items: center;
    gap: 12px;

    font-size: 1.4rem;
}

.implantation-map__legend .implantation-type-icon {
    max-height: 27px;
    max-width: 40px;
}