/* Full-viewport map + overlay drawer */
html, body, #container {
    height: 100%;
    height: 100dvh;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
    background: #f3f4f6;
    -webkit-font-smoothing: antialiased;
}

#container {
    position: relative;
    z-index: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Menu button — always visible, top-left */
#drawer-toggle {
    position: fixed;
    z-index: 1100;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#drawer-toggle:hover {
    background: #fff;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: #1a1a1a;
    border-radius: 1px;
    transition: transform 0.2s ease, top 0.2s ease, background 0.2s ease;
}

.menu-icon {
    position: relative;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
}

.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }

body.drawer-open .menu-icon {
    background: transparent;
}

body.drawer-open .menu-icon::before {
    top: 0;
    transform: rotate(45deg);
}

body.drawer-open .menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Dim backdrop — phone only, when drawer is open */
.drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.4);
}

@media (max-width: 767px) {
    body.drawer-open .drawer-backdrop {
        display: block;
    }
}

/* Left drawer — closed by default, slides over the map */
.drawer {
    position: fixed;
    z-index: 1050;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: min(320px, 92vw);
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.16);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    pointer-events: none;
    box-sizing: border-box;
}

body.drawer-open .drawer {
    transform: translateX(0);
    pointer-events: auto;
}

.drawer-header {
    flex-shrink: 0;
    padding: 14px 16px 10px 56px;
}

.drawer-header h1 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.drawer-search {
    flex-shrink: 0;
    padding: 0 12px 10px;
}

#poi-search {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    font-size: 0.95rem;
    background: #fff;
}

#poi-search:focus {
    outline: 2px solid #16a34a;
    outline-offset: 1px;
    border-color: #16a34a;
}

.category-chips {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
}

.cat-chip {
    border: 1px solid #2f6f4e;
    background: transparent;
    border-radius: 999px;
    padding: 4px 10px;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.3;
    color: #2f6f4e;
    cursor: pointer;
}

.cat-chip.active {
    background: #6fbf8a;
    color: #fff;
    border-color: #6fbf8a;
}

.list {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-top: 1px solid rgba(229, 231, 235, 0.8);
}

.poi-card {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.85rem 1rem;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.poi-card:last-child {
    border-bottom: 0;
}

.poi-card:hover {
    background: #e8f5ed;
}

.poi-card.active {
    background: #e8f5ed;
    box-shadow: inset 3px 0 0 #16a34a;
}

.poi-card-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
}

.poi-card-cat {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #888;
}

.poi-card-blurb {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.84rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poi-card[hidden] {
    display: none;
}

.drawer-layers {
    flex-shrink: 0;
    padding: 10px 16px 16px;
    border-top: 1px solid rgba(229, 231, 235, 0.8);
    font-size: 14px;
}

.drawer-layers-title {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.drawer-layers label {
    display: block;
    padding: 6px 0;
    cursor: pointer;
}

.drawer-layers input[type="checkbox"] {
    margin-right: 8px;
}

.layer-panel-overlay-ctrl {
    margin-top: 8px;
}

.layer-panel-overlay-ctrl input[type="range"] {
    width: 100%;
}

/* --- InfoWindow styles (ported from map.html) --- */

.amap-info-content .thumbnail-image {
    display: inline-block;
    vertical-align: top;
}

.amap-marker {
    cursor: pointer;
}

.amap-info-window {
    max-height: 80vh !important;
    overflow: visible !important;
    position: relative !important;
}

.amap-info-content {
    max-height: 80vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    position: relative !important;
}

.amap-info-window-content-wrapper {
    height: auto !important;
    max-height: 80vh !important;
}

.amap-info-content > .infowindow-content {
    max-height: 80vh !important;
    overflow-y: auto !important;
}

.infowindow-content {
    padding: 10px;
    max-width: min(520px, 90vw);
    width: min(520px, 90vw);
    min-width: 280px;
    max-height: 80vh;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.infowindow-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.infowindow-gridref {
    font-weight: normal;
    color: #888;
    font-size: 13px;
}

.infowindow-address {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    flex-shrink: 0;
}

.infowindow-blurb {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.45;
    flex-shrink: 0;
}

.infowindow-images-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    flex: 1;
    min-height: 0;
}

.thumbnail-image {
    flex: 1 1 240px;
    min-width: 200px;
    max-width: calc(100% - 10px);
    height: 240px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: transform 0.2s, border-color 0.2s;
}

.thumbnail-image:hover {
    transform: scale(1.05);
    border-color: #007bff;
}

/* --- Full-screen image modal (ported from map.html) --- */

.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
    animation: fadeIn 0.3s;
}

.image-modal-visible {
    display: block;
}

.image-modal-container {
    position: relative;
    margin: auto;
    padding: 20px;
    max-width: 90%;
    max-height: 90%;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
}

.image-modal-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    animation: zoomIn 0.3s;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
}

.image-modal-close:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

.map-credit {
    font-size: 11px;
    line-height: 1.4;
    color: #4b5563;
}

.map-credit a {
    color: #1d4ed8;
    text-decoration: underline;
}

.map-credit-drawer {
    margin: 12px 0 0;
}

.map-credit-corner {
    position: fixed;
    z-index: 500;
    left: 12px;
    bottom: 28px;
    max-width: min(320px, calc(100vw - 80px));
    margin: 0;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
