/* ─── Malta — Site view (MapLibre GL) ─── platform addition; follows the island palette */
#site { position: fixed; inset: 0; z-index: 4; display: none; background: var(--sea); }
body[data-view="site"] #site { display: block; }
body[data-view="site"] #map { visibility: hidden; }
body[data-view="site"] header .sub { display: none; }
#site-map { position: absolute; inset: 0; }
.maplibregl-canvas { outline: none; }
.maplibregl-ctrl-attrib { background: rgba(13,20,25,0.85) !important; color: #5b727c !important; font-family: "IBM Plex Mono", monospace; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: #7fa0ad !important; }
.maplibregl-ctrl-group { background: rgba(13,20,25,0.9) !important; border: 1px solid var(--hair); box-shadow: 0 6px 22px rgba(0,0,0,0.5) !important; }
.maplibregl-ctrl-group button { filter: invert(0.85); }
.maplibregl-popup-content { background: rgba(10,17,21,0.96); color: var(--ink); border: 1px solid var(--hair); border-radius: 10px; font-family: "IBM Plex Mono", monospace; font-size: 12px; padding: 10px 12px; max-width: 320px; }
.maplibregl-popup-tip { border-top-color: rgba(10,17,21,0.96) !important; }
.maplibregl-popup-close-button { color: var(--ink-dim); font-size: 16px; }
.sp-title { font-family: "Archivo", sans-serif; font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.sp-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px dashed rgba(255,255,255,0.06); }
.sp-row span { color: var(--ink-dim); } .sp-row b { font-weight: 500; text-align: right; }
.sp-src { margin-top: 6px; font-size: 10px; color: #54707c; line-height: 1.4; }

/* top bar: address search + state */
#site-bar { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 8; display: flex; gap: 8px; align-items: center; }
body:not([data-view="site"]) #site-bar { display: none; }
#site-search { position: relative; }
#site-search input { width: 360px; max-width: 70vw; background: rgba(13,20,25,0.92); border: 1px solid var(--hair); color: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: 12px; padding: 8px 12px 8px 30px; border-radius: 999px; outline: none; backdrop-filter: blur(6px); }
#site-search input:focus { border-color: #4a6570; }
#site-search .ss-ico { position: absolute; left: 11px; top: 7px; color: #51707d; font-size: 13px; pointer-events: none; }
#site-results { position: absolute; top: 36px; left: 0; right: 0; background: rgba(13,20,25,0.97); border: 1px solid var(--hair); border-radius: 10px; overflow: hidden; display: none; box-shadow: 0 14px 40px rgba(0,0,0,0.5); }
#site-results.open { display: block; }
#site-results button { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: 11.5px; padding: 8px 12px; cursor: pointer; }
#site-results button:hover { background: #1a262d; }
#site-results .ss-note { padding: 8px 12px; color: var(--ink-dim); font-family: "IBM Plex Mono", monospace; font-size: 11px; }
.site-chip { background: rgba(13,20,25,0.9); border: 1px solid var(--hair); color: var(--ink-dim); font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.06em; padding: 7px 13px; border-radius: 999px; cursor: pointer; backdrop-filter: blur(6px); }
.site-chip:hover { color: var(--ink); border-color: #4a6570; }
.site-chip.zoom { color: #7fa0ad; cursor: default; }

/* site-only layers panel (right side, registry-generated) */
#site-legend { position: fixed; right: 22px; top: 120px; bottom: 120px; width: 300px; z-index: 6; overflow-y: auto; display: none; flex-direction: column; gap: 6px; padding-right: 4px; }
body[data-view="site"] #site-legend { display: flex; }
#panel.open ~ #site-legend { display: none; }
#site-legend::-webkit-scrollbar { width: 6px; } #site-legend::-webkit-scrollbar-thumb { background: #2a3a42; border-radius: 3px; }
#site-legend .sl-head { font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.2em; color: #51707d; padding: 0 6px 6px; border-bottom: 1px solid var(--hair); }
#site-legend .layer { width: 100%; justify-content: flex-start; }
#site-legend .layer .eng-state { margin-left: auto; font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; border: 1px solid transparent; }
#site-legend .layer .eng-state.live { color: #84c8a2; border-color: rgba(84,185,122,0.35); }
#site-legend .layer .eng-state.loading { color: #9fcbe0; border-color: rgba(95,176,224,0.35); }
#site-legend .layer .eng-state.unavailable { color: #8a949a; border-color: #34464f; background: rgba(255,255,255,0.03); }
#site-legend .layer.unavailable { color: #6d8590; border-style: dashed; }
#site-legend .layer.zoom-wait .zoom-hint { color: #f0b366; border-color: #6e4a1f; }
#site-legend .lgroup-body .lnote { max-width: none; }

/* attribution footer for the site view (registry sources of the layers on + basemap) */
#site-attrib { position: fixed; left: 28px; bottom: 18px; max-width: 560px; z-index: 5; font-family: "IBM Plex Mono", monospace; font-size: 10.5px; color: #5b727c; line-height: 1.5; display: none; }
body[data-view="site"] #site-attrib { display: block; }
body[data-view="site"] footer { display: none; }

/* pin */
.site-pin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #ffcf5e; background: rgba(255,207,94,0.25); box-shadow: 0 0 0 4px rgba(255,207,94,0.15), 0 0 14px rgba(255,207,94,0.6); cursor: pointer; }

@media (max-width: 820px) {
  #site-bar { top: 118px; width: calc(100% - 24px); }
  #site-search input { width: 100%; max-width: none; }
  #site-legend { right: 0; left: 0; top: auto; bottom: 0; width: 100%; max-height: 40vh; padding: 10px 12px 70px; background: rgba(11,17,21,0.97); border-top: 1px solid var(--hair); }
  #site-attrib { display: none !important; }
}
