/* Maply web design system — "a map that shouts" (bold & social).
   One stylesheet drives every surface: the landing page, /s share snapshots,
   /l & /@handle published pages, and the legal/support pages. Component class
   names are a contract with viewer.js and the backend page templates — don't
   rename without updating those. */

@font-face {
  font-family: "Anton";
  src: url("/anton.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Grand Hotel";
  src: url("/grandhotel.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  /* Per-creator premium pages inject `--maply-accent` in an inline <style> after
     this file; --accent (and its --tint alias) fall back to the Maply flare, so
     one indirection themes pins, buttons, links and the profile header. */
  --accent: var(--maply-accent, #ff2e4d);
  --tint: var(--accent);
  --flare: #ff2e4d; --magenta: #ff2e93; --tangerine: #ff7a1a; --cyan: #10c4de;

  /* Warm, chosen neutrals (not pure white/grey). */
  --bg: #fbf4ef; --fg: #1a1210; --muted: #8b7d75; --card: #ffffff;
  --hairline: rgba(26, 18, 16, .12);
  --paper: var(--bg); --ink: var(--fg); --line: var(--hairline);
  /* Fixed on-color tokens — used on gradient/accent surfaces so a dark-mode flip
     can never invert text against a fixed background. */
  --ink0: #1a1210; --paper0: #fbf4ef;

  --brand-grad: linear-gradient(115deg, #ff7a1a 0%, #ff2e4d 46%, #ff2e93 100%);

  --display: "Anton", system-ui, sans-serif;
  --wordmark: "Grand Hotel", cursive;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --r: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #150f0d; --fg: #fbf4ef; --muted: #a89a92; --card: #221917;
    --hairline: rgba(251, 244, 239, .14);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px; line-height: 1.5;
  color: var(--fg); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
#maply-app { max-width: 720px; margin: 0 auto; padding: 0 16px 16px; }

/* Shared bits */
.maply-logo { width: 1.06em; height: 1.06em; fill: currentColor; flex: none; vertical-align: -.15em; }
.maply-ico { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* Sticky top bar */
.maply-bar {
  position: sticky; top: 0; z-index: 1200; /* above Leaflet controls (z 1000) */
  isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 -16px 8px; padding: 10px 16px;
  background: var(--bg); /* opaque: a blurred bar ghosts stale map pixels in Safari */
  border-bottom: 2px solid var(--ink);
}
.maply-wordmark { display: inline-flex; align-items: center; gap: 6px; font-family: var(--wordmark); font-weight: 400; font-size: 1.55rem; text-transform: lowercase; line-height: 1; }
.maply-bar-actions { display: flex; align-items: center; gap: 8px; }

/* App Store badge — stays black (Apple convention) */
.maply-appstore {
  display: inline-flex; align-items: center; gap: 5px;
  background: #000; color: #fff; text-decoration: none;
  padding: 7px 12px; border-radius: 999px; font-weight: 700; font-size: .8rem;
  border: 2px solid var(--ink0);
}
.maply-apple { width: 14px; height: 14px; display: block; }
.maply-appstore-text { line-height: 1; }

/* Title header */
.maply-header { padding: 22px 2px 18px; }
.maply-header h1 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(1.9rem, 7vw, 2.7rem); line-height: .96; letter-spacing: .01em; margin: 0;
}
.maply-sub { font-family: var(--mono); color: var(--muted); margin: 8px 0 0; font-size: .82rem; letter-spacing: .04em; }

/* CTAs — sticker pills with a hard offset shadow */
.maply-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 800;
  padding: 13px 24px; border-radius: 999px; border: 2.5px solid var(--ink0);
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.maply-cta:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink0); }
.maply-cta:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink0); }
.maply-cta-sm { padding: 8px 15px; font-size: .85rem; box-shadow: var(--shadow-sm); }
.maply-cta-sm:hover { box-shadow: 5px 5px 0 var(--ink0); }

a:focus-visible, button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

/* Unclaimed seeded pages (§16.1.3) — the curated-by-Maply label + claim CTA.
   Rendered as static HTML by the backend templates, outside #maply-app. */
.maply-unclaimed {
  display: block; margin: 0; padding: 10px 16px;
  background: var(--paper0); color: var(--ink0);
  border-bottom: 2.5px solid var(--ink0);
  font-family: var(--mono); font-size: .8rem; letter-spacing: .02em; text-align: center;
}
.maply-unclaimed a { color: var(--accent); font-weight: 800; }

/* Map */
.maply-map {
  height: 320px; border-radius: 14px; overflow: hidden; margin: 10px 0 22px;
  background: var(--card); border: 2.5px solid var(--ink); box-shadow: var(--shadow-sm);
}
.leaflet-container { font: inherit; }
.maply-marker { background: none; border: none; }
.maply-marker span {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-family: var(--mono); font-weight: 700; font-size: .82rem;
  border: 2.5px solid var(--ink0); box-shadow: 2px 2px 0 rgba(26, 18, 16, .4);
  transition: transform .15s ease;
}
.maply-marker.active span { transform: scale(1.28); z-index: 1000; }
.maply-dot { background: var(--accent); border: 2.5px solid var(--ink0); border-radius: 50%; box-shadow: 2px 2px 0 rgba(26, 18, 16, .35); }

/* Place cards */
.maply-cards { display: flex; flex-direction: column; gap: 12px; }
.maply-card {
  background: var(--card); border-radius: 14px; padding: 14px 16px; cursor: pointer;
  border: 2.5px solid var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.maply-card:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.maply-card.active { border-color: var(--accent); box-shadow: 5px 5px 0 var(--accent); }
.maply-card-head { display: flex; align-items: center; gap: 9px; }
.maply-card-emoji { font-size: 1.2rem; margin-left: auto; order: 2; }
.maply-card-name { font-weight: 850; font-size: 1.06rem; letter-spacing: -.01em; }
.maply-card-addr { font-family: var(--mono); color: var(--muted); margin: 7px 0 0; font-size: .76rem; }
.maply-card-handle { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); margin: 6px 0 0; font-size: .82rem; font-weight: 700; }
.maply-card-note { margin: 6px 0 0; font-size: .95rem; }
.maply-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Actions render as bold mini-chips */
.maply-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700;
  color: var(--ink); text-decoration: none; background: var(--card);
  border: 2px solid var(--ink); border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
.maply-link:hover { background: var(--ink); color: var(--paper); }
.maply-watch { background: var(--cyan); border-color: var(--ink0); color: var(--ink0); }
.maply-watch:hover { background: var(--ink0); color: var(--paper0); }

/* Embeds */
.maply-embed { margin-top: 12px; position: relative; padding-top: 150%; max-width: 340px; }
.maply-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 12px; border: 2.5px solid var(--ink); }
.maply-embed-ig { margin-top: 12px; max-width: 400px; }
.maply-embed-ig .instagram-media { margin: 0 !important; }
.maply-ig-fallback {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 12px;
  padding: 12px 16px; text-decoration: none; color: var(--fg); font-weight: 700; box-shadow: var(--shadow-sm);
}
.maply-ig-glyph { font-size: 1.2rem; }

/* Creator attribution strip (published list pages) */
.maply-attrib {
  display: flex; align-items: center; gap: 11px;
  margin: 4px 0 0; padding: 11px 13px;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 14px;
  text-decoration: none; color: var(--fg); box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.maply-attrib:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.maply-attrib-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2.5px solid var(--ink); }
.maply-attrib-text { display: flex; flex-direction: column; line-height: 1.15; }
.maply-attrib-name { font-weight: 850; }
.maply-attrib-handle { font-family: var(--mono); color: var(--muted); font-size: .78rem; }

/* Creator page (/@handle) — the gradient profile header */
.maply-profile {
  text-align: center; padding: 34px 22px 26px; margin: 8px 0 20px;
  border: 3px solid var(--ink0); border-radius: 24px; box-shadow: var(--shadow);
  color: #fff;
  background: var(--accent); /* fallback if color-mix unsupported */
  background: linear-gradient(140deg,
    color-mix(in oklab, var(--accent) 82%, #fff),
    var(--accent) 52%,
    color-mix(in oklab, var(--accent), #000 15%));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.maply-avatar {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--ink0); box-shadow: 4px 4px 0 rgba(26, 18, 16, .35);
}
.maply-avatar-blank {
  display: flex; align-items: center; justify-content: center;
  background: var(--paper0); color: var(--ink0); font-size: 2.2rem; font-weight: 900;
}
.maply-profile-name { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(1.7rem, 6vw, 2.3rem); letter-spacing: .01em; margin: 0; }
.maply-profile-handle { font-family: var(--mono); color: #fff; opacity: .95; margin: 0; font-weight: 400; }
.maply-profile-bio { margin: 4px auto 4px; max-width: 42ch; font-weight: 500; }
.maply-socials { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 4px; }
.maply-social {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink0); text-decoration: none; font-weight: 700; font-size: .8rem;
  font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase;
  padding: 7px 12px; background: var(--paper0); border: 2px solid var(--ink0); border-radius: 999px;
}

/* Creator list cards — a grid only when the page is a creator page */
.maply-cards:has(.maply-listcard) { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* The list cards and the CTA both wear hard offset shadows — without real
   breathing room they read as one stacked blob. */
.maply-cards:has(.maply-listcard) + .maply-cta { margin-top: 28px; }
.maply-listcard {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 16px; padding: 16px;
  text-decoration: none; color: var(--fg); box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.maply-listcard:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.maply-listcard-emoji { font-size: 1.9rem; }
.maply-listcard-title { font-weight: 850; font-size: 1.08rem; letter-spacing: -.01em; }
.maply-listcard-count { font-family: var(--mono); color: var(--muted); font-size: .76rem; }

/* Footer */
.maply-footer { text-align: center; padding: 32px 0 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.maply-store {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--ink); font-weight: 800; text-decoration: none;
  border: 2.5px solid var(--ink); border-radius: 999px; padding: 11px 20px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.maply-store:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.maply-note { font-family: var(--mono); color: var(--muted); font-size: .74rem; margin: 0; max-width: 42ch; letter-spacing: .03em; }
.maply-report { color: var(--muted); font-size: .78rem; cursor: pointer; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .maply-cta, .maply-card, .maply-attrib, .maply-listcard, .maply-store, .maply-marker span { transition: none; }
}
