/* MJK Electric — service areas page (templates/website/service_areas/index.html). Loaded after css/home_v2.css
   (tokens, nav, buttons, section heads, spec strip, the full-width photo band, call to action, footer) and
   css/services.css (photo header, the circuit directory). See docs/home_v2.md. */

/* ----------------------------------------------------------------- header */
.sareas .shero { min-height: min(82vh, 800px); }
/* the lit buildings and the freeway sit in the right half of the photo */
.sareas .shero__media img { object-position: 74% 50%; }
.sareas .shero__lede { max-width: 31em; }

/* ------------------------------------------------------- 01 where we work */
.sec--vic { background: radial-gradient(900px 620px at 20% 62%, rgba(194, 124, 46, .1), transparent 62%), var(--bg); }
.sec--vic .oneline__intro p { max-width: 34em; }
.vic { display: grid; grid-template-columns: minmax(0, 51.5%) minmax(0, 1fr); gap: clamp(28px, 4.4vw, 72px); align-items: start; }

/* the vicinity map, as on the cover sheet of a plan set: the shop, the freeways and one node per city */
.vmap { --sheet: #0f1317; position: relative; overflow: hidden; container: vmap / inline-size; border: 1px solid var(--line-2); border-radius: 6px; background: var(--sheet);
    box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .95), 0 0 0 1px rgba(0, 0, 0, .5), 0 0 90px -30px rgba(226, 150, 74, .28); }
.vmap__bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.vmap__dots { display: flex; gap: 6px; }
.vmap__dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.vmap__dots i:first-child { background: var(--copper-hi); }
.vmap__bar .mono { color: var(--text); }
.vmap__bar .vmap__tag { margin-left: auto; color: var(--dim); }
.vmap__key { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 22px; padding: 12px 18px 14px; border-top: 1px solid var(--line); }
.vmap__key ul { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.vmap__key li { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.vmap__sw { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--copper-hi); stroke-width: 1.6; stroke-linecap: round; }
.vmap__sw .dot { fill: var(--copper-hi); stroke: none; }
.vmap__sw--road, .vmap__sw--ring { width: 22px; }
.vmap__sw--road { stroke: rgba(236, 232, 226, .5); stroke-width: 2.4; }
.vmap__sw--ring { stroke: rgba(234, 168, 98, .6); stroke-width: 1.4; stroke-dasharray: 2 5; }
.vmap__credit { font-family: var(--mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); white-space: nowrap; transition: color .2s; }
.vmap__credit:hover { color: var(--copper-hi); }

.vm { display: block; width: 100%; height: auto; }
.vm-grid { fill: none; stroke: rgba(255, 255, 255, .04); stroke-width: 1; }
.vm-ring { fill: none; stroke: rgba(234, 168, 98, .26); stroke-width: 1; stroke-dasharray: 2 7; stroke-linecap: round; }
.vm-ringl { font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; fill: rgba(234, 168, 98, .72); paint-order: stroke; stroke: var(--sheet); stroke-width: 7px; stroke-linejoin: round; }
.vm-road { fill: none; stroke: rgba(236, 232, 226, .46); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.vm-road--minor { stroke: rgba(236, 232, 226, .17); stroke-width: 1.6; }
.vm-shield { transform-box: fill-box; transform-origin: center; }
.vm-shield rect { fill: var(--sheet); stroke: rgba(255, 255, 255, .24); stroke-width: 1; }
.vm-shield text { font: 600 10px var(--mono); letter-spacing: .04em; text-anchor: middle; fill: #c3c6ca; }
.vm-shield--minor rect { stroke: rgba(255, 255, 255, .13); }
.vm-shield--minor text { fill: #81868c; }
.vm-to { font: 500 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; fill: #8d9299; paint-order: stroke; stroke: var(--sheet); stroke-width: 6px; stroke-linejoin: round; }

/* a feeder from the shop to the city under the pointer (js/service_areas.js sets .is-on) */
.vm-feed { stroke: var(--copper-hi); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 5 7; opacity: 0; transition: opacity .25s; pointer-events: none; }
.vm-feed.is-on { opacity: 1; animation: vmFlow .9s linear infinite; }
@keyframes vmFlow { to { stroke-dashoffset: -24; } }

.vm-node { cursor: pointer; transition: opacity .25s; }
.vm-node__hit { fill: transparent; }
.vm-node__ring { fill: var(--sheet); stroke: var(--copper-hi); stroke-width: 1.6; transform-box: fill-box; transform-origin: center; transition: transform .35s var(--ease), fill .25s; }
.vm-node__dot { fill: var(--copper-hi); transition: fill .25s; }
.vm-node__name { font: 600 22px var(--display); letter-spacing: .05em; text-transform: uppercase; fill: #fff; paint-order: stroke; stroke: var(--sheet); stroke-width: 7px; stroke-linejoin: round; transition: fill .25s; }
.vm-node__k { font: 600 10.5px var(--mono); letter-spacing: .06em; fill: var(--copper-hi); }
.vm-node:hover .vm-node__ring, .vm-node.is-on .vm-node__ring { transform: scale(1.5); fill: rgba(234, 168, 98, .22); }
.vm-node:hover .vm-node__dot, .vm-node.is-on .vm-node__dot { fill: #fff; }
.vm-node:hover .vm-node__name, .vm-node.is-on .vm-node__name { fill: var(--copper-hi); }
.vic.has-on .vm-node:not(.is-on) { opacity: .5; }

.vm-shop__body { fill: var(--sheet); stroke: var(--copper-hi); stroke-width: 2; }
.vm-shop__wave { fill: none; stroke: var(--copper-hi); stroke-width: 2; stroke-linecap: round; }
.vm-shop__pulse { fill: none; stroke: var(--copper-hi); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; animation: vmPulse 2.8s ease-out infinite; }
@keyframes vmPulse { from { transform: scale(1); opacity: .75; } to { transform: scale(2.7); opacity: 0; } }
.vm-shop__name { font: 700 25px var(--display); letter-spacing: -.01em; fill: #fff; paint-order: stroke; stroke: var(--sheet); stroke-width: 7px; stroke-linejoin: round; }
.vm-shop__sub { font: 700 8.5px var(--body); letter-spacing: .34em; text-transform: uppercase; fill: var(--copper-hi); paint-order: stroke; stroke: var(--sheet); stroke-width: 6px; stroke-linejoin: round; }

.vm-north circle { fill: var(--sheet); stroke: var(--line-2); stroke-width: 1; }
.vm-north path { fill: var(--copper-hi); }
.vm-north text, .vm-scale text { font: 500 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; fill: #8d9299; }
.vm-scale path { fill: none; stroke: #8d9299; stroke-width: 1.2; }

/* the lettering is sized in the drawing's own units, so it shrinks with the drawing: enlarge it as the sheet narrows.
   These come after every .vm- rule above, which they override. */
@container vmap (max-width: 640px) {
    .vm-node__name { font-size: 25px; }
    .vm-node__k, .vm-ringl, .vm-to, .vm-north text, .vm-scale text { font-size: 12.5px; }
    .vm-shield { transform: scale(1.22); }
    .vm-shop__name { font-size: 28px; }
    .vm-shop__sub { font-size: 9.5px; }
}
@container vmap (max-width: 480px) {
    .vm-node__name { font-size: 29px; stroke-width: 9px; }
    .vm-node__k, .vm-shield--minor, .vm-scale { display: none; }    /* the key numbers stay in the list */
    .vm-node__ring { stroke-width: 2.4; }
    .vm-ringl, .vm-to, .vm-north text { font-size: 20px; }
    .vm-shield { transform: scale(1.65); }
    .vm-shop__name { font-size: 31px; }
    .vm-shop__sub { font-size: 11px; }
    .vm-road { stroke-width: 3.2; }
    .vm-road--minor { stroke-width: 2; }
    .vm-ring { stroke-width: 1.6; }
}

/* the cities, keyed to the map like the notes on a drawing */
.alist { border-top: 1px solid var(--line-2); }
.alist li { border-bottom: 1px solid var(--line); }
.acity { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 28px; column-gap: clamp(10px, 1.2vw, 18px); align-items: center; padding: 17px 0 19px; transition: background .3s, padding .35s var(--ease); }
.acity::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--copper-hi); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.acity:hover, .acity:focus-visible, .acity.is-on { background: linear-gradient(90deg, rgba(234, 168, 98, .08), transparent 72%); padding-left: 14px; }
.acity:hover::before, .acity:focus-visible::before, .acity.is-on::before { transform: scaleX(1); }
.acity__k { align-self: start; padding-top: 4px; color: var(--copper-hi); font-weight: 600; }
.acity__body { display: block; min-width: 0; }
.acity__pre { display: block; margin-bottom: 5px; font-family: var(--mono); font-weight: 500; font-size: .62rem; line-height: 1.5; letter-spacing: .18em; color: var(--dim); }
.acity__name { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 2.3vw, 2.15rem); line-height: 1; letter-spacing: .01em; text-transform: uppercase; color: #fff; transition: color .25s; }
.acity:hover .acity__name, .acity.is-on .acity__name { color: var(--copper-hi); }
.acity__sum { display: block; margin-top: 7px; max-width: 36em; font-size: .95rem; line-height: 1.5; color: var(--muted); }
.acity__go { justify-self: end; font-family: var(--display); font-weight: 600; font-size: 1.4rem; color: var(--copper-hi); transition: transform .3s var(--ease); }
.acity:hover .acity__go, .acity.is-on .acity__go { transform: translateX(6px); }

/* ------------------------------------------------ 02 elsewhere in Arizona */
.sec--beyond { padding: clamp(96px, 12vw, 190px) 0 clamp(84px, 10vw, 150px); }
.sec--beyond .az__media img { object-position: 60% 62%; }
.sec--beyond .az__shade { background:
    linear-gradient(180deg, var(--bg) 0%, rgba(9, 11, 13, .3) 24%, rgba(9, 11, 13, .34) 62%, var(--bg-2) 100%),
    linear-gradient(90deg, rgba(9, 11, 13, .86) 0%, rgba(9, 11, 13, .5) 42%, rgba(9, 11, 13, .08) 80%); }
.sec--beyond .az__lede { max-width: 30em; }
.beyond__call { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: clamp(26px, 3vw, 40px); }
.beyond__phone { font-family: var(--display); font-weight: 600; font-size: clamp(2.6rem, 5.2vw, 4.6rem); line-height: 1; letter-spacing: .01em; color: var(--copper-hi); text-shadow: 0 2px 30px rgba(0, 0, 0, .6); border-bottom: 2px solid rgba(234, 168, 98, .4); padding-bottom: 6px; transition: color .25s, border-color .25s; }
.beyond__phone:hover { color: #fff; border-color: #fff; }
.beyond__call .mono { color: #d7d4cf; }

/* ------------------------------------------------------------- responsive */
/* the map stays beside the list while it scrolls; on a short screen its column is made narrower so all of it still
   fits under the nav (228px: the nav, a margin, the map's title bar and its key; 1.065: the drawing's width to its height) */
@media (min-width: 1101px) and (min-height: 700px) {
    .vic { grid-template-columns: min(51.5%, calc((100vh - 228px) * 1.065)) minmax(0, 1fr); }
    .vmap { position: sticky; top: 84px; }
}
@media (max-width: 1100px) {
    .vic { grid-template-columns: minmax(0, 1fr); }
    .vmap { width: 100%; max-width: 820px; justify-self: center; }
    .acity__sum { max-width: 46em; }
}
@media (max-width: 900px) {
    .sareas .shero { min-height: 0; }
    .acity:hover, .acity:focus-visible, .acity.is-on { padding-left: 0; background: none; }
}
@media (max-width: 599px) {
    .sareas .shero .eyebrow { letter-spacing: .14em; line-height: 1.6; align-items: flex-start; }
    .sareas .shero .eyebrow .tick { margin-top: .7em; width: 20px; }
    .vmap__bar { padding: 12px 14px; }
    .vmap__key { padding: 11px 14px 13px; }
    .vmap__key ul { gap: 6px 14px; }
    .acity { grid-template-columns: 30px minmax(0, 1fr) 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .vm-shop__pulse { display: none; }
    .vm-feed.is-on { animation: none; }
}
