/* Contact page: the address card.
   The map is a flat image generated once by .scratch/mkmap.mjs from OSM tiles
   and committed to public/images — no map SDK, no API key, no third-party
   request at runtime, nothing to pay for. Greyscale per the Colorless Chrome
   rule, which leaves the pin as the only hue on the card. */

.mapcard {
  --map-accent: #417ced; /* Stratos Blue: the pin marks a located thing, like the About page's stage dot */
  display: block;
  margin-top: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  background: var(--color-card);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.mapcard:hover {
  border-color: color-mix(in oklab, var(--map-accent) 45%, var(--color-border));
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
}
.mapcard:focus-visible {
  outline: none;
  border-color: var(--map-accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--map-accent) 25%, transparent);
}

/* ---------- map ---------- */

.mapcard__canvas {
  position: relative;
  display: block;
  aspect-ratio: 960 / 620;
  overflow: hidden;
  background: var(--color-muted);
}
.mapcard__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
/* The source image is greyscale, so a straight inversion is a legitimate dark
   basemap — land goes to ink, roads and labels come up light — and costs
   nothing next to shipping a second image. */
.dark .mapcard__img {
  filter: invert(1);
}
.mapcard:hover .mapcard__img {
  transform: scale(1.04);
}

.mapcard__pin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -100%);
  color: var(--map-accent);
  line-height: 0;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.35));
}
.mapcard__pin svg {
  width: 2rem;
  height: 2rem;
}
/* Halo sits under the pin's point, standing in for the shadow a real marker
   would cast and keeping the pin legible over pale and dark basemaps alike. */
.mapcard__pin::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -0.3125rem;
  width: 1.5rem;
  height: 0.5rem;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--map-accent) 45%, transparent), transparent);
}

/* Required by ODbL — the basemap is derived from OpenStreetMap data. */
.mapcard__credit {
  margin-top: 0.625rem;
  font-size: 0.6875rem;
  line-height: 1.5;
  color: color-mix(in oklab, var(--color-muted-foreground) 85%, transparent);
}
.mapcard__credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in oklab, var(--color-muted-foreground) 40%, transparent);
}
.mapcard__credit a:hover {
  color: var(--color-foreground);
}

/* ---------- foot ---------- */

.mapcard__foot {
  display: block;
  padding: 1.125rem 1.25rem 1.25rem;
}
.mapcard__kind {
  display: block;
  margin-bottom: 0.4375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted-foreground);
}
.mapcard__place {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-foreground);
}
.mapcard__sub {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-muted-foreground);
}

/* The condition on visiting, in the slot the coordinate pair used to hold —
   rule and all, since it is what separates the address from the action under
   it. The icon keeps the line from reading as a third line of the address. */
.mapcard__note {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  margin-top: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 2px solid var(--color-border);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--color-muted-foreground);
  transition: border-color 0.25s ease;
}
.mapcard__note svg {
  width: 0.8125rem;
  height: 0.8125rem;
  flex: none;
}
.mapcard:hover .mapcard__note {
  border-bottom-color: color-mix(in oklab, var(--map-accent) 60%, var(--color-border));
}

.mapcard__open {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
  transition: color 0.25s ease;
}
.mapcard:hover .mapcard__open {
  color: var(--color-foreground);
}
.mapcard__open svg {
  width: 0.75rem;
  height: 0.75rem;
  transition: transform 0.25s ease;
}
.mapcard:hover .mapcard__open svg {
  transform: translate(1px, -1px);
}

@media (prefers-reduced-motion: reduce) {
  .mapcard,
  .mapcard__img,
  .mapcard__note,
  .mapcard__open,
  .mapcard__open svg { transition-duration: 0.01ms; }
  .mapcard:hover .mapcard__img { transform: none; }
}
