/* ═══════════════════════════════════════════════════════════════
   Tignarius CMS – Map Stylesheet
   Fullscreen OpenStreetMap with sidebar overlay
   ═══════════════════════════════════════════════════════════════ */

.map-page {
    position: relative;
    width: 100%;
    height: calc(100vh - 72px); /* minus header */
    overflow: hidden;
}

/* ── Fullscreen Map ── */
.map-fullscreen {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ── Inline map widget (non-fullscreen) ── */
.cms-map {
    border-radius: 12px;
    margin: var(--space-lg, 48px) 0;
    box-shadow: 0 4px 24px rgba(28,18,16,.08);
    overflow: hidden;
    z-index: 1;
}
.cms-map--fullscreen {
    position: fixed;
    inset: 0;
    border-radius: 0;
    margin: 0;
    z-index: 1000;
}

/* ── Sidebar Overlay ── */
.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 380px;
    background: rgba(250, 245, 240, .95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(224, 213, 201, .6);
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px 0 32px rgba(28,18,16,.08);
}

.map-overlay__header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(224, 213, 201, .6);
    flex-shrink: 0;
}

.map-overlay__title {
    font-family: 'Baskervville', Georgia, serif;
    font-size: 26px;
    line-height: 1.15;
    color: #1c1210;
    letter-spacing: -.01em;
    margin-bottom: 6px;
}

.map-overlay__desc {
    font-size: 14px;
    color: #8c7568;
    line-height: 1.5;
}

/* ── Location List ── */
.map-overlay__locations {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.map-overlay__locations-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #8b2520;
    padding: 8px 12px 12px;
}

.map-location-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 12px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all .2s;
    font-family: inherit;
}

.map-location-item:hover {
    background: rgba(139, 37, 32, .05);
}

.map-location-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 37, 32, .08);
    border-radius: 8px;
}

.map-location-info {
    flex: 1;
    min-width: 0;
}

.map-location-name {
    font-size: 14px;
    font-weight: 600;
    color: #1c1210;
    line-height: 1.3;
}

.map-location-desc {
    font-size: 12px;
    color: #8c7568;
    margin-top: 2px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Mobile Toggle ── */
.map-toggle-list {
    display: none;
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 20;
    padding: 10px 16px;
    background: rgba(250, 245, 240, .95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(224, 213, 201, .6);
    border-radius: 10px;
    cursor: pointer;
    font: 600 13px/1 'Outfit', sans-serif;
    color: #1c1210;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    gap: 8px;
    align-items: center;
}

.map-toggle-list svg {
    flex-shrink: 0;
}

/* ── Custom Markers ── */
.map-marker-container {
    background: transparent !important;
    border: none !important;
}

.map-marker {
    position: relative;
    width: 40px;
    height: 48px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.map-marker__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #8b2520;
    border-radius: 50% 50% 50% 0;
    /*transform: rotate(-45deg);*/
    box-shadow: 0 3px 10px rgba(139, 37, 32, .35);
    font-size: 16px;
    line-height: 1;
    border: 2px solid #fff;
}

.map-marker__icon > * {
    transform: rotate(45deg);
}

/* Marker mit Emoji Green – Icon aufrecht halten */
.map-marker__icon_green {
    font-size: 18px;
}

.map-marker__icon_green {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #1d6712;
    border-radius: 50% 50% 50% 0;
    /*transform: rotate(-45deg);*/
    box-shadow: 0 3px 10px rgba(243, 255, 151, 0.35);
    font-size: 16px;
    line-height: 1;
    border: 2px solid #fff;
}

.map-marker__icon_green > * {
    transform: rotate(45deg);
}

/* Marker mit Emoji Green – Icon aufrecht halten */
.map-marker__icon_green {
    font-size: 18px;
}

/* ── 3D Portal Markers (elevated, circular) ── */
.map-portal-container {
    background: transparent !important;
    border: none !important;
    z-index: 650 !important;
}

.map-portal {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Portal image (PNG from user) */
.map-portal__img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 3;
    filter: drop-shadow(0 0 8px rgba(184, 149, 62, .6));
    transition: transform .3s, filter .3s;
}

.map-portal:hover .map-portal__img {
    transform: scale(1.1);
    filter: drop-shadow(0 0 14px rgba(184, 149, 62, .85));
}

/* Emoji fallback */
.map-portal__emoji {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(135deg, #b8953e, #8b6f1e);
    border: 2px solid rgba(255, 255, 255, .8);
    box-shadow: 0 0 12px rgba(184, 149, 62, .5);
    position: relative;
    z-index: 3;
    transition: transform .3s, box-shadow .3s;
}

.map-portal:hover .map-portal__emoji {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(184, 149, 62, .75);
}

/* Glowing ring around the portal */
.map-portal__ring {
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 2px solid rgba(184, 149, 62, .5);
    box-shadow:
        0 0 10px rgba(184, 149, 62, .3),
        0 0 20px rgba(184, 149, 62, .15),
        inset 0 0 8px rgba(184, 149, 62, .1);
    z-index: 2;
    animation: portalRingGlow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes portalRingGlow {
    0%, 100% { border-color: rgba(184, 149, 62, .4); box-shadow: 0 0 10px rgba(184, 149, 62, .2), 0 0 20px rgba(184, 149, 62, .1); }
    50%      { border-color: rgba(184, 149, 62, .8); box-shadow: 0 0 16px rgba(184, 149, 62, .4), 0 0 32px rgba(184, 149, 62, .2); }
}

/* Expanding pulse ring */
.map-portal__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(184, 149, 62, .4);
    z-index: 1;
    animation: portalPulse 2.5s ease-out infinite;
    pointer-events: none;
}

@keyframes portalPulse {
    0%   { transform: scale(1); opacity: .8; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* 3D Popup */
.map-popup-wrapper--3d .leaflet-popup-content-wrapper {
    border: 1.5px solid rgba(184, 149, 62, .3);
}

.map-popup--3d .map-popup__title {
    color: #8b6f1e;
}

.map-popup__link--3d {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #b8953e, #8b6f1e);
    color: #fff !important;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .2s;
}

.map-popup__link--3d:hover {
    opacity: .85;
    color: #fff !important;
}

/* ── Popups ── */
.map-popup-wrapper .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(28,18,16,.12);
    padding: 0;
    overflow: hidden;
    font-family: 'Outfit', -apple-system, sans-serif;
}

.map-popup-wrapper .leaflet-popup-content {
    margin: 0;
    min-width: 200px;
}

.map-popup-wrapper .leaflet-popup-tip {
    box-shadow: 0 2px 8px rgba(28,18,16,.1);
}

.map-popup {
    padding: 16px 18px;
}

.map-popup__title {
    font-family: 'Baskervville', Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    color: #1c1210;
    line-height: 1.2;
    margin-bottom: 4px;
}

.map-popup__desc {
    font-size: 13px;
    color: #8c7568;
    line-height: 1.5;
    margin-bottom: 8px;
}

.map-popup__link {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #8b2520;
    text-decoration: none;
}

.map-popup__link:hover {
    color: #a92e28;
}

/* ── Leaflet overrides ── */
.leaflet-control-zoom a {
    background: rgba(250, 245, 240, .95) !important;
    color: #1c1210 !important;
    border-color: rgba(224, 213, 201, .6) !important;
    backdrop-filter: blur(8px);
    font-size: 16px !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
}

.leaflet-control-zoom a:hover {
    background: #fff !important;
}

.leaflet-control-attribution {
    background: rgba(250, 245, 240, .7) !important;
    backdrop-filter: blur(4px);
    font-size: 10px !important;
    color: #8c7568 !important;
}

.leaflet-control-attribution a {
    color: #8b2520 !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .map-overlay {
        position: absolute;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 55vh;
        border-right: none;
        border-top: 1px solid rgba(224, 213, 201, .6);
        border-radius: 20px 20px 0 0;
        transform: translateY(calc(100% - 0px));
        transition: transform .35s cubic-bezier(.4, 0, .2, 1);
        box-shadow: 0 -4px 32px rgba(28,18,16,.1);
    }

    .map-overlay.open {
        transform: translateY(0);
    }

    .map-overlay__header {
        padding: 20px 20px 16px;
    }

    .map-overlay__title {
        font-size: 20px;
    }

    .map-toggle-list {
        display: flex;
    }

    .map-page {
        height: calc(100vh - 72px);
        height: calc(100dvh - 72px);
    }
}

/* ── Scrollbar styling for locations list ── */
.map-overlay__locations::-webkit-scrollbar {
    width: 4px;
}
.map-overlay__locations::-webkit-scrollbar-track {
    background: transparent;
}
.map-overlay__locations::-webkit-scrollbar-thumb {
    background: rgba(140, 117, 104, .2);
    border-radius: 2px;
}

/* ── 3D location items in sidebar ── */
.map-location-item--3d { border-left: 2px solid rgba(184, 149, 62, .3); }
.map-location-item--3d:hover { background: rgba(184, 149, 62, .06); }
.map-location-icon--3d {
    background: rgba(184, 149, 62, .12);
    border-radius: 50%;
    overflow: hidden;
}
