/* ============================================================
   MAPIRANDO TOPO CSS - VERSION 191.0 (CENTRAGE MOBILE & AVERTISSEMENT SUGGESTION)
   ============================================================ */

/* ============================================================
   ANCIEN CSS (Compatibilité)
   ============================================================ */
.mapi-wrapper { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; max-width: 1000px; margin: 0 auto; padding: 0 20px; position: relative; }

.mapi-header-block { text-align: center; margin-bottom: 40px; margin-top: 30px; }
.mapi-main-title { font-size: 2.2em; color: #2c3e50; margin: 0 0 10px 0; font-weight: 800; line-height: 1.2; text-transform: uppercase; }
.mapi-interest-block { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mapi-hearts { display: flex; justify-content: center; align-items: center; gap: 3px; }
.mapi-desc { font-size: 1.1em; line-height: 1.8; color: #444; margin-bottom: 50px; text-align: justify; }

#mapirando-map { width: 100%; height: 350px; background: #eee; border-radius: 12px; margin-bottom: 30px; border: 1px solid #ddd; }

.mapi-actions-row { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 20px; margin-bottom: 30px; }
.mapi-btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 30px; border-radius: 50px; text-decoration: none; font-weight: bold; font-size: 1em; transition: 0.3s; color: white !important; }
.mapi-btn:hover { transform: translateY(-2px); }
.mapi-btn-dl { background: #27ae60; box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3); }
.mapi-btn-org { background: #df2727; box-shadow: 0 4px 15px rgba(223, 39, 39, 0.3); }

.mapi-form-container { max-width: 800px; margin: 0 auto 60px auto; background: white; padding: 40px; border-radius: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.08); position: relative; z-index: 10; margin-top: -80px; font-family: sans-serif; }
.mapi-inp-group { margin-bottom: 20px; }
.mapi-label { display: block; font-weight: bold; margin-bottom: 8px; color: #2c3e50; }
.mapi-input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; box-sizing: border-box; background: #fcfcfc; }
.mapi-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mapi-submit-btn { width: 100%; background: #000000; color: white; border: none; padding: 15px; font-size: 1.1em; font-weight: bold; border-radius: 50px; cursor: pointer; margin-top: 20px; transition: all 0.2s; }
.mapi-submit-btn:hover { background: #df2727; }
.mapi-hero-simple { height: 350px; width: 100%; background-size: cover; background-position: center; position: relative; }

/* ============================================================
   TOPO SINGLE - ARCHITECTURE HAUT DE GAMME
   ============================================================ */

.mapi-topo-hero {
    width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
    margin-top: -80px; box-sizing: border-box !important;
    min-height: 540px;
    background-size: cover; background-position: center center;
    overflow: hidden; position: relative;
}

.mapi-topo-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.08) 60%, rgba(0,0,0,0.35) 100%);
    z-index: 1;
}

.mapi-topo-content-card {
    max-width: 1100px; margin: -80px auto 80px auto;
    background: white; padding: 45px 50px; border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1); position: relative; z-index: 10;
}

/* Titre + Département dans la card */
.mapi-card-title-row {
    display: flex; justify-content: center; align-items: flex-start;
    margin-bottom: 8px; position: relative;
    padding-right: 80px;
}
.mapi-card-main-title {
    font-size: 2em; font-weight: 800; color: #1e293b;
    text-transform: uppercase; letter-spacing: 1px;
    margin: 0; line-height: 1.15; text-align: center; width: 100%;
}
.mapi-card-dept-badge {
    background: #111; color: #fff; padding: 22px 16px;
    border-radius: 10px; font-weight: 900; font-size: 1.6em;
    line-height: 1; letter-spacing: -1px; flex-shrink: 0;
    min-width: 50px; text-align: center;
    position: absolute; right: 0; top: 0;
}
.mapi-card-location {
    font-size: 0.95em; color: #94a3b8; font-weight: 500;
    margin: 0 0 20px 0; text-align: left;
}

/* Badge Famille sobre sous les cœurs */
.mapi-family-tag {
    display: inline-flex; align-items: center; gap: 5px;
    background: #f8fafc; color: #475569; border: 1px solid #e2e8f0;
    padding: 4px 10px; border-radius: 20px; font-weight: 600;
    font-size: 0.75em; margin-top: 5px;
}
.mapi-family-tag .material-symbols-rounded { color: #64748b; }

/* Barre compacte */
.mapi-compact-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 0; /* Ajustement vertical pour respirer */
    margin-bottom: 20px;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    gap: 15px; flex-wrap: wrap; position: relative;
}
.mapi-compact-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.mapi-compact-author { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.mapi-compact-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #e2e8f0; object-fit: cover; }
.mapi-compact-author-info { display: flex; flex-direction: column; }
.mapi-compact-author-label { font-size: 0.65em; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.mapi-compact-author-name { font-weight: 700; font-size: 0.9em; color: #1e293b; }
.mapi-compact-author:hover .mapi-compact-author-name { color: #3b82f6; }

/* Centrage vertical absolu pour les coeurs */
.mapi-compact-center {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
}

.mapi-compact-interest-label { font-size: 0.65em; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.mapi-compact-hearts { display: flex; align-items: center; gap: 3px; }
.mapi-compact-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Encart Organiser une sortie */
.mapi-event-cta {
    display: flex; align-items: center; gap: 15px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 18px 22px; margin-bottom: 30px;
}
.mapi-event-cta-icon {
    width: 48px; height: 48px; background: #111; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mapi-event-cta-icon .material-symbols-rounded { color: #fff; font-size: 24px; }
.mapi-event-cta-text { flex: 1; }
.mapi-event-cta-title { display: block; font-weight: 800; color: #1e293b; font-size: 1em; }
.mapi-event-cta-sub { display: block; font-size: 0.82em; color: #94a3b8; margin-top: 2px; }

/* ============================================================
   REFONTE : BOUTONS ACTIONS RONDS (Gris clair)
   ============================================================ */
.mapi-slim-action {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; background: #f1f5f9;
    border: none; cursor: pointer; text-decoration: none;
    transition: all 0.2s ease; border-radius: 50%;
    padding: 0; flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
.mapi-slim-action:hover { 
    background: #e2e8f0; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.06); 
}
.mapi-slim-action:active { 
    transform: scale(0.92); 
}
.mapi-slim-icon {
    font-size: 20px; color: #475569;
    font-variation-settings: 'FILL' 0, 'wght' 400;
    transition: all 0.2s;
}
.mapi-slim-action:hover .mapi-slim-icon { 
    color: #1e293b; 
}
.mapi-slim-active { 
    color: #e11d48 !important; 
    font-variation-settings: 'FILL' 1, 'wght' 400 !important; 
}

/* ------------------------------------------------------------ */

.mapi-author-block { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.mapi-author-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #e2e8f0; }
.mapi-author-info { display: flex; flex-direction: column; }
.mapi-author-label { font-size: 0.75em; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.mapi-author-name { font-weight: 700; color: #1e293b; text-decoration: none; font-size: 1em; }
.mapi-author-name:hover { color: #3b82f6; }
.mapi-hearts-inline { display: flex; flex-direction: column; align-items: center; gap: 5px; position: absolute; left: 50%; transform: translateX(-50%); }
.mapi-interest-label-inline { font-size: 0.75em; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.mapi-hearts-row { display: flex; justify-content: center; align-items: center; gap: 3px; }
.mapi-hearts-row .dashicons { font-size: 22px !important; width: 22px !important; height: 22px !important; }

.mapi-actions-icons { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.mapi-icon-btn { width: 50px; height: 50px; border-radius: 50%; border: none !important; background: transparent !important; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }

.mapi-location-bar { color: #1e293b; font-weight: 700; font-size: 1.1em; margin-bottom: 30px; padding: 15px; background: #f8fafc; border-radius: 8px; }
.mapi-location-bar .dashicons { color: #3b82f6; margin-right: 8px; }
.mapi-access-condition-bar { color: #92400e; font-weight: 600; font-size: 1.05em; margin-bottom: 40px; padding: 15px 20px; background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; display: flex; align-items: center; }
.mapi-access-condition-bar .dashicons { color: #d97706; margin-right: 15px; font-size: 32px; width: 32px; height: 32px; }
.mapi-topo-description { line-height: 1.9; color: #334155; font-size: 1.1em; margin-bottom: 50px; text-align: left; }

/* Espacement sections accru */
.mapi-tiles-grid { margin-bottom: 50px; }
.mapi-map-section { margin: 50px 0; }
.mapi-location-bar { margin-bottom: 35px; }

/* ============================================================
   LA NOUVELLE GRILLE CSS (12 TUILES)
   ============================================================ */
.mapi-tiles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 40px; }
.mapi-tile { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 15px 5px 12px 5px; text-align: center; display: flex; flex-direction: column !important; align-items: center; justify-content: flex-start !important; gap: 6px; transition: all 0.2s ease; height: 125px !important; box-sizing: border-box; overflow: hidden; }
.mapi-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); border-color: #cbd5e1; }
.mapi-tile .dashicons { font-size: 28px !important; width: 28px !important; height: 28px !important; margin-bottom: 2px; }
.mapi-tile-icon { font-size: 28px !important; margin-bottom: 2px; font-variation-settings: 'FILL' 0, 'wght' 300; }
.mapi-tile-stars { display: flex; justify-content: center; gap: 2px; height: 24px; margin-bottom: 2px; }
.mapi-tile-value { font-weight: 800; font-size: 1.2em; color: #1e293b; line-height: 1.1; margin-bottom: 2px; }
.mapi-tile::before { content: ''; margin-top: auto; }
.mapi-tile-label { font-size: 0.75em; text-transform: uppercase; color: #94a3b8; letter-spacing: 0.5px; font-weight: 700; line-height: 1; margin-top: auto; }
.duree-data-wrapper { display: flex; align-items: center; justify-content: center; width: 100%; gap: 15px; margin-bottom: 2px; }
.duree-left { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.duree-sep { width: 1px; height: 40px; background-color: #cbd5e1; }
.duree-right { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; }
.duree-detail { display: flex; align-items: center; gap: 5px; font-size: 0.85em; font-weight: 700; color: #475569; line-height: 1; }
.duree-detail .dashicons { font-size: 16px !important; width: 16px !important; height: 16px !important; margin: 0 !important; }
.up-arrow { color: #e74c3c !important; } .down-arrow { color: #27ae60 !important; } 
.o-duree { order: 1; } .o-dist { order: 2; } .o-diff { order: 3; } .o-alt-dep { order: 4; } .o-alt-max { order: 5; } .o-balisage { order: 6; } .o-dplus { order: 7; } .o-dminus { order: 8; } .o-type { order: 9; } .o-periode { order: 10; } .o-freq { order: 11; } .o-chiens { order: 12; }
.mapi-map-section { margin: 40px 0; }
.mapi-gps-bar { display: flex; justify-content: space-between; align-items: center; background: #f1f5f9; padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.mapi-gps-coords { font-family: 'Courier New', monospace; color: #475569; font-size: 0.95em; }
.mapi-gps-link { background: #3b82f6; color: white; padding: 8px 20px; border-radius: 20px; text-decoration: none; font-weight: 600; font-size: 0.9em; transition: all 0.2s; }
.mapi-gps-link:hover { background: #2563eb; transform: translateY(-2px); }

/* ============================================================
   RESPONSIVE OPTIMISÉ (MOBILE)
   ============================================================ */
@media (max-width: 768px) {
    .mapi-topo-hero {
        margin-top: 0;
        background-attachment: scroll;
        background-size: cover !important;
        background-position: center center !important;
        min-height: unset !important;
        height: 100dvh !important;
        padding: 0 !important;
    }
    .mapi-hero-simple {
        height: auto !important;
        min-height: 380px !important;
        background-size: cover !important;
        background-position: center !important;
        margin-top: -80px !important;
        padding-top: 160px !important;
        padding-bottom: 80px !important;
    }
    .mapi-hero-simple .mapi-hero-overlay {
        position: absolute !important;
        inset: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding-top: 80px !important;
    }
    .mapi-topo-content-card { width: calc(100% - 20px) !important; max-width: none !important; box-sizing: border-box !important; margin: -50px auto 40px auto !important; padding: 25px 15px !important; border-radius: 16px !important; overflow: hidden; }
    .mapi-card-main-title { font-size: 1.4em; }
    .mapi-card-title-row { padding-right: 0; }
    .mapi-card-dept-badge { position: static; align-self: center; font-size: 1.3em; padding: 16px 14px; margin-top: 10px; }
    .mapi-card-title-row { flex-direction: column; align-items: center; }
    
    /* CENTRAGE TEXTE DESCRIPTIF MOBILE (Massif + Titres Description) */
    .mapi-card-location { text-align: center; }
    .mapi-topo-description h1, 
    .mapi-topo-description h2, 
    .mapi-topo-description h3 { text-align: center; }

    .mapi-compact-bar { flex-direction: column; align-items: stretch; gap: 16px; }
    .mapi-compact-left { justify-content: center; }
    .mapi-compact-center { position: static; transform: none; align-items: center; }
    .mapi-compact-right { justify-content: center; gap: 15px; }
    .mapi-event-cta { flex-direction: column; text-align: center; }
    .mapi-event-cta-text { text-align: center; }
    .mapi-tiles-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .mapi-tile-stars { transform: scale(0.75) !important; transform-origin: center center; }
    .duree-data-wrapper { gap: 10px; }
    .duree-right { gap: 4px; }
    .duree-sep { height: 35px; }
    .o-duree { order: 1; } .o-dist { order: 2; } .o-alt-dep { order: 3; } .o-alt-max { order: 4; } .o-dplus { order: 5; } .o-dminus { order: 6; } .o-diff { order: 7; } .o-balisage { order: 8; } .o-type { order: 9; } .o-freq { order: 10; } .o-periode { order: 11; } .o-chiens { order: 12; }
    .mapi-gps-bar { flex-direction: column; align-items: flex-start; }
    .mapi-topo-description { font-size: 1rem !important; }
    #mapi-gallery-grid { grid-template-columns: 1fr !important; }
    .mapi-gallery-item { height: auto; aspect-ratio: 4/3; }
}

/* ============================================================
   MODAL MODERN LIGHT (Ancienne Modale Conservée par sécurité)
   ============================================================ */
.mapi-modal { position: fixed; inset: 0; z-index: 9999999; display: none; align-items: center; justify-content: center; }
.mapi-modal.active { display: flex; }
.mapi-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.mapi-modal-content { position: relative; background: #ffffff; border-radius: 20px; width: 90%; max-width: 540px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); border: 1px solid #e2e8f0; animation: modalSlideIn 0.3s ease-out; display: flex; flex-direction: column; max-height: 90vh; }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.mapi-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; }
.mapi-modal-header h3 { color: #1e293b; font-size: 1.3em; font-weight: 800; margin: 0; }
.mapi-modal-close { background: none; border: none; color: #94a3b8; font-size: 32px; line-height: 1; cursor: pointer; padding: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; transition: color 0.2s; }
.mapi-modal-close:hover { color: #0f172a; }
.mapi-modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.mapi-form-group { margin-bottom: 20px; }
.mapi-form-group label { display: block; color: #475569; font-size: 0.85em; font-weight: 700; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.mapi-modal-input { width: 100%; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 12px; padding: 12px 16px; color: #334155; font-size: 1.05em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; transition: all 0.2s; box-sizing: border-box; }
.mapi-modal-input:focus { outline: none; border-color: #3b82f6; background: #ffffff; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.mapi-modal-input::placeholder { color: #94a3b8; }
select.mapi-modal-input { appearance: none; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%2364748b" d="M6 9L1 4h10z"/></svg>'); background-repeat: no-repeat; background-position: right 16px center; padding: 12px 40px 12px 16px; min-height: 50px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
textarea.mapi-modal-input { resize: vertical; min-height: 100px; line-height: 1.5; }
.mapi-modal-footer { display: flex; gap: 12px; padding: 20px 24px; border-top: 1px solid #f1f5f9; background: #fcfcfc; border-radius: 0 0 20px 20px; flex-shrink: 0; }

.mapi-btn-modal { flex: 1; padding: 14px 24px; border-radius: 12px; font-size: 1em; font-weight: 700; cursor: pointer; transition: all 0.2s; border: none; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.mapi-btn-cancel { background: #f1f5f9; color: #475569; }
.mapi-btn-cancel:hover { background: #e2e8f0; color: #1e293b; }
.mapi-btn-submit { background: #000000; color: #ffffff; transition: all 0.2s ease; }
.mapi-btn-submit:hover { background: #df2727; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(223, 39, 39, 0.2); }
@media (max-width: 600px) { .mapi-modal-content { width: 95%; border-radius: 16px; } .mapi-modal-header, .mapi-modal-body, .mapi-modal-footer { padding: 16px 20px; } .mapi-modal-footer { flex-direction: column; } }

/* ============================================================
   GESTION BLINDÉE DES ICÔNES D'ACTION
   ============================================================ */
.mapi-icon-btn .material-symbols-rounded { font-size: 35px !important; transition: all 0.3s ease; }
.mapi-action-icon-empty { color: #1e293b !important; font-variation-settings: 'FILL' 0, 'wght' 200 !important; }
.mapi-action-icon-filled { color: #e11d48 !important; font-variation-settings: 'FILL' 1, 'wght' 400 !important; }
.mapi-report-btn:hover .material-symbols-rounded { color: #ea580c !important; font-variation-settings: 'FILL' 1, 'wght' 400 !important; }
.mapi-share-btn:hover .material-symbols-rounded { color: #3b82f6 !important; font-variation-settings: 'FILL' 1, 'wght' 400 !important; }

/* ============================================================
   BOUTONS MODERNES DU FOOTER & LIGHTBOX
   ============================================================ */
.mapi-actions-footer-modern { width: 100%; margin-top: 40px; margin-bottom: 40px; padding-top: 30px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid #f1f5f9; }
.mapi-btn-ios { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 20px; background-color: transparent; border: 1px solid #f1f5f9; border-radius: 16px; text-decoration: none; cursor: pointer; transition: all 0.2s ease; width: 100%; box-sizing: border-box; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.mapi-btn-ios:hover { background-color: #f8fafc; transform: scale(0.99); box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
.mapi-btn-ios .icon-wrapper { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; }
.mapi-btn-ios .material-symbols-rounded { font-size: 24px; color: inherit !important; font-variation-settings: 'FILL' 1 !important; }
.mapi-btn-ios .text-wrapper { display: flex; flex-direction: column; align-items: flex-start; }
.mapi-btn-ios .text-main { font-size: 1.05em; font-weight: 700; color: #0f172a; letter-spacing: -0.3px; line-height: 1.2; }
.btn-gpx .icon-wrapper { background-color: #e0f2fe; } .btn-gpx .material-symbols-rounded { color: #0284c7 !important; }
.btn-export .icon-wrapper { background-color: #f3e8ff; } .btn-export .material-symbols-rounded { color: #9333ea !important; }
.btn-event .icon-wrapper { background-color: #ffedd5; } .btn-event .material-symbols-rounded { color: #ea580c !important; }
.btn-edit .icon-wrapper { background-color: #f1f5f9; } .btn-edit .material-symbols-rounded { color: #475569 !important; }
@media (min-width: 768px) { .mapi-actions-footer-modern { flex-direction: row; flex-wrap: wrap; } .mapi-btn-ios { width: calc(50% - 6px); } }
.mapi-lightbox { display: none; position: fixed; z-index: 999999; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; background-color: rgba(0,0,0,0.92); flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.mapi-lightbox.active { display: flex; }
.mapi-lightbox-img { max-width: 92vw; max-height: 78dvh; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); object-fit: contain; }
.mapi-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 50px; cursor: pointer; user-select: none; padding: 20px; transition: 0.2s; z-index: 2; }
.mapi-lb-nav:hover { color: #3b82f6; }
.mapi-lb-prev { left: 20px; } .mapi-lb-next { right: 20px; }
.mapi-lb-counter { position: absolute; bottom: 20px; color: white; font-family: sans-serif; font-size: 1.1em; letter-spacing: 1px; }
.mapi-gallery-item { cursor: pointer; display: block; height: 280px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: transform 0.2s; background-position: center; background-size: cover; }
.mapi-gallery-item:hover { transform: scale(1.02); }
@media(max-width: 768px) { .mapi-lb-nav { font-size: 30px; padding: 10px; } }
/* Masquer le burger quand la lightbox est ouverte sur mobile */
@media(max-width: 768px) {
    body.mapi-lightbox-open .ct-header,
    body.mapi-lightbox-open #masthead,
    body.mapi-lightbox-open header.site-header { display: none !important; }
}

/* ==========================================================================
   VIGNETTES TOPO (card-topo.php)
   ========================================================================== */
.mapi-topo-card { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.08); border: 1px solid #f0f0f0; display: flex; flex-direction: column; height: 100%; transition: transform 0.2s, box-shadow 0.2s; }
.mapi-topo-card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0,0,0,0.12); }
.mapi-topo-image { display: block; position: relative; height: 220px; overflow: hidden; }
.mapi-topo-image-bg { width: 100%; height: 100%; background-size: cover; background-position: center; transition: transform 0.3s; }
.mapi-topo-card:hover .mapi-topo-image-bg { transform: scale(1.05); }
.mapi-topo-difficulty-badge { position: absolute; top: 15px; left: 15px; background: rgba(0,0,0,0.6); padding: 4px 8px; border-radius: 6px; backdrop-filter: blur(2px); }
.mapi-topo-badge-label { color: white; font-size: 0.65em; font-weight: bold; text-transform: uppercase; margin-bottom: 2px; font-family: sans-serif; }
.mapi-topo-stars { display: flex; }
.mapi-topo-dept-badge { position: absolute; top: 15px; right: 15px; background: #111; color: white; border-radius: 6px; padding: 5px 8px; text-align: center; min-width: 40px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.mapi-topo-dept-label { font-size: 0.6em; text-transform: uppercase; display: block; opacity: 0.8; font-family: sans-serif; }
.mapi-topo-dept-number { font-size: 1.1em; font-weight: 800; font-family: sans-serif; }
.mapi-topo-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; text-align: center; }
.mapi-topo-title { margin: 0 0 5px 0; font-size: 1.15em; font-weight: 800; font-family: sans-serif; line-height: 1.3; }
.mapi-topo-title a { text-decoration: none; color: #2c3e50; transition: color 0.2s; }
.mapi-topo-title a:hover { color: #e74c3c; }
.mapi-topo-massif { color: #7f8c8d; font-size: 0.85em; margin-bottom: 15px; font-family: sans-serif; }
.mapi-topo-interest-label { display: block; font-size: 0.7em; text-transform: uppercase; color: #aaa; letter-spacing: 1px; font-weight: bold; margin-bottom: 3px; font-family: sans-serif; }
.mapi-topo-hearts { display: flex; justify-content: center; }
.mapi-topo-stats { margin-top: auto; padding-top: 15px; border-top: 1px solid #eee; display: flex; justify-content: space-between; color: #555; font-size: 0.85em; font-weight: bold; font-family: sans-serif; }
.mapi-topo-stat { display: flex; align-items: center; gap: 3px; }
.mapi-topo-footer { padding: 12px; background: #f9f9f9; text-align: center; border-top: 1px solid #eee; }
.mapi-topo-footer a { text-decoration: none; color: #2c3e50; font-weight: bold; font-size: 0.9em; font-family: sans-serif; transition: color 0.2s; }
.mapi-topo-footer a:hover { color: #e74c3c; }

/* ============================================================
   NOUVELLES CLASSES (TOOLBAR, BADGES, PARTAGE)
   ============================================================ */
.mapi-toolbar-btn { background: none; border: none; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform 0.2s ease; text-decoration: none; }
.mapi-toolbar-btn:hover { transform: scale(1.1); }
.mapi-toolbar-icon { width: 32px; height: 32px; object-fit: contain; }
.mapi-save-icon-img.is-saved { filter: invert(29%) sepia(80%) saturate(2856%) hue-rotate(334deg) brightness(92%) contrast(93%); }
.mapi-family-badge { display: inline-flex; align-items: center; gap: 6px; background: #ffffff; color: #1e293b; border: 1px solid #f1f5f9; padding: 8px 14px; border-radius: 14px; font-weight: 700; font-size: 0.85em; position: relative; cursor: help; user-select: none; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.mapi-family-badge .material-symbols-rounded { font-size: 18px; font-variation-settings: 'FILL' 1; color: #3b82f6; }
.mapi-family-badge::after { content: attr(data-tooltip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: #1e293b; color: white; padding: 10px 15px; border-radius: 8px; font-size: 0.95em; white-space: normal; width: max-content; max-width: 250px; text-align: center; opacity: 0; visibility: hidden; transition: all 0.2s; z-index: 100; font-weight: 400; pointer-events: none; box-shadow: 0 4px 10px rgba(0,0,0,0.15); line-height: 1.4; }
.mapi-family-badge:hover::after, .mapi-family-badge:active::after { opacity: 1; visibility: visible; bottom: 140%; }
.mapi-family-badge::before { content: ''; position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%); border-width: 6px; border-style: solid; border-color: #1e293b transparent transparent transparent; opacity: 0; visibility: hidden; transition: all 0.2s; z-index: 100; pointer-events: none; }
.mapi-family-badge:hover::before, .mapi-family-badge:active::before { opacity: 1; visibility: visible; bottom: 120%; }

.mapi-share-wrapper { position: relative; }

/* ============================================================
   BARRE D'ACTIONS AVEC LABELS (icône + texte)
   ============================================================ */
.mapi-action-bar {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.mapi-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-width: 52px;
}

.mapi-action-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    border-color: #e2e8f0;
}

.mapi-action-item:active {
    transform: scale(0.95);
}

.mapi-action-item-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.mapi-action-item-label {
    font-size: 0.65em;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1;
}

.mapi-action-item-inline {
    flex-direction: row;
    gap: 6px;
    padding: 6px 12px;
}

.mapi-action-item-inline .mapi-action-item-icon {
    width: 22px;
    height: 22px;
}

.mapi-action-item-inline .mapi-action-item-label {
    font-size: 0.75em;
}

@media (max-width: 768px) {
    .mapi-action-bar { gap: 4px; justify-content: center; }
    .mapi-action-item { padding: 6px 8px; min-width: 46px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
    .mapi-action-item-icon { width: 22px; height: 22px; }
    .mapi-action-item-label { font-size: 0.6em; }
}

/* ============================================================
   MASQUAGE — Profil d'élévation (croix + download)
   ============================================================ */
.elevation-control .close-button,
.leaflet-control-elevation .close-button,
.elevation-control .download,
.leaflet-control-elevation a[download],
.elevation-control .close,
.gpx-summary a[download],
.elevation-detached .close-button,
.elevation-detached a[download],
a.leaflet-control-elevation-toggle-icon,
.leaflet-control-elevation .elevation-toggle-icon,
.elevation-summary .close,
.elevation-summary .close-button,
.gpx-elevation .close,
.gpx-elevation .close-button,
.gpx-summary .close,
.gpx-summary .close-button,
.leaflet-gpx-elevation .close,
.leaflet-gpx-elevation .close-button,
div[class*="elevation"] > a[href="#"],
div[class*="elevation"] > span[class*="close"],
div[class*="elevation"] > button[class*="close"],
.height-focus .close,
.leaflet-control-elevation-close { display: none !important; }

/* ============================================================
   BARRE DE RECHERCHE — Flèche dropdown (Explorer + Sorties)
   Problème : text-overflow ne tronque pas le texte dans un flex
   container avec text node direct → le texte chevauche le SVG.
   Solution : supprimer le SVG background, ajouter un ::after
   absolu qui reste toujours à droite, hors du texte.
   ============================================================ */
.mapi-main-filters .mapi-custom-select-trigger {
    background-image: none !important;
    display: flex !important;
    align-items: center !important;
    padding-right: 56px !important;
    position: relative !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}
.mapi-main-filters .mapi-custom-select-trigger::after {
    content: '' !important;
    position: absolute !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 5px solid transparent !important;
    border-right: 5px solid transparent !important;
    border-top: 6px solid #ffffff !important;
    pointer-events: none !important;
    display: block !important;
}

/* ============================================================
   BOUCLIER GLOBAL — .mapi-chat-send (chargé sur toutes les pages)
   Neutralise l'animation rouge (::before custom ou Blocksy)
   ============================================================ */
.mapi-chat-send::before,
.mapi-chat-send::after {
    display: none !important;
    content: none !important;
}

/* ============================================================
   PROFIL D'ÉLÉVATION — Style visuel
   ============================================================ */

/* Axes du graphique SVG */
#mapi-elevation-chart .domain,
#mapi-elevation-chart .tick line {
    stroke: #dde1e7 !important;
}

#mapi-elevation-chart .tick text {
    fill: #7f8c9a !important;
    font-size: 11px !important;
    font-family: Nunito, sans-serif !important;
}

/* ── Légende des pentes colorées ── */
.mapi-slope-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    padding: 6px 4px 0;
    font-size: 11px;
    font-family: Nunito, sans-serif;
    color: #666;
    flex-wrap: wrap;
}

.mapi-slope-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.mapi-slope-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Bloc de données techniques ── */
.mapi-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding: 0;
    font-family: Nunito, sans-serif;
}

.mapi-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f7fa;
    border-radius: 20px;
    padding: 7px 14px;
    flex: 1 1 auto;
    min-width: 120px;
}

.mapi-stat-icon {
    font-size: 15px;
    line-height: 1;
}

.mapi-stat-label {
    font-size: 11px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.mapi-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin-left: auto;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .mapi-stat-item {
        min-width: calc(50% - 4px);
    }
}

/* =========================================================
   MODALES STYLE 8 : UNDERSCORED AIRY (CSS PUR)
   ========================================================= */
.airy-modal {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    max-height: 90vh;
    overflow-y: auto;
}

.airy-report-modal { width: 400px; max-width: 90vw; }
.airy-share-modal { width: 260px; max-width: 90vw; }

.airy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.airy-modal-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.4px;
    color: #000000;
}

/* CROIX ABSOLUE POUR LA MODALE PARTAGE */
.airy-share-modal .airy-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
}

.airy-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cccccc;
    transition: color 0.2s;
}

.airy-close-btn:hover {
    color: #888888;
}

.airy-close-btn svg { 
    width: 24px; 
    height: 24px; 
}

.airy-input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.airy-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    color: #888888;
    text-transform: uppercase;
    display: block;
}

.airy-select, .airy-textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
    color: #000000;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid #e5e5ea;
    border-radius: 0;
    padding: 10px 0;
    outline: none;
    transition: border-color 0.2s;
}

.airy-select:focus, .airy-textarea:focus {
    border-bottom-color: #000000;
    box-shadow: none;
}

.airy-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888888'%3E%3Cpath d='M6 8.5L2 4.5h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0px center;
    cursor: pointer;
}

.airy-textarea {
    height: 100px;
    resize: none;
}

.airy-textarea::placeholder {
    color: #cccccc;
}

.airy-btn-group {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.airy-btn {
    flex: 1;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border-radius: 24px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-decoration: none;
}

.airy-btn-cancel {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #000000;
}

.airy-btn-cancel:hover {
    background-color: #f5f5f5;
}

.airy-btn-submit {
    background-color: #000000;
    color: #ffffff;
    border: none;
}

.airy-btn-submit:hover {
    background-color: #df2727;
    color: #ffffff;
}

.airy-share-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.airy-share-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    font-weight: 500;
    color: #000000;
    cursor: pointer;
    transition: opacity 0.2s;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
    text-decoration: none;
}

.airy-share-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.airy-share-item:first-child {
    padding-top: 0;
}

.airy-share-item:hover {
    opacity: 0.6;
}

.airy-share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
}

.airy-share-icon svg { 
    width: 20px; 
    height: 20px; 
}

.share-text {
    font-family: inherit;
}

/* =========================================================
   MODALE SUGGESTION (AIRY) - GESTION SPÉCIFIQUE DE L'ACCORDÉON
   ========================================================= */
.airy-modal-body {
    scrollbar-width: thin;
    scrollbar-color: #e5e5ea transparent;
}
.airy-modal-body::-webkit-scrollbar {
    width: 6px;
}
.airy-modal-body::-webkit-scrollbar-thumb {
    background-color: #e5e5ea;
    border-radius: 10px;
}

/* On s'assure que le style inline des textarea Airy l'emporte sur l'ancien display: none */
.mapi-step-block.collapsed textarea.airy-textarea {
    display: none !important;
}

/* Chevron d'accordéon pour l'ancienne classe .mapi-step-title s'il est collapsed */
.mapi-step-block.collapsed .mapi-step-title::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #888888;
    margin-left: auto;
}

.mapi-remove-suggest-step:hover {
    color: #e74c3c !important;
}

#mapi-add-suggest-step:hover {
    background: #f9f9f9 !important;
    border-color: #000000 !important;
}

/* ==========================================================================
   BOUCLIER ANTI-THEME (BLOCKSY) - SUPPRESSION DE L'ANIMATION ROUGE
   ========================================================================== */
.mapi-submit-btn::before, .mapi-submit-btn::after,
.mapi-btn-dl::before, .mapi-btn-dl::after,
.mapi-btn-org::before, .mapi-btn-org::after,
.mapi-btn-submit::before, .mapi-btn-submit::after,
.mapi-btn-cancel::before, .mapi-btn-cancel::after,
.airy-btn-submit::before, .airy-btn-submit::after,
.airy-btn-cancel::before, .airy-btn-cancel::after,
.mapi-btn-ios::before, .mapi-btn-ios::after {
    display: none !important;
    content: none !important;
}