/* ============================================================
   locations.css
   ────────────────────────────────────────────────────────────
   Page styles for locations.html.

   The "map" tile is a stylised abstraction of London — not a real
   slippy map. Why: a real map ties us to a service (Mapbox / Google
   tiles) and adds weight. A stylised tile reads more like a print
   directory and stays performant.
   ============================================================ */

/* ── 1. Page hero ──────────────────────────────────────────── */
.locations-hero {
  grid-auto-rows: clamp(160px, 16vw, 220px);
  margin-bottom: var(--s-7);
}
.locations-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 1.6rem + 4.4vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--paper-bone);
}
.locations-title__italic {
  font-style: italic;
  color: rgba(246,240,225,0.7);
  display: inline-block;
  margin-left: -0.02em;
}
.locations-lede {
  font-family: var(--font-ui);
  font-size: clamp(0.96rem, 0.88rem + 0.5vw, 1.12rem);
  color: rgba(246,240,225,0.78);
  max-width: 42ch;
  line-height: 1.5;
}

/* ── 2. Map tile ───────────────────────────────────────────── */
.tile--map {
  /* The map tile reads as an aerial view. Cream-on-cream with subtle
     compass lines + numbered pins. */
  background:
    radial-gradient(circle at 50% 50%, var(--paper-cream) 0%, var(--paper-dim) 80%);
  padding: 0;
}
.map {
  position: relative;
  width: 100%; height: 100%;
  /* A subtle dotted-grid background — looks like trace paper. */
  background-image:
    radial-gradient(circle at center, rgba(31,42,27,0.06) 1px, transparent 1px);
  background-size: 18px 18px;
  background-position: 9px 9px;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.map__rule {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--paper-edge) 20%, var(--paper-edge) 80%, transparent);
}
.map__label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-300);
}
.map__label--n { font-weight: 500; color: var(--ink-700); }

.map__pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ink-900);
}
.map__pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--matcha-500);
  box-shadow:
    0 0 0 4px rgba(107,142,35,0.18),
    0 1px 3px rgba(31,42,27,0.3);
  /* A soft pulse — once every 3s. Pure transform/opacity = GPU. */
  animation: pin-pulse 3s var(--ease-in-out) infinite;
}
.map__pin:nth-of-type(2) .map__pin-dot { animation-delay: 0.6s; }
.map__pin:nth-of-type(3) .map__pin-dot { animation-delay: 1.2s; }
.map__pin:nth-of-type(4) .map__pin-dot { animation-delay: 1.8s; }
.map__pin:nth-of-type(5) .map__pin-dot { animation-delay: 2.4s; }

@keyframes pin-pulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(107,142,35,0.18), 0 1px 3px rgba(31,42,27,0.3); }
  50%     { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(107,142,35,0), 0 1px 3px rgba(31,42,27,0.3); }
}

@media (prefers-reduced-motion: reduce) {
  .map__pin-dot { animation: none; }
}

.map__pin-label {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 500;
  background: var(--paper-bone);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--paper-edge);
  white-space: nowrap;
}

/* ── 3. Location detail tile ───────────────────────────────── */
.tile--location {
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  align-items: stretch;
  overflow: hidden;
}
.tile--location--wide {
  /* For the full-width 12-col tile: image gets a larger share. */
  grid-template-columns: 1fr 1.8fr;
}
.loc__image {
  position: relative;
  overflow: hidden;
  background: var(--ink-900);
  min-height: 220px;
}
.loc__image img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--dur-4) var(--ease-out);
}
.tile--location:hover .loc__image img { transform: scale(1.04); }

.loc__image--alt {
  /* For odd-indexed tiles we flip the side of the image — adds rhythm
     when the grid is two columns wide (Fulham / Norbury, Shoreditch /
     Bermondsey). */
  order: 1;
}

.loc__body {
  padding: clamp(24px, 2vw, 36px);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.loc__index {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  color: var(--ink-300);
}
.loc__name {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 1.8rem + 1.8vw, 3.4rem);
  font-weight: 400;
  line-height: 1;
  color: var(--ink-900);
  letter-spacing: var(--ls-display);
}
.loc__address {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink-700);
  line-height: 1.4;
}

.loc__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3) var(--s-5);
  padding-top: var(--s-3);
  border-top: 1px solid var(--paper-edge);
}
.loc__meta div { display: flex; flex-direction: column; gap: 2px; }
.loc__meta dt {
  font-size: var(--t-micro);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--ink-500);
}
.loc__meta dd {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--ink-900);
  font-weight: 500;
}

.loc__actions {
  margin-top: auto;
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding-top: var(--s-3);
}

/* ── 4. Mobile collapse ────────────────────────────────────── */
@media (max-width: 720px) {
  .tile--location, .tile--location--wide { grid-template-columns: 1fr; }
  .loc__image { aspect-ratio: 16/9; min-height: 0; }
  .loc__image--alt { order: 0; }
  .loc__meta { grid-template-columns: 1fr; }
  .locations-hero { grid-auto-rows: minmax(160px, auto); }
  .tile--map { min-height: 320px; }
}
