/* town-atlas.css — "Style E" atlas look for the town guides (Claude, Nov 24 2026)
   Activated only on pages whose <body> has class "town-atlas" and sets
   --atlas-map: url(...) to that town's own map. Safe to load on any page. */

/* 1. Map wallpaper: fixed behind the whole page */
html:has(body.town-atlas){background:#e9dcc2}
body.town-atlas{background:transparent!important;position:relative;isolation:isolate}
body.town-atlas::before{content:"";position:fixed;inset:-4vh -4vw;z-index:-2;pointer-events:none;
  background:var(--atlas-map) center 30%/cover no-repeat;
  filter:sepia(.55) saturate(.9);opacity:.75;transform:scale(1.04)}
body.town-atlas::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;
  background:radial-gradient(ellipse at 50% 35%,rgba(244,236,218,.15),rgba(239,230,210,.45) 62%,rgba(226,213,186,.75))}

/* 2. Header: deep navy so the gold logo reads over the wallpaper */
body.town-atlas .site-header{background:rgba(18,30,46,.9)!important;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}

/* Restore the site background under the light brokerage and disclosure text. */
body.town-atlas .agent-footer { background-color: var(--navy); }

/* 3. Hero: navy wash on the text side, map on the other */
body.town-atlas section.search-hero{position:relative;background:transparent!important}
body.town-atlas section.search-hero::before{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;
  background:linear-gradient(90deg,rgba(14,24,38,.88) 0%,rgba(14,24,38,.72) 42%,rgba(14,24,38,.2) 70%,rgba(14,24,38,0) 100%)}
body.town-atlas section.search-hero>*{position:relative;z-index:1}

/* 4. Engraved cartographer's border with a linen mat around the hero map */
body.town-atlas .g-hero-map{position:relative;margin:24px auto!important;padding:46px!important;border:0!important;border-radius:2px!important;
  background:#f1e6cd repeating-linear-gradient(45deg,rgba(59,42,23,.13) 0 1px,transparent 1px 5px)!important;
  box-shadow:inset 0 0 0 6px #f1e6cd,inset 0 0 0 7px #3b2a17,inset 0 0 0 11px #f1e6cd,inset 0 0 0 14px #3b2a17,
    inset 0 0 0 18px #f1e6cd,inset 0 0 0 19px #3b2a17,0 30px 70px -22px rgba(0,0,0,.6)!important}
body.town-atlas .g-hero-map::before{content:"";position:absolute;inset:24px;pointer-events:none;
  background:radial-gradient(circle at 0 0,#3b2a17 0 5px,transparent 6px),radial-gradient(circle at 100% 0,#3b2a17 0 5px,transparent 6px),
    radial-gradient(circle at 0 100%,#3b2a17 0 5px,transparent 6px),radial-gradient(circle at 100% 100%,#3b2a17 0 5px,transparent 6px)}
body.town-atlas .g-hero-map img{display:block;background:#f3ead6;box-shadow:0 0 0 1px rgba(90,60,25,.45),0 6px 18px -6px rgba(60,40,15,.45)}
body.town-atlas .g-hero-map figcaption{color:#6b5330!important;text-align:center;font-style:italic;margin-top:8px;font-size:10.5px!important;line-height:1.3;letter-spacing:.02em;opacity:.55}
body.town-atlas .g-hero-map figcaption sup{font-size:.8em}
body.town-atlas .g-hero-map figcaption a{color:inherit}

/* Desktop: whole framed map visible on the first screen */
@media (min-width:821px){
  body.town-atlas .g-hero-map img{width:auto!important;max-width:100%;height:auto;max-height:calc(100vh - 330px);object-fit:contain}
}

/* 5. Content sections float over the wallpaper as translucent navy panels */
body.town-atlas main>section:not(.search-hero),body.town-atlas main>nav.town-return{
  background:rgba(12,21,34,.86)!important;border:1px solid rgba(214,174,98,.28);border-radius:18px;
  box-shadow:0 24px 60px -28px rgba(0,0,0,.55);margin:28px auto!important;padding:28px clamp(18px,3vw,44px)!important}
body.town-atlas main>section:not(.search-hero){backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}

/* 6. Click-to-zoom affordance and viewer */
body.town-atlas .g-hero-map img[data-zoom]{cursor:zoom-in}
.atlas-zoom-hint{position:absolute;left:50%;top:13px;transform:translateX(-50%);white-space:nowrap;z-index:2;padding:6px 10px;border-radius:999px;font:600 12px/1 system-ui,sans-serif;
  letter-spacing:.04em;color:#f6ecd5;background:rgba(18,30,46,.82);border:1px solid rgba(214,174,98,.55);pointer-events:none;opacity:.92}
.atlas-viewer{position:fixed;inset:0;z-index:10000;display:none;background:rgba(8,13,22,.94);touch-action:none}
.atlas-viewer.open{display:block}
.atlas-viewer .av-stage{position:absolute;inset:0;overflow:hidden;cursor:grab}
.atlas-viewer .av-stage.drag{cursor:grabbing}
.atlas-viewer img{position:absolute;left:0;top:0;transform-origin:0 0;max-width:none;user-select:none;-webkit-user-drag:none;
  box-shadow:0 0 0 10px #f1e6cd,0 0 0 11px #3b2a17,0 0 0 15px #f1e6cd,0 0 0 18px #3b2a17,0 30px 80px rgba(0,0,0,.6)}
.atlas-viewer .av-bar{position:absolute;right:16px;top:16px;display:flex;gap:8px;z-index:2}
.atlas-viewer button::before,.atlas-viewer button::after{content:none!important;display:none!important}
.atlas-viewer button{all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:50%;border:1px solid rgba(214,174,98,.6);background:rgba(18,30,46,.9);
  color:#f6ecd5;font:600 20px/1 system-ui,sans-serif;cursor:pointer;width:44px;height:44px;border-radius:50%;border:1px solid rgba(214,174,98,.6);background:rgba(18,30,46,.9)}
.atlas-viewer button:focus-visible{outline:2px solid #e6c37a;outline-offset:2px}
.atlas-viewer .av-note{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);color:#d9c9a5;font:13px system-ui,sans-serif;opacity:.85;text-align:center}
.atlas-viewer .av-load{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#e6c37a;font:15px system-ui,sans-serif}

/* 7. Phones and small tablets: lighter wallpaper, full-width map */
@media (max-width:820px){
  body.town-atlas::before{opacity:.22;filter:sepia(.4)}
  body.town-atlas .g-hero-map{padding:22px!important;margin:18px 0!important}
  body.town-atlas .g-hero-map::before{inset:12px}
  body.town-atlas .g-hero-map img{width:100%!important;height:auto!important}
  body.town-atlas main>section:not(.search-hero),body.town-atlas main>nav.town-return{border-radius:12px;margin:14px auto!important;max-width:calc(100% - 16px);padding:20px 16px!important}
  .atlas-zoom-hint{top:4px;font-size:11px;padding:4px 8px}
  body.town-atlas section.search-hero::before{background:rgba(14,24,38,.86)}
}
@media (prefers-reduced-motion:reduce){body.town-atlas::before{transform:none}}
