/*! Campus Map Kit v1.0.0 — all classes are prefixed with .cmk to avoid clashes. Theme via CSS variables.
   Colours follow the site tokens (assets/css/kids.css) with olive fallbacks, so light and dark mode both apply. */
.cmk {
    --cmk-primary: var(--accent, #69794b);
    --cmk-accent: var(--accent-strong, #414a31);
    --cmk-text: var(--text, #3a4130);
    --cmk-muted: var(--text-muted, #5f6652);
    --cmk-soft: var(--olive-mist, #f0f1e8);
    /* Solid (not glass): the side panel and the buttons read cleanly over the map. */
    --cmk-panel-bg: var(--surface-solid, #ffffff);
    --cmk-line: var(--line, #dcd8c6);
    --cmk-radius: var(--r-md, 22px);
    --cmk-shadow: var(--shadow-2, 0 22px 44px -24px rgba(65, 74, 49, .42));
    --cmk-font: inherit;
    --cmk-panel-width: 340px;

    position: relative;
    /* Its own stacking layer: MapLibre's "hold Ctrl to zoom" screen (z-index
       99999) and the controls stay inside the map and never paint over the
       page's sticky header while the page scrolls past. */
    z-index: 0;
    isolation: isolate;
    height: 620px;
    min-height: 420px;
    overflow: hidden;
    font-family: var(--cmk-font);
    color: var(--cmk-text);
    background: var(--sand-soft, #ebe6d4);
    border-radius: var(--cmk-radius);
    box-sizing: border-box;
}
.cmk *, .cmk *::before, .cmk *::after { box-sizing: border-box; }
.cmk .cmk-canvas, .cmk .cmk-canvas.maplibregl-map { position: absolute; inset: 0; }
.cmk:fullscreen { border-radius: 0; }

.cmk-toolbar { position: absolute; top: 12px; left: 56px; z-index: 2; display: flex; gap: 8px; }
.cmk-group { display: flex; overflow: hidden; background: var(--cmk-panel-bg); border-radius: 999px; box-shadow: 0 0 0 1px var(--cmk-line), var(--shadow-1, 0 6px 18px -10px rgba(65, 74, 49, .25)); }
.cmk-group button, .cmk-reset {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 34px; padding: 0 12px; margin: 0;
    font: 700 13px/1 var(--cmk-font); color: var(--cmk-accent);
    background: var(--cmk-panel-bg); border: 0; cursor: pointer;
    transition: background-color .2s, color .2s;
}
.cmk-group button:hover, .cmk-reset:hover { background: var(--cmk-soft); }
.cmk-group button.is-active { color: var(--on-accent, #fff); background: var(--cmk-primary); }
.cmk-reset { border-radius: 999px; box-shadow: 0 0 0 1px var(--cmk-line), var(--shadow-1, 0 6px 18px -10px rgba(65, 74, 49, .25)); }
.cmk svg { width: 16px; height: 16px; }

.cmk-panel {
    position: absolute; top: 12px; right: 12px; bottom: 12px; z-index: 2;
    width: var(--cmk-panel-width); overflow-y: auto; padding: 22px 24px;
    background: var(--cmk-panel-bg); border: 1px solid var(--cmk-line); border-radius: 18px; box-shadow: var(--cmk-shadow);
}
.cmk-empty-icon { color: var(--cmk-primary); }
.cmk-empty > p { margin: 10px 0 15px; font-size: 15px; line-height: 1.5; color: var(--cmk-muted); }
.cmk-list { margin: 0; padding: 0; list-style: none; }
.cmk-list button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    margin: 0 0 6px; padding: 10px 12px;
    font: 600 14px/1.3 var(--cmk-font); color: var(--cmk-text); text-align: left;
    background: var(--cmk-soft); border: 1px solid transparent; border-radius: 12px; cursor: pointer;
    transition: border-color .2s, background-color .2s;
}
.cmk-list button:hover, .cmk-list button.is-active { border-color: var(--cmk-primary); }
.cmk-swatch { flex: 0 0 14px; height: 14px; border-radius: 4px; }

.cmk-body { position: relative; animation: cmk-in .35s var(--ease-out, ease) both; }
@keyframes cmk-in { from { opacity: 0; transform: translateY(8px); } }
.cmk-body h3 { margin: 10px 0 4px; padding-right: 40px; font-size: 21px; font-weight: 700; line-height: 1.25; color: var(--heading, #414a31); }
.cmk-body h4 { margin: 16px 0 6px; font-size: 14px; font-weight: 700; color: var(--cmk-accent); }
.cmk-body p, .cmk-body li { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.cmk-body ul { margin: 0; padding-left: 18px; }
.cmk-body li::marker { color: var(--cmk-primary); }
.cmk-body a { color: var(--cmk-accent); font-weight: 600; }
.cmk-subtitle { font-weight: 600; color: var(--cmk-primary); }
.cmk-meta { color: var(--cmk-muted); }
/* Inside the panel's content box, so neither the panel edge nor its scrollbar cuts it. */
.cmk-close { position: absolute; top: -4px; right: 0; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: var(--cmk-accent); background: none; border: 0; border-radius: 50%; cursor: pointer; }
.cmk-close:hover { background: var(--cmk-soft); }
.cmk-badge { display: inline-block; padding: 3px 10px; font-size: 13px; font-weight: 700; border-radius: 20px; }
.cmk-badge.is-verified { color: var(--accent-strong, #414a31); background: var(--olive-soft, #e6e9dc); }
.cmk-badge.is-unverified { color: var(--heading, #414a31); background: var(--sand-soft, #ebe6d4); }
.cmk-message { display: flex; align-items: center; justify-content: center; height: 100%; margin: 0; padding: 20px; text-align: center; }

@media (max-width: 767px) {
    .cmk { height: auto !important; min-height: 0; }
    .cmk .cmk-canvas, .cmk .cmk-canvas.maplibregl-map { position: relative; inset: auto; height: 420px; }
    .cmk-panel { position: static; width: auto; border: 0; border-top: 1px solid var(--cmk-line); border-radius: 0; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
    .cmk-body { animation: none; }
}
