:root {
  --navy: #1a2433;
  --navy-soft: #243447;
  --ink: #162033;
  --muted: #5c6b7a;
  --line: #d7dde5;
  --paper: #f7f5f1;
  --paper-2: #efece6;
  --gold: #a7803a;
  --gold-deep: #8a6a2e;
  --gold-soft: #d9c7a2;
  --white: #ffffff;
  --danger: #9b2c2c;
  --ok: #1f6b4a;
  --chrome: #3c3c3b;
  --shadow: 0 18px 40px rgba(22, 32, 51, 0.12);
  --radius: 14px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--chrome);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 1.25rem 3rem;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(167, 128, 58, 0.18), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(36, 52, 71, 0.16), transparent 50%),
    linear-gradient(180deg, #fbfaf7 0%, var(--paper) 40%, #f3f0ea 100%);
}

.hero {
  background: var(--chrome);
  margin: 0 -1.25rem;
  padding: 2.75rem 1.25rem 1.5rem;
}

.hero__inner {
  text-align: center;
}

.hero__logo {
  height: 52px;
  width: auto;
  margin-bottom: 1.25rem;
}

.hero__title {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  letter-spacing: 0.01em;
  color: var(--paper);
  line-height: 1.05;
}

.hero__lead {
  margin: 0.85rem auto 0;
  max-width: 34rem;
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(247, 245, 241, 0.72);
  line-height: 1.55;
}

.embed-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--chrome);
  margin: 0 -1.25rem;
  padding: 1rem 1.25rem 0.75rem;
}

.embed-bar__logo {
  height: 28px;
  width: auto;
}

.embed-bar__title {
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--paper);
}

.is-embed {
  background: var(--paper);
}

.is-embed .page {
  min-height: 0;
  padding-top: 0;
  padding-bottom: 1.25rem;
  background: transparent;
}

.toolbar {
  display: grid;
  gap: 0.85rem;
  margin: 1.25rem 0 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(215, 221, 229, 0.9);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 1rem;
  background: var(--white);
  color: var(--ink);
}

.search input:focus,
.filters select:focus,
.modal input:focus,
.modal textarea:focus {
  outline: 2px solid rgba(167, 128, 58, 0.35);
  border-color: var(--gold);
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.filters:has(#filter-city-wrap:not([hidden])) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.is-debug .filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.is-debug .filters:has(#filter-city-wrap:not([hidden])) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.filters label {
  display: grid;
  gap: 0.35rem;
}

.filters span {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.filters select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: var(--white);
  color: var(--ink);
}

.status,
.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

.list {
  display: grid;
  gap: 1.75rem;
}

.month-block {
  display: grid;
  gap: 0.65rem;
}

.month-title {
  margin: 0.5rem 0 0.15rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--navy);
  border-bottom: 1px solid var(--gold-soft);
  padding-bottom: 0.35rem;
}

.event {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(215, 221, 229, 0.85);
  border-radius: 12px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.event:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: rgba(167, 128, 58, 0.45);
}

.event__date {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-deep);
  line-height: 1.25;
}

.event__time {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.event__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}

.event__meta {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.event__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge--stock {
  background: rgba(31, 107, 74, 0.1);
  color: var(--ok);
}

.badge--cat {
  background: rgba(167, 128, 58, 0.12);
  color: var(--gold-deep);
}

.badge--src-d {
  background: rgba(36, 52, 71, 0.12);
  color: var(--navy);
}

.badge--src-l {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.badge--src-x {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}

.badge--id {
  background: rgba(92, 107, 122, 0.12);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debug-banner {
  margin: 0.85rem auto 0;
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(155, 44, 44, 0.1);
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 500;
}

.debug-banner--inline {
  margin: 0 0 0 auto;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--ghost {
  background: transparent;
  color: var(--gold-deep);
  border: 1px solid rgba(167, 128, 58, 0.45);
  white-space: nowrap;
}

.btn--ghost:hover {
  background: rgba(167, 128, 58, 0.1);
}

.btn--primary {
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--white);
  margin-top: 0.5rem;
}

.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.footer a {
  color: var(--gold-deep);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 32, 51, 0.55);
  backdrop-filter: blur(3px);
}

.modal__panel {
  position: relative;
  width: min(440px, 100%);
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: var(--shadow);
  animation: rise 180ms ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.modal__panel h2 {
  margin: 0 1.5rem 0.35rem 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--navy);
}

.modal__event {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.modal form {
  display: grid;
  gap: 0.75rem;
}

.modal label {
  display: grid;
  gap: 0.3rem;
}

.modal label span {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.modal label em {
  color: var(--gold-deep);
  font-style: normal;
}

.modal input,
.modal textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  resize: vertical;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.form-success {
  margin: 0.75rem 0 0;
  color: var(--ok);
  font-size: 0.95rem;
}

@media (max-width: 760px) {
  .filters,
  .filters:has(#filter-city-wrap:not([hidden])),
  .is-debug .filters,
  .is-debug .filters:has(#filter-city-wrap:not([hidden])) {
    grid-template-columns: 1fr;
  }

  .event {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .event__date {
    font-size: 0.98rem;
  }

  .btn--ghost {
    width: 100%;
  }
}
