/* Rate tables and the cancellation-tier timeline. */

.rates {
  width: 100%;
  border-collapse: collapse;

  & th,
  & td {
    text-align: left;
    padding: 16px 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
  }

  & th {
    font: 500 0.74rem/1.2 var(--font-text);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-hi);
  }

  & td:last-child,
  & th:last-child {
    text-align: right;
    white-space: nowrap;
  }

  & td b {
    font-weight: 500;
  }

  & td .p {
    font: 400 1.2rem var(--font-title);
    color: var(--accent-hi);
  }

  & tbody tr {
    transition: background 0.2s;

    &:hover {
      background: var(--tint);
    }
  }
}

.rates-title--next {
  margin-top: 2em;
}

/* narrow: each row becomes name + price, with the "includes" line under */
@media (max-width: 559px) {
  .rates thead {
    display: none;
  }

  .rates tr {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
  }

  .rates td {
    border: 0;
    padding: 4px 0;

    &:nth-child(2) {
      grid-column: 1 / -1;
      grid-row: 2;
    }
  }
}

.policy-lead {
  max-width: 64ch;
}

.policy-cards {
  margin-top: 28px;
}

.policy-foot {
  margin-top: 20px;
}

/* cancellation timeline */
.tl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin: 24px 0 10px;
}

@media (min-width: 640px) {
  .tl {
    grid-template-columns: 1.3fr 1fr 0.8fr;
  }
}

.tl__btn {
  all: unset;
  cursor: pointer;
  padding: 16px;
  border-radius: 6px;
  background: var(--surface-color);
  border-top: 4px solid var(--c);
  transition: background 0.25s, transform 0.25s var(--ease);

  &:hover,
  &:focus-visible,
  &[aria-pressed="true"] {
    background: var(--border-color);
    transform: translateY(-2px);
  }

  &:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }

  & b {
    display: block;
    font: 400 1.15rem var(--font-title);
  }

  & span {
    font-size: 0.85rem;
    color: var(--text-soft);
  }
}

.tl__btn--ok {
  --c: var(--positive-color);
}

.tl__btn--mid {
  --c: var(--accent);
}

.tl__btn--hot {
  --c: var(--secondary-hi);
}

.tl-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted-hi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tl-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--tint);
  min-height: 3.2em;
}
