/* Macedon Places. Tokens follow the theme's own (Kutlesh: --bg, --ink, --line, --serif, --sans …),
   so colours, fonts and dark mode match the site. Override any --mp-* token in your theme if needed. */
:root {
	--mp-ground: var(--soft, #F6F3EE);
	--mp-paper: var(--bg, #FFFFFF);
	--mp-ink: var(--ink, #1E1B18);
	--mp-muted: var(--muted, #5E5750);
	--mp-line: var(--line, #DDD5CA);
	--mp-line-strong: #CFC6B9;
	--mp-hover: var(--soft, #F3EEE6);
	--mp-red: var(--k-red, #A3121A);
	--mp-red-dark: #7A0D13;
	--mp-gold: #E9A800;
	--mp-gold-soft: #FFF4CC;
	--mp-gold-ink: #5C4300;
	--mp-sans: var(--sans, 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif);
	--mp-serif: var(--serif, 'PT Serif', Georgia, serif);
}
html[data-theme="dark"] { --mp-line-strong: #3a3633; }

/* Language: both printed, one shown (shared with the hub's switch). */
html:not([data-mh-lang="en"]) .mp-l-en { display: none !important; }
html[data-mh-lang="en"] .mp-l-mk { display: none !important; }

.mp-map-wrap, .mp-place { font-family: var(--mp-sans); color: var(--mp-ink); }
.mp-map-wrap *, .mp-place * { box-sizing: border-box; }
.mp-map-wrap button, .mp-place button { font: inherit; color: inherit; cursor: pointer; }
.mp-map-wrap svg, .mp-place svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Map page ---------- */
.mp-map-wrap { background: var(--mp-paper); border: 1px solid var(--mp-line); border-radius: 16px; overflow: hidden; }
.mp-bar { padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--mp-line); }
.mp-bar-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mp-search-wrap { position: relative; flex: 1 1 280px; min-width: 0; }
.mp-search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border: 1px solid var(--mp-line-strong); border-radius: 999px; background: var(--mp-ground); color: var(--mp-muted); }
.mp-search:focus-within { border-color: var(--mp-ink); box-shadow: 0 0 0 3px rgba(30,27,24,.12); }
.mp-search input { border: 0 !important; background: transparent !important; box-shadow: none !important; font: inherit; font-size: 16px; color: var(--mp-ink); flex: 1; min-width: 0; padding: 0 !important; outline: none; height: auto; }
.mp-results { position: absolute; z-index: 1001; left: 0; right: 0; top: 52px; background: var(--mp-paper); border: 1px solid var(--mp-line); border-radius: 14px; box-shadow: 0 12px 32px rgba(30,27,24,.18); padding: 6px; max-height: 360px; overflow-y: auto; }
.mp-results button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 10px; min-height: 44px; }
.mp-results button:hover, .mp-results button:focus-visible { background: var(--mp-hover); }
.mp-results small { display: block; color: var(--mp-muted); font-size: 12.5px; }
.mp-results p { margin: 0; padding: 12px; color: var(--mp-muted); }
.mp-btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--mp-line-strong); background: var(--mp-paper); font-weight: 600; }
.mp-btn.is-busy { opacity: .6; }
.mp-lang { display: inline-flex; border: 1px solid var(--mp-line-strong); border-radius: 999px; overflow: hidden; height: 46px; }
.mp-lang button { border: 0; background: var(--mp-paper); padding: 0 16px; font-weight: 600; }
.mp-lang button[aria-pressed="true"] { background: var(--mp-ink); color: var(--mp-paper); font-weight: 700; }
.mp-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mp-chips::-webkit-scrollbar { display: none; }
.mp-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--mp-line-strong); background: var(--mp-paper); font-weight: 600; font-size: 14px; white-space: nowrap; }
.mp-chip[aria-pressed="true"] { background: var(--mp-ink); border-color: var(--mp-ink); color: var(--mp-paper); }
.mp-dot { width: 11px; height: 11px; border-radius: 999px; background: var(--c); flex: none; display: inline-block; }
.mp-register { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--mp-muted); min-height: 32px; }
.mp-register input { width: 18px; height: 18px; accent-color: var(--mp-red); margin: 0; }

.mp-body { display: flex; height: var(--mp-h, 640px); position: relative; }
.mp-list { flex: 0 0 340px; display: flex; flex-direction: column; border-right: 1px solid var(--mp-line); background: var(--mp-paper); min-height: 0; }
.mp-no-list .mp-list { display: none; }
.mp-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 14px 18px 6px; }
.mp-list-head h2 { margin: 0; font-family: var(--mp-serif); font-size: 19px; line-height: 1.2; }
.mp-list-head span { font-size: 12.5px; color: var(--mp-muted); }
.mp-list ol { list-style: none; margin: 0; padding: 0 8px 12px; overflow-y: auto; flex: 1; }
.mp-list li { margin: 0; }
.mp-list li button { width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; }
.mp-list li button:hover, .mp-list li button[aria-current="true"] { background: var(--mp-hover); }
.mp-list .mp-dot { margin-top: 5px; }
.mp-li-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mp-li-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.mp-li-sub, .mp-li-meta { font-size: 12.5px; color: var(--mp-muted); }

.mp-canvas { flex: 1; position: relative; min-width: 0; }
.mp-leaflet { position: absolute; inset: 0; background: var(--mp-ground); font-family: var(--mp-sans); }
.mp-error { position: absolute; z-index: 999; left: 16px; top: 16px; margin: 0; background: var(--mp-paper); padding: 10px 14px; border-radius: 10px; }
.mp-list-toggle { display: none; }

/* Pins and clusters */
.mp-pin-wrap { background: none; border: 0; }
.mp-pin { display: block; width: 100%; height: 100%; border-radius: 999px; background: var(--c); border: 2.5px solid #FFFFFF; box-shadow: 0 0 0 1px rgba(30,27,24,.35), 0 2px 6px rgba(30,27,24,.3); transition: transform .12s; }
.mp-pin.is-featured { border-width: 3px; }
.mp-pin.is-selected { box-shadow: 0 0 0 4px var(--mp-gold), 0 3px 10px rgba(30,27,24,.35); }
.mp-pin-wrap:hover .mp-pin { transform: scale(1.12); }
.mp-cluster { background: none; }
.mp-cluster span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 999px; background: rgba(30,27,24,.78); color: #FFFFFF; border: 2.5px solid #FFFFFF; font: 600 12.5px var(--mp-sans); box-shadow: 0 2px 6px rgba(30,27,24,.3); }
.mp-cluster--reg span { background: rgba(107,91,46,.85); font-size: 11px; }

/* Card (desktop popup and phone sheet share it) */
.mp-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 12px 32px rgba(30,27,24,.28); }
.mp-popup .leaflet-popup-content { margin: 0; width: 330px !important; font-family: var(--mp-sans); font-size: 14px; line-height: 1.45; }
.mp-popup .leaflet-popup-tip { box-shadow: none; }
.mp-card { position: relative; background: var(--mp-paper); color: var(--mp-ink); }
.mp-card-img { position: relative; height: 160px; background: var(--mp-line-strong); }
.mp-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-credit { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); font-size: 10.5px; line-height: 1.3; background: rgba(255,255,255,.88); color: #3D3833 !important; padding: 2px 8px; border-radius: 999px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-card-close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 36px; height: 36px; border-radius: 999px; border: 0; background: rgba(255,255,255,.94); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(30,27,24,.2); }
.mp-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.mp-card h3 { margin: 2px 0 0; font-family: var(--mp-serif); font-size: 21px; line-height: 1.2; padding-right: 30px; }
.mp-card-img + .mp-card-close + .mp-card-body h3 { padding-right: 0; }
.mp-card-other { margin: 0; font-size: 13.5px; color: var(--mp-muted); }
.mp-card-line { margin: 2px 0 4px; font-size: 14.5px; }
.mp-card-actions { display: flex; gap: 8px; margin-top: 4px; }
.mp-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--c, var(--mp-ink)); color: #FFFFFF; }
.mp-badge--soft { background: var(--mp-ground); color: var(--mp-ink); border: 1px solid var(--mp-line); }
.mp-badge--gold { background: var(--mp-gold-soft); color: var(--mp-gold-ink); }
.mp-cta { flex: 1; display: grid; place-items: center; min-height: 46px; padding: 0 14px; border-radius: 11px; background: var(--mp-red); color: #FFFFFF !important; text-decoration: none !important; font-weight: 700; border: 0; text-align: center; }
.mp-cta:hover { background: var(--mp-red-dark); }
.mp-cta--quiet { background: var(--mp-paper); color: var(--mp-ink) !important; border: 1.5px solid var(--mp-ink); font-weight: 600; }
.mp-cta--quiet:hover { background: var(--mp-hover); }
.mp-reg-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; font-family: var(--mp-sans); }
.mp-reg-card strong { font-family: var(--mp-serif); font-size: 17px; }
.mp-reg-type { font-size: 12px; font-weight: 600; color: #6B5B2E; }
.mp-popup--reg .leaflet-popup-content { width: auto !important; }

.mp-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1000; background: var(--mp-paper); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 24px rgba(30,27,24,.22); max-height: 78%; overflow-y: auto; }
.mp-sheet[hidden] { display: none; }
.mp-sheet .mp-card-img { height: 150px; border-radius: 18px 18px 0 0; overflow: hidden; }

.leaflet-container a.mp-cta { color: #FFFFFF; }
.leaflet-control-attribution { font-size: 10.5px; }

/* Phones: full-height map, filters on top, card as a bottom sheet, list as a slide-over */
@media (max-width: 720px) {
	.mp-map-wrap { border-radius: 0; border-left: 0; border-right: 0; }
	.mp-bar { padding: 10px 10px 8px; gap: 8px; }
	.mp-bar-top .mp-btn span { display: none; }
	.mp-bar-top .mp-btn { width: 46px; padding: 0; justify-content: center; }
	.mp-register { font-size: 13px; }
	.mp-body { height: calc(100vh - 170px); height: calc(100dvh - 170px); min-height: 420px; }
	.mp-list { position: absolute; z-index: 1001; inset: 0 auto 0 0; width: min(88vw, 360px); transform: translateX(-102%); transition: transform .2s; box-shadow: 8px 0 24px rgba(30,27,24,.2); }
	.is-list-open .mp-list { transform: none; }
	.mp-list-toggle { display: inline-flex; position: absolute; z-index: 999; left: 10px; top: 10px; height: 40px; padding: 0 16px; align-items: center; border-radius: 999px; border: 0; background: var(--mp-paper); font-weight: 700; box-shadow: 0 2px 10px rgba(30,27,24,.2); }
	.has-sheet .mp-list-toggle { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mp-list, .mp-pin { transition: none; } }

/* ---------- Place page ---------- */
.mp-place { max-width: 1180px; margin: 0 auto; }
.mp-place-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.mp-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: var(--mp-red); min-height: 44px; }
.mp-place .mp-lang { height: 40px; }
.mp-hero { margin: 0 0 24px; position: relative; border-radius: 16px; overflow: hidden; background: var(--mp-line-strong); }
.mp-hero img { width: 100%; max-height: 520px; object-fit: cover; display: block; }
.mp-hero figcaption { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); font-size: 12px; }
.mp-hero figcaption a { background: rgba(255,255,255,.9); color: #3D3833; padding: 4px 10px; border-radius: 999px; text-decoration: none; display: inline-block; }
.mp-place-grid { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.mp-place-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.mp-other-name { margin: -8px 0 0; font-family: var(--mp-serif); font-size: 21px; color: var(--mp-muted); }
.mp-desc { font-size: 17.5px; line-height: 1.65; max-width: 680px; }
.mp-desc p { margin: 0 0 14px; }
.mp-place h2 { margin: 0 0 12px; font-family: var(--mp-serif); font-size: 24px; }
.mp-near-grid, .mp-videos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mp-near-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: var(--mp-paper); border: 1px solid var(--mp-line); text-decoration: none !important; color: var(--mp-ink) !important; }
.mp-near-card:hover { border-color: var(--mp-ink); }
.mp-near-type { font-size: 12px; font-weight: 600; color: var(--c); }
.mp-video { display: flex; flex-direction: column; gap: 8px; text-decoration: none !important; color: var(--mp-ink) !important; }
.mp-video-img { aspect-ratio: 16 / 9; border-radius: 10px; background: #2B2622 center / cover no-repeat; }
.mp-video-title { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.mp-sources { font-size: 14px; color: var(--mp-muted); border-top: 1px solid var(--mp-line); padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.mp-sources strong { color: var(--mp-ink); }
.mp-visit { flex: 1 1 300px; max-width: 380px; background: var(--mp-paper); border: 1px solid var(--mp-line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 24px; }
.mp-visit h2 { margin: 0; font-size: 22px; }
.mp-minimap { height: 170px; border-radius: 12px; overflow: hidden; background: var(--mp-ground); }
.mp-visit dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; font-size: 15px; }
.mp-visit dt { color: var(--mp-muted); }
.mp-visit dd { margin: 0; overflow-wrap: anywhere; }
.mp-visit .mp-cta { flex: none; }
.mp-dirlink { font-size: 14px; text-align: center; }
@media (max-width: 720px) {
	.mp-visit { position: static; max-width: none; }
	.mp-hero img { max-height: 300px; }
}

/* Full-width map (default): break out of the theme's content column. */
.mp-map-wrap.mp-full {
	width: calc(100vw - var(--mp-sbw, 0px));
	max-width: none;
	margin-left: calc(50% - (100vw - var(--mp-sbw, 0px)) / 2);
	margin-right: 0;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
	position: relative;
}
.mp-full .mp-bar { padding-left: max(16px, calc((100% - var(--wrap, 1400px)) / 2)); padding-right: max(16px, calc((100% - var(--wrap, 1400px)) / 2)); }
.mp-full .mp-chips { flex-wrap: wrap; overflow: visible; }
.mp-full .mp-list { flex-basis: 360px; }
@media (min-width: 1500px) { .mp-full .mp-list { flex-basis: 400px; } }
@media (max-width: 720px) { .mp-full .mp-chips { flex-wrap: nowrap; overflow-x: auto; } }
