/* Booker-facing pages: hub, booking widget, status page. Loaded after
   admin.css (shared tokens, buttons, fields, notices). From the UI prototype
   (book-event.html). The brand accent appears only on fills: the selected
   date, the selected time and the primary button. Text on it is black or
   white, set by the server for contrast. */

body.booker { background: var(--white); }
.wrap { width: min(100% - 2rem, 1120px); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2rem, 640px); margin-inline: auto; }
.row-between { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; }
.nowrap { white-space: nowrap; }

.site-bar { background: var(--white); border-bottom: 1px solid var(--line); }
.site-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 64px; }
.site-foot { padding: var(--s6) 0; color: var(--ink-2); font-size: var(--fs-sm); border-top: 1px solid var(--line); margin-top: var(--s7); }
.site-foot p { margin: 0; max-width: none; }
.test-bar { background: var(--white); border-bottom: 2px dashed var(--warn); font-size: var(--fs-sm); }
.test-bar .wrap { display: flex; gap: var(--s3); align-items: center; min-height: 40px; flex-wrap: wrap; }

.page-intro { padding: var(--s7) 0 var(--s5); }
.page-intro h1 { font-size: clamp(3rem, 2rem + 4vw, 5.25rem); max-width: 14ch; margin-bottom: var(--s4); line-height: 1; }
.page-intro p { font-size: var(--fs-lg); color: var(--ink-2); }
/* Hub intro written in Settings, Booking page (Markdown subset). */
.page-intro .md { max-width: 68ch; }
.page-intro .md > * + * { margin-top: var(--s4); }
.page-intro .md h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem); line-height: 1.1; margin-top: var(--s6); }
.page-intro .md h3 { font-size: 1.35rem; margin-top: var(--s5); }
.page-intro .md ul, .page-intro .md ol { padding-left: 1.4em; font-size: var(--fs-lg); color: var(--ink-2); }
.page-intro .md li + li { margin-top: var(--s1); }
.page-intro .md a:not(.btn) { color: inherit; }
.page-intro .md img { display: block; max-width: 100%; height: auto; border-radius: var(--r-control, 6px); }
.page-intro .md .btn { margin: 0 var(--s2) var(--s2) 0; }
.hub-frame { display: block; width: 100%; height: 240px; border: 0; margin-top: var(--s5); }

.type-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.type-item { position: relative; display: grid; grid-template-columns: 1fr auto; gap: var(--s2) var(--s5); padding: var(--s5) 0; border-bottom: 1px solid var(--line); align-items: center; }
.type-item h2 { font-size: 2.25rem; margin: 0; }
.type-item h2 a { color: var(--ink); text-decoration: none; }
.type-item h2 a::after { content: ""; position: absolute; inset: 0; }
.type-item:hover h2 a { text-decoration: underline; text-decoration-thickness: 1px; }
.type-item:focus-within { outline: 3px solid var(--focus); outline-offset: 4px; }
.type-item h2 a:focus-visible { outline: none; }
.type-meta { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); color: var(--ink-2); font-size: var(--fs-sm); margin: var(--s1) 0 0; padding: 0; list-style: none; }
.type-desc { grid-column: 1; margin: 0; color: var(--ink-2); }
.type-price { grid-row: 1 / span 3; grid-column: 2; text-align: right; font-family: var(--font-display); font-size: 2rem; line-height: 1.1; }
@media (max-width: 560px) { .type-item { grid-template-columns: 1fr; } .type-price { grid-row: auto; grid-column: 1; text-align: left; } }

/* ---------- Booking widget ---------- */
.bw { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); overflow: hidden; min-height: 560px; }
.bw-rail { padding: var(--s5); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s4); }
.bw-main { padding: var(--s5) var(--s6) var(--s6); min-width: 0; }
.bw-brand { display: flex; align-items: center; gap: var(--s2); font-weight: 650; color: var(--ink-2); font-size: var(--fs-sm); margin: 0; }
.bw-title { font-size: 2.5rem; margin: 0; line-height: 1; }
.bw-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.bw-facts li { display: flex; gap: var(--s2); align-items: flex-start; }
.bw-facts .icon { margin-top: 0.2em; color: var(--ink-2); }
.bw-desc { color: var(--ink-2); font-size: var(--fs-sm); white-space: pre-line; }
.bw-desc p { margin-bottom: var(--s2); }

.readout { border-top: 1px solid var(--ink); padding-top: var(--s4); margin-top: auto; }
.readout-label { font-size: var(--fs-sm); color: var(--ink-2); margin: 0 0 var(--s1); }
.readout-date { font-size: var(--fs-md); font-weight: 600; margin: 0; }
.readout-date.is-empty { color: var(--ink-2); font-weight: 400; }
.readout-time { font-family: var(--font-display); font-size: 3.75rem; line-height: 1; margin: var(--s1) 0 0; }
.readout-zone { font-size: var(--fs-sm); color: var(--ink-2); margin: var(--s1) 0 0; }

.price-lines { list-style: none; margin: var(--s3) 0 0; padding: 0; font-size: var(--fs-sm); }
.price-lines li { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s1) 0; }
.price-lines .total { border-top: 1px solid var(--ink); margin-top: var(--s1); padding-top: var(--s2); font-weight: 650; font-size: var(--fs-md); }

.bw-steps { display: flex; gap: var(--s5); list-style: none; margin: 0 0 var(--s5); padding: 0 0 var(--s3); border-bottom: 1px solid var(--line); counter-reset: step; font-size: var(--fs-sm); flex-wrap: wrap; }
.bw-steps li { counter-increment: step; color: var(--ink-2); display: flex; gap: var(--s2); align-items: center; }
.bw-steps li::before { content: counter(step); width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--control); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-xs); }
.bw-steps li[aria-current="step"] { color: var(--ink); font-weight: 650; }
.bw-steps li[aria-current="step"]::before { background: var(--ink); border-color: var(--ink); color: var(--white); }
.bw-steps li.is-done { color: var(--ink); }
.bw-steps li.is-done::before { content: "✓"; border-color: var(--ink); color: var(--ink); }

.bw-step-title { font-size: 2.25rem; margin-bottom: var(--s4); }
.bw-step-title:focus { outline: none; }
.bw-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 220px); gap: var(--s6); align-items: start; }
.bw-actions { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); }
.bw-actions .btn-primary { margin-left: auto; }
.bw-actions form { margin: 0; }
.tz-row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; margin-top: var(--s4); font-size: var(--fs-sm); }
.tz-row .select { width: auto; min-height: 40px; font-size: var(--fs-sm); }
.length-row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; margin-bottom: var(--s5); }
.length-row .select { width: auto; }

/* Calendar month grid */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.cal-head h3 { margin: 0; font-size: 1.75rem; }
.cal-nav { display: flex; gap: var(--s1); }
.icon-btn { width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--white); cursor: pointer; color: var(--ink); }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn[disabled] { color: var(--line); border-color: var(--line); cursor: not-allowed; }
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); padding-bottom: var(--s2); }
.cal td { padding: 2px; text-align: center; }
.day { width: 100%; aspect-ratio: 1; max-height: 52px; min-height: var(--tap); border: 1px solid transparent; border-radius: var(--r-control); background: transparent; display: grid; place-items: center; position: relative; color: #8a8a8a; font: inherit; }
button.day { cursor: pointer; }
.day.has-slots { color: var(--ink); font-weight: 650; border-color: var(--line); }
.day.has-slots::after { content: ""; position: absolute; bottom: 6px; width: 14px; height: 3px; border-radius: 2px; background: var(--accent); }
.day.has-slots:hover { border-color: var(--ink); }
.day.is-today { text-decoration: underline; text-underline-offset: 0.25em; }
.day[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.day[aria-pressed="true"]::after { background: var(--on-accent); }
.cal-legend { display: flex; gap: var(--s4); font-size: var(--fs-xs); color: var(--ink-2); margin-top: var(--s3); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; gap: var(--s1); align-items: center; }
.cal-legend i { width: 14px; height: 3px; background: var(--accent); border-radius: 2px; display: inline-block; }

/* Time slots: radio inputs styled as buttons */
.slots-head { font-weight: 650; margin-bottom: var(--s3); }
.slot-list { display: grid; gap: var(--s2); max-height: 430px; overflow-y: auto; padding: 3px; margin: -3px; }
.slot { position: relative; display: block; }
.slot input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.slot span { display: flex; align-items: center; justify-content: center; min-height: var(--tap); border: 1px solid var(--ink); color: var(--ink); border-radius: var(--r-control); font-weight: 600; background: var(--white); }
.slot input:hover + span { box-shadow: inset 0 0 0 1px var(--ink); }
.slot input:checked + span { background: var(--accent); border-color: var(--ink); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--ink); }
.slot input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.slots-empty { color: var(--ink-2); font-size: var(--fs-sm); }
.slots-prompt { border: 1px dashed var(--control); border-radius: var(--r-control); padding: var(--s4); color: var(--ink-2); font-size: var(--fs-sm); }

.btn-primary { border-color: var(--ink); }
.pay-note { border: 1px solid var(--line); border-left: 4px solid var(--ink); padding: var(--s3) var(--s4); font-size: var(--fs-sm); margin: var(--s5) 0 0; max-width: none; }
.policy { font-size: var(--fs-sm); color: var(--ink-2); border-left: 2px solid var(--line); padding-left: var(--s3); margin-top: var(--s4); white-space: pre-line; }
.confirm-mark, .wait-mark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin-bottom: var(--s4); }
.confirm-mark { border: 2px solid var(--ok); color: var(--ok); }
.wait-mark { border: 2px solid var(--ink); color: var(--ink); }
.ref-code { font-family: var(--font-code); font-weight: 600; letter-spacing: 0.04em; }
.name-check { border: 1px solid var(--line); border-radius: var(--r-control); padding: var(--s4); margin-top: var(--s4); }
.turnstile { margin-top: var(--s5); min-height: 65px; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.status-card { border: 1px solid var(--line); border-radius: var(--r-panel); padding: var(--s6); margin: var(--s6) 0; }
.status-card h1 { font-size: 2.75rem; }

/* Event type photo (Event type editor, Photo). Only computers show it: the
   image is set inside this media query, so phones never download it. A dark
   wash keeps white text at 4.5:1 or better over any photo, light or dark. */
.status-split-main { width: min(100% - 2rem, 640px); margin-inline: auto; padding: var(--s5) 0 var(--s7); }
.status-split-photo { display: none; }
@media (min-width: 821px) {
  .bw-rail.has-photo {
    background: linear-gradient(rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.6) 65%, rgba(0, 0, 0, 0.74)), var(--rail-photo) center / cover no-repeat;
    color: #fff; border-right-color: transparent; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  }
  .bw-rail.has-photo .bw-brand, .bw-rail.has-photo .bw-facts .icon, .bw-rail.has-photo .bw-desc,
  .bw-rail.has-photo .readout-label, .bw-rail.has-photo .readout-zone, .bw-rail.has-photo .readout-date.is-empty { color: rgba(255, 255, 255, 0.9); }
  .bw-rail.has-photo .wordmark-mark { border-color: #fff; }
  /* A dark icon would vanish on the photo: give it a white tile. */
  .bw-rail.has-photo .brand-icon { background: #fff; padding: 2px; border-radius: 6px; box-sizing: border-box; }
  .bw-rail.has-photo .wordmark-mark::after { background: #fff; }
  .bw-rail.has-photo .readout, .bw-rail.has-photo .price-lines .total { border-color: rgba(255, 255, 255, 0.85); }
  .bw-rail.has-photo a { color: #fff; }

  .status-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100vh - 65px); }
  .status-split-main { width: auto; margin: 0; padding: var(--s5) var(--s6) var(--s7) max(1rem, calc((100vw - 1120px) / 2)); }
  .status-split-main .status-card { max-width: 560px; }
  .status-split-photo { display: block; background: var(--status-photo) center / cover no-repeat; }
  main:has(.status-split) + .site-foot { margin-top: 0; }
}

@media (max-width: 820px) {
  .bw { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .bw-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .readout { margin-top: 0; }
  .readout-time { font-size: 3rem; }
  .bw-main { padding: var(--s4); }
  .bw-pick { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .slot-list { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); max-height: none; }
  .bw-actions .btn-primary { margin-left: 0; width: 100%; order: -1; }
  .bw-actions .btn-secondary, .bw-actions .btn-quiet, .bw-actions form { width: 100%; }
  .bw-actions form .btn { width: 100%; }
  .status-card { padding: var(--s4); }
}
@media (max-width: 480px) { .bw-title { font-size: 2rem; } .bw-step-title { font-size: 1.85rem; } .bw-steps { gap: var(--s3); } }
.name-check legend { float: left; width: 100%; margin-bottom: var(--s1); }
.name-check legend + * { clear: both; }
.btn-quiet.btn-flush { padding-left: 0; }

/* ---------- Booker portal ---------- */
.site-bar nav a { font-weight: 600; white-space: nowrap; }
.site-bar .wordmark { flex: 1 1 auto; }
.wordmark-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Phones: the logo alone, its name kept for screen readers. */
@media (max-width: 480px) { .site-bar .brand-logo { max-width: 50vw; } .site-bar .brand-logo + .wordmark-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.portal-bar { padding-top: var(--s3); }
.portal-bar form { margin: 0; }
.portal-head { padding: var(--s5) 0 0; }
.portal-head h1 { font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem); margin-bottom: var(--s2); }
.auth-panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); padding: var(--s6); margin: var(--s7) auto; }
.auth-panel h1 { font-size: 2.75rem; }
.auth-panel h1:focus { outline: none; }
.code-input { font-family: var(--font-code); font-size: 1.75rem; letter-spacing: 0.4em; text-align: center; max-width: 14rem; }
.booking-list { list-style: none; margin: 0 0 var(--s4); padding: 0; border-top: 1px solid var(--ink); }
.booking-item { padding: var(--s5) 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--s5); }
.booking-when { font-weight: 600; line-height: 1.25; }
.booking-when .day-num { display: block; font-family: var(--font-display); font-weight: 400; font-size: 3.25rem; line-height: 1; }
.booking-when .muted { font-weight: 400; font-size: var(--fs-sm); }
.booking-body h3 { font-size: 1.75rem; margin-bottom: var(--s2); }
.booking-meta { list-style: none; margin: 0 0 var(--s3); padding: 0; display: grid; gap: var(--s1); font-size: var(--fs-sm); }
.booking-meta a { overflow-wrap: anywhere; }
.booking-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
@media (max-width: 560px) { .booking-item { grid-template-columns: 1fr; gap: var(--s2); } .booking-when .day-num { display: inline; font-size: 1.75rem; margin-right: var(--s2); } .auth-panel { padding: var(--s4); margin: var(--s5) auto; } }
a.day { text-decoration: none; }

/* Embedded on another site (?embed=1): no site header or footer, no outer margins. */
.embed-main { padding: 1px; }
.is-embed .status-card { margin: 0; }
.is-embed .page-intro { padding-top: var(--s5); }

/* Steps row: the steps, plus the pop-up's close button on the same line. */
.bw-steps-row { display: flex; align-items: flex-start; gap: var(--s3); margin: 0 0 var(--s5); padding: 0 0 var(--s3); border-bottom: 1px solid var(--line); }
.bw-steps-row .bw-steps { flex: 1 1 auto; margin: 0; padding: 0; border: 0; }
.embed-close { flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; margin: -8px -8px -8px 0; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--ink); cursor: pointer; }
.embed-close:hover { border-color: var(--ink); }
.embed-close .icon { width: 20px; height: 20px; }
.embed-close-row { display: flex; justify-content: flex-end; margin-bottom: var(--s2); }
/* Pop-up (?embed=popup): the card is the dialog, no frame inside a frame. */
.is-popup .embed-main { padding: 0; }
.is-popup .bw { border: 0; border-radius: 0; }
.is-popup .status-card { border: 0; margin: 0; }
.is-popup .page-intro { padding-top: 0; }
.is-popup main > .embed-close-row { padding: var(--s4) var(--s4) 0; margin: 0; }
/* Phones: the steps sit below the summary, so the pop-up's close button stays in the top corner. */
@media (max-width: 820px) {
  .is-popup .bw-steps-row .embed-close { position: fixed; top: 10px; right: 10px; margin: 0; z-index: 5; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
  .is-popup .bw-rail { padding-right: 64px; }
}
