/* Speedy book, see /js/common/speedy-book.js. The structure is shared and each site dresses it in its own box */

.speedy-book[hidden] { display: none; }
.speedy-book { text-align: left; }
.speedy-book__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.speedy-book__name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.speedy-book__icon { width: 18px; height: 18px; flex: none; }
.speedy-book__title { font-weight: 700; }
.speedy-book__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.speedy-book__when { font-size: 12px; border-radius: 999px; padding: 2px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; flex: none; }
.speedy-book__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.speedy-book__row { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 100%; }
.speedy-book button { font: inherit; cursor: pointer; }
.speedy-book__remove,
.speedy-book__swap { border: 0; background: none; padding: 4px; line-height: 1; flex: none; }
.speedy-book__remove { color: #8b9298; font-size: 18px; }
.speedy-book__swap { font-size: 18px; }
.speedy-book__route { flex: 1; min-width: 0; display: grid; border: 0; background: none; padding: 0; text-align: left; color: inherit; }
/* Each end of the journey is one line. One too long for the row fades at the edge rather than ending in
   an ellipsis, and slides along to show the rest, see the motion rules at the end */
.speedy-book__line { display: block; overflow: hidden; white-space: nowrap; }
.speedy-book__text { display: inline-block; white-space: nowrap; }
.speedy-book__line.is-long {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}
.speedy-book__from { font-weight: 700; }
.speedy-book__go { flex: none; border: 0; white-space: nowrap; }
.speedy-book button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.speedy-book__promo { display: flex; align-items: center; gap: 12px; }
.speedy-book__promo .speedy-book__icon { width: 22px; height: 22px; padding: 8px; border-radius: 50%; box-sizing: content-box; }
.speedy-book__promo-text { display: grid; gap: 1px; min-width: 0; }

/* taxicode.com, a white card inside the grey quote panel. Journeys share the width, so one fills the row
   and three sit side by side, and a phone stacks them */
.speedy-book--tc { margin: 12px 0 6px; padding: 12px 14px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); font-family: inherit; color: #111; }
.speedy-book--tc .speedy-book__icon { color: #009fdb; }
.speedy-book--tc .speedy-book__title { font-size: 16px; color: #000; }
.speedy-book--tc .speedy-book__sub { font-size: 13px; color: #666; }
.speedy-book--tc .speedy-book__when { color: #1677c2; border: 1px solid #1677c2; }
/* the time pill opens the time picker on taxicode.com */
.speedy-book--tc button.speedy-book__when { background: #fff; line-height: 1.5; cursor: pointer; }
.speedy-book--tc button.speedy-book__when:hover { background: #1677c2; color: #fff; }
.speedy-book--tc .speedy-book__row { flex: 1 1 260px; background: #f5f7f9; border: 1px solid #e1e6ea; padding: 8px 10px; }
/* taxicode.com loads Muli at 300 and 400 only, so the pickup stands out by size and colour, not weight */
.speedy-book--tc .speedy-book__from { font-size: 14.5px; color: #000; }
.speedy-book--tc .speedy-book__to { font-size: 13px; color: #6b6b6b; }
.speedy-book--tc .speedy-book__swap { color: #1677c2; }
.speedy-book--tc .speedy-book__go { background: #009fdb; color: #fff; font: 700 13px Arial, sans-serif; padding: 8px 14px; }
.speedy-book--tc .speedy-book__go:hover { background: #0089bd; }
.speedy-book--tc.speedy-book--empty { padding: 10px 14px; }
.speedy-book--tc .speedy-book__promo .speedy-book__icon { background: #e6f6fc; }
.speedy-book--tc .speedy-book__promo-text { font-size: 13px; color: #444; }
.speedy-book--tc .speedy-book__promo-text .speedy-book__title { color: #111; }
/* On a wide screen the strip is only as wide as what is in it, centred under the bar, with the heading
   beside the journeys rather than above them, so a short promo or one journey leaves no empty band */
@media screen and (min-width: 666px) {
  .speedy-book--tc:not([hidden]) { display: flex; align-items: center; gap: 14px; width: fit-content; max-width: 100%; margin: 14px auto 16px; padding: 8px 10px 8px 14px; box-sizing: border-box; }
  .speedy-book--tc .speedy-book__head { flex-direction: column; align-items: flex-start; gap: 3px; margin: 0; flex: none; }
  .speedy-book--tc .speedy-book__sub { display: none; }
  .speedy-book--tc .speedy-book__when { max-width: 160px; font-size: 11px; padding: 1px 8px; }
  /* rows keep a readable width and wrap onto another line before they would be squeezed */
  .speedy-book--tc .speedy-book__list { flex-wrap: wrap; min-width: 0; }
  .speedy-book--tc .speedy-book__row { flex: 1 1 220px; max-width: 320px; }
  .speedy-book--tc.speedy-book--empty { padding: 8px 16px 8px 10px; }
  .speedy-book--tc .speedy-book__promo .speedy-book__icon { padding: 6px; }
  .speedy-book--tc .speedy-book__promo-text { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
}
/* A laptop width bar cannot take the heading and every journey on one line, so the heading goes on top
   and each journey gets the full width, rather than a narrow column beside it */
@media screen and (min-width: 666px) and (max-width: 1199px) {
  .speedy-book--tc:not([hidden]):not(.speedy-book--empty) { flex-direction: column; align-items: stretch; gap: 8px; width: auto; padding: 10px 12px; }
  .speedy-book--tc:not(.speedy-book--empty) .speedy-book__head { flex-direction: row; align-items: center; justify-content: space-between; }
  .speedy-book--tc:not(.speedy-book--empty) .speedy-book__row { flex: 1 1 100%; max-width: none; }
}
@media screen and (max-width: 665px) {
  .speedy-book--tc { margin: 12px 5px 6px; }
  .speedy-book--tc .speedy-book__title { font-size: 16px; }
  .speedy-book--tc .speedy-book__sub { display: none; }
  .speedy-book--tc .speedy-book__list { gap: 0; }
  .speedy-book--tc .speedy-book__row { flex-basis: 100%; gap: 6px; background: none; border-width: 0 0 1px; padding: 10px 2px; }
  .speedy-book--tc .speedy-book__row:last-child { border-bottom: 0; }
  /* the button and swap stay compact so the address keeps as much of the row as it can */
  .speedy-book--tc .speedy-book__row { gap: 4px; }
  .speedy-book--tc .speedy-book__from,
  .speedy-book--tc .speedy-book__to { font-size: 14.5px; }
  .speedy-book--tc .speedy-book__swap { padding: 4px 2px; }
  .speedy-book--tc .speedy-book__go { font-size: 12.5px; padding: 8px 9px; }
  .speedy-book--tc .speedy-book__promo-text { font-size: 14px; }
}

/* TaxiPriceCompare, straight under the blue pickup and destination band of the card */
.book .speedy-book--tpc { padding: 12px 22px 6px; border-bottom: 1px solid var(--line2, #e4ebf0); font-family: var(--fb, inherit); color: var(--ink, #0b1f2a); }
.book .speedy-book--tpc .speedy-book__icon { color: var(--blue-d, #0076b3); }
.book .speedy-book--tpc .speedy-book__title { font-size: 14px; }
.book .speedy-book--tpc .speedy-book__sub { display: none; }
.book .speedy-book--tpc .speedy-book__when { color: var(--blue-d, #0076b3); background: var(--blue-xl, #ecf3f7); font-weight: 600; }
.book .speedy-book--tpc .speedy-book__list { gap: 0; }
.book .speedy-book--tpc .speedy-book__row { padding: 8px 0; border-top: 1px solid var(--line2, #e4ebf0); }
.book .speedy-book--tpc .speedy-book__row:first-child { border-top: 0; }
.book .speedy-book--tpc .speedy-book__from { font-size: 14px; }
.book .speedy-book--tpc .speedy-book__to { font-size: 13px; color: var(--ink2, #5e717d); }
.book .speedy-book--tpc .speedy-book__swap { color: var(--blue-d, #0076b3); }
.book .speedy-book--tpc.speedy-book--empty { padding: 12px 22px; }
.book .speedy-book--tpc .speedy-book__promo .speedy-book__icon { background: var(--blue-xl, #e6f4fb); }
.book .speedy-book--tpc .speedy-book__promo-text { font-size: 13px; line-height: 1.4; color: var(--ink2, #5e717d); }
.book .speedy-book--tpc .speedy-book__promo-text .speedy-book__title { color: var(--ink, #0b1f2a); }
.book .speedy-book--tpc .speedy-book__go { background: var(--blue, #008dd4); color: #fff; font-weight: 800; font-size: 12.5px; border-radius: 999px; padding: 7px 12px; }
/* On a wider screen each journey takes one line, so the card grows as little as possible and Compare fares
   stays in view on a laptop */
@media screen and (min-width: 700px) {
  .book .speedy-book--tpc { padding: 10px 22px 4px; }
  .book .speedy-book--tpc .speedy-book__head { margin-bottom: 2px; }
  .book .speedy-book--tpc .speedy-book__row { padding: 5px 0; }
  .book .speedy-book--tpc .speedy-book__route { display: flex; align-items: baseline; gap: 6px; }
  .book .speedy-book--tpc .speedy-book__from { flex: 0 1 auto; max-width: 55%; }
  .book .speedy-book--tpc .speedy-book__to { flex: 1 1 0; }
  .book .speedy-book--tpc .speedy-book__go { padding: 5px 11px; }
}
/* While journeys show, the rest of the card tightens up, so with three of them Compare fares still sits
   above the fold on an 800px tall laptop. A first time visitor sees the card exactly as before */
@media screen and (min-width: 700px) {
  .book.has-speedy-book .band { padding: 14px 22px 10px; }
  .book.has-speedy-book .band-t { margin-bottom: 8px; }
  .book.has-speedy-book .route { gap: 7px; }
  .book.has-speedy-book .add-via { margin-top: 6px; }
  .book.has-speedy-book .speedy-book--tpc .speedy-book__row { padding: 3px 0; }
  .book.has-speedy-book .trip-tab { padding: 9px 6px 7px; }
  .book.has-speedy-book .line,
  .book.has-speedy-book .when-pick { min-height: 46px; }
  .book.has-speedy-book .form-in > .go { margin-top: 10px; padding-top: 12px; padding-bottom: 12px; }
}

/* A long address slides to its end and back so it can be read in full: while the row is hovered with a
   mouse, and by itself after a short pause on a phone, which has no hover. Nobody who has asked their
   device to reduce motion sees it move, the full journey stays in the row's tooltip and label */
@keyframes speedy-slide {
  0%, 15% { transform: translateX(0); }
  85%, 100% { transform: translateX(var(--speedy-shift, 0)); }
}
@media (prefers-reduced-motion: no-preference) {
  @media (hover: hover) {
    .speedy-book__row:hover .is-long .speedy-book__text,
    .speedy-book__route:focus-visible .is-long .speedy-book__text { animation: speedy-slide var(--speedy-time, 6s) ease-in-out .2s infinite alternate; }
  }
  @media (hover: none) {
    .speedy-book__line.is-long .speedy-book__text { animation: speedy-slide var(--speedy-time, 6s) ease-in-out 2s infinite alternate; }
  }
}
