/* =============================================================================
   MANTAP Directory
   Palette lifted from the MANTAP identity: four brand colours used as a system
   of category signals rather than decoration. Each category owns one hue, so a
   result card, a map pin and a leaderboard row all agree on what a business is.
   ========================================================================== */

:root {
  --pink:   #d62e72;
  --teal:   #1db5ac;
  --green:  #1e874c;
  --orange: #f2953c;

  --ink:        #14120f;
  --ink-soft:   #4a453f;
  --ink-faint:  #8a827a;
  --paper:      #f2f1ee;
  --card:       #ffffff;
  --line:       #e2dfd9;

  --display: 'Poppins', system-ui, sans-serif;
  --body:    'Inter', system-ui, sans-serif;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --shadow: 0 1px 2px rgba(20,18,15,.05), 0 8px 24px -12px rgba(20,18,15,.18);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; margin: 0; letter-spacing: -.02em; }
p { margin: 0 0 1rem; }
a { color: inherit; }

img { max-width: 100%; display: block; }

.wrap { width: min(1220px, 100% - 2.5rem); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: .75rem 1.25rem;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------- buttons -- */

.btn {
  font-family: var(--display);
  font-weight: 600;
  font-size: .9rem;
  border: 0;
  border-radius: 999px;
  padding: .7rem 1.4rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: background-color .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }

.btn--pink  { background: var(--pink);  color: #fff; }
.btn--pink:hover  { background: #b7245e; }
.btn--teal  { background: var(--teal);  color: #fff; }
.btn--teal:hover  { background: #17968f; }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--google { background: #fff; color: var(--ink); border: 1.5px solid var(--line); width: 100%; justify-content: center; }
.btn--google:hover { border-color: var(--ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------------- nav -- */

.nav {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.nav__inner { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.nav__logo img { height: 34px; width: auto; }
.nav__links { display: flex; gap: 1.5rem; margin-left: auto; font-size: .9rem; font-weight: 500; }
.nav__links a { text-decoration: none; color: var(--ink-soft); }
.nav__links a:hover { color: var(--pink); }
.nav__auth { display: flex; align-items: center; }

.acct { position: relative; }
.acct summary { list-style: none; }
.acct summary::-webkit-details-marker { display: none; }
.acct__menu {
  position: absolute; right: 0; top: calc(100% + .5rem);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  min-width: 180px; padding: .4rem; z-index: 50;
}
.acct__menu a, .acct__menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; font: inherit; font-size: .9rem;
  padding: .55rem .75rem; border-radius: var(--r-sm);
  cursor: pointer; text-decoration: none; color: var(--ink);
}
.acct__menu a:hover, .acct__menu button:hover { background: var(--paper); }

/* ------------------------------------------------------------------ hero --
   The search field is the hero. No marketing headline stack above it, because
   the page has exactly one job and burying the input under a banner would make
   people scroll to reach it.                                                */

.hero { padding: 3.5rem 0 2rem; }

.hero__title {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  max-width: 16ch;
  margin-bottom: .75rem;
}
.hero__sub {
  color: var(--ink-soft);
  max-width: 52ch;
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.search {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: .5rem .5rem .5rem 1.4rem;
  box-shadow: var(--shadow);
  max-width: 780px;
}
.search input {
  flex: 1; border: 0; outline: 0; background: none;
  font-family: var(--body); font-size: 1.05rem; padding: .65rem 0;
  min-width: 0;
}
.search input::placeholder { color: var(--ink-faint); }
.search__clear {
  border: 0; background: none; cursor: pointer; color: var(--ink-faint);
  font-size: 1.35rem; line-height: 1; padding: .25rem .5rem;
}
.search__clear:hover { color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.chip {
  font-family: var(--display); font-weight: 500; font-size: .82rem;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 999px; padding: .4rem 1rem; cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink-faint); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* --------------------------------------------------------------- explore --
   Map on the left, results on the right. The map is sticky on desktop so the
   pin you clicked stays in view while you read what came out of it.          */

.explore {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.75rem;
  padding: 1.5rem 0 4rem;
  align-items: start;
}

.map-panel { position: sticky; top: 84px; }

#map {
  height: min(66vh, 620px);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: #e8e6e1;
  z-index: 1;
}

.map-hint {
  font-size: .82rem; color: var(--ink-faint);
  margin: .7rem .25rem 0;
}

/* Leaflet pins, coloured by the dominant category in that building. */
.pin {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(20,18,15,.35);
  display: grid; place-items: center;
}
.pin span {
  transform: rotate(45deg);
  font-family: var(--display); font-weight: 700; font-size: .78rem; color: #fff;
}
.pin--active { outline: 3px solid var(--ink); outline-offset: 2px; }

.leaflet-popup-content-wrapper { border-radius: var(--r); }
.leaflet-popup-content { margin: .8rem 1rem; font-family: var(--body); }

/* --------------------------------------------------------------- results -- */

.results__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.results__count { font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.results__reset {
  background: none; border: 0; cursor: pointer; font: inherit; font-size: .85rem;
  color: var(--pink); text-decoration: underline;
}

.results { display: grid; gap: .85rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.1rem 1.2rem;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1rem;
  text-decoration: none;
  border-left: 4px solid var(--line);
}
.card:hover { border-color: var(--ink-faint); }
.card:hover .card__name { color: var(--pink); }

.card__logo {
  width: 52px; height: 52px; border-radius: 12px; object-fit: cover;
  background: var(--paper); border: 1px solid var(--line);
}
.card__logo--empty {
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: #fff;
}
.card__name { font-family: var(--display); font-weight: 600; font-size: 1.08rem; margin-bottom: .15rem; }
.card__tagline { color: var(--ink-soft); font-size: .9rem; margin: 0 0 .5rem; }
.card__meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .84rem; color: var(--ink-faint); }
.card__condo { color: var(--ink-soft); font-weight: 500; }
.card__cat { font-weight: 500; }

.empty {
  background: var(--card); border: 1px dashed var(--line);
  border-radius: var(--r); padding: 2.5rem 1.5rem; text-align: center;
}
.empty h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.empty p { color: var(--ink-soft); max-width: 40ch; margin-inline: auto; }

.skeleton {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); height: 88px;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ----------------------------------------------------------- leaderboard --
   Numbered here because it genuinely is a ranking, which is the only time a
   number in front of a row means anything.                                   */

.board { padding: 4rem 0; background: var(--card); border-block: 1px solid var(--line); }
.board__head { max-width: 58ch; margin-bottom: 2rem; }
.board__title { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: .6rem; }
.board__sub { color: var(--ink-soft); }

.board__list { display: grid; gap: .5rem; counter-reset: rank; }

.board__row {
  display: grid;
  grid-template-columns: 2.75rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.1rem;
  border-radius: var(--r);
  background: var(--paper);
  text-decoration: none;
  border: 1px solid transparent;
}
.board__row:hover { border-color: var(--line); background: #fff; }

.board__rank {
  font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  color: var(--ink-faint); text-align: center;
}
.board__row:nth-child(1) .board__rank { color: var(--pink); font-size: 1.5rem; }
.board__row:nth-child(2) .board__rank { color: var(--teal); font-size: 1.3rem; }
.board__row:nth-child(3) .board__rank { color: var(--orange); font-size: 1.2rem; }

.board__name { font-family: var(--display); font-weight: 600; }
.board__area { font-size: .85rem; color: var(--ink-faint); }
.board__count { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.board__count small { display: block; font-weight: 400; font-size: .72rem; color: var(--ink-faint); }

.board__flag {
  display: inline-block; font-size: .68rem; font-weight: 600;
  background: var(--green); color: #fff; padding: .1rem .5rem;
  border-radius: 999px; margin-left: .5rem; vertical-align: middle;
}

/* ------------------------------------------------------------ condo page -- */

.page-head { padding: 3rem 0 2rem; }
.crumb { font-size: .85rem; color: var(--ink-faint); margin-bottom: .9rem; }
.crumb a { color: var(--ink-soft); }
.page-title { font-size: clamp(2rem, 5vw, 3.1rem); margin-bottom: .5rem; }
.page-sub { color: var(--ink-soft); font-size: 1.05rem; }

.stat-row { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 1.75rem; }
.stat__n { font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1; }
.stat__l { font-size: .82rem; color: var(--ink-faint); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; padding-bottom: 4rem; }

/* ----------------------------------------------------------- vendor page -- */

.vendor-head {
  display: grid; grid-template-columns: 96px 1fr; gap: 1.5rem;
  align-items: start; padding: 3rem 0 1.5rem;
}
.vendor-logo { width: 96px; height: 96px; border-radius: 20px; object-fit: cover; border: 1px solid var(--line); }
.vendor-logo--empty { display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 2rem; color: #fff; }

.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tag {
  font-size: .8rem; background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: .25rem .8rem; color: var(--ink-soft);
}

.vendor-body {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2.5rem; padding-bottom: 4rem; align-items: start;
}
.prose { max-width: 62ch; }
.prose p { color: var(--ink-soft); }

.contact-box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1.6rem; box-shadow: var(--shadow);
  position: sticky; top: 84px;
}
.contact-box h2 { font-size: 1.2rem; margin-bottom: .6rem; }
.contact-box p { font-size: .9rem; color: var(--ink-soft); }
.contact-box .btn { width: 100%; justify-content: center; }

.revealed { display: grid; gap: .6rem; margin-top: .5rem; }
.revealed a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--paper); border-radius: var(--r-sm);
  padding: .8rem 1rem; text-decoration: none; font-weight: 500;
}
.revealed a:hover { background: #e9e7e2; }
.revealed small { color: var(--ink-faint); font-weight: 400; }

.report-link {
  background: none; border: 0; padding: 0; margin-top: 1rem;
  font: inherit; font-size: .8rem; color: var(--ink-faint);
  text-decoration: underline; cursor: pointer;
}

/* ------------------------------------------------------------ moderation -- */

.admin-tabs { display: flex; gap: .5rem; margin: 2rem 0 1.5rem; flex-wrap: wrap; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--r); overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: top; }
.admin-table th { font-family: var(--display); font-weight: 600; background: var(--paper); }
.admin-table td .btn { padding: .4rem 1rem; font-size: .8rem; }
.gate { padding: 5rem 0; text-align: center; }

/* ----------------------------------------------------------------- modal -- */

.modal {
  border: 0; border-radius: var(--r-lg); padding: 2rem;
  width: min(440px, calc(100vw - 2rem));
  box-shadow: 0 24px 60px -20px rgba(20,18,15,.4);
}
.modal::backdrop { background: rgba(20,18,15,.55); }
.modal__close-form { position: absolute; top: .75rem; right: .9rem; }
.modal__close { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-faint); }
.modal__title { font-size: 1.35rem; margin-bottom: .75rem; padding-right: 1.5rem; }
.modal__body { font-size: .92rem; color: var(--ink-soft); }
.modal__or { text-align: center; font-size: .82rem; color: var(--ink-faint); margin: 1.1rem 0 .6rem; }
.modal__email { display: flex; gap: .5rem; }
.modal__email input {
  flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 999px;
  padding: .7rem 1.1rem; font: inherit; font-size: .92rem;
}
.modal__note { font-size: .85rem; margin: .9rem 0 0; min-height: 1.2em; }
.modal__note[data-tone="ok"]  { color: var(--green); }
.modal__note[data-tone="bad"] { color: var(--pink); }

/* ---------------------------------------------------------------- footer -- */

.foot { background: var(--ink); color: rgba(255,255,255,.72); padding: 3.5rem 0 2.5rem; }
.foot a { color: #fff; }
.foot__rule { display: flex; height: 4px; border-radius: 2px; overflow: hidden; margin-bottom: 2.5rem; }
.foot__rule span { flex: 1; }
.foot__rule span:nth-child(1) { background: var(--pink); }
.foot__rule span:nth-child(2) { background: var(--teal); }
.foot__rule span:nth-child(3) { background: var(--green); }
.foot__rule span:nth-child(4) { background: var(--orange); }
.foot__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2.5rem; }
.foot__lead { font-family: var(--display); font-weight: 600; font-size: 1.3rem; color: #fff; margin-bottom: .5rem; }
.foot__meta p { margin-bottom: .4rem; }
.foot__fine { font-size: .82rem; color: rgba(255,255,255,.5); }

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 940px) {
  .explore { grid-template-columns: 1fr; }
  .map-panel { position: static; order: 2; }
  .results-panel { order: 1; }
  #map { height: 400px; }
  .vendor-body { grid-template-columns: 1fr; }
  .contact-box { position: static; }
  .foot__grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .wrap { width: calc(100% - 2rem); }
  .nav__links { display: none; }
  .hero { padding: 2.25rem 0 1.25rem; }
  .search { padding-left: 1.1rem; }
  .search input { font-size: 1rem; }
  .vendor-head { grid-template-columns: 1fr; }
  .board__row { grid-template-columns: 2rem 1fr auto; padding: .75rem .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
