/* Two Day Pass — a printed timetable meets a ticket stub.
   Signature: perforated stubs + a "span bar" that shows when each event sits in the 8am–10pm day. */

:root {
  --ink: #16213a;
  --ink-70: #44506b;
  --ink-30: rgba(22, 33, 58, .35);
  --ink-12: rgba(22, 33, 58, .12);
  --paper: #f5eedf;
  --surface: #fffaf0;
  --accent: #c42f17;
  --on-accent: #fff;
  --focus: #2447ff;
  --focus-dark: #ffd166;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: 24px;
  --r: 6px;
}

.c-Art        { --c: #ff9f8a; }
.c-Film       { --c: #9db4ff; }
.c-Food       { --c: #ffd166; }
.c-Literature { --c: #d7b8ff; }
.c-Music      { --c: #7fd6b5; }
.c-Outdoors   { --c: #b7d96a; }
.c-Walks      { --c: #7cc6e8; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 12px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  -webkit-text-size-adjust: 100%;
}
body.lock { overflow: hidden; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hero :focus-visible, .foot :focus-visible { outline-color: var(--focus-dark); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--surface); color: var(--ink); padding: 10px 14px; z-index: 100; border-radius: var(--r); }
.skip:focus { top: 12px; }

/* ---------- hero ---------- */
.hero { background: var(--ink); color: var(--paper); padding-bottom: 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--paper); font-family: var(--serif); font-weight: 700; font-size: 1.3rem; letter-spacing: .01em; }
.brand svg { color: #ff9f8a; }
.navlinks { display: flex; gap: 8px; }
.navlinks a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; text-decoration: none; font-size: .95rem; border-radius: 999px; }
.navlinks a:hover { background: rgba(255, 255, 255, .12); }
.navcount { min-width: 22px; padding: 0 6px; text-align: center; border-radius: 999px; background: #ffd166; color: var(--ink); font: 700 .8rem/22px var(--mono); }

.hero-grid { display: grid; grid-template-columns: 8fr 4fr; gap: 48px; align-items: end; padding: 40px 0 48px; }
.eyebrow { font: 600 .8rem/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #ffd166; margin-bottom: 20px; }
h1 { font: 700 clamp(2.9rem, 7.4vw, 6.4rem)/.98 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.lead { font-size: 1.1rem; max-width: 40ch; color: #e4dccb; }
.cta { display: inline-flex; gap: 10px; margin-top: 24px; padding: 14px 22px; background: #ffd166; color: var(--ink); font-weight: 700; text-decoration: none; border-radius: 999px; }
.cta:hover { background: #fff; }

/* timetable */
.glance { border-top: 1px solid rgba(245, 238, 223, .3); padding-top: 24px; }
.glance-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.glance h2 { font: 700 1.5rem/1.2 var(--serif); }
.glance-note { font-size: .92rem; color: #cfc7b6; max-width: 60ch; }
.star { color: #ffd166; }
.tt-scroll { overflow-x: auto; padding-bottom: 6px; }
.tt { min-width: 760px; }
.tt-row { display: grid; grid-template-columns: 76px 1fr; gap: 12px; margin-bottom: 8px; }
.tt-day { font: 700 .85rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding-top: 8px; color: #ffd166; }
.tt-day span { display: block; color: #cfc7b6; font-weight: 400; }
.tt-track { position: relative; background: rgba(255, 255, 255, .06); border-radius: 4px; }
.tt-line { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .14); }
.blk {
  position: absolute; height: 34px; padding: 0 8px; border: 0; border-radius: 3px;
  background: var(--c); color: var(--ink); text-align: left; font: 600 .78rem/34px var(--sans);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity .15s, transform .15s;
}
.blk:hover { transform: translateY(-2px); background: #fff; }
.blk.dim { opacity: .22; }
.blk.saved { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px #ffd166; z-index: 1; }
.tt-axis { display: grid; grid-template-columns: 76px 1fr; gap: 12px; }
.tt-ticks { position: relative; height: 22px; }
.tt-ticks span { position: absolute; top: 2px; transform: translateX(-50%); font: .72rem/1 var(--mono); color: #cfc7b6; }
.tt-ticks span:first-child { transform: none; }
.tt-ticks span:last-child { transform: translateX(-100%); }

/* ---------- controls ---------- */
.browse { padding-top: 40px; padding-bottom: 72px; }
.controls {
  display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(170px, 1fr) auto auto; gap: 20px 24px; align-items: end;
  padding: 20px 0 28px; border-bottom: 3px solid var(--ink); margin-bottom: 32px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font: 600 .78rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-70); }
input[type="search"], select {
  height: 48px; padding: 0 14px; background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r); width: 100%;
}
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; }
input::placeholder { color: var(--ink-70); }

.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; height: 48px; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 0 16px; font-weight: 600; font-size: .95rem; }
.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button:focus-visible { outline-offset: -4px; }

.saved-toggle { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 18px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--surface); font-weight: 600; }
.saved-toggle .badge { min-width: 24px; padding: 0 7px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 700 .8rem/24px var(--mono); text-align: center; }
.saved-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.saved-toggle[aria-pressed="true"] .badge { background: #fff; color: var(--accent); }

/* ---------- list ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 48px; align-items: start; }
.count { font: .85rem/1.2 var(--mono); color: var(--ink-70); margin-bottom: 20px; }
.day { margin-bottom: 40px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.day-head h3 { font: 700 clamp(1.7rem, 3.2vw, 2.4rem)/1.1 var(--serif); letter-spacing: -.01em; }
.day-head span { font: .85rem var(--mono); color: var(--ink-70); }
.tickets { display: grid; gap: 14px; }

.ticket {
  position: relative; display: grid; grid-template-columns: 132px minmax(0, 1fr) 190px;
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r);
  transition: transform .15s, box-shadow .15s;
}
.ticket:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.ticket:has(.open-item:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.stub { position: relative; padding: 18px 14px 18px 18px; border-right: 2px dashed var(--ink-30); font-family: var(--mono); background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, var(--surface))); border-radius: 4px 0 0 4px; }
.stub::before, .stub::after { content: ""; position: absolute; right: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 0; z-index: 1; }
.stub::before { top: -11px; }
.stub::after { bottom: -11px; }
.t-start { display: block; font-size: 1.45rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.t-start small { font-size: .78rem; margin-left: 2px; letter-spacing: 0; }
.t-end { display: block; margin-top: 6px; font-size: .8rem; color: var(--ink); opacity: .85; }
.t-dur { display: block; margin-top: 2px; font-size: .75rem; color: var(--ink); opacity: .75; }

.t-main { padding: 16px 20px; min-width: 0; }
.t-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 600 .74rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.chip i { width: 12px; height: 12px; background: var(--c); border: 1.5px solid var(--ink); border-radius: 2px; }
.tag-saved { font: 700 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; background: var(--accent); color: var(--on-accent); border-radius: 999px; }
.tag-saved[hidden] { display: none; }
.t-title { margin: 0; font: 700 1.4rem/1.2 var(--serif); }
.open-item { all: unset; cursor: pointer; display: block; }
.open-item::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.t-sum { margin-top: 6px; color: var(--ink-70); font-size: .98rem; max-width: 60ch; }
.t-where { margin-top: 8px; font-size: .92rem; font-weight: 600; }
.t-where span { font-weight: 400; color: var(--ink-70); }

.t-meta { padding: 16px 20px 16px 0; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; gap: 14px; text-align: right; }
.price { font: 700 1.5rem/1 var(--serif); }
.price.free { color: #14663f; }
.fmt { display: block; margin-top: 4px; font: .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-70); }
.go { font: 700 .85rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.ticket:hover .go { text-decoration: underline; text-underline-offset: 4px; }

.span { position: relative; display: block; width: 100%; height: 8px; border-radius: 4px; background: var(--ink-12); }
.span i { position: absolute; top: 0; bottom: 0; background: var(--ink); border-radius: 4px; min-width: 6px; }

/* empty */
.empty { padding: 40px 28px; border: 2px dashed var(--ink); border-radius: var(--r); background: var(--surface); text-align: left; }
.empty[hidden] { display: none; }
.empty-title { font: 700 1.8rem/1.2 var(--serif); margin-bottom: 8px; }
.btn { margin-top: 20px; padding: 12px 20px; background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; font-weight: 700; }
.btn:hover { background: var(--accent); }

/* plan */
.plan { position: sticky; top: 16px; background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r); padding: 20px; max-height: calc(100vh - 32px); overflow: auto; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.plan h2 { font: 700 1.5rem/1.2 var(--serif); }
.linkbtn { background: none; border: 0; padding: 4px; text-decoration: underline; text-underline-offset: 3px; font-size: .9rem; }
.linkbtn[hidden] { display: none; }
.plan-empty { color: var(--ink-70); font-size: .98rem; }
.plan-list { display: grid; gap: 0; border-top: 1.5px solid var(--ink); }
.plan-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 12px 0; border-bottom: 1px dashed var(--ink-30); }
.plan-when { font: 600 .75rem/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-70); grid-column: 1 / -1; }
.plan-open { all: unset; cursor: pointer; font: 700 1.05rem/1.25 var(--serif); text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.plan-open:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.plan-rm { width: 32px; height: 32px; border: 1.5px solid var(--ink); border-radius: 50%; background: transparent; font-size: .85rem; line-height: 1; }
.plan-rm:hover { background: var(--ink); color: var(--paper); }
.plan-clash { grid-column: 1 / -1; font-size: .85rem; color: var(--accent); font-weight: 600; }
.plan-total { display: flex; justify-content: space-between; padding-top: 14px; font-weight: 700; }
.plan-total span:last-child { font-family: var(--serif); font-size: 1.2rem; }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: #dcd4c3; padding: 28px 0; font-size: .92rem; }
.foot-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* ---------- detail dialog ---------- */
dialog#detail {
  margin: 0 0 0 auto; padding: 0; border: 0; background: var(--surface); color: var(--ink);
  width: min(560px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; overflow: auto;
  border-left: 3px solid var(--ink);
}
dialog#detail::backdrop { background: rgba(22, 33, 58, .6); }
.d-inner { padding: 20px 28px 36px; }
.d-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.d-eyebrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.d-close { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; font-weight: 700; }
.d-close:hover { background: var(--ink); color: var(--paper); }
#d-title { font: 700 clamp(1.9rem, 5vw, 2.6rem)/1.08 var(--serif); letter-spacing: -.015em; margin-bottom: 20px; }
#d-title:focus { outline: none; }
.d-time { background: var(--c); border-radius: var(--r); padding: 16px 18px; margin-bottom: 20px; border: 1.5px solid var(--ink); }
.d-time-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font: 700 1.1rem/1.3 var(--mono); margin-bottom: 12px; }
.d-time .span { background: rgba(22, 33, 58, .2); height: 10px; }
.d-axis { display: flex; justify-content: space-between; font: .72rem/1 var(--mono); margin-top: 6px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1.5px solid var(--ink); margin-bottom: 24px; }
.facts div { padding: 12px 0; border-bottom: 1px dashed var(--ink-30); }
.facts div:nth-child(odd) { padding-right: 12px; }
.facts dt { font: 600 .74rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-70); margin-bottom: 4px; }
.facts dd { font-weight: 600; }
.d-body p { max-width: 58ch; }
.d-body p + p { margin-top: 20px; padding: 14px 16px; background: var(--paper); border-left: 4px solid var(--ink); border-radius: 0 var(--r) var(--r) 0; }
.d-body p + p::before { content: "Good to know"; display: block; font: 700 .74rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; color: var(--ink-70); }
.d-clash { margin-top: 16px; color: var(--accent); font-weight: 600; }
.d-clash[hidden] { display: none; }
.d-actions { margin-top: 28px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.save { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px; border: 2px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; }
.save:hover { background: var(--accent); border-color: var(--accent); }
.save[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.save[aria-pressed="true"]:hover { background: var(--ink); border-color: var(--ink); }
.d-status { font-size: .9rem; color: var(--ink-70); }

@media (prefers-reduced-motion: no-preference) {
  dialog#detail[open] { animation: slide .22s ease-out; }
  dialog#detail[open]::backdrop { animation: fade .22s ease-out; }
  @keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .ticket:hover, .blk:hover { transform: none; }
}

/* ---------- intermediate ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .plan { position: static; max-height: none; }
  .controls { grid-template-columns: 1fr 1fr; }
  .field-search { grid-column: 1 / -1; }
}

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  :root { --gutter: 20px; }
  body { font-size: 16.5px; }
  .navlinks a { padding: 8px; font-size: .88rem; }
  .navlinks li:nth-child(1) { display: none; }
  .brand { font-size: 1.15rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; padding: 20px 0 32px; }
  .controls { grid-template-columns: 1fr; gap: 16px; }
  .field-search { grid-column: auto; }
  .field-day .seg { display: flex; }
  .seg button { flex: 1; min-height: 44px; }
  .saved-toggle { width: 100%; justify-content: center; }
  .field-saved .label { display: none; }

  .ticket { grid-template-columns: 1fr; }
  .stub { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 12px 18px; border-right: 0; border-bottom: 2px dashed var(--ink-30); border-radius: 4px 4px 0 0; background: var(--c); }
  .stub::before, .stub::after { right: auto; top: auto; bottom: -11px; }
  .stub::before { left: -11px; }
  .stub::after { right: -11px; }
  .t-start { font-size: 1.3rem; }
  .t-end, .t-dur { margin: 0; }
  .t-main { padding: 14px 18px 8px; }
  .t-title { font-size: 1.3rem; }
  .t-meta { flex-direction: row; align-items: center; padding: 8px 18px 16px; text-align: left; }
  .t-meta .span { flex: 1; width: auto; }
  .t-price-wrap { order: 0; }
  .go { display: none; }

  .d-inner { padding: 16px 20px 32px; }
  .facts { grid-template-columns: 1fr; }
  .facts div:nth-child(odd) { padding-right: 0; }
  dialog#detail { width: 100vw; border-left: 0; }
  .save { width: 100%; justify-content: center; }
}
