/**
 * Styles front-end pour BZP Maps [bzp-maps]
 * Inclut la carte Leaflet et la Timeline native BZP (style Journal de presse).
 */

.bzp-map-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    margin: 2rem 0;
    position: relative;
    box-sizing: border-box;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--color-border, #dcdcdc);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
    background: var(--color-bg, #ffffff);
}

/* Mode combiné (type="both") : empilé verticalement (carte 55% en haut, timeline 45% en bas) */
.bzp-map--both {
    flex-direction: column;
    min-height: 760px;
}

.bzp-map--both .bzp-panel-map {
    flex: 0 0 54%;
    width: 100%;
    min-height: 360px;
    border-bottom: 1px solid var(--color-border, #dcdcdc);
}

.bzp-map--both .bzp-panel-timeline {
    flex: 1 1 46%;
    width: 100%;
    min-height: 320px;
}

.bzp-map--map .bzp-panel-map,
.bzp-map--timeline .bzp-panel-timeline {
    flex: 1 1 100%;
    width: 100%;
    height: 100%;
}

.bzp-frontend-map {
    width: 100%;
    height: 100%;
    min-height: 360px;
    background: #e5e3df;
}

.bzp-frontend-timeline {
    width: 100%;
    height: 100%;
    min-height: 320px;
    background: var(--color-bg, #ffffff);
}

.bzp-timeline-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    color: var(--color-ink-muted, #595959);
    font-size: 14px;
}

/* ==========================================================================
   MARQUEURS CARTE & SURBRILLANCE ACTIVE
   ========================================================================== */

.bzp-step-marker,
.bzp-pin-marker {
    background: transparent;
    border: none;
}

.bzp-pin-marker svg {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
    transition: transform 0.18s ease;
}

.bzp-pin-marker:hover svg {
    transform: scale(1.14);
}

.bzp-phare-icon {
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    padding: 2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
    transition: opacity 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Quand un marqueur est sélectionné, estomper légèrement les autres pour qu'il ressorte immédiatement */
.bzp-has-active-marker .leaflet-marker-icon:not(.bzp-marker--active) {
    opacity: 0.55;
}

.bzp-has-active-marker .leaflet-marker-icon:not(.bzp-marker--active):hover {
    opacity: 0.95;
}

@keyframes bzp-marker-pulse {
    0% {
        box-shadow:
            0 0 0 3px #ffffff,
            0 0 0 7px #d97706,
            0 0 0 11px rgba(217, 119, 6, 0.45),
            0 6px 16px rgba(0, 0, 0, 0.45);
    }

    70% {
        box-shadow:
            0 0 0 3px #ffffff,
            0 0 0 7px #d97706,
            0 0 0 22px rgba(217, 119, 6, 0),
            0 6px 16px rgba(0, 0, 0, 0.45);
    }

    100% {
        box-shadow:
            0 0 0 3px #ffffff,
            0 0 0 7px #d97706,
            0 0 0 11px rgba(217, 119, 6, 0),
            0 6px 16px rgba(0, 0, 0, 0.45);
    }
}

/* Marqueur Phare actif : agrandi sans écraser le transform translate3d de Leaflet + double halo ambre pulsant */
.leaflet-marker-icon.bzp-phare-icon.bzp-marker--active {
    width: 40px !important;
    height: 40px !important;
    margin-left: -20px !important;
    margin-top: -20px !important;
    padding: 4px;
    background: #fef3c7;
    opacity: 1 !important;
    z-index: 2000 !important;
    animation: bzp-marker-pulse 1.8s infinite;
}

/* Marqueur Pin SVG actif */
.leaflet-marker-icon.bzp-pin-marker.bzp-marker--active {
    opacity: 1 !important;
    z-index: 2000 !important;
}

.leaflet-marker-icon.bzp-pin-marker.bzp-marker--active svg {
    transform: scale(1.38);
    transform-origin: bottom center;
    filter: drop-shadow(0 0 3px #ffffff) drop-shadow(0 0 8px #d97706) drop-shadow(0 5px 10px rgba(0, 0, 0, 0.45));
}

.bzp-step-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #0073aa;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.bzp-step-pin span {
    transform: rotate(45deg);
}

.bzp-step-marker:hover .bzp-step-pin,
.bzp-marker--active .bzp-step-pin {
    background: #d97706;
    transform: rotate(-45deg) scale(1.32);
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 7px rgba(217, 119, 6, 0.45), 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Tooltip discret sur la carte (mode both) */
.leaflet-tooltip.bzp-map-tooltip {
    background: var(--color-ink, #111111);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-family: var(--font-heading, system-ui, sans-serif);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.leaflet-tooltip-top.bzp-map-tooltip::before {
    border-top-color: var(--color-ink, #111111);
}

/* ==========================================================================
   INFOWINDOW VERTICALE LÉGÈRE (PHOTO CLIQUABLE + TITRE CLIQUABLE)
   ========================================================================== */

.bzp-leaflet-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 7px;
    border: 1px solid var(--color-border, #dcdcdc);
    background: var(--color-bg, #ffffff);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}

.bzp-leaflet-popup .leaflet-popup-content {
    margin: 0 !important;
    width: 175px !important;
    font-family: var(--font-body, system-ui, sans-serif);
    line-height: 1.25;
}

.bzp-leaflet-popup .leaflet-popup-tip {
    width: 11px;
    height: 11px;
    background: var(--color-bg, #ffffff);
    border: 1px solid var(--color-border, #dcdcdc);
}

.bzp-popup-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--color-bg, #ffffff);
}

.bzp-popup-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 115px;
    background: var(--color-surface-alt, #f2f2f2);
    border-bottom: 1px solid var(--color-border-light, #eaeaea);
    overflow: hidden;
    text-decoration: none;
}

.bzp-popup-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease;
}

a.bzp-popup-media:hover img {
    transform: scale(1.04);
}

.bzp-popup-title {
    margin: 0;
    padding: 8px 10px 9px;
    font-family: var(--font-editorial, Georgia, serif);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    color: var(--color-ink, #111111);
}

.bzp-popup-title a {
    color: var(--color-ink, #111111);
    text-decoration: none;
    transition: color 0.15s ease;
}

.bzp-popup-title a:hover {
    color: var(--color-ocean, #0a4d8c);
}

/* ==========================================================================
   TIMELINE NATIVE BZP — STYLE JOURNAL DE PRESSE
   ========================================================================== */

.bzp-tl-native {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    background: var(--color-bg, #ffffff);
    color: var(--color-ink-soft, #2c2c2c);
    font-family: var(--font-body, system-ui, sans-serif);
    outline: none;
}

/* 1. Scène principale (flèche gauche + carte fiche + flèche droite) */
.bzp-tl-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px 12px;
}

.bzp-tl-nav {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border, #dcdcdc);
    background: var(--color-bg, #ffffff);
    color: var(--color-ink, #111111);
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.bzp-tl-nav:hover:not(:disabled) {
    background: var(--color-ink, #111111);
    color: #ffffff;
    border-color: var(--color-ink, #111111);
}

.bzp-tl-nav:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Grille de la slide : photo à gauche + éditorial à droite (aucune image rognée) */
.bzp-tl-slide {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 22px;
    align-items: center;
    max-width: 980px;
    margin: 0 auto;
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1), transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

/* États de transition directionnelle entre 2 événements */
.bzp-tl-slide.is-leaving-left {
    opacity: 0;
    transform: translate3d(-28px, 0, 0);
    transition-duration: 0.16s;
}

.bzp-tl-slide.is-leaving-right {
    opacity: 0;
    transform: translate3d(28px, 0, 0);
    transition-duration: 0.16s;
}

.bzp-tl-slide.is-entering-right {
    opacity: 0;
    transform: translate3d(28px, 0, 0);
    transition: none;
}

.bzp-tl-slide.is-entering-left {
    opacity: 0;
    transform: translate3d(-28px, 0, 0);
    transition: none;
}

.bzp-tl-media {
    width: 200px;
    height: 175px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--color-surface-alt, #f2f2f2);
    border: 1px solid var(--color-border-light, #eaeaea);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bzp-tl-media-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.bzp-tl-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.25s ease;
}

.bzp-tl-media-link:hover .bzp-tl-img {
    transform: scale(1.04);
}

.bzp-tl-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.bzp-tl-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bzp-tl-date-pill {
    display: inline-block;
    background: var(--color-ink, #111111);
    color: #ffffff;
    font-family: var(--font-heading, system-ui, sans-serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 10px;
    border-radius: 3px;
}

.bzp-tl-counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-ink-muted, #595959);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bzp-tl-title {
    margin: 0;
    font-family: var(--font-editorial, Georgia, serif);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    line-height: 1.2;
    color: var(--color-ink, #111111);
}

.bzp-tl-title a {
    color: inherit;
    text-decoration: none;
}

.bzp-tl-title a:hover {
    color: var(--color-ocean, #0a4d8c);
}

/* Badges des caractéristiques clés (Commune, Hauteur, Portée...) */
.bzp-tl-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bzp-tl-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    background: var(--color-surface-alt, #f2f2f2);
    border: 1px solid var(--color-border, #dcdcdc);
    border-radius: 4px;
    padding: 2px 9px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--color-ink-soft, #2c2c2c);
}

.bzp-tl-badge-label {
    color: var(--color-ink-muted, #595959);
}

.bzp-tl-badge-val {
    color: var(--color-ink, #111111);
    font-weight: 700;
}

.bzp-tl-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--color-ink-soft, #2c2c2c);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bzp-tl-actions {
    margin-top: 2px;
}

.bzp-tl-cta {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-heading, system-ui, sans-serif);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-ocean, #0a4d8c);
    text-decoration: none;
    border-bottom: 1.5px solid currentColor;
    padding-bottom: 1px;
}

.bzp-tl-cta:hover {
    color: var(--color-ink, #111111);
}

/* 2. Ruban chronologique horizontal (bas de la timeline) */
.bzp-tl-track-bar {
    flex: 0 0 auto;
    background: var(--color-surface, #fafafa);
    border-top: 1px solid var(--color-border, #dcdcdc);
    padding: 8px 14px 10px;
}

.bzp-tl-track {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    padding-bottom: 4px;
}

.bzp-tl-node {
    position: relative;
    flex: 0 0 auto;
    min-width: 88px;
    max-width: 130px;
    padding: 4px 8px 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* Ligne horizontale continue reliant les points */
.bzp-tl-node::before {
    content: "";
    position: absolute;
    top: 26px;
    left: -4px;
    right: -4px;
    height: 2px;
    background: var(--color-border, #dcdcdc);
    z-index: 0;
}

.bzp-tl-node:first-child::before {
    left: 50%;
}

.bzp-tl-node:last-child::before {
    right: 50%;
}

.bzp-tl-node-year {
    font-family: var(--font-heading, system-ui, sans-serif);
    font-size: 11px;
    font-weight: 700;
    color: var(--color-ink-muted, #595959);
    line-height: 1.1;
}

.bzp-tl-node-dot {
    position: relative;
    z-index: 1;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--color-ink-muted, #595959);
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.bzp-tl-node-label {
    width: 100%;
    font-size: 11px;
    line-height: 1.2;
    color: var(--color-ink-soft, #2c2c2c);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bzp-tl-node:hover {
    background: var(--color-surface-alt, #f2f2f2);
}

.bzp-tl-node.is-active {
    background: #ffffff;
    border-color: var(--color-ink, #111111);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.bzp-tl-node.is-active .bzp-tl-node-year {
    color: var(--color-ink, #111111);
    font-size: 12px;
}

.bzp-tl-node.is-active .bzp-tl-node-dot {
    background: var(--color-ocean, #0a4d8c);
    border-color: var(--color-ocean, #0a4d8c);
    transform: scale(1.3);
}

.bzp-tl-node.is-active .bzp-tl-node-label {
    color: var(--color-ink, #111111);
    font-weight: 700;
}

/* ==========================================================================
   RESPONSIVE MOBILE / TABLETTE
   ========================================================================== */

@media (max-width: 720px) {
    .bzp-map--both {
        min-height: 820px;
    }

    .bzp-tl-stage {
        padding: 12px 10px 8px;
        gap: 6px;
    }

    .bzp-tl-nav {
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .bzp-tl-slide {
        grid-template-columns: 110px 1fr;
        gap: 12px;
    }

    .bzp-tl-media {
        width: 110px;
        height: 120px;
    }

    .bzp-tl-title {
        font-size: 1.15rem;
    }

    .bzp-tl-desc {
        -webkit-line-clamp: 2;
        font-size: 13px;
    }
}