/* Loose Plans — weekend discovery
   Palette: paper + ink + one accent (deep emerald). One radius system:
   pills for buttons/toggles/badges, 14px for cards/dialogs, 10px for inputs. */

:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-muted: #edefe9;
  --ink: #14181a;
  --ink-soft: #4d555a;
  --ink-faint: #5b6367;
  --border: #dde0d9;
  --border-strong: #c7cbc2;
  --accent: #0f6b4f;
  --accent-strong: #0b5640;
  --accent-wash: #e4f0ea;
  --focus-ring: #0f6b4f;

  --radius-card: 14px;
  --radius-input: 10px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(20, 24, 26, 0.04), 0 8px 20px -12px rgba(20, 24, 26, 0.18);
  --shadow-dialog: 0 24px 60px -20px rgba(20, 24, 26, 0.35);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 24px;
}

.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 1em;
  height: 1em;
}

a {
  color: var(--accent-strong);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2.5px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  color: var(--accent-strong);
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.header-weekend {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- Intro ---------- */

.intro {
  padding-top: 40px;
  padding-bottom: 8px;
  max-width: 720px;
}

.intro h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  font-weight: 800;
}

.intro-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  max-width: 56ch;
}

/* ---------- Toolbar ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
}

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

.field-category {
  flex: 0 0 190px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 13px;
  color: var(--ink-faint);
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 11px 14px 11px 38px;
}

input[type="search"],
select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-input);
  padding: 11px 14px;
}

input[type="search"]::placeholder {
  color: var(--ink-faint);
}

input[type="search"]:focus-visible,
select:focus-visible {
  border-color: var(--accent);
}

select {
  padding-right: 34px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1 1l6 6 6-6' fill='none' stroke='%234d555a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

/* ::-webkit-search-cancel-button intentionally left default for native clear affordance */

.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.chip-toggle svg {
  color: var(--ink-faint);
  transition: color 0.18s var(--ease);
}

.chip-toggle:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.chip-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chip-toggle[aria-pressed="true"] svg {
  color: #fff;
}

/* ---------- Results ---------- */

.results {
  padding-bottom: 72px;
}

.results-count {
  margin: 0 0 20px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.day-group {
  margin-bottom: 36px;
}

.day-group-heading {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--border);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.event-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(20, 24, 26, 0.05), 0 16px 28px -14px rgba(20, 24, 26, 0.24);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-wash);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
}

.category-badge svg {
  width: 14px;
  height: 14px;
}

.price-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.saved-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.saved-flag svg {
  width: 13px;
  height: 13px;
}

.card-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  font-size: 0.87rem;
  color: var(--ink-soft);
}

.card-meta li {
  display: flex;
  align-items: center;
  gap: 7px;
  list-style: none;
}

.card-meta svg {
  color: var(--ink-faint);
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

.card-summary {
  margin: 2px 0 4px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  flex: 1;
}

.card-actions {
  margin-top: auto;
}

.open-item-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.12s var(--ease);
}

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

.open-item-btn:active {
  transform: scale(0.98);
}

/* ---------- Empty state ---------- */

.empty-state {
  padding: 56px 24px;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-card);
  color: var(--ink-soft);
}

.empty-state p {
  margin: 0 0 16px;
  font-size: 1.02rem;
}

#clear-filters {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s var(--ease);
}

#clear-filters:hover {
  background: var(--accent-strong);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 40px;
}

.site-footer p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------- Detail dialog ---------- */

.detail-dialog {
  border: none;
  padding: 0;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-dialog);
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  color: var(--ink);
  background: var(--surface);
}

.detail-dialog::backdrop {
  background: rgba(20, 24, 26, 0.5);
}

.detail-dialog[open] {
  animation: dialog-in 0.22s var(--ease);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.detail-inner {
  padding: 24px 24px 28px;
  overflow-y: auto;
  max-height: min(720px, calc(100vh - 48px));
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s var(--ease);
}

.icon-btn:hover {
  background: var(--surface-muted);
}

.detail-dialog h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.detail-facts {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.detail-facts li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.detail-facts svg {
  color: var(--accent-strong);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.detail-body {
  font-size: 0.97rem;
  color: var(--ink);
  margin-bottom: 22px;
}

.detail-body p {
  margin: 0 0 12px;
}

.detail-body p:last-child {
  margin-bottom: 0;
}

.save-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 750;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.12s var(--ease);
}

.save-toggle:hover {
  background: var(--accent-strong);
}

.save-toggle:active {
  transform: scale(0.98);
}

.save-toggle[aria-pressed="true"] {
  background: var(--ink);
}

.save-toggle[aria-pressed="true"]:hover {
  background: #000;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .wrap {
    padding-inline: 16px;
  }

  .header-inner {
    height: 60px;
  }

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

  .header-weekend {
    font-size: 0.78rem;
  }

  .intro {
    padding-top: 28px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .field-category {
    flex-basis: auto;
  }

  .chip-toggle {
    justify-content: center;
  }

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

  .detail-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .detail-inner {
    max-height: 100dvh;
    padding: 20px 18px 24px;
  }
}

/* ---------- Reduced motion ---------- */

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

  .event-card:hover {
    transform: none;
  }

  .detail-dialog[open] {
    animation: none;
  }
}
