*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Space Grotesk', sans-serif;
  background: #fb9fe0;
}

/* ── Site container ── */
#site {
  max-width: 980px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
}

/* ── Top bar ── */
#topbar {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: #fff;
  border-bottom: 2px solid #000;
}

#topbar-logo {
  display: block;
  height: 60px;
  width: auto;
  pointer-events: all;
}

/* ── Map ── */
#map-container {
  position: relative;
  width: 100%;
  line-height: 0;
  container-type: size;
  container-name: map;
}

#map-bg {
  display: block;
  width: 100%;
  height: auto;
}

/* Fade the bottom of the map into the white container background */
#map-container::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18cqh;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
  pointer-events: none;
}

/* ── Column overlay ── */
#columns-overlay {
  position: absolute;
  inset: 0;
  display: flex;
}

.col {
  flex: 1;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.col:last-child {
  border-right: none;
}

.col:hover {
  background: rgba(255, 255, 255, 0.07);
}

.col.active {
  background: rgba(255, 255, 255, 0.1);
}

/* ── Pin shape (ribbon banner) ── */
.pin-anchor {
  position: absolute;
  left: 50%;
  width: 13.3cqw;
  height: 28.3cqh;
  container-type: inline-size;
  pointer-events: none;
  animation-name: pin-bob;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

/* Slightly smaller pins on desktop screen sizes */
@media (min-width: 1024px) {
  .pin-anchor {
    width: 11.3cqw;
    height: 24cqh;
  }
}

@keyframes pin-bob {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(var(--pin-scale, 1)); }
  50%      { transform: translateX(-50%) translateY(-10px) scale(var(--pin-scale, 1)); }
}

/* Shape layer: matches the Y-skew used in the Figma mockup (X: 0°, Y: 22°) */
.pin-shape {
  position: absolute;
  inset: 0;
  transform: skewY(var(--pin-skew-y, 22deg));
  filter: drop-shadow(0 5.5cqw 13cqw rgba(0, 0, 0, 0.4));
  transition: transform 0.2s, filter 0.2s;
}

.pin-border {
  position: absolute;
  inset: 0;
  background: #000;
  clip-path: polygon(0 0, 100% 0, 100% 64%, 50% 100%, 0 64%);
}

.pin-fill {
  position: absolute;
  inset: 2.8cqw;
  background: var(--pin-color, #ffa3e8);
  clip-path: polygon(0 0, 100% 0, 100% 64%, 50% 100%, 0 64%);
}

/* Text layer: nested inside .pin-shape, so it skews along with the banner */
.pin-content {
  position: absolute;
  inset: 0;
  padding: 15cqw 7cqw 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  color: #111;
}

.pin-number {
  font-size: 26cqw;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 9cqw;
}

.pin-label {
  font-size: 12cqw;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pin-emoji {
  font-size: 30cqw;
  line-height: 1;
}

.col:hover .pin-shape,
.col.active .pin-shape {
  transform: skewY(var(--pin-skew-y, 22deg)) translateY(-6px) scale(1.05);
  filter: drop-shadow(0 9cqw 18cqw rgba(0, 0, 0, 0.5));
}

.col:hover .pin-anchor,
.col.active .pin-anchor {
  animation-play-state: paused;
}

/* ── Logo badge (fallback initial, used for client logos with no upload) ── */
.logo-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #000;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  background: #fff;
}

/* ── Homepage ("/") — its own standalone layout, no map/sidebar ── */
#homepage-hero {
  display: block;
  width: 100%;
  height: auto;
}

#homepage-about {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 32px 60px;
  text-align: center;
}

#homepage-about #about-body {
  margin: 12px 0 28px;
}

/* ── About section (below the map) — 60/40 with a download sidebar ── */
#about-section {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 32px;
  padding: 40px 40px 60px;
  align-items: start;
}

@media (max-width: 700px) {
  #about-section {
    grid-template-columns: 1fr;
  }
}

#about-sidebar {
  border: 2px solid #000;
  border-radius: 16px;
  padding: 24px;
  background: #fff6fb;
  box-shadow: 4px 4px 0 #000;
}

#about-sidebar h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 8px;
}

#about-sidebar p {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  margin: 0 0 18px;
}

#download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #111;
  background: #fb9fe0;
  border: 2px solid #000;
  border-radius: 999px;
  padding: 10px 22px;
  box-shadow: 2px 2px 0 #000;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

#download-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

#download-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

#download-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: 2px 2px 0 #000;
}

#email-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #111;
  text-decoration: none;
  background: #fff;
  border: 2px solid #000;
  border-radius: 999px;
  padding: 10px 22px;
  box-shadow: 2px 2px 0 #000;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

#email-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

#email-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

#about-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

/* Default margin is for the mobile pin view, where the title stands alone
   (no #about-header wrapper). Inside #about-header, the header's own
   margin-bottom already provides that gap, so the title resets to 0. */
#about-business-name {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 16px;
}

#about-header #about-business-name {
  margin: 0;
}

/* ── Shared rich-text styling for every user-authored content block
   (about text, pin bodies) — so nothing renders with default browser
   typography, regardless of which section it's used in. ── */
.copy-block {
  font-size: 18px;
  line-height: 1.7;
  color: #444;
}

.copy-block p { margin: 0 0 1em; }
.copy-block p:last-child { margin-bottom: 0; }

.copy-block h2, .copy-block h3 {
  color: #111;
  font-weight: 800;
  line-height: 1.3;
  margin: 1.2em 0 0.5em;
}
.copy-block h2:first-child, .copy-block h3:first-child { margin-top: 0; }
.copy-block h2 { font-size: 1.3em; }
.copy-block h3 { font-size: 1.1em; }

.copy-block ul, .copy-block ol {
  margin: 0 0 1em 1.3em;
  padding: 0;
}
.copy-block li { margin-bottom: 0.4em; }
.copy-block li:last-child { margin-bottom: 0; }
/* --card-color is set per-pin (modal/mobile inline view) via JS; falls
   back to the surrounding text color where there's no pin (e.g. About). */
.copy-block li::marker { color: var(--card-color, currentColor); }

.copy-block strong, .copy-block b { font-weight: 700; color: #111; }

.copy-block a { color: #1a6fb0; text-decoration: underline; }

/* Mobile: tapping a pin swaps #about-content to show that pin instead of a modal */
#mobile-pin-back {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #111;
  background: #fb9fe0;
  border: 2px solid #000;
  border-radius: 999px;
  box-shadow: 2px 2px 0 #000;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

#mobile-pin-back:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

/* ── Pin modal ── */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

#modal-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

#pin-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(560px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  border: 3px solid #000;
  border-radius: 24px;
  box-shadow: 4px 4px 0 #000;
  padding: 40px 32px 28px;
  z-index: 401;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

#pin-modal.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

#pin-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #000;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #d21f3c;
  cursor: pointer;
  transition: transform 0.15s;
}

#pin-modal-close:hover {
  transform: translate(-1px, -1px);
}

#pin-modal-title {
  font-size: 22px;
  font-weight: 800;
  color: #111;
  margin-bottom: 14px;
}

.pin-title-number {
  font-weight: 800;
}

#pin-modal-body {
  margin-bottom: 28px;
}

/* Shared by the desktop modal's nav and the mobile inline pin view's nav */
.pin-nav {
  display: flex;
  gap: 12px;
  border-top: 2px solid #000;
  padding-top: 20px;
}

.pin-nav button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: #111;
  border: 2px solid #000;
  border-radius: 999px;
  background: #f6d048;
  box-shadow: 2px 2px 0 #000;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.pin-nav button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

.pin-nav button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

/* ── Bottom-of-page printable/shareable poster (fixed size: 595 x 842,
   3 stacked sections — banner / 2x3 pin grid / footer bar). Positioned
   off-screen rather than display:none — the Download button's html2canvas
   capture needs it fully laid out/rendered, just not visible on the page. ── */
#poster-wrap {
  position: absolute;
  top: 0;
  left: -9999px;
  pointer-events: none;
}

#poster {
  width: 595px;
  flex-shrink: 0;
}

#poster-banner {
  width: 595px;
  height: 140px;
  overflow: hidden;
  background-color: #eee;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

#poster-banner-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px;
}

#poster-banner-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #000;
  background: #fff;
  margin-bottom: 8px;
}

#poster-banner-title {
  color: #000;
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

#poster-banner-subtitle {
  color: #dc4b3f;
  font-size: 15px;
  font-weight: 700;
  margin: 4px 0 0;
}

#poster-grid {
  width: 595px;
  height: 644px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(2, 265px);
  grid-template-rows: repeat(3, 190px);
  column-gap: 21.67px;
  row-gap: 18.5px;
  padding: 18.5px 21.67px;
}

.poster-card {
  width: 265px;
  height: 190px;
  box-sizing: border-box;
  border: 2px solid #000;
  border-radius: 14px;
  box-shadow: 4px 4px 0 #000;
  padding: 16px;
  overflow: hidden;
  --poster-scale: 1; /* shrunk by JS (public/static/map.js) only if content overflows */
}

/* 16px/13px are the MAX sizes (scale 1) — public/static/map.js measures each
   card and lowers --poster-scale until the content fits, with a floor so it
   never shrinks to the point of being unreadable. */
.poster-card h3 {
  font-size: calc(16px * var(--poster-scale));
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--card-color, #111);
}

.poster-card-body {
  font-size: calc(13px * var(--poster-scale));
  line-height: 1.5;
  color: #444;
}

.poster-card-body p { margin: 0 0 0.6em; }
.poster-card-body p:last-child { margin-bottom: 0; }
.poster-card-body ul, .poster-card-body ol { margin: 0 0 0.6em 1.1em; padding: 0; }
.poster-card-body li::marker { color: var(--card-color, #444); }
.poster-card-body strong, .poster-card-body b { font-weight: 700; color: #111; }

#poster-footer {
  width: 595px;
  height: 58px;
  box-sizing: border-box;
  background: #fdec11;
  border-top: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

#poster-footer-logo {
  height: 32px;
  width: auto;
  display: block;
}

#poster-footer-back {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  text-decoration: none;
}

#poster-footer-back:hover {
  text-decoration: underline;
}

#site-footer {
  width: 100%;
  box-sizing: border-box;
  background: #fdec11;
  border-top: 3px solid #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
}

#site-footer-logo {
  height: 36px;
  width: auto;
  display: block;
}

#site-footer-link {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  text-decoration: none;
}

#site-footer-link:hover {
  text-decoration: underline;
}
