/* badatparking.com — plain CSS, mobile-first. */
:root {
  --bg: #f3f3f6;
  --card: #ffffff;
  --ink: #17171b;
  --muted: #6c6c78;
  --accent: #e5383b;      /* citation red */
  --accent-2: #ff9f1c;    /* ticket amber */
  --line: #e6e6ec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 10px 30px rgba(20, 20, 30, .06);
  --maxw: 680px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

/* ---- header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}
.site-header .wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  font-weight: 800;
  letter-spacing: .5px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
}
.brand .tag {
  background: var(--accent-2);
  color: #1b1b1b;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.site-header nav { margin-left: auto; display: flex; gap: 6px; }
.site-header nav a {
  text-decoration: none;
  color: #fff;
  opacity: .8;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}
.site-header nav a:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.site-header nav a.active { opacity: 1; background: var(--accent); }

/* ---- layout ---- */
main { max-width: var(--maxw); margin: 0 auto; padding: 16px; }

.page-title {
  margin: 6px 0 14px;
  font-size: 22px;
  font-weight: 800;
}
.page-title small { display: block; font-weight: 500; color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ---- filter bar ---- */
.filters {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  box-shadow: var(--shadow);
}
.filters label { font-size: 12px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.filters input, .filters select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.filters .actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
.btn.secondary { background: #ececf1; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---- post card ---- */
.feed { display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card .body { padding: 12px 14px 14px; }
.card .caption { font-size: 16px; margin: 0 0 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f0f0f4;
  color: var(--ink);
}
.badge.make { background: var(--accent-2); color: #1b1b1b; }
.card .when { color: var(--muted); font-size: 13px; margin-top: 8px; }
.card .when a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ---- gallery / carousel ---- */
.gallery { position: relative; background: #111; }
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; }
.slide img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #222;
  cursor: pointer;
}
.gallery.full .slide img { aspect-ratio: auto; max-height: 80vh; object-fit: contain; }
.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.gallery-btn.prev { left: 8px; }
.gallery-btn.next { right: 8px; }
.gallery-count {
  position: absolute;
  bottom: 8px;
  right: 10px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

/* ---- states ---- */
.note { text-align: center; color: var(--muted); padding: 40px 16px; }
.note.error { color: var(--accent); }
#loadmore-wrap { text-align: center; margin: 18px 0 6px; }

/* ---- stats / hall of shame ---- */
.total-banner {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.total-banner .num { font-size: 48px; font-weight: 900; color: var(--accent-2); line-height: 1; }
.total-banner .lbl { text-transform: uppercase; letter-spacing: 2px; font-size: 13px; opacity: .85; margin-top: 6px; }

.board { display: flex; flex-direction: column; gap: 8px; }
.row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}
.row .top { display: flex; align-items: center; gap: 10px; }
.row .rank { font-size: 18px; width: 30px; text-align: center; font-weight: 800; color: var(--muted); }
.row .name { font-weight: 700; }
.row .count { margin-left: auto; font-weight: 800; }
.bar {
  height: 10px;
  border-radius: 999px;
  background: #eee;
  margin-top: 8px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width .8s cubic-bezier(.2, .8, .2, 1);
}
.row.top1 { border-color: var(--accent-2); }

/* ---- detail page ---- */
.back-link { display: inline-block; margin-bottom: 12px; color: var(--accent); text-decoration: none; font-weight: 700; }
.detail .body { padding: 16px; }
.detail .caption { font-size: 20px; font-weight: 700; }
.share-row { margin-top: 14px; display: flex; gap: 8px; }

footer { max-width: var(--maxw); margin: 24px auto; padding: 0 16px 30px; color: var(--muted); font-size: 13px; text-align: center; }

@media (min-width: 560px) {
  .filters { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

@media (max-width: 480px) {
  .brand { font-size: 16px; }
  .brand .tag { display: none; }       /* declutter the header on small phones */
  .site-header .wrap { gap: 8px; }
}

/* ---- admin ---- */
.card.pad { padding: 16px; box-shadow: var(--shadow); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff;
}
.field textarea { min-height: 72px; resize: vertical; }
.field input[type="file"] { padding: 9px; }
.req { color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.error-text { color: var(--accent); font-weight: 600; margin-top: 10px; }
.up-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.up-row { font-size: 13px; }
.up-row .name { display: flex; justify-content: space-between; gap: 8px; }
.up-row .bar { margin-top: 5px; }
.up-row .bar > span { transition: width .25s linear; }
.up-row.done .bar > span { background: #2a9d4a; }
.up-row.err .name { color: var(--accent); }
.success-box { text-align: center; padding: 26px 16px; }
.success-box .big { font-size: 44px; line-height: 1; }
.success-box h2 { margin: 10px 0 6px; }
.btn.block { width: 100%; display: block; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
