/* AP Service Area Map , flat light theme matched to allpainting.ca (Open Sans, #016fff, pill radius) */

.ap-map-widget { max-width: 1200px; margin: 0 auto; font-family: inherit; }

.ap-head { text-align: center; margin-bottom: 34px; }
.ap-head h2 { font-weight: 700; color: #000; font-size: clamp(26px, 3.2vw, 38px); margin: 0 0 12px; padding-bottom: 0; }
.ap-head p { color: #666; font-size: 16px; line-height: 1.7; max-width: 640px; margin: 0 auto; }

.ap-grid { display: grid; grid-template-columns: 1fr 350px; gap: 26px; align-items: stretch; }

/* ---- Stage ---- */
.ap-stage { position: relative; background: #f8f8f9; border-radius: 20px; padding: 18px; display: flex; align-items: center; }
.ap-stage svg { width: 100%; height: auto; display: block; }

.ap-reset { visibility: hidden; position: absolute; top: 14px; left: 14px; z-index: 2; appearance: none; border: 1px solid #e3e5e8; background: #fff; color: #000; font-family: inherit; font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 30px; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s; }
.ap-reset.show { visibility: visible; opacity: 1; pointer-events: auto; transform: none; transition-delay: 0s; }
/* hidden until a region is chosen: visibility keeps it out of the tab order while it is invisible */
.ap-reset:hover { border-color: #0a77f6; color: #0a77f6; }

/* Region shapes */
.ap-rp { stroke: #fff; stroke-width: 2.5; cursor: pointer; transition: fill .25s ease, opacity .3s ease; }
.ap-rp.dim { opacity: .38; }

/* Paint overlay: revealed left->right like a roller pass */
.ap-paint { stroke: #fff; stroke-width: 2.5; cursor: pointer; clip-path: inset(0 100% 0 0); -webkit-clip-path: inset(0 100% 0 0); transition: clip-path .7s cubic-bezier(.22,.61,.36,1); }
.ap-paint.wet { clip-path: inset(0 0 0 0); -webkit-clip-path: inset(0 0 0 0); }

/* Logo speed-dashes trailing the painted region */
.ap-dash { stroke-linecap: round; opacity: 0; transform: translateX(26px); transition: opacity .35s ease, transform .5s cubic-bezier(.22,.61,.36,1); }
.ap-dashgrp.show .ap-dash-0 { transition-delay: .30s; }
.ap-dashgrp.show .ap-dash-1 { transition-delay: .42s; }
.ap-dashgrp.show .ap-dash-2 { transition-delay: .54s; }
.ap-dashgrp.show .ap-dash { opacity: .92; transform: none; }

/* Labels */
.ap-rt { font-family: inherit; font-size: 16px; font-weight: 700; fill: #24292f; pointer-events: none; transition: fill .3s ease, opacity .25s ease; }
.ap-rt.on-paint { fill: #fff; }
.ap-rt.hide, .ap-ml.hide, .ap-drop.hide { opacity: 0; }
.ap-ml { font-family: inherit; font-size: 15px; font-weight: 600; fill: #fff; pointer-events: none; transition: opacity .35s ease .25s; text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.ap-drop { fill: #fff; opacity: .95; pointer-events: none; transition: opacity .35s ease .2s; }

/* Toronto HQ marker */
.ap-hq-drop { fill: #fff; }
.ap-hq-badge { fill: #016fff; stroke: #fff; stroke-width: 1.6; } /* client round 2026-10-08: the HQ logo sits on a brand-blue badge, so it reads over the lake too */
.ap-hq-pulse { fill: none; stroke: #016fff; stroke-width: 1.6; opacity: .8; transform-origin: 299px 390px; animation: apPulse 2.4s ease-out infinite; }
.ap-hq-tag { font-family: inherit; font-size: 12px; font-weight: 700; fill: #24292f; text-anchor: middle; }
.ap-hq-tag-short { display: none; }
[data-ap-hq] { transition: opacity .3s ease; pointer-events: none; }
@keyframes apPulse { 0% { transform: scale(.6); opacity: .85; } 70% { transform: scale(1.9); opacity: 0; } 100% { transform: scale(1.9); opacity: 0; } }

/* ---- Panel ---- */
.ap-panel { background: #fff; border: 1px solid #e9eaee; border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; }
.ap-panel-head { padding: 24px 24px 14px; }
.ap-panel-title { font-size: 20px; font-weight: 700; color: #000; display: flex; align-items: center; }
.ap-panel-count { display: inline-block; font-size: 12.5px; font-weight: 600; color: #016fff; margin: 6px 0 8px; }
.ap-panel-sub { font-size: 14px; color: #666; line-height: 1.65; }
.ap-region-link { display: inline-block; margin-top: 10px; font-size: 13.5px; font-weight: 600; color: #016fff; text-decoration: none; }
.ap-region-link:hover { text-decoration: underline; color: #016fff; }

.ap-panel-body { flex: 1; padding: 6px 24px 10px; overflow-y: auto; }

.ap-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; flex: none; }
.ap-panel-title .ap-dot { width: 12px; height: 12px; }

.ap-rlist { display: flex; flex-direction: column; gap: 8px; }
.ap-ritem { display: flex; align-items: center; background: #f8f8f9; border-radius: 14px; padding: 13px 16px; cursor: pointer; transition: background .2s ease, transform .2s ease; }
button.ap-ritem { width: 100%; margin: 0; border: 0; font: inherit; color: inherit; text-align: left; -webkit-appearance: none; appearance: none; }
.ap-ritem:focus-visible, .ap-reset:focus-visible { outline: 3px solid #0a66f2; outline-offset: 2px; }
.ap-panel-title:focus { outline: none; }
.ap-panel-title:focus-visible { outline: 3px solid #0a66f2; outline-offset: 4px; border-radius: 6px; }
.ap-ritem:hover { background: #eef0f3; transform: translateX(3px); }
.ap-ritem b { font-size: 15px; font-weight: 600; color: #111; flex: 1; }
.ap-ritem em { font-style: normal; font-size: 12.5px; color: #999; margin-right: 10px; }
.ap-ritem .arr { color: #016fff; font-size: 20px; line-height: 1; }

.ap-cities { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-city { display: inline-flex; align-items: center; gap: 8px; background: #f8f8f9; color: #333; font-size: 13.5px; font-weight: 600; padding: 8px 16px; border-radius: 30px; text-decoration: none; transition: background .2s ease, color .2s ease; }
.ap-city::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); transition: background .2s ease; }
.ap-city:hover { background: var(--ink); color: #fff; }
.ap-city:hover::before { background: #fff; }
.ap-city.current { background: var(--ink); color: #fff; }
.ap-city.current::before { background: #fff; }

.ap-panel-cta { padding: 14px 24px 24px; }
.ap-cta { display: block; text-align: center; background: #016fff; color: #fff !important; font-size: 15px; font-weight: 600; padding: 13px 20px; border-radius: 30px; text-decoration: none; transition: background .2s ease; }
.ap-cta:hover { background: #0157d6; }
/* client round 2026-10-08: below 1240 px (no phone in the header) the panel offers quote + call, like every CTA pair */
.ap-panel-cta .ap-cta--call { margin-top: 10px; background: #fff; color: #0b1a33 !important; border: 1.5px solid #016fff; padding: 11.5px 20px; }
.ap-panel-cta .ap-cta--call:hover { background: #eef4ff; }
@media (min-width: 1240px) { .ap-panel-cta .ap-cta--call { display: none; } }

/* ---- Responsive ---- */
@media (max-width: 980px) {
    .ap-grid { grid-template-columns: 1fr; }
    .ap-stage { padding: 10px; }
    .ap-panel-body { max-height: 340px; }
    .ap-hq-tag-full { display: none; }
    .ap-hq-tag-short { display: none; } /* review R3: no lone "HQ" on phones */
    .ap-rt { font-size: 26px; }
    .ap-ml { font-size: 19px; }
    .ap-hq-tag { font-size: 17px; }
    .ap-map-widget.ap-dark .ap-rt { font-size: 26px; }
    .ap-stage.zoomed .ap-drop { transform-box: fill-box; }
}

@media (prefers-reduced-motion: reduce) {
    .ap-paint, .ap-dash, .ap-rp, .ap-reset, .ap-ritem { transition: none; }
    .ap-hq-pulse { animation: none; opacity: 0; }
}


/* ---- Dark theme (Bold immersive), enabled with theme="dark" ---- */
.ap-map-widget.ap-dark { max-width: none; color: #f4f1ea; }
.ap-map-widget.ap-dark .ap-head h2 { color: #f4f1ea; }
.ap-map-widget.ap-dark .ap-head p { color: #b9b6ae; }
.ap-map-widget.ap-dark .ap-grid { grid-template-columns: 7fr 5fr; gap: 1.5rem; }
.ap-map-widget.ap-dark .ap-stage { background: #16181d; border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; padding: clamp(0.5rem, 2vw, 1.5rem); }
.ap-map-widget.ap-dark .ap-reset { background: #1f2229; color: #f4f1ea; border-color: rgba(255,255,255,0.15); border-radius: 12px; }
.ap-map-widget.ap-dark .ap-reset:hover { border-color: #f4f1ea; color: #f4f1ea; }
.ap-map-widget.ap-dark .ap-rp { stroke: #3a3f4a; stroke-width: 1.5; }
.ap-map-widget.ap-dark .ap-paint { stroke: rgba(255,255,255,0.35); stroke-width: 1.5; opacity: 0.92; }
.ap-map-widget.ap-dark .ap-rt { fill: #f4f1ea; font-family: "Bricolage Grotesque", inherit; font-weight: 800; font-size: 18px; }
.ap-map-widget.ap-dark .ap-rt.on-paint { fill: #fff; }
.ap-map-widget.ap-dark .ap-ml { fill: #fff; font-weight: 700; paint-order: stroke; stroke: rgba(14,15,18,0.7); stroke-width: 3.5px; stroke-linejoin: round; }
.ap-map-widget.ap-dark .ap-hq-tag { fill: #f4f1ea; }
.ap-map-widget.ap-dark .ap-hq-drop, .ap-map-widget.ap-dark .ap-drop { fill: #f4f1ea; }
.ap-map-widget.ap-dark .ap-hq-pulse { stroke: #f4f1ea; }
.ap-map-widget.ap-dark .ap-panel { background: #16181d; border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; }
.ap-map-widget.ap-dark .ap-panel-title { color: #f4f1ea; font-family: "Bricolage Grotesque", inherit; font-weight: 800; font-size: 1.6rem; }
.ap-map-widget.ap-dark .ap-panel-count { color: #b9b6ae; }
.ap-map-widget.ap-dark .ap-panel-sub { color: #b9b6ae; }
.ap-map-widget.ap-dark .ap-region-link { color: #f4f1ea; border-bottom: 2px solid #0a77f6; text-decoration: none; }
.ap-map-widget.ap-dark .ap-region-link:hover { text-decoration: none; color: #fff; }
.ap-map-widget.ap-dark .ap-ritem { background: #1f2229; border-radius: 12px; }
.ap-map-widget.ap-dark .ap-ritem:hover { background: #2a2e37; }
.ap-map-widget.ap-dark .ap-ritem b { color: #f4f1ea; }
.ap-map-widget.ap-dark .ap-ritem em { color: #b9b6ae; }
.ap-map-widget.ap-dark .ap-ritem .arr { color: #f4f1ea; }
.ap-map-widget.ap-dark .ap-city { background: #1f2229; color: #f4f1ea; border: 1px solid rgba(255,255,255,0.1); border-radius: 999px; }
.ap-map-widget.ap-dark .ap-city:hover, .ap-map-widget.ap-dark .ap-city.current { background: var(--ink); color: #fff; }
.ap-map-widget.ap-dark .ap-cta { background-color: #f4f1ea; background-image: linear-gradient(#d90a2e, #d90a2e); background-repeat: no-repeat; background-size: 0% 100%; background-position: left center; color: #0e0f12 !important; border-radius: 14px; font-weight: 700; padding: 0.9rem 1.5rem; transition: background-size .3s ease, color .15s ease .15s; }
@media (hover: hover) { .ap-map-widget.ap-dark .ap-cta:hover { background-size: 100% 100%; color: #fff !important; } }
.ap-map-widget.ap-dark .ap-cta:focus-visible { background-size: 100% 100%; color: #fff !important; outline: 2px solid #0a77f6; outline-offset: 3px; }
@media (max-width: 980px) { .ap-map-widget.ap-dark .ap-grid { grid-template-columns: 1fr; } }

/* Bold theme: panel keeps its height from content-rich states, CTA pinned to the bottom */
.ap-map-widget.ap-dark .ap-panel-cta { margin-top: auto; }
.ap-map-widget.ap-dark .ap-panel-sub { color: #b9b6ae; font-size: 0.95rem; }
.ap-map-widget.ap-dark .ap-panel-body { padding-top: 10px; }
.ap-panel-more { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(0,0,0,0.08); }
.ap-map-widget.ap-dark .ap-panel-more { border-top-color: rgba(255,255,255,0.1); }
.ap-panel-more-h { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #666; margin-bottom: 8px; }
.ap-map-widget.ap-dark .ap-panel-more-h { color: #b9b6ae; }
.ap-rlist--compact .ap-ritem { padding: 8px 10px; }

/* ---- Rollout fixes 2026-10-01: page's own city highlighted, colliding neighbours hidden, no inner scroll on phones ---- */
.ap-ml.clash, .ap-drop.clash { opacity: 0 !important; }
.ap-map-widget.ap-dark .ap-ml.current { fill: #0e0f12; font-weight: 800; stroke: none; text-shadow: none; }
.ap-ml-pill { fill: #f4f1ea; pointer-events: none; filter: drop-shadow(0 1px 3px rgba(0,0,0,.45)); }
@media (max-width: 980px) {
    .ap-panel-body { max-height: none; overflow: visible; }
}
/* Phones: a square map stage so a tall region (Durham, York) is shown large enough for its lakeshore labels */
@media (max-width: 560px) {
    .ap-map-widget.ap-dark .ap-stage[data-ap-stage] svg { height: min(88vw, 440px); }
}
/* neighbouring regions run to the rounded stage edge instead of stopping at the SVG's own rectangle */
.ap-map-widget .ap-stage { overflow: hidden; }
.ap-map-widget .ap-stage svg { overflow: visible; }
