/* impreza — warehouse-flyer aesthetic: dark room, taped paper flyers, hazard-tape accent. */

@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('vendor/fonts/anton-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+0304, U+0308, U+0329;
}
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('vendor/fonts/anton-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F, U+2122;
}

:root {
  --asphalt: #121214;
  --asphalt-raised: #1c1b1f;
  --paper: #efe9db;
  --paper-dark: #d9d0b8;
  --paper-darker: #c9bfa2;
  --ink: #1a1712;
  --cloud: #f4f2ec;
  --fog: #a6a29a;
  --caution: #f4c81f;
  --caution-ink: #1a1503;
  --blood: #e2483a;
  --line: rgba(244, 242, 236, 0.1);

  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--asphalt);
  color: var(--cloud);
  line-height: 1.5;
}

a { color: inherit; }

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

:focus-visible {
  outline: 3px solid var(--caution);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--asphalt-raised);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--cloud);
}

.hazard-bar {
  height: 7px;
  background: repeating-linear-gradient(-45deg, var(--caution) 0 12px, var(--ink) 12px 24px);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--caution);
  color: var(--caution-ink);
  border: none;
  padding: 10px 18px;
  border-radius: 3px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--cloud);
  border: 1px solid var(--line);
}

.btn-danger {
  background: transparent;
  color: var(--blood);
  border: 1px solid var(--blood);
}

button { font-family: inherit; }

/* ---------------------------------------------------------------- layout */

main { max-width: 960px; margin: 0 auto; padding: 0 20px 60px; }

.intro {
  max-width: 46ch;
  color: var(--fog);
  padding: 22px 0 6px;
}

/* ---------------------------------------------------------------- map hero */

.map-hero {
  position: relative;
  margin: 0 -20px 32px;
}

#map {
  height: 380px;
  filter: saturate(0.5) brightness(0.85);
}

.map-hero-caption {
  position: absolute;
  left: 20px;
  bottom: 16px;
  background: var(--caution);
  color: var(--caution-ink);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  transform: rotate(-1deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  z-index: 500;
}

/* ---------------------------------------------------------------- board / tickets */

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 34px 22px;
  padding-top: 10px;
}

.ticket {
  position: relative;
  display: block;
  background: var(--paper);
  color: var(--ink);
  padding: 16px 16px 14px;
  text-decoration: none;
  transform: rotate(var(--tilt, -1deg));
  /* solid shadows = the flyers stacked underneath; they always paint behind the
     background, unlike z-index:-1 children of a transformed (stacking-context) box */
  box-shadow:
    5px 6px 0 var(--paper-dark),
    -5px 5px 0 var(--paper-darker),
    0 14px 30px rgba(0, 0, 0, 0.45);
}

.ticket-when {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #5c5647;
  margin-bottom: 6px;
}

.ticket-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.1;
  margin: 0 0 6px;
}

.ticket-where {
  font-size: 0.85rem;
  color: #4a453a;
  margin: 0 0 10px;
}

.ticket-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.ticket-foot {
  font-size: 0.82rem;
  color: #5c5647;
  border-top: 1px dashed #b6ac91;
  padding-top: 8px;
}

.ticket-count { font-family: var(--font-mono); font-weight: 700; color: var(--ink); }

.empty-state {
  grid-column: 1 / -1;
  text-align: left;
  padding: 40px 0;
  color: var(--fog);
}

.empty-state .btn { margin-top: 14px; }

/* ---------------------------------------------------------------- chips */

.chip {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.78rem;
  border-radius: 2px;
  border: 1px solid currentColor;
  color: #6b6455;
}

.chip-on {
  background: var(--caution);
  color: var(--caution-ink);
  border-color: var(--caution);
  font-weight: 700;
}

.chip-off {
  color: #8a8372;
}

/* dark-background variant, used on the event detail page */
.badges .chip { color: var(--fog); border-color: var(--line); }
.badges .chip-on { color: var(--caution-ink); }

/* ---------------------------------------------------------------- event detail */

.event-head { padding-top: 22px; }

.event-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1.05;
  margin: 0 0 6px;
}

.event-when {
  font-family: var(--font-mono);
  color: var(--caution);
  margin: 0 0 16px;
}

.cover-frame {
  position: relative;
  margin: 0 0 20px;
  padding: 10px;
  background: var(--asphalt-raised);
}

.cover-frame img { width: 100%; }

.cover-frame::before,
.cover-frame::after {
  content: '';
  position: absolute;
  width: 34px;
  height: 14px;
  background: rgba(244, 200, 31, 0.85);
  top: -6px;
}

.cover-frame::before { left: 24px; transform: rotate(-4deg); }
.cover-frame::after { right: 24px; transform: rotate(3deg); }

.desc { max-width: 60ch; color: #d8d5cc; }

.where { color: var(--fog); font-size: 0.92rem; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }

#map.detail-map { height: 280px; margin: 16px 0; }

.join-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0 8px;
}

.join-count { font-family: var(--font-mono); color: var(--fog); }

/* ---------------------------------------------------------------- forms */

.form-page h1 { font-size: 1.4rem; }

form { display: grid; gap: 20px; max-width: 560px; padding-top: 6px; }

fieldset {
  border: none;
  border-left: 3px solid var(--caution);
  padding: 4px 0 4px 16px;
  margin: 0;
}

legend {
  display: block;
  width: 100%;
  font-weight: 700;
  padding: 0 0 8px;
}

.field-hint { color: var(--fog); font-size: 0.85rem; margin: -4px 0 10px; }

label {
  display: block;
  margin: 10px 0 0;
  color: var(--fog);
  font-size: 0.88rem;
}

.check-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--cloud); }
.check-row input { width: auto; margin: 0; }

input[type=text],
input[type=datetime-local],
textarea {
  width: 100%;
  padding: 9px 10px;
  margin-top: 5px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: var(--asphalt-raised);
  color: var(--cloud);
  font-family: inherit;
  font-size: 0.95rem;
}

input:focus, textarea:focus { border-color: var(--caution); }

.tabs { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; color: var(--cloud); font-size: 0.88rem; }
.tabs label { margin: 0; display: flex; align-items: center; gap: 6px; }
.tabs input { width: auto; }

#map.form-map { height: 260px; margin: 10px 0; filter: saturate(0.5) brightness(0.85); }

#cover-preview { max-width: 220px; margin-top: 10px; border: 3px solid var(--asphalt-raised); }

#form-message {
  color: var(--caution);
  font-size: 0.9rem;
  min-height: 1.2em;
}

#edit-guard { color: var(--fog); padding: 20px 0; }

@media (max-width: 600px) {
  .event-title { font-size: 1.8rem; }
  #map { height: 280px; }
}
