/* Talanoa Centre room booking (2026-09-28): the public form, the slot tables
   and the staff screen. See app/views/public/talanoa.php. */

.pc-talanoa,
.tc-admin {
  --tc-open-bg:   #e6f5ec;
  --tc-open-ink:  #0b6b3a;
  --tc-open-line: #b9e2c9;
  --tc-held-bg:   #eceff3;
  --tc-held-ink:  #55677a;
  --tc-past-ink:  #8c9aa8;
}
[data-theme="dark"] .pc-talanoa,
[data-theme="dark"] .tc-admin {
  --tc-open-bg:   #10301f;
  --tc-open-ink:  #86e3b3;
  --tc-open-line: #1f5a3b;
  --tc-held-bg:   #1a2540;
  --tc-held-ink:  #a3b3c6;
  --tc-past-ink:  #72839a;
}

/* ── The form ─────────────────────────────────────────────────────────────── */

.tc-form legend {
  float: none;
  width: auto;
  margin-bottom: .5rem;
}
.tc-form .tc-note {
  font-size: .9rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
}
.tc-select { max-width: 20rem; }

.tc-rooms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.tc-room {
  display: flex;
  flex-direction: column;
  padding: .5rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.tc-room:hover { border-color: var(--brand-2); }
.tc-room:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent);
}
.tc-room:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.tc-room-pic img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}
.tc-room-pick {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .55rem;
  font-weight: 600;
  font-size: .9rem;
}
.tc-room-pick .form-check-input { margin: 0; flex: none; }
.tc-room.is-full { opacity: .6; }
.tc-room-full {
  margin-top: .25rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--tc-held-ink);
}

.tc-check {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .4rem;
  cursor: pointer;
}
.tc-check .form-check-input { margin: 0; flex: none; }

/* What an Open slot in the table filled in, lit for a moment. */
@keyframes tc-filled {
  from { box-shadow: 0 0 0 4px color-mix(in srgb, var(--reef) 45%, transparent); }
  to   { box-shadow: 0 0 0 4px transparent; }
}
.tc-filled { animation: tc-filled 1.6s ease-out; border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: reduce) { .tc-filled { animation: none; } }

/* ── After booking ────────────────────────────────────────────────────────── */

.tc-done { border-left: 4px solid var(--reef); }
.tc-done h2 { color: var(--reef); }
.tc-done-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .3rem 1.25rem;
  margin: 0 0 1rem;
}
.tc-done-list dt { font-weight: 600; color: var(--muted); }
.tc-done-list dd { margin: 0; }

/* ── The slot tables ──────────────────────────────────────────────────────── */

@media (min-width: 992px) {
  .pc-talanoa .col-lg-5 .tc-slots { position: sticky; top: 6rem; }
}

/* Without the script every day is shown under its own heading; with it the
   day buttons are tabs and the headings would only repeat them. */
.tc-days { display: none; }
.tc-grid.is-tabbed .tc-days {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .35rem;
  margin-bottom: .75rem;
}
.tc-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .4rem .2rem;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.2;
}
.tc-day:hover { border-color: var(--brand-2); }
.tc-day[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tc-day-n { font-weight: 700; font-size: .85rem; }
.tc-day-d { font-size: .72rem; opacity: .85; white-space: nowrap; }

.tc-day-panel + .tc-day-panel { margin-top: 1.25rem; }
.tc-grid.is-tabbed .tc-day-panel { display: none; margin-top: 0; }
.tc-grid.is-tabbed .tc-day-panel.is-on { display: block; }
.tc-day-h { font-size: .9rem; font-weight: 700; margin: 0 0 .4rem; }
.tc-grid.is-tabbed .tc-day-h { display: none; }

.tc-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 3px;
  margin: 0 -3px;
  font-size: .8rem;
}
.tc-table thead th {
  padding: .15rem 0 .25rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-table .tc-time {
  width: 3.7rem;
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tc-table tbody .tc-time small { font-size: .66rem; color: var(--muted); font-weight: 600; }
.tc-table td { padding: 0; }

.tc-cell {
  display: block;
  width: 100%;
  padding: .42rem .1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-cell.is-open { background: var(--tc-open-bg); color: var(--tc-open-ink); border-color: var(--tc-open-line); }
button.tc-cell.is-open:hover,
button.tc-cell.is-open:focus-visible { background: var(--reef); border-color: var(--reef); color: #fff; }
.tc-cell.is-picked,
button.tc-cell.is-picked:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.tc-cell.is-booked { background: var(--tc-held-bg); color: var(--tc-held-ink); }
.tc-cell.is-past { color: var(--tc-past-ink); border: 1px dashed var(--line-2); font-weight: 500; }

.tc-key {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  margin-top: .85rem;
  color: var(--muted);
}
.tc-key .tc-cell { display: inline-block; width: auto; padding: .12rem .45rem; margin-right: .2rem; }

/* ── Staff screen ─────────────────────────────────────────────────────────── */

.tc-admin .tc-table { font-size: .78rem; }
.tc-admin .tc-cell.is-booked { font-weight: 600; }
.tc-admin .tc-bookings td { vertical-align: top; }
.tc-admin .tc-purpose { max-width: 22rem; white-space: pre-line; }
