:root {
  --surface: #fbfaf7;
  --card: #ffffff;
  --line: #dedcd5;
  --text: #1f2328;
  --muted: #5f656d;
  --link: #0b5cad;
  --sticker: #c8323c;
  --panel-width: 24rem;
}

* { box-sizing: border-box; }

/* Text scales with the window: 16px up to 1280px wide, rising to 20px. */
html { font-size: clamp(1rem, 0.45vw + 0.640625rem, 1.25rem); }

html, body {
  margin: 0;
  height: 100%;
  background: var(--surface);
  color: var(--text);
  font-family: "Avenir Next", "Helvetica Neue", system-ui, sans-serif;
  line-height: 1.5;
}

/* Desktop: the panel, then the two maps side by side, all full height. */
body {
  display: grid;
  grid-template-columns: var(--panel-width) 1fr 1fr;
}

a { color: var(--link); }

#panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--line);
}

.masthead { padding: 1.25rem 1.5rem 0.75rem; border-bottom: 1px solid var(--line); }
.kicker { margin: 0; color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.03em; }
h1 { margin: 0.25rem 0 0.375rem; font-size: 1.625rem; line-height: 1.15; }
.credit { margin: 0; color: var(--muted); font-size: 0.875rem; }

#card { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
#card p { margin: 0 0 0.75rem; }
#card h2 { margin: 0.75rem 0 0.25rem; font-size: 1.25rem; line-height: 1.25; }
.ground { color: var(--muted); }

.photo {
  display: block;
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  background: #f1f0ec;
  border-radius: 6px;
}

/* Overview: every sticker as a numbered thumbnail. */
.thumbs { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(3, 1fr); }
.thumbs button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: none;
}
.thumbs img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.thumbs button:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.thumbs .num { position: absolute; top: 0.375rem; left: 0.375rem; }

.num, .pin {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--sticker);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid #fff;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--line);
}
.pager button {
  font: inherit;
  padding: 0.375rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager button:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
#count { color: var(--muted); font-size: 0.875rem; }

.map-pane { position: relative; height: 100vh; border-right: 1px solid var(--line); }
.map { position: absolute; inset: 0; }
.map-label {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  margin: 0;
  padding: 0.25rem 0.625rem;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  pointer-events: none;
}

/* Map markers */
.pin, .ground-dot { padding: 0; font-family: inherit; }
.pin { cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); transition: transform 0.15s; }
.pin.active { transform: scale(1.35); background: #8f1a22; z-index: 2; }
.pin.dim { opacity: 0.55; }
.ground-dot {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--sticker);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
.ground-dot.active { width: 1.25rem; height: 1.25rem; background: #8f1a22; }
.galway-dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--text); border: 2px solid #fff; }
.marker-label {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 0.125rem 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Phone: the two maps side by side on top, then the panel beneath them. */
@media (max-width: 760px) {
  body { grid-template-columns: 1fr 1fr; grid-template-rows: 38vh auto; height: auto; }
  #panel { grid-column: 1 / -1; grid-row: 2; height: auto; border-right: 0; }
  #card { overflow: visible; }
  .photo { max-height: 50vh; }
  .pager { position: sticky; bottom: 0; background: var(--card); z-index: 3; }
  .map-pane { grid-row: 1; height: 38vh; border-bottom: 1px solid var(--line); }
  .map-label { font-size: 0.75rem; }
  /* Put the club's name under its dot, where the half-width map has room for it. */
  .marker-label { left: 50%; top: calc(100% + 0.25rem); transform: translateX(-50%); }
}
