/* The page editor and everything only it uses: the weekday table, the
   switches, the length pills and the preview rail. Split from
   scheduling.css to keep each file readable in one sitting. */

/* The editor: the form on the left, the public page as it will look on the
   right. Judging a change without publishing it is the whole point. */
.editor-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  column-gap: 32px;
  align-items: start;
}

.editor-form,
.editor-preview {
  display: flex;
  flex-direction: column;
  row-gap: 20px;
}

.preview-card {
  display: flex;
  flex-direction: column;
  row-gap: 16px;
  padding: 24px;
  border: 1px solid var(--c-neutral-3);
  border-radius: 12px;
}

.slug-field {
  display: flex;
  align-items: center;
  column-gap: 8px;
  border: 1px solid var(--c-neutral-3);
  border-radius: 8px;
  padding: 0 12px;
}

.slug-field input {
  border: 0;
  background: transparent;
  flex: 1;
}

.slug-prefix {
  font: var(--t-body-small-300);
  color: var(--c-neutral-9);
  white-space: nowrap;
}

.slug-state {
  font: var(--t-body-small-300);
  color: var(--c-neutral-9);
  white-space: nowrap;
}

/* The tick sits with the word, as on the design: a green word on its own
   reads as a label rather than an answer. */
.slug-state svg {
  vertical-align: -1px;
  margin-right: 4px;
}

.slug-state.slug-ok {
  color: var(--c-green);
}

.slug-state.slug-taken {
  color: var(--c-red);
}

.pill-group {
  display: flex;
  column-gap: 8px;
}

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--c-neutral-3);
  background: transparent;
  color: var(--c-white);
  font: var(--t-body-small-300);
  cursor: pointer;
}

.pill-on {
  border-color: transparent;
  background: var(--c-blue);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 24px;
  padding: 16px;
  border: 1px solid var(--c-neutral-3);
  border-radius: 8px;
}

.switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--c-neutral-3);
  background: var(--c-neutral-2);
  position: relative;
  cursor: pointer;
  flex: none;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-neutral-9);
  transition: transform 150ms ease-in-out;
}

.switch[aria-pressed="true"] {
  background: var(--c-green);
  border-color: transparent;
}

.switch[aria-pressed="true"]::after {
  background: var(--c-white);
  transform: translateX(20px);
}

.weekdays-table {
  display: flex;
  flex-direction: column;
}

.weekday {
  display: grid;
  /* The two times are as wide as a time needs and no wider, as on the design;
     what is left goes to the count of slots the window yields. */
  grid-template-columns: 44px 110px 104px 24px 104px 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-neutral-2);
}

.weekday-name {
  font: var(--t-body-primary-300);
  color: var(--c-white);
}

.weekday-to {
  font: var(--t-body-small-300);
  color: var(--c-neutral-9);
  text-align: center;
}

.weekday-off .select-shell,
.weekday-off .weekday-to {
  visibility: hidden;
}

.weekday-off .weekday-name {
  color: var(--c-neutral-9);
}

.legend {
  display: flex;
  column-gap: 16px;
  padding-top: 4px;
}

.legend span {
  display: flex;
  align-items: center;
  column-gap: 6px;
  font: var(--t-body-small-300);
  color: var(--c-neutral-9);
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.swatch-free {
  border: 1px solid var(--c-neutral-3);
}

.swatch-chosen {
  background: var(--c-blue);
}

.swatch-none {
  background: var(--c-neutral-2);
}

@media (max-width: 1100px) {
  .editor-columns {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 24px;
  }
}

/* The one destructive button in this module: cancelling a booking somebody is
   expecting. Red, and never the default action on a screen. */
.button-danger {
  background: var(--c-red);
  border-color: transparent;
  color: var(--c-white);
}

.button-danger:hover {
  background: var(--c-red-darker);
}

/* S3 and S4: one table, two views. The columns differ between them - what is
   upcoming has a note and two actions, what happened has a status and the
   sentence that explains it. */
.bookings-views {
  display: flex;
  align-items: center;
  column-gap: 12px;
}

#bookings .row {
  grid-template-columns: 150px 220px 180px minmax(0, 1fr) 160px;
  padding: 14px 20px;
}

#bookings .row-headings-history,
#bookings .rows-history .row {
  grid-template-columns: 150px 220px 180px 120px minmax(0, 1fr);
}

/* Name over address, in every cell of this table: side by side they read as
   one long string and the eye cannot find the name. */
#bookings .row strong,
#bookings .row small {
  display: block;
}

#bookings .row small {
  font: var(--t-body-small-300);
  color: var(--c-neutral-9);
}

.booking-when {
  display: flex;
  flex-direction: column;
  row-gap: 2px;
}

.booking-when small {
  font: var(--t-body-small-300);
  color: var(--c-neutral-9);
}

.badge-moved {
  border-color: var(--c-orange);
  color: var(--c-orange);
}

/* Upcoming and History sit together as one control, as drawn. */
.segmented {
  display: flex;
  column-gap: 4px;
  padding: 3px;
  border: 1px solid var(--c-neutral-3);
  border-radius: 999px;
}

.booking-row-note {
  font: var(--t-body-small-300);
  color: var(--c-neutral-9);
}

.badge-cancelled {
  border-color: var(--c-red);
  color: var(--c-red);
}

/* S10: the people who host a team page, and the directory search above them. */
.host-results {
  border: 1px solid var(--c-neutral-3);
  border-radius: 8px;
  margin-top: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  row-gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}

.host-result,
.host-row {
  display: flex;
  align-items: center;
  column-gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
}

.host-row {
  border: 1px solid var(--c-neutral-3);
  margin-bottom: 8px;
}

.host-result:hover {
  background: var(--surface-hover);
}

.host-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.host-who strong {
  font: var(--t-body-small-500);
  color: var(--c-white);
}

.host-who small {
  font: var(--t-body-small-300);
  color: var(--c-neutral-9);
  overflow-wrap: anywhere;
}

.badge-lead {
  color: var(--c-white);
  border-color: var(--c-neutral-7);
  background: var(--c-neutral-2);
}

/* A switch with more under it than a sentence: the row, then whatever the
   switch reveals, inside one box. */
.switch-card {
  border: 1px solid var(--c-neutral-3);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  row-gap: 14px;
}

.switch-row-plain {
  border: none;
  padding: 0;
}

.switch-card [data-transcript-options] {
  display: flex;
  flex-direction: column;
  row-gap: 14px;
}
