/* ============================================================
   Forma — warm editorial craft
   Palette: cream ground, ink text, clay accent
   ============================================================ */

@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/Fraunces-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f1e7;
  --bg-deep: #efe8da;
  --card: #fdfaf4;
  --ink: #221a12;
  --ink-soft: #5d5344;
  --ink-faint: #8a7e6c;
  --clay: #9c4a21;
  --clay-deep: #7e3a19;
  --clay-wash: #f3e2d6;
  --line: #e2d8c6;
  --white: #fffdf8;
  --ring: #9c4a21;
  --shadow: 0 1px 2px rgba(34, 26, 18, 0.06), 0 8px 24px rgba(34, 26, 18, 0.08);
  --shadow-lift: 0 2px 4px rgba(34, 26, 18, 0.08), 0 14px 34px rgba(34, 26, 18, 0.12);
  --radius: 14px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

.shell {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
}

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

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

/* Focus + motion */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.on-dark :focus-visible,
.detail :focus-visible { outline-color: var(--clay); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  background: var(--ink);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus-visible { top: 12px; }

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(246, 241, 231, 0.9);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--clay);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}
.brand-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.header-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero { padding-block: 56px 40px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--clay);
}
.hero h1 {
  font-size: clamp(38px, 4.6vw, 58px);
  margin-bottom: 18px;
}
.lede {
  margin: 0 0 26px;
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero-media {
  margin: 0;
  position: relative;
}
.hero-media img {
  width: 100%;
  aspect-ratio: 7 / 5;
  object-fit: cover;
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-lift);
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1.5px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  z-index: -1;
}
.hero-cta { margin-top: 4px; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: 600 15px/1 var(--font-body);
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.button-primary {
  background: var(--clay);
  color: var(--white);
}
.button-primary:hover { background: var(--clay-deep); }
.button-secondary {
  background: transparent;
  color: var(--clay-deep);
  border-color: var(--clay);
}
.button-secondary:hover { background: var(--clay-wash); }

/* ------------------------------------------------------------
   Toolbar
   ------------------------------------------------------------ */
.browse { padding-block: 24px 72px; }
.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.list-head h2 { font-size: clamp(26px, 3vw, 34px); }
.count {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(170px, 0.8fr) auto;
  gap: 16px;
  align-items: end;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.search-wrap { position: relative; }
.search-wrap .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--ink-faint);
  pointer-events: none;
}
input[type="search"],
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: 400 15px/1.3 var(--font-body);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select { padding-left: 12px; cursor: pointer; }
input[type="search"]:hover,
select:hover { border-color: var(--ink-faint); }
input[type="search"]:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(156, 74, 33, 0.18);
}
input[type="search"]::placeholder { color: var(--ink-soft); opacity: 1; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: 600 14px/1 var(--font-body);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.toggle .icon { width: 16px; height: 16px; }
.toggle:hover { border-color: var(--clay); color: var(--clay-deep); }
.toggle[aria-pressed="true"] {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--white);
}

/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.card-media { position: relative; }
.card-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
  flex: 1;
}
.card-cat {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--clay);
}
.card-title { font-size: 22px; }
.card-title .card-open {
  all: unset;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
/* Stretched link: whole card opens the detail view */
.card-title .card-open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card-title .card-open:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.card-title .card-open:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; border-radius: 4px; }

.card-desc {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.card-meta .icon { width: 15px; height: 15px; color: var(--ink-faint); }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.price {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}
.price small {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-faint);
}
.seats {
  font-size: 13px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seats .icon { width: 15px; height: 15px; color: var(--ink-faint); }

/* Card save toggle */
.card-save {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(34, 26, 18, 0.18);
  transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}
.card-save .icon { width: 19px; height: 19px; }
.card-save:hover { color: var(--clay); transform: scale(1.06); }
.card-save[aria-pressed="true"] { color: var(--clay); }
.card-save[aria-pressed="true"] .icon { fill: currentColor; }

/* ------------------------------------------------------------
   Empty state
   ------------------------------------------------------------ */
.empty {
  text-align: center;
  padding: 64px 24px;
  background: var(--card);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
}
.empty-icon { width: 40px; height: 40px; color: var(--ink-faint); margin-inline: auto; }
.empty h3 { font-size: 24px; margin: 12px 0 6px; }
.empty p { margin: 0 0 20px; color: var(--ink-soft); }

/* ------------------------------------------------------------
   Detail dialog
   ------------------------------------------------------------ */
.detail {
  width: min(880px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 32px));
  padding: 0;
  border: none;
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(34, 26, 18, 0.28);
  overscroll-behavior: contain;
}
.detail::backdrop {
  background: rgba(34, 26, 18, 0.55);
  backdrop-filter: blur(3px);
}
.detail[open] { animation: detail-in 0.24s ease; }
@keyframes detail-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.detail-frame {
  position: relative;
  display: grid;
  grid-template-columns: 340px 1fr;
  max-height: inherit;
  overflow: hidden;
}
.detail-media { margin: 0; }
.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-body {
  padding: 32px 32px 28px;
  overflow-y: auto;
}
.detail-cat {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--clay);
}
.detail-title { font-size: clamp(26px, 3vw, 34px); margin-bottom: 10px; }
.detail-desc {
  margin: 0 0 18px;
  font-size: 16px;
  color: var(--ink-soft);
}

.save-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 12px 20px;
  margin-bottom: 22px;
  border: 1.5px solid var(--clay);
  border-radius: 999px;
  background: transparent;
  color: var(--clay-deep);
  font: 600 14.5px/1 var(--font-body);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.save-button .icon { width: 17px; height: 17px; }
.save-button:hover { background: var(--clay-wash); }
.save-button[aria-pressed="true"] {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--white);
}
.save-button[aria-pressed="true"] .icon { fill: currentColor; }

.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 22px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.fact dt {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 3px;
}
.fact dd {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
}
.detail-subhead {
  font-size: 18px;
  margin-bottom: 8px;
}
.detail-body-text {
  margin: 0 0 14px;
  color: var(--ink-soft);
}
.detail-note {
  margin: 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(34, 26, 18, 0.22);
  transition: transform 0.2s ease, color 0.2s ease;
}
.detail-close .icon { width: 19px; height: 19px; }
.detail-close:hover { transform: rotate(90deg); color: var(--clay-deep); }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
}
.footer-inner { padding-block: 32px; }
.footer-brand {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}
.footer-inner p:last-child {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1020px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding-block: 40px 28px; }
  .lede { max-width: 56ch; }
}

@media (max-width: 700px) {
  .shell { width: min(1180px, 100% - 32px); }
  .header-note { display: none; }
  .cards { grid-template-columns: 1fr; gap: 18px; }
  .toolbar {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
  }
  .field-saved .toggle { width: 100%; justify-content: center; }
  .hero h1 { font-size: clamp(34px, 9vw, 42px); }
  .browse { padding-bottom: 56px; }

  /* Detail becomes a near-full-height sheet */
  .detail {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .detail-frame {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 1fr;
    overflow-y: auto;
  }
  .detail-body { padding: 24px 20px 28px; overflow-y: visible; }
  .detail-facts { grid-template-columns: repeat(2, 1fr); }
  .detail-close { top: 12px; right: 12px; }
}

/* Short viewport on desktop: keep close button reachable while body scrolls */
@media (min-width: 701px) and (max-height: 640px) {
  .detail-frame { grid-template-columns: 280px 1fr; }
}

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover { transform: none; }
  .detail-close:hover { transform: none; }
}
