/* Scoped styles keep the host Omeka theme and existing tour controls intact. */
#dual-map { --map-accent: #663a71; margin: 0; color: #263e43; }
#dual-map * { box-sizing: border-box; }
#dual-map [hidden] { display: none !important; }
#dual-map button { font: inherit; cursor: pointer; min-height: 44px; padding: 8px 12px; border: 1px solid #c2cfd2; border-radius: 5px; background: #fff; color: #263e43 !important; margin: 0; }
#dual-map button:hover { background: #edf4f5; }
#dual-map button:focus-visible, #dual-map a:focus-visible { outline: 3px solid #247eae; outline-offset: 2px; }
#dual-map button:disabled { opacity: .5; cursor: default; }
.dual-map-toolbar, .dual-map-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #f6f9f9; }
.dual-map-toolbar { border-bottom: 1px solid #d8e1e3; flex-wrap: wrap; }
.dual-map-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#dual-map p { margin: 0; }
.dual-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 230px; align-items: start; }
#dual-map.catalog-collapsed .dual-map-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dual-map-pane { min-width: 0; border-right: 1px solid #d8e1e3; }
#dual-map h2 { font-size: 18px; line-height: 1.3; margin: 0; }
.dual-map-heading { min-height: 70px; background: #fff; }
.dual-map-heading button { font-size: 13px !important; flex-shrink: 0; }
#dual-map #historical-map, #dual-map #map { width: 100%; height: clamp(360px, 65vh, 760px) !important; min-height: 0; position: relative; z-index: 0; }
#historical-map { background: #f0ebe1; }
#dual-map .leaflet-container img { margin: 0; max-width: none !important; max-height: none !important; }
#dual-map .dual-map-feedback { padding: 10px 16px; font-size: 13px; line-height: 1.5; min-height: 44px; }
#historical-map-status.is-error { color: #8c2929; }
#historical-map-retry { margin-top: 8px !important; }
#historical-map-catalog { padding: 20px 16px; font-size: 14px; line-height: 1.5; }
#historical-map-catalog p { margin-top: 16px; }
#historical-map-list { margin-top: 16px; }
#historical-map-list button { width: 100%; text-align: left; margin-bottom: 8px; }
#historical-map-list button[aria-pressed="true"] { border-color: var(--map-accent); box-shadow: inset 3px 0 var(--map-accent); }
#historical-map-sources a { display: block; margin-top: 12px; text-decoration: underline; color: #365e6b; }
#dual-map .leaflet-control-zoom a { min-width: 36px; min-height: 36px; line-height: 36px; }
@media (max-width: 1000px) {
    .dual-map-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    #historical-map-catalog { grid-column: 1 / -1; border-top: 1px solid #d8e1e3; }
}
@media (max-width: 640px) {
    .dual-map-layout, #dual-map.catalog-collapsed .dual-map-layout { grid-template-columns: minmax(0, 1fr); }
    .dual-map-toolbar { align-items: start; }
    .dual-map-toolbar p { max-width: 55%; }
    .dual-map-heading { padding: 8px 12px; }
    #dual-map #historical-map, #dual-map #map { height: 52vh !important; min-height: 300px; max-height: 520px; }
    .dual-map-pane { border-right: 0; border-bottom: 1px solid #d8e1e3; }
}

/* Place search retains its English accessible labels. */
#dual-map .map-place-search { width: 280px; max-width: calc(100vw - 85px); background: white; border: 1px solid #c2cfd2; border-radius: 10px; box-shadow: 0 2px 8px #263e4333; color: #263e43; overflow: hidden; }
#dual-map .map-place-search form { display: flex; align-items: center; margin: 0; padding: 3px; }
#dual-map .map-place-search input { min-width: 0; flex: 1; width: 100%; margin: 0; padding: 10px 8px; border: 0; box-shadow: none; background: white; color: #263e43; font: 15px/1.4 sans-serif; height: 44px; }
#dual-map .map-place-search form button { width: 36px; min-height: 40px; padding: 0; border: 0; font-size: 24px; flex-shrink: 0; }
#dual-map .map-place-results { max-height: 230px; overflow-y: auto; border-top: 1px solid #d8e1e3; }
#dual-map .map-place-results button { display: block; width: 100%; border: 0; border-radius: 0; text-align: left; font-size: 13px; line-height: 1.4; }
#dual-map .search-attribution { display: block; padding: 4px 8px; font: 10px/1.4 sans-serif; color: #456974; text-align: right; }
#dual-map .search-feedback { padding: 6px 9px; font-size: 12px; line-height: 1.4; }
@media (max-width: 1100px) {
    #dual-map .map-place-search { width: 230px; }
}
@media (max-width: 640px) {
    #dual-map .map-place-search { width: 260px; }
}

#dual-map .map-place-search.is-collapsed { width: 44px; border: 0; border-radius: 7px; }
#dual-map .map-place-search .search-toggle { display: block; width: 44px; height: 44px; padding: 10px; }
#dual-map .search-toggle svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
#dual-map .map-place-search .clear-search { min-height: 32px; margin: 0 6px; padding: 4px 6px; border: 0; font-size: 12px; text-decoration: underline; }
#dual-map .historical-place-marker.is-selected { filter: drop-shadow(0 0 3px #ffc857) drop-shadow(0 0 2px #ffc857); }
#dual-map .historical-place-popup .leaflet-popup-content { margin: 20px; font: 15px/1.5 sans-serif; color: #333; max-width: calc(100vw - 100px); }
#dual-map .historical-place-popup .geolocation_balloon { text-align: left; }
#dual-map .historical-place-popup .geolocation_balloon_title { font-size: 22px; font-weight: bold; line-height: 1.3; margin-bottom: 8px; text-align: left; }
#dual-map .historical-place-popup a { color: #007da5; text-decoration: underline; }
#dual-map .historical-place-popup .geolocation_balloon_thumbnail img { display: block; width: 100%; height: auto; max-width: 100% !important; }
#dual-map .historical-place-popup .geolocation_balloon_description { margin-top: 16px; }
#historical-place-details { margin: 16px 0; padding: 12px; background: #edf4f5; }
#historical-place-details p, #historical-place-details a, #historical-place-details button { margin-top: 10px !important; }
#historical-place-select { width: 100%; margin: 8px 0; min-height: 44px; }

#dual-map .historical-place-cluster {background: #29677c; border: 3px solid #fff; border-radius: 50%; color: #fff; text-align: center; line-height: 32px; font-weight: bold; box-shadow: 0 1px 4px #333;}

#historical-place-editor {border-top: 1px solid #ccc; margin-top: 1em; padding-top: 1em;}
#historical-place-editor input, #historical-place-editor textarea {box-sizing: border-box; width: 100%;}
#dual-map .historical-place-marker.is-draft {color: #b34810; font: 24px/20px sans-serif; text-align: center; border: 2px dashed #b34810; border-radius: 50%;}

#historical-map-list small {display: block; margin-top: .3em; font-size: .85em;}
#historical-place-visibility {width: 100%;}
#historical-hidden-label {display: block; margin: 1em 0;}
#historical-hidden-label[hidden] {display: none;}
