/*
  Ручная, без сборки, стилевая система — тёмный urban-стиль со
  "spray-paint"-акцентами. Никакого Tailwind/Node на этапе сборки: только
  этот файл + шрифты с Google Fonts (см. base.html).
*/

:root {
  --bg: #0a0a0d;
  --bg-elevated: #16161d;
  --bg-elevated-2: #1f1f29;
  --border: #2b2b36;
  --text: #f4f2ec;
  --text-muted: #a4a3b0;
  --text-faint: #6e6d7a;

  --accent: #ff2d78;
  --accent-strong: #ff5c96;
  --accent-soft: rgba(255, 45, 120, 0.14);
  --acid: #c6ff3d;
  --acid-strong: #d8ff70;

  --danger: #ef4444;
  --success: #34d399;

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

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
}
h2 {
  font-size: clamp(1.3rem, 1rem + 1.2vw, 1.8rem);
}
h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
  color: var(--text-muted);
}

a {
  color: var(--acid);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 10, 13, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  max-width: var(--container);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.brand:hover {
  text-decoration: none;
  color: var(--text);
}
.brand__mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.brand__tagline {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--text-faint);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.nav a:hover,
.nav a.is-active {
  color: var(--text);
  background: var(--bg-elevated-2);
  text-decoration: none;
}

.donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.donate-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  color: #100109;
}
.btn-primary:hover {
  background: var(--accent-strong);
  color: #100109;
}
.btn-acid {
  background: var(--acid);
  color: #0a1200;
}
.btn-acid:hover {
  background: var(--acid-strong);
  color: #0a1200;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--text-muted);
  background: var(--bg-elevated-2);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* --- Cards / badges --- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-status-pending,
.badge-status-pending_review {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}
.badge-status-published,
.badge-status-approved {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.4);
}
.badge-status-rejected {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
}

/* --- Hero / map page --- */
.map-page {
  position: relative;
  flex: 1;
  min-height: 0;
}
#map-canvas {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
}

.map-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100% - 32px);
  overflow-y: auto;
  background: rgba(16, 16, 21, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.map-overlay summary {
  margin-bottom: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  cursor: pointer;
}
.map-overlay[open] summary {
  margin-bottom: 10px;
}
.map-overlay:not([open]) {
  overflow: visible;
}
.map-overlay:not([open]) summary {
  margin-bottom: 0;
}

.type-filter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.type-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  user-select: none;
}
.type-filter-item:hover {
  background: var(--bg-elevated-2);
}
.type-filter-item input {
  accent-color: var(--accent);
}
.type-filter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.map-add-cta {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 20;
}

.map-pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #0a0a0d;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
.map-pin__inner {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  transform: rotate(45deg);
  background: var(--bg-elevated) center/cover no-repeat;
}

.map-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #100109;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  border: 2px solid #0a0a0d;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.map-popup {
  font-family: var(--font-body);
  color: #16161d;
  max-width: 220px;
}
.map-popup img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}
.map-popup__body {
  padding: 10px 12px;
}
.map-popup__title {
  font-weight: 700;
  margin-bottom: 2px;
}
.map-popup__type {
  font-size: 0.78rem;
  color: #6b6b76;
}
.map-popup a {
  color: #b3134f;
}

/* --- Generic page sections --- */
.page {
  padding: 40px 0 80px;
}
.page-header {
  margin-bottom: 28px;
}
.section-eyebrow {
  color: var(--acid);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

/* --- Catalog grid --- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.filter-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.filter-chip:hover {
  border-color: var(--text-muted);
  text-decoration: none;
}
.filter-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #100109;
}

.object-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.object-card {
  display: flex;
  flex-direction: column;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.object-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: var(--text-faint);
}
.object-card__image {
  aspect-ratio: 4 / 3;
  background: var(--bg-elevated-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 2rem;
}
.object-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.object-card__body {
  padding: 12px 14px 16px;
}
.object-card__title {
  font-weight: 600;
  margin-bottom: 4px;
}
.object-card__meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

/* --- Object detail --- */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 32px;
}
@media (max-width: 860px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.gallery-empty {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: repeating-linear-gradient(
    135deg,
    var(--bg-elevated) 0 14px,
    var(--bg-elevated-2) 14px 28px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.meta-list li {
  display: flex;
  gap: 8px;
  font-size: 0.9rem;
}
.meta-list .label {
  color: var(--text-faint);
  min-width: 110px;
}

.mini-map {
  width: 100%;
  height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
/* #map-canvas{position:absolute;inset:0} и .mini-map живут на одном и том
   же элементе (id="map-canvas" class="mini-map") — ID-селектор специфичнее
   класса, поэтому просто position:relative в .mini-map не переопределял его.
   Нужен составной селектор той же специфичности, что и #map-canvas. */
#map-canvas.mini-map {
  position: relative;
}

.history {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.history-item {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.88rem;
  color: var(--text-muted);
}
.history-item:last-child {
  border-bottom: none;
}

/* --- Forms --- */
.form-grid {
  display: grid;
  gap: 16px;
  max-width: 640px;
}
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
}
.field .help {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 4px;
}
.field .errorlist {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 0.82rem;
}
input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.94rem;
}
textarea {
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}
input[type="file"] {
  color: var(--text-muted);
}
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* --- allauth (вход/регистрация/выход и другие служебные страницы) --- */
.allauth-page {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}
.alert-box {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-size: 0.9rem;
}
.panel-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  background: var(--bg-elevated);
}
.panel-box h2 {
  font-size: 1.1rem;
}

.placement-hint {
  background: var(--bg-elevated-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* --- Moderation --- */
.mod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.mod-table th,
.mod-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.mod-table th {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.88rem;
}
.diff-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.diff-table .label {
  color: var(--text-faint);
  white-space: nowrap;
  width: 140px;
}
.diff-old {
  color: var(--danger);
  text-decoration: line-through;
}
.diff-new {
  color: var(--success);
}

.diff-prose {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  line-height: 1.7;
  margin-bottom: 20px;
}
.diff-ins {
  background: rgba(52, 211, 153, 0.18);
  color: var(--success);
  text-decoration: none;
  border-radius: 3px;
  padding: 0 2px;
}
.diff-del {
  background: rgba(239, 68, 68, 0.16);
  color: var(--danger);
  border-radius: 3px;
  padding: 0 2px;
}

/* --- Messages --- */
.messages {
  list-style: none;
  margin: 0;
  padding: 12px 0 0;
}
.messages li {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}
.messages .success {
  border-color: rgba(52, 211, 153, 0.4);
  color: var(--success);
}
.messages .error {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 0.82rem;
  color: var(--text-faint);
}
.site-footer a {
  color: var(--text-muted);
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.footer-credit__logo {
  height: 1.3em;
  width: auto;
}

.site-footer__meta {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-faint);
  opacity: 0.7;
}
.site-footer__meta code {
  font-size: 0.9em;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
}

@media (max-width: 640px) {
  .map-overlay {
    width: calc(100vw - 32px);
    /* Открытая по умолчанию панель не должна закрывать всю карту на
       маленьком экране — сворачивается через <summary>, если мешает. */
    max-height: 45vh;
  }
  .site-header__inner {
    flex-wrap: wrap;
  }
}
