@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
/* =========================================================
   Guest Map — full-screen MapLibre map + slide-in side panel
   ========================================================= */

/* Make html/body full height so the map can fill the viewport */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Readable base font (Roboto) + slightly smaller text on the front */
#map-page-wrapper,
.map-panel {
    font-family: 'Roboto', -apple-system, "Segoe UI", Arial, sans-serif;
}
.map-panel__title {
    font-size: 16px;
    font-weight: 500;
}
.map-panel__body {
    font-size: 12px;
    line-height: 1.55;
}
.map-panel__body p {
    font-size: 12px;
    font-weight: 400;
    text-align: justify;
}
.map-panel__body .ql-editor {
    font-family: inherit;
    font-size: 12px;
    line-height: 1.55;
    padding: 0;
    height: auto;
    text-align: justify;
}

/* Wrapper fills the whole viewport below the fixed menu bar */
#map-page-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Menu bar is typically 60px — adjust to match your layout */
    top: 60px;
}

/* MapLibre container */
#guest-map {
    position: absolute;
    inset: 0;
    /* top/right/bottom/left: 0 */
    transition: right 0.35s ease;
}

/* ---- Side panel ---- */
.map-panel {
    position: absolute;
    top: 0;
    right: -420px;
    /* hidden off-screen */
    width: 400px;
    max-width: 100vw;
    bottom: 0;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.35s ease;
    z-index: 10;
    border-radius: 0;
    overflow: hidden;
}

.map-panel.open {
    right: 0;
}

/* When panel is open, shrink map so markers aren't hidden behind it */
#map-page-wrapper:has(.map-panel.open) #guest-map {
    right: 400px;
}

/* Panel header */
.map-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 14px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    background: #fff;
}

.map-panel__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    max-width: calc(100% - 36px);
    /* allow up to two lines, then ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    line-height: 1.25;
}
/* long titles shrink a bit so they still fit in two lines */
.map-panel__title--long {
    font-size: 13px;
}

.map-panel__close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    padding: 4px 6px;
    line-height: 1;
    flex-shrink: 0;
}

.map-panel__close:hover {
    color: #333;
}

/* Panel body — scrollable */
.map-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px 24px;
    -webkit-overflow-scrolling: touch;
}

/* Hero image inside panel */
.map-panel__body .panel-hero-img {
    width: 100%;
    margin: 0 0 16px;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Loading spinner */
.panel-loading {
    text-align: center;
    padding: 48px 0;
    color: #aaa;
    font-size: 28px;
}

/* Custom map marker */
.guest-marker {
    position: relative;
    cursor: pointer;
    font-size: 28px;
    color: #e74c3c;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.30));
    transition: transform 0.15s ease;
}

.guest-marker:hover {
    transform: scale(1.2);
    color: #c0392b;
    z-index: 5;
}

/* title label shown next to the marker on hover */
.guest-marker__label {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    white-space: nowrap;
    background: #fff;
    color: #1B1725;
    padding: 3px 9px;
    border-radius: 6px;
    font-family: 'Roboto', -apple-system, "Segoe UI", Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.guest-marker:hover .guest-marker__label {
    opacity: 1;
}

/* User's current location marker (blue pulsing dot) */
.guest-user-marker {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2d8cff;
    border: 3px solid #fff;
    box-shadow: 0 0 0 rgba(45, 140, 255, 0.5);
    animation: guest-user-pulse 2s infinite;
}

@keyframes guest-user-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(45, 140, 255, 0.5); }
    70%  { box-shadow: 0 0 0 14px rgba(45, 140, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(45, 140, 255, 0); }
}

/* Panel footer + Navigate button */
.map-panel__footer {
    flex-shrink: 0;
    padding: 12px 18px;
    border-top: 1px solid #eee;
    background: #fff;
}

.map-panel__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    background: #2d8cff;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
}

.map-panel__nav:hover {
    background: #1f7ae0;
    color: #fff;
}

/* ---- Mobile: large panel sliding in from the right ---- */
@media (max-width: 640px) {
    .map-panel {
        width: 92%;
        max-width: 92%;
        top: 0;
        bottom: 0;
        right: -100%;
        /* hidden off-screen to the right */
        left: auto;
        max-height: none;
        border-radius: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
        transition: right 0.35s ease;
    }

    .map-panel.open {
        right: 0;
        bottom: 0;
    }

    /* Panel overlays the map on mobile (don't shrink the map) */
    #map-page-wrapper:has(.map-panel.open) #guest-map {
        right: 0;
        bottom: 0;
    }

    /* a touch more room for content on small screens */
    .map-panel__body {
        padding-bottom: 16px;
    }
}