/* "Location is key.": the home page's map (site/js/areamap.js), linked from that page only.
   Pinned while the scroll zooms from Spain into the Costa del Sol; then the pin lets go and the map stays, to explore.
   .ready: the map is drawn. .ui: the areas, the controls and the hint are in. .free: the zoom has landed and the map
   takes gestures. .used: someone has moved it (the hint goes). .full: full screen (phones). .still: reduced motion,
   without the zoom. .none: no WebGL 2, the areas as a list. */
html{scrollbar-gutter:stable}   /* full screen holds the page still (overflow hidden): keep the scrollbar's room so nothing shifts */
/* a phone: "Location is key." sits in the frame's empty top, above Spain, and scrolls away before the zoom starts
   (Hampus, 2026-10-29: "a bit too much white space"). Spain is centred in the frame and 63.6% of the page's width tall
   (SPAIN's bounds in Mercator, with frameUp's 8% padding), so the empty top is (100svh - 98px - 63.6vw) / 2 below the
   frame's 82px; the section comes up under the words by that, less the 56px left between them and Spain. Not for reduced
   motion or without WebGL 2, where the frame holds the map or the list from the start. */
@media (max-width:760px) and (prefers-reduced-motion:no-preference){
  .coast-intro{position:relative;z-index:2}
  .am{margin-top:min(0px,calc(23px + 31.8vw - 50svh))}   /* never pushes down (a phone on its side) */
  .am.still,.am.none{margin-top:0}
}
.am{position:relative;height:400svh}   /* the zoom and the rise into 3D (LAND in areamap.js: the first 78% of the pin, as before), then the landed coast held for two thirds of a screen with its call to explore */
.am-pin{position:sticky;top:0;height:100svh;overflow:hidden}
/* Spain starts on the page's own cream, so the frame only shows itself as the photographs come in */
.am-frame{position:absolute;left:0;right:0;top:calc(env(safe-area-inset-top,0px) + 94px);bottom:16px;border-radius:28px;overflow:hidden;background:var(--cream);color:var(--ink);isolation:isolate}
/* MapLibre's own stylesheet (loaded with it, after this one) makes its box relative: this stays absolute */
.am .am-map{position:absolute;inset:0;opacity:0;transition:opacity .8s var(--ease)}
.am.ready .am-map{opacity:1}
.am-map .maplibregl-canvas{outline:none}
.am-map .maplibregl-canvas:focus-visible{outline:2px solid var(--champagne);outline-offset:-4px}
.am-wait{position:absolute;left:0;right:0;top:50%;margin:0;text-align:center;transition:opacity .4s}
.am.ready .am-wait,.am.none .am-wait{display:none}

/* the target over Spain (areamap.js aimAt): thin wine rings and ticks round the strip, and its name */
.am-aim{position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none;overflow:visible}
.am-aim circle{fill:none;stroke:var(--wine);stroke-width:1.2}
.am-aim circle:nth-child(2){stroke-opacity:.55}
.am-aim circle:nth-child(3){stroke-opacity:.3}
.am-aim path{fill:none;stroke:var(--wine);stroke-width:1.2}
.am-aim-l{position:absolute;left:0;top:0;z-index:1;display:grid;gap:6px;margin:0;pointer-events:none;white-space:nowrap}
.am-aim-l b{font:400 clamp(26px,2.6vw,40px)/1 var(--f-display,var(--f-sans));letter-spacing:-.01em;color:var(--ink)}
.am-aim-l span{font:600 10.5px/1.4 var(--f-sans);letter-spacing:.2em;text-transform:uppercase;color:var(--brown)}
.am-aim-l.under{justify-items:center;text-align:center}
.am:not(.ready) .am-aim,.am:not(.ready) .am-aim-l,.am.still .am-aim,.am.still .am-aim-l{display:none}

/* over the map: the index of areas and the controls at the top; "Open interactive map" below (full screen, a hint on how
   to move it instead) */
.am-pad{padding-left:max(clamp(16px,2.4vw,36px),var(--pad-l));padding-right:max(clamp(16px,2.4vw,36px),var(--pad-r))}
.am-top{position:absolute;left:0;right:0;top:0;z-index:3;display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding-top:clamp(16px,2.4vw,30px);pointer-events:none}
.am-top,.am-hint{opacity:0;visibility:hidden;transition:opacity .45s var(--ease),visibility 0s .45s}
.am.ui .am-top,.am.ui .am-hint{opacity:1;visibility:visible;transition:opacity .45s var(--ease)}
/* the site's liquid glass, more opaque over the photographs and without the blur or the bending rim (both would be
   redone on every frame of the moving map); always the light tone */
.am-nav,.am-ctl,.am-hint,.am-card{--lg-tint:color-mix(in srgb,var(--cream) 92%,transparent);--lg-adapt:0;--lg-refract:0;-webkit-backdrop-filter:none;backdrop-filter:none}
.am-nav{pointer-events:auto;display:flex;flex-wrap:wrap;gap:4px;padding:4px;border-radius:26px}
.am-nav button{min-height:40px;padding:0 15px;border-radius:999px;font:600 11px/1 var(--f-sans);letter-spacing:.16em;text-transform:uppercase;transition:background .25s,color .25s}
.am-nav button:hover{background:color-mix(in srgb,var(--ink) 8%,transparent)}
.am-nav button[aria-current=true]{background:var(--ink);color:var(--cream)}
.am-ctl{pointer-events:auto;display:flex;flex-direction:column;gap:2px;padding:4px;border-radius:24px}
.am-ctl button{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;transition:background .25s,color .25s}
.am-ctl button:hover{background:var(--ink);color:var(--cream)}
.am-ctl svg{width:14px;height:14px}
.am-hint{position:absolute;z-index:3;left:50%;bottom:clamp(16px,2.4vw,30px);transform:translateX(-50%);display:flex;align-items:center;gap:10px;margin:0;padding:12px 18px;border-radius:999px;font:600 10.5px/1 var(--f-sans);letter-spacing:.16em;text-transform:uppercase;white-space:nowrap;pointer-events:none}
.am-hint svg{width:18px;height:18px;flex:none}
.am-hint-t{display:none}
.am:not(.full) .am-hint{display:none}   /* in the page the map only takes clicks: the hint is for the full-screen map */
.am.used .am-hint,.am.picked .am-hint{opacity:0;visibility:hidden;transition:opacity .45s var(--ease),visibility 0s .45s}
/* the call to explore: large and light over the dark sea, rising in with the scroll as the coast lands (--go from
   areamap.js) and staying while the pin holds the landed map */
.am-go{position:absolute;z-index:3;left:50%;bottom:clamp(22px,3.4vw,44px);min-height:64px;padding:0 10px 0 32px;gap:20px;font-size:13px;
  opacity:var(--go,0);visibility:hidden;transform:translate(-50%,calc((1 - var(--go,0)) * 32px))}
.am.ui .am-go{visibility:visible}
.am-go .dot{width:44px;height:44px;background:var(--ink);color:var(--cream)}
.am-go .dot svg{width:15px;height:15px}
.am-go:hover .dot svg{transform:scale(1.15)}
.am-go[hidden]{display:none}
/* the credits the photographs and outlines ask for (CC BY 4.0, ODbL): short in the map's corner, all of them behind the i
   (Hampus, 2026-10-28: no line of credits under the map; OpenStreetMap's guidelines allow a corner credit and an i) */
.am-credit{position:absolute;z-index:3;right:12px;bottom:10px;max-width:calc(100% - 24px);display:grid;justify-items:end;gap:6px;font:500 10px/1.4 var(--f-sans);letter-spacing:.02em;color:var(--ink)}
.am-credit p{margin:0;border-radius:999px;background:color-mix(in srgb,var(--cream) 86%,transparent)}
.am-credit-short{display:flex;align-items:center;gap:8px;padding:4px 4px 4px 11px}
.am-credit .am-credit-all{max-width:440px;padding:9px 13px;border-radius:14px;text-align:right}
.am-credit-all[hidden]{display:none}
.am-credit a{color:inherit;text-decoration:none}
.am-credit a:hover{text-decoration:underline}
.am-credit button{width:18px;height:18px;border-radius:50%;border:1px solid currentColor;display:grid;place-items:center;font:italic 600 10px/1 var(--f-serif)}
.am-credit button[aria-expanded=true]{background:var(--ink);color:var(--cream);border-color:var(--ink)}
.am-x{position:absolute;z-index:5;right:16px;top:calc(env(safe-area-inset-top,0px) + 16px);min-height:46px;gap:10px;background:var(--cream);color:var(--ink)}
.am-x svg{width:12px;height:12px}
.am-x[hidden]{display:none}

/* names on the map: the areas as pills (the one chosen inverted), their places as you zoom in, a few landmarks */
/* MapLibre sets each marker's own opacity inline, so the fade is on its parts */
.am-l{position:absolute;width:0;height:0;padding:0;border:0;background:none;color:var(--ink);text-decoration:none}
.am-l>*{opacity:0;visibility:hidden;transition:opacity .35s,visibility 0s .35s}
.am-l.vis>*{opacity:1;visibility:visible;transition:opacity .35s}
.am-l i{position:absolute;left:-5px;top:-5px;width:10px;height:10px;border-radius:50%;background:var(--cream);box-shadow:0 0 0 2px var(--wine),0 1px 6px rgba(20,14,10,.4)}
.am-l span{position:absolute;left:12px;top:0;transform:translateY(-50%);padding:8px 13px;border-radius:999px;background:color-mix(in srgb,var(--cream) 92%,transparent);font:600 10.5px/1 var(--f-sans);letter-spacing:.16em;text-transform:uppercase;white-space:nowrap;transition:background .25s,color .25s;box-shadow:0 2px 12px rgba(20,14,10,.18)}
/* a name that doesn't fit on the right of its point goes on the left (areamap.js place()) */
.am-l.flip span{left:-12px;transform:translate(-100%,-50%)}
.am-l.pl.flip span{left:-8px}
.am-l.up span{left:0;top:-10px;transform:translate(-50%,-100%)}
.am-l.down span{left:0;top:10px;transform:translate(-50%,0)}
.am-l.area{cursor:pointer}
.am-l.area.on span{background:var(--ink);color:var(--cream)}
.am-l.area.on i{background:var(--wine);box-shadow:0 0 0 2px var(--cream),0 1px 6px rgba(20,14,10,.4)}
@media (hover:hover){.am-l.area:hover span{background:var(--ink);color:var(--cream)}}
.am-l.area:focus-visible{outline:none}
.am-l.area:focus-visible span{outline:2px solid var(--champagne);outline-offset:2px}
/* places: light words with a dark halo, on any photograph */
.am-l.pl i{left:-3px;top:-3px;width:6px;height:6px;background:var(--champagne);box-shadow:0 0 0 1.5px rgba(31,22,16,.55)}
.am-l.pl span{left:8px;padding:0;background:none;box-shadow:none;font:500 13px/1 var(--f-sans);letter-spacing:.01em;text-transform:none;color:var(--champagne);text-shadow:0 0 3px rgba(20,14,10,.95),0 0 9px rgba(20,14,10,.7)}
a.am-l.pl:hover span{text-decoration:underline;text-underline-offset:3px}
.am-l.mk i{display:none}
/* landmarks: a small cream tag in italic serif, which reads on the veil and on the photographs alike */
.am-l.mk span{left:0;transform:translate(-50%,-50%);padding:5px 10px 6px;background:color-mix(in srgb,var(--cream) 78%,transparent);box-shadow:none;font:italic 400 16px/1 var(--f-serif);letter-spacing:.01em;text-transform:none;color:var(--ink)}

/* an area's card: its picture, words, homes for sale and the way to its guide */
.am-card{position:absolute;z-index:4;left:max(clamp(16px,2.4vw,36px),var(--pad-l));bottom:clamp(16px,2.4vw,30px);width:min(600px,calc(100% - 32px));display:flex;gap:16px;padding:12px;border-radius:22px;opacity:0;transform:translateY(14px);transition:opacity .35s var(--ease),transform .5s var(--ease)}
.am-card.on{opacity:1;transform:none}
.am-card.nophoto .am-card-ph{display:none}   /* an area without a picture of its own */
.am-card.nophoto{width:min(480px,calc(100% - 32px))}
/* the areas without a guide: the same pill, a step quieter */
.am-l.area.minor span{padding:7px 11px;font-size:9.5px;background:color-mix(in srgb,var(--cream) 80%,transparent)}
.am-l.area.minor i{left:-4px;top:-4px;width:8px;height:8px}
.am-l.area.minor.on span{background:var(--ink);color:var(--cream)}
@media (hover:hover){.am-l.area.minor:hover span{background:var(--ink);color:var(--cream)}}
.am-card[hidden]{display:none}
.am-card-x{position:absolute;right:10px;top:10px;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;transition:background .25s,color .25s}
.am-card-x:hover{background:var(--ink);color:var(--cream)}
.am-card-x svg{width:11px;height:11px}
.am-card-ph{flex:none;width:clamp(110px,10vw,148px);aspect-ratio:3/4;margin:0;border-radius:14px;overflow:hidden;background:var(--greige)}
.am-card-ph{position:relative}
.am-card-ph img{width:100%;height:100%;object-fit:cover}
/* the photographer a picture was made after, in small print on it */
.am-card-tx{min-width:0;display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-start;gap:8px;padding:4px 40px 2px 4px}
.am-card-tx h3{margin:0;font:400 clamp(30px,2.8vw,44px)/1 var(--f-display,var(--f-sans));letter-spacing:-.01em}
.am-card-tx p{margin:0;font-size:15px;line-height:1.5;color:var(--ink)}
.am-card-facts{display:flex;gap:8px 26px;margin:4px 0 0}
.am-card-facts[hidden]{display:none}
.am-card-facts div{display:grid;gap:5px}
.am-card-facts dt{order:2;font:600 9.5px/1.4 var(--f-sans);letter-spacing:.16em;text-transform:uppercase;color:var(--brown)}
.am-card-facts dd{margin:0;font:500 clamp(22px,2vw,30px)/1 var(--f-sans);letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.am-card-go{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.am-card-go .pill{min-height:44px}
.am-card-go .pill.dark{padding:0 6px 0 18px;gap:12px}
.am-card-go .pill .dot{width:32px;height:32px}
.am-card-go .pill.line{padding:0 18px}
.am-card-go .pill{letter-spacing:.14em}
.am-card-go [hidden]{display:none}
.am.picked .am-hint,.am.picked .am-go{opacity:0;visibility:hidden}

/* full screen (a phone's "Explore the map") */
html.am-lock{overflow:hidden}
/* main is a layer of its own (z-index 1, to round over the footer), which would keep the map under the header: not while full screen */
html.am-lock main{z-index:auto}
.am.full .am-pin{z-index:80}
.am.full .am-frame{position:fixed;inset:0;z-index:80;border-radius:0}
.am.full .am-top{padding-top:calc(env(safe-area-inset-top,0px) + 16px);padding-right:max(124px,var(--pad-r))}
/* full screen, the zoom buttons go to the lower right, so the index has the top to itself (Close sits at the top right) */
.am.full .am-ctl{position:fixed;right:16px;bottom:calc(env(safe-area-inset-bottom,0px) + 96px)}
.am.full .am-nav{max-width:100%}
.am.full.picked .am-ctl{opacity:0;visibility:hidden}   /* the card has the bottom; Close or Escape brings them back */

/* reduced motion: no zoom and no pin, the coast at once */
.am.still{height:auto}
.am.still .am-pin{position:relative;height:min(100svh,880px)}

/* no WebGL 2: the areas as links, on the cream */
.am.none{height:auto}
.am.none .am-pin{position:relative;height:auto;overflow:visible}
.am.none .am-frame{position:relative;inset:auto;margin-top:24px;background:none;border-radius:0;overflow:visible}
.am.none .am-map,.am.none .am-top,.am.none .am-hint,.am.none .am-go,.am.none .am-credit{display:none}
.am-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:clamp(14px,1.6vw,22px);margin:0;padding:0 var(--pad-r) 40px var(--pad-l);list-style:none}
.am-list a{display:grid;gap:8px;color:inherit;text-decoration:none}
.am-list img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:18px}
.am-list b{font:400 30px/1 var(--f-display,var(--f-sans))}
.am-list span:last-child{font-size:15px;line-height:1.5;color:var(--ink)}
.am-list[hidden]{display:none}

@media (pointer:coarse){.am-hint-p{display:none}.am-hint-t{display:inline}}
@media (max-width:760px){
  .am-frame{top:calc(env(safe-area-inset-top,0px) + 82px);bottom:16px;border-radius:22px}
  .am-credit{right:10px;bottom:8px}
  .coast-intro{padding-top:24px}
  .am-top{flex-direction:row}
  .am-nav{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;max-width:calc(100% - 60px)}
  .am-nav::-webkit-scrollbar{display:none}
  .am-nav button{flex:none;min-height:36px;padding:0 12px;font-size:10px}
  .am-ctl button{width:36px;height:36px}
  .am-go{bottom:40px;min-height:58px;padding:0 8px 0 24px;gap:14px;font-size:12px;letter-spacing:.12em;white-space:nowrap}
  .am-go .dot{width:42px;height:42px}
  /* the card: a sheet along the bottom of the frame */
  .am-card{left:10px;right:10px;bottom:10px;width:auto;flex-direction:column;gap:12px;padding:10px}
  .am-card-ph{width:100%;aspect-ratio:2/1;max-height:20svh}
  .am-card-tx{padding:2px 4px 4px}
  .am-card-x{right:16px;top:16px;background:var(--cream)}
  .am-card-go{width:100%}
  .am-card-go .pill{flex:1 1 auto}
}
