/* Public showcase — what both pages share: tokens, chrome, cards, photos.
   Served from this app own origin. No build step, no framework, no CDN. */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --fg: #10141a;
  --muted: #5f6b78;
  --line: #e3e7ec;
  --acc: #1d4ed8;
  --acc-soft: #e8eeff;
  --low-bg: #e6f5ec;  --low-fg: #10693a;
  --mid-bg: #eef1f5;  --mid-fg: #4a5561;
  --high-bg: #fdeceb; --high-fg: #a52318;
  --shadow: 0 1px 2px rgba(16, 20, 26, .06), 0 6px 20px rgba(16, 20, 26, .06);
  --shadow-hi: 0 2px 6px rgba(16, 20, 26, .09), 0 14px 34px rgba(16, 20, 26, .12);
  --radius: 14px;
  --page: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1116;
    --surface: #161b22;
    --fg: #e8eaed;
    --muted: #98a3b0;
    --line: #262d36;
    --acc: #6f9bff;
    --acc-soft: #1a2338;
    --low-bg: #12301f;  --low-fg: #6fd39a;
    --mid-bg: #21272f;  --mid-fg: #a8b3bf;
    --high-bg: #331a19; --high-fg: #ff9c92;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-hi: 0 4px 12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* Header */
header {
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px 18px 10px;
}
.brand {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--acc);
  margin: 0 0 6px;
}
.brand a { color: inherit; text-decoration: none; }
.brand a:hover { text-decoration: underline; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0; max-width: 62ch; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 4px; }

/* Map */
.mapbox { max-width: var(--page); margin: 0 auto; }
#map {
  height: 340px;
  max-width: var(--page);
  margin: 16px auto 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.leaflet-container { background: var(--surface); }
.mapbox > summary {
  display: none;
  cursor: pointer;
  margin: 12px 14px 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: .9rem;
  font-weight: 600;
  list-style: none;
}
.mapbox > summary::-webkit-details-marker { display: none; }
.mapbox > summary::after { content: " ▾"; color: var(--muted); }
.mapbox[open] > summary::after { content: " ▴"; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s ease, transform .18s ease;
}
@media (hover: hover) {
  .card:hover { box-shadow: var(--shadow-hi); transform: translateY(-2px); }
}
.card:target { outline: 2px solid var(--acc); outline-offset: 2px; }

/* Photos */
.ph { position: relative; }
.gal { position: relative; background: var(--mid-bg); }
.track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  aspect-ratio: 4 / 3;
}
.track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: center;
  display: block;
  cursor: zoom-in;
}
.gal.no-photo::after,
.gal.empty-track::after {
  content: "фото недоступно";
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  color: var(--muted);
  font-size: .85rem;
}
.gal.empty-track .track { display: none; }

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(12, 16, 22, .55);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease;
  backdrop-filter: blur(4px);
  z-index: 2;
}
.nav.prev { left: 8px; }
.nav.next { right: 8px; }
@media (hover: hover) {
  .gal:hover .nav, .nav:focus-visible { opacity: 1; }
}
.count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(12, 16, 22, .6);
  color: #fff;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}

.tag {
  position: absolute;
  top: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  background: rgba(12, 16, 22, .6);
  backdrop-filter: blur(4px);
  white-space: nowrap;
  z-index: 2;
}
.tag.src { left: 10px; }
.tag.fresh { right: 10px; }
.tag.drop, .tag.upd { left: 10px; top: 42px; }
.tag.drop { background: rgba(165, 35, 24, .85); }

/* Card body */
.body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.price { margin: 0; font-size: .9rem; color: var(--muted); }
.price b { font-size: 1.3rem; color: var(--fg); letter-spacing: -.01em; }
.card h3 {
  margin: 0;
  font-size: .98rem;
  line-height: 1.35;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.facts { margin: 0; font-size: .85rem; color: var(--muted); }
.excerpt {
  margin: 0;
  font-size: .84rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.excerpt.pending { font-style: italic; opacity: .8; }
.verdict {
  margin: 2px 0 0;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--mid-bg);
  color: var(--mid-fg);
}
.verdict.low { background: var(--low-bg); color: var(--low-fg); }
.verdict.high { background: var(--high-bg); color: var(--high-fg); }
.loc { margin: 0; font-size: .85rem; }
.loc a { color: var(--acc); text-decoration: none; }
.loc a:hover { text-decoration: underline; }
.loc i { color: var(--muted); font-size: .78rem; font-style: normal; }
.who { margin: 0; font-size: .8rem; color: var(--muted); }
.btns { margin: auto 0 0; padding-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* The whole photo is a link to the object page, under the arrows and chips. */
.open { position: absolute; inset: 0; z-index: 1; }

/* Buttons */
.btn {
  padding: 8px 13px;
  border-radius: 10px;
  background: var(--acc-soft);
  color: var(--acc);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: filter .15s ease;
}
.btn:hover { filter: brightness(.96); }
.btn.primary { background: var(--acc); color: #fff; }
.btn.big { font-size: .95rem; padding: 11px 18px; }
/* The dark accent is a LIGHT blue, so white on it fails contrast: the filled
   button takes dark text there. Must sit AFTER the rule above — same
   specificity, so the cascade goes by order, not by the media query. */
@media (prefers-color-scheme: dark) {
  .btn.primary { color: #0d1116; }
}

/* Lightbox */
#lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
}
#lightbox::backdrop { background: rgba(6, 8, 12, .92); }
#lightbox .track { aspect-ratio: auto; height: 100%; align-items: center; }
#lightbox .slide { object-fit: contain; height: 100%; cursor: default; background: #000; }
#lightbox .nav { opacity: 1; width: 44px; height: 44px; }
#lightbox .close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 3;
}
#lightbox .count { right: 50%; transform: translateX(50%); bottom: 18px; }

/* Footer */
footer {
  text-align: center;
  color: var(--muted);
  padding: 8px 18px 44px;
  font-size: .84rem;
}

@media (max-width: 640px) {
  .mapbox > summary { display: block; }
}

@media (max-width: 480px) {
  header { padding: 20px 14px 8px; }
  h1 { font-size: 1.4rem; }
  #map { height: 260px; border-radius: 0; border-left: 0; border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Витрина открыта как Telegram Mini App (класс ставит frontend/miniapp.js).
   Прячем то, что осмысленно только снаружи: приглашение написать боту, из
   которого читатель сюда и пришёл. */
.tg .bot-link { display: none; }
