/* Weekend Edit — city weekend guide */

@font-face {
  font-family: 'DM Serif Display';
  src: url('assets/dm-serif.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('assets/dm-sans.ttf') format('truetype');
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/ibm-plex-mono.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #faf5ec;
  --surface: #fffdf9;
  --ink: #211a12;
  --muted: #6b6055;
  --line: #e4dbc9;
  --accent: #c1502e;
  --accent-ink: #fff8f0;
  --accent-soft: #f4e3da;
  --focus: #1f5fae;
  --radius: 14px;
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  .event-card,
  .btn-secondary,
  .saved-toggle,
  .save-item,
  .close-detail,
  .open-item-btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  }
}

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

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

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

button {
  font: inherit;
  color: inherit;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem 2.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.1;
}

.brand-dates {
  margin: 0.15rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.tagline {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Controls */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 2rem;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.field-label {
  font-weight: 600;
  color: var(--ink);
}

.field-search {
  flex: 1 1 260px;
}

.field-filter {
  flex: 0 1 200px;
}

input[type='text'],
select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

input[type='text']:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.saved-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  align-self: flex-end;
  white-space: nowrap;
}

.saved-toggle .icon-bookmark {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.saved-toggle[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.saved-toggle[aria-pressed='true'] .icon-bookmark {
  fill: currentColor;
}

.saved-toggle:hover {
  border-color: var(--accent);
}

.results-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-family: var(--font-mono);
}

/* Event grid */

.event-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.event-card:hover {
  box-shadow: 0 8px 24px rgba(33, 26, 18, 0.08);
  transform: translateY(-2px);
}

.event-media {
  height: 140px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.saved-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}

.saved-badge svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.event-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.event-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-price {
  background: var(--line);
  color: var(--muted);
}

.event-title {
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.25;
}

.event-meta,
.event-venue {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.event-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.open-item-btn {
  margin-top: auto;
  align-self: flex-start;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  border: 1.5px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}

.open-item-btn:hover {
  background: var(--ink);
  color: var(--surface);
}

/* Empty state */

.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 0.35rem;
}

.empty-copy {
  margin: 0 0 1.1rem;
  color: var(--muted);
}

.btn-secondary {
  padding: 0.6rem 1.15rem;
  border-radius: 8px;
  border: 1.5px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--surface);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p {
  max-width: 60ch;
  margin: 0 auto;
}

/* Detail dialog */

.detail-dialog {
  border: none;
  border-radius: 0;
  padding: 0;
  width: min(620px, 100vw);
  height: 100vh;
  max-height: 100vh;
  max-width: 100vw;
  margin: 0 0 0 auto;
  overflow-y: auto;
  background: var(--surface);
  box-shadow: -18px 0 48px rgba(33, 26, 18, 0.18);
}

.detail-dialog::backdrop {
  background: rgba(33, 26, 18, 0.45);
}

.detail-media {
  height: 220px;
  background-size: cover;
  background-position: center;
}

.detail-content {
  position: relative;
  padding: 1.75rem 1.75rem 2.5rem;
}

.close-detail {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.close-detail svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.close-detail:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-category {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 0.4rem;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 0.5rem;
  padding-right: 2.5rem;
}

.detail-schedule {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-weight: 600;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.25rem;
  margin: 0 0 1.5rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.detail-facts div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.detail-facts dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.detail-facts dd {
  margin: 0;
  font-weight: 600;
}

.detail-body {
  margin: 0 0 1.75rem;
}

.detail-body p {
  margin: 0 0 1rem;
  color: var(--ink);
}

.save-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.3rem;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.save-item .icon-bookmark {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.save-item[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
}

.save-item[aria-pressed='true'] .icon-bookmark {
  fill: currentColor;
}

.save-item:hover {
  opacity: 0.9;
}

@media (max-width: 640px) {
  .header-inner {
    padding: 1.5rem 1.25rem 1.5rem;
  }

  .brand-name {
    font-size: 1.55rem;
  }

  main {
    padding: 1.5rem 1.1rem 3rem;
  }

  .control-row {
    flex-direction: column;
    align-items: stretch;
  }

  .field-filter,
  .saved-toggle {
    flex: 1 1 auto;
    align-self: stretch;
    justify-content: center;
  }

  .event-grid {
    grid-template-columns: 1fr;
  }

  .detail-dialog {
    width: 100vw;
  }

  .detail-facts {
    grid-template-columns: 1fr;
  }

  .detail-title {
    font-size: 1.65rem;
  }
}
