/* The County map page (aroostook_county_map.php + county-map.js). Season colours come from site.css variables. */

.county-page .county-intro { padding-top: .75rem; padding-bottom: .25rem; }
.county-page .county-intro h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.4rem); }

/* The map fills the width; its height is set by county-map.js to fill the rest of the screen */
.cmap-wrap { position: relative; width: 100%; height: 75vh; min-height: 440px; background: var(--tint, #FCE7D8); }
.cmap-wrap:fullscreen, .cmap-wrap:-webkit-full-screen { width: 100%; height: 100vh; min-height: 0; }
.cmap { position: absolute; inset: 0; }
.cmap-note { position: absolute; left: 1rem; top: 1rem; margin: 0; background: #fff; padding: .5rem .75rem; border-radius: 6px; }

/* Zoom slider, top left of the map */
.cm-zoom { display: flex; align-items: center; gap: .45rem; background: #fff; color: #1B1F2A; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.2); padding: .4rem .7rem; font: 700 .8rem/1 system-ui, sans-serif; margin: 10px 0 0 10px; }
.cm-zoom-range { width: 160px; min-height: 36px; accent-color: var(--main, #C2410C); cursor: pointer; }
.cm-zoom-range:focus-visible { outline: 3px solid #1B1F2A; outline-offset: 2px; }
@media (max-width: 639px) { .cm-zoom-range { width: 110px; } }

/* While the site menu is open, hide the map's key and zoom slider so they don't sit over the menu */
.nav-open .cm-legend, .nav-open .cm-zoom { display: none !important; }

/* Full-screen button, top right of the map */
.cm-fs .cm-fs-btn { font: 700 .85rem/1 system-ui, sans-serif; padding: .55rem .7rem; background: #fff; color: #1B1F2A; border: 0; cursor: pointer; min-height: 36px; }
.cm-fs .cm-fs-btn:hover { background: var(--tint, #FCE7D8); }
.cm-fs .cm-fs-btn:focus-visible { outline: 3px solid var(--main, #C2410C); outline-offset: 2px; }

/* Town names beside the dots */
.leaflet-tooltip.cm-label { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0; color: #1B1F2A; font: 700 .8rem/1.2 system-ui, sans-serif; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; white-space: nowrap; }
.leaflet-tooltip.cm-label::before { display: none; }
.leaflet-tooltip.cm-city-label { font-size: .95rem; font-weight: 800; }
.cm-hide-labels .leaflet-tooltip.cm-label:not(.cm-city-label) { display: none; }

/* Legend, bottom left, in the empty corner of the map */
.cm-legend { background: #fff; color: #1B1F2A; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.2); padding: .6rem .8rem; margin: 0 0 .75rem .75rem; font: 500 .9rem/1.4 system-ui, sans-serif; max-width: 240px; }
.cm-legend p { margin: .2rem 0; }
.cm-legend-title { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.cm-legend-tip { color: #4a4f5c; font-size: .8rem; }
.cm-legend-toggle { display: none; font: 700 .85rem/1 system-ui, sans-serif; padding: .5rem .7rem; background: var(--main, #C2410C); color: #fff; border: 0; border-radius: 6px; cursor: pointer; min-height: 36px; }
.cm-legend-toggle:focus-visible { outline: 3px solid #1B1F2A; outline-offset: 2px; }
.cm-sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: .35rem; }
.cm-sw-county { border-radius: 2px; width: 16px; height: 12px; background: var(--accent, #FFC93C); border: 2px solid var(--main, #C2410C); }
.cm-sw-town { background: var(--deep, #7C2D12); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--deep, #7C2D12); }
.cm-sw-route { width: 20px; height: 4px; border-radius: 2px; background: var(--main, #C2410C); vertical-align: 3px; }
.cm-sw-city { width: 18px; height: 18px; background: var(--deep, #7C2D12); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--deep, #7C2D12); }

/* Phones: the key folds into a button so it doesn't cover the towns */
@media (max-width: 639px) {
  .cm-legend { max-width: none; padding: .35rem; background: transparent; box-shadow: none; }
  .cm-legend-toggle { display: inline-block; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
  .cm-legend-panel { background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.2); padding: .6rem .8rem; margin-top: .4rem; max-width: 240px; }
  .cm-legend-panel[hidden] { display: none; }
}

/* Popup card for a town */
.cm-card { font: 500 .95rem/1.4 system-ui, sans-serif; color: #1B1F2A; }
.cm-card h3 { margin: .2rem 0 .3rem; font: 800 1.25rem/1.1 'Big Shoulders Display', sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.cm-card-photo { display: block; width: 100%; height: auto; border-radius: 6px; margin-bottom: .4rem; aspect-ratio: 16 / 10; object-fit: cover; }
.cm-card-meta { margin: 0 0 .5rem; color: #4a4f5c; font-size: .85rem; }
.cm-card-link { font-weight: 800; color: var(--link, #B13B0A); }

/* The plain list under the map */
.county-list { padding-top: 1.5rem; padding-bottom: 3rem; }
.county-panel { background: #fff; border: 1px solid #d8c9bd; border-radius: 8px; padding: .75rem 1rem; }
.county-panel summary { font-weight: 800; cursor: pointer; font-size: 1.1rem; min-height: 44px; display: flex; align-items: center; }
.county-panel summary:focus-visible { outline: 3px solid var(--main, #C2410C); outline-offset: 2px; }
.county-panel[open] summary { margin-bottom: .5rem; }
.county-towns { columns: 2 14rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.county-towns li { break-inside: avoid; margin: 0 0 .6rem; }
.county-towns a { font-weight: 700; }
