/*
 * National STR Map: compact top. The map is the product, so the title block, the stat strip, the Budget Finder and the listings
 * panel are kept slim and the map starts near the top of the screen. Loaded after the other map stylesheets; it only overrides spacing
 * and layout, never colours or content.
 */
.sm-hero { padding: 84px 24px 10px; padding-top: calc(84px + env(safe-area-inset-top, 0px)); }
.sm-hero-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.sm-hero-inner > .sm-eyebrow, .sm-hero-inner > .sm-powered { flex: 0 0 auto; }
.sm-hero h1 { flex: 1 1 100%; margin: 4px 0 0; font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.15; }
.sm-intro { flex: 1 1 100%; margin: 0; }
.sm-intro summary { display: inline-block; cursor: pointer; color: var(--sm-accent); font-size: .85rem; font-weight: 600; list-style: none; }
.sm-intro summary::-webkit-details-marker { display: none; }
.sm-intro summary::after { content: ' \25BE'; }
.sm-intro[open] summary::after { content: ' \25B4'; }
.sm-intro p { margin: 8px 0 0; }
/* the stat strip becomes one thin line */
.sm-kpis { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; }
.sm-kpi { display: inline-flex; align-items: baseline; gap: 7px; background: none; border: 0; border-radius: 0; padding: 0; }
.sm-kpi-v { font-size: 1.05rem; }
.sm-kpi-l { margin: 0; font-size: .68rem; }

/* the Budget Finder: one slim row from laptop width up; the long readout and tagline give way to the slider */
.sm-finder .sf-tagline { display: none; }
.sm-finder .sf-wrap { padding-top: 10px; }
.sm-finder .sf-bar { padding-top: 9px; padding-bottom: 9px; }
@media (min-width: 1100px) and (max-width: 1480px) {
    .sm-finder .sf-bar { grid-template-columns: auto minmax(300px, 1fr) auto auto; grid-template-areas: "brand hero match actions"; }
    .sm-finder .sf-readout { display: none; }
}
@media (max-width: 720px) {
    .sm-hero { padding: 80px 16px 8px; padding-top: calc(80px + env(safe-area-inset-top, 0px)); }
    .sm-hero h1 { font-size: 1.3rem; }
    .sm-kpis { gap: 2px 14px; }
    .sm-kpi-v { font-size: .95rem; }
    .sm-kpi-l { font-size: .62rem; }
    .sm-finder .sf-readout { display: none; }
}

/* the map starts closer to what is above it */
.sm-app { padding-top: 10px; }

/* phones: the overlay picker becomes a swipeable strip above the map, and the legend moves below it, so the map is the first big thing you see */
@media (max-width: 720px) {
    .sm-rail { display: contents; }
    .sm-rail > .sm-panel:first-child { order: 0; }
    .sm-center { order: 1; }
    .sm-rail > .sm-panel:nth-child(2) { order: 2; }
    .sm-drawer { order: 3; }
    .sm-rail > .sm-panel:first-child .sm-panel-head { display: none; }
    .sm-rail > .sm-panel:first-child .sm-panel-body { padding: 8px; }
    .sm-overlays { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
    .sm-overlays > * { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; }
}
@media (max-width: 720px) { .sm-powered { display: none; } }

/*
 * The folded results list: one centred, unmissable button. It pulses softly (about one beat every 1.6 seconds, never a hard flash) while
 * the list is folded, and goes back to a plain small button once the list is open. Still and just as bold for anyone who has asked their
 * device for reduced motion.
 */
.sm-finder .sf-res-head { flex-wrap: wrap; }
.sm-finder #sf-list-toggle[aria-expanded="false"] {
    order: 10; flex: 0 1 400px; width: 100%; max-width: 400px; margin: 6px auto 4px; justify-self: center; grid-area: auto; grid-column: 1 / -1;
    padding: 13px 28px; border-radius: 999px; border: 0; cursor: pointer;
    background: linear-gradient(135deg, #34D399, #10B981); color: #05231A;
    font-size: 1rem; font-weight: 800; letter-spacing: .02em; text-align: center;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, .6), 0 6px 22px -6px rgba(16, 185, 129, .7);
    animation: sf-list-pulse 1.6s ease-in-out infinite;
}
.sm-finder #sf-list-toggle[aria-expanded="false"]::after { content: ' \25BE'; }
.sm-finder #sf-list-toggle[aria-expanded="false"]:hover, .sm-finder #sf-list-toggle[aria-expanded="false"]:focus-visible { animation-play-state: paused; filter: brightness(1.12); }
.sm-finder #sf-list-toggle[aria-expanded="false"]:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@keyframes sf-list-pulse {
    0%   { filter: brightness(1);    box-shadow: 0 0 0 0 rgba(52, 211, 153, .6), 0 6px 22px -6px rgba(16, 185, 129, .7); }
    50%  { filter: brightness(1.22); box-shadow: 0 0 0 12px rgba(52, 211, 153, 0), 0 6px 26px -4px rgba(52, 211, 153, .9); }
    100% { filter: brightness(1);    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0), 0 6px 22px -6px rgba(16, 185, 129, .7); }
}
@media (prefers-reduced-motion: reduce) {
    .sm-finder #sf-list-toggle[aria-expanded="false"] { animation: none; }
}
/* wider screens: a line break before the folded-list button so it sits centred on its own row under the title and sort */
@media (min-width: 721px) {
    .sm-finder .sf-res-head:has(#sf-list-toggle[aria-expanded="false"])::after { content: ''; flex: 0 0 100%; order: 9; height: 0; }
}
