/* Lead-to-Booking, stays: the two ends of a stay over the month calendar, the guest counts, the kinds of room
   one to a row, and the front office's list. Colours and shapes are the business's own tokens. */

/* ---- arrival, departure and the nights between ---- */
.xb-stay { display: grid; gap: 16px; min-width: 0; }
.xb-stay-ends { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.xb-stay-end, .xb-stay-nights { display: grid; align-content: start; gap: 2px; min-width: 0; min-height: 76px; padding: 10px 12px; border: 1px solid var(--x-line); border-radius: var(--x-radius, 8px); background: var(--x-surface); color: inherit; font: inherit; text-align: start; }
.xb-stay-end { cursor: pointer; transition: border-color var(--x-fast) ease, background-color var(--x-fast) ease; }
.xb-stay-end--on { border-color: var(--x-accent); box-shadow: inset 0 0 0 1px var(--x-accent); background: color-mix(in srgb, var(--x-accent) 7%, var(--x-surface)); }
.xb-stay-nights { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 12px; min-height: 0; border-style: dashed; background: none; }
.xb-stay-end-label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; color: var(--x-muted); font-size: .8125rem; font-weight: 600; line-height: var(--x-lh-label); letter-spacing: var(--x-caps-track); text-transform: var(--x-caps); }
.xb-stay-end-now { color: var(--x-accent-ink); font-weight: 600; letter-spacing: 0; text-transform: none; }
.xb-stay-end-value { font: var(--x-display-weight, 600) 1.1875rem/var(--x-lh-head) var(--x-display, var(--x-text)); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.xb-stay-end-value:lang(th) { font-family: "x-figures", var(--x-display, var(--x-text)); font-weight: var(--x-th-display-weight, 600); }
.xb-stay-end-value--open { color: var(--x-muted); }
.xb-stay-end-sub { color: var(--x-muted); font-size: .875rem; line-height: var(--x-lh-label); }
.xb-stay .xb-cal { max-width: none; }
@media (min-width: 30em) { .xb-stay .xb-cal { max-width: 420px; } }

/* The arrival closes the band of nights on its left, the departure on its right. */
.xb-day--in { border-start-end-radius: 0; border-end-end-radius: 0; }
.xb-day--out { border-start-start-radius: 0; border-end-start-radius: 0; }
.xb-day--last .xb-day-mark, .xb-day-key--last { display: block; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; }
.xb-day--last .xb-day-mark { bottom: 4px; margin-left: -4px; }
.xb-day-key--end, .xb-day-key--night { width: 14px; height: 14px; border-radius: var(--x-radius, 8px); }
.xb-day-key--end { background: var(--x-accent); }
.xb-day-key--night { background: color-mix(in srgb, var(--x-accent) 16%, transparent); box-shadow: inset 0 0 0 1px var(--x-hair); }

/* ---- who is coming ---- */
.xb-stay-who { display: grid; gap: 4px; }
.xb-stay-count { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 12px 0; border-top: 1px solid var(--x-hair); }
.xb-stay-count:last-of-type { border-bottom: 1px solid var(--x-hair); }
.xb-stay-count-text { display: grid; gap: 2px; min-width: 0; }
.xb-stay-times { --x-fact-label: 8.5rem; }
.xb-stay-aside { display: grid; gap: 18px; }
.xb-stay-aside h2 { font-size: 1.125rem; }

/* ---- the kinds of room, one to a row ---- */
.xb-stay-rooms { display: grid; gap: clamp(28px, 5vw, 44px); min-width: 0; margin: 0; padding: 0; border: 0; }
.xb-stay-room { display: grid; gap: 16px; min-width: 0; padding-top: clamp(20px, 4vw, 32px); border-top: 1px solid var(--x-hair); }
.xb-stay-room-pic { min-width: 0; border-radius: var(--x-radius, 8px); }
.xb-stay-room-text { display: grid; align-content: start; gap: 12px; min-width: 0; }
.xb-stay-room-name { font-size: clamp(1.5rem, 4vw, 1.875rem); }
.xb-stay-room-facts { --x-fact-label: 6.5rem; font-size: .9375rem; }
.xb-stay-room-facts .x-fact { padding: 7px 0; }
.xb-stay-room--off .xb-stay-room-pic { opacity: .62; }
.xb-stay-room--off .xb-stay-room-name { color: var(--x-muted); }
.xb-stay-fit { display: grid; gap: 6px; justify-items: start; }
.xb-stay-reason { color: var(--x-ink); font-size: .9375rem; }
.xb-stay-more summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--x-accent-ink); font-weight: 600; cursor: pointer; }
.xb-stay-more ul { display: grid; gap: 4px 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); padding: 4px 0 8px; font-size: .9375rem; }
.xb-stay-more li { padding-inline-start: 14px; background: linear-gradient(var(--x-muted), var(--x-muted)) 0 .7em / 6px 1px no-repeat; }
.xb-stay-extra { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--x-radius, 8px); background: var(--x-surface-2); }
@media (min-width: 45em) {
  .xb-stay-room { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 44px); align-items: start; }
}

/* Asking for a room: one set of radios through every room and the two choices after them. */
.xb-stay-ask { position: relative; display: block; justify-self: start; max-width: 100%; cursor: pointer; }
.xb-stay-ask input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.xb-stay-ask-face { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px 8px 12px; border: 1px solid var(--x-line); border-radius: var(--x-radius, 8px); background: var(--x-surface); font-weight: 600; line-height: var(--x-lh-label); transition: border-color var(--x-fast) ease, background-color var(--x-fast) ease; }
.xb-stay-ask-dot { flex: none; width: 18px; height: 18px; border: 1.5px solid var(--x-line); border-radius: 50%; background: var(--x-bg); }
.xb-stay-ask input:checked + .xb-stay-ask-face { border-color: var(--x-accent); box-shadow: inset 0 0 0 1px var(--x-accent); background: color-mix(in srgb, var(--x-accent) 10%, var(--x-surface)); }
.xb-stay-ask input:checked + .xb-stay-ask-face .xb-stay-ask-dot { border-color: var(--x-accent); background: radial-gradient(circle, var(--x-accent) 0 42%, var(--x-bg) 46%); }
.xb-stay-ask input:focus-visible + .xb-stay-ask-face { outline: 2px solid var(--x-focus); outline-offset: 2px; }
.xb-stay-ask--off { cursor: default; }
.xb-stay-ask--off .xb-stay-ask-face { border-style: dashed; background: var(--x-surface-2); color: var(--x-muted); font-weight: 400; }
.xb-stay-others { display: grid; gap: 16px; padding-top: clamp(20px, 4vw, 32px); border-top: 1px solid var(--x-hair); }
.xb-stay-other { display: grid; gap: 6px; }
.xb-stay-other .x-hint { max-width: 40rem; }
.xb-stay-lead { max-width: 40rem; }

/* ---- the details ---- */
/* A tall field reached by Tab with only its top edge showing is not scrolled to: room kept clear under it is. */
html:has(.xb-step textarea) { scroll-padding-bottom: 10rem; }

/* ---- the result ---- */
.xb-stay-done { display: grid; gap: 24px; align-items: start; }
.xb-stay-done-pic { min-width: 0; max-width: 44rem; border-radius: var(--x-radius, 8px); }
/* A result has no summary beside it: on a wide screen the record has the step's column, the picture the other. */
@supports selector(:has(a)) {
  @media (min-width: 56.25em) {
    .xb-step:has(> .xb-stay-done) { grid-column: 1 / -1; }
    .xb-stay-done { grid-template-columns: minmax(0, 44rem) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); }
  }
}

/* ---- the front office's list: seven columns ---- */
.xb-stay-desk { display: grid; gap: 18px; min-width: 0; }
.xb-stay-desk-sum { font-size: 1.0625rem; }
.xb-stay-desk-sum strong { font-weight: 700; }
@media (min-width: 37.5em) {
  .xb-stay-desk .xb-table thead th:first-child { width: 9%; }
  .xb-stay-desk .xb-table thead th:nth-child(2) { width: 11%; }
  .xb-stay-desk .xb-table thead th:nth-child(3) { width: 18%; }
  .xb-stay-desk .xb-table thead th:nth-last-child(2) { width: 15%; }
  .xb-stay-desk .xb-table thead th:last-child { width: 18%; }
}
.xb-stay-cell-sub { display: block; color: var(--x-muted); font-size: .875rem; }
/* In a phone's compact card the cells run on one line: the nights join it. */
@media (max-width: 37.49em) {
  .xb-stay-cell-sub { display: inline; font-size: inherit; }
  .xb-stay-cell-sub::before { content: "\00B7"; margin-inline: 7px; }
}
.xb-stay-switch { display: grid; gap: 8px; max-width: 44rem; padding: clamp(14px, 3vw, 20px); border: 1px dashed var(--x-line); border-radius: var(--x-radius, 8px); }
.xb-stay-switch h2 { font-size: 1.125rem; }

@media (hover: hover) and (pointer: fine) {
  .xb-stay-end:not(.xb-stay-end--on):hover, .xb-stay-ask:not(.xb-stay-ask--off):hover .xb-stay-ask-face { border-color: var(--x-ink); }
}
@media (forced-colors: active) {
  .xb-stay-end--on, .xb-stay-ask input:checked + .xb-stay-ask-face { outline: 2px solid Highlight; outline-offset: -2px; }
  .xb-day--mid { outline: 1px dashed Highlight; outline-offset: -3px; }
}
