/* The tour operator page's own parts: the summary under the title, the tour cards, the departure
   months, the price table and the comparison. The photo gallery, jump links, region cards, deal
   cards, bands and FAQs are the cruise line page's (cruiseline-page.css, ship-pricing.css). */

/* Header: the title with the Quality rating and types beside it, and the logo without a box. */

.top-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 12px;
}

.top-head .page_title {
  margin: 0 0 8px;
}

.top-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.top-head-quality {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1f2a37;
  text-decoration: none;
}

.top-head-label {
  color: #5b6b78;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The Font Awesome stars adc-sites' copy of this page draws until it copies the Tour Class
   markup (adc-sites#312). Remove these once that copy is in production. */
.top-stars {
  color: #e8a317;
  font-size: 15px;
  white-space: nowrap;
}

.top-stars > i,
.top-star-half {
  margin-right: 2px;
}

.top-stars i {
  color: #e8a317;
  font-size: 15px;
}

.top-star-half {
  position: relative;
  display: inline-block;
}

.top-star-half .fa-solid {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  overflow: hidden;
}

/* Tour Class stars (tour_class_helper), drawn at the size of the text around them. */
.top-head-quality .tc-stars,
.top-table .tc-stars {
  font-size: 16px;
}

.top-tier {
  color: #1f2a37;
  font-size: 13px;
  font-weight: 600;
}

.top-table .top-tier {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

.top-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-types li {
  padding: 3px 10px;
  border: 1px solid #b7d3ea;
  border-radius: 999px;
  background-color: #f1f7fd;
  color: #004a83;
  font-size: 12px;
  font-weight: 600;
}

.top-head-logo {
  flex: 0 0 auto;
  max-width: 220px;
  max-height: 72px;
  object-fit: contain;
}

.top-nowrap {
  white-space: nowrap;
}

/* The comparison's region list wraps so the table fits beside the Quality column. */

.top-table td.top-wrap {
  min-width: 150px;
  white-space: normal;
}

/* Deals after the price section: a rule at the content width between the two white sections. */

#deals_content_container.clp-deals {
  padding-top: 0;
}

#deals_content_container.clp-deals > .page_max_width {
  padding-top: var(--band);
  border-top: 1px solid #d6e0ea;
}

/* Summary */

.top-summary {
  margin: 0 0 16px;
}

.top-answer {
  max-width: 920px;
  margin: 0 0 14px;
  color: #1f2a37;
  font-size: 16px;
  line-height: 1.55;
}

.top-facts {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  background-color: #fff;
  list-style: none;
}

.top-facts li {
  flex: 1 1 150px;
  padding: 12px 16px;
  border-right: 1px solid #d6e0ea;
  text-align: center;
}

.top-facts li:last-child {
  border-right: 0;
}

.top-facts strong {
  display: block;
  color: #004a83;
  font-size: 22px;
  line-height: 1.2;
}

.top-facts span {
  color: #5b6b78;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Bands: the site's light blue across the window, or white, with the shared section spacing. */

.top-band {
  padding: var(--band) 0;
  border-image: linear-gradient(#d0e8ff, #d0e8ff) fill 0 / 0 / 0 100vmax;
}

.top-white {
  padding: var(--band) 0;
}

/* Filters: region chips and the month, length and guaranteed choices, which filter the cards in
   place (operator-page.js), or open tour search without the script. */

.top-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.top-chip {
  padding: 7px 12px;
  border: 1px solid #b7d3ea;
  border-radius: 999px;
  background-color: #fff;
  color: #1f2a37;
  font-size: 13px;
  text-decoration: none;
}

.top-chip:hover,
.top-chip:focus-visible {
  border-color: #004a83;
  color: #004a83;
}

.top-chip.is-on {
  border-color: #004a83;
  background-color: #004a83;
  color: #fff;
}

/* A region the other choices leave no tours in. */
.top-chip.is-off,
.top-chip.is-off:hover {
  border-color: #d6e0ea;
  color: #8a97a3;
  cursor: default;
}

.top-refine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}

.top-refine-label {
  color: #1f2a37;
  font-size: 14px;
  font-weight: bold;
}

.top-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.top-go {
  padding: 8px 16px;
  border: 0;
  border-radius: 4px;
  background-color: #004a83;
  color: #fff;
  font: bold 13px Arial, "Helvetica Neue", Helvetica, sans-serif;
  cursor: pointer;
}

.top-count {
  margin: 0 0 10px;
  color: #5b6b78;
  font-size: 13px;
}

/* Filtering in place, the choices apply as they change, so the button goes. */
.top-refine.is-live .top-go {
  display: none;
}

.top-none {
  margin: 0 0 14px;
  color: #1f2a37;
  font-size: 15px;
}

.top-clear {
  padding: 0;
  border: 0;
  background: none;
  color: #004a83;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Tour cards: the whole card opens the tour page through its title link. */

.top-tgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* While the matching tours load, the cards dim. */
.is-loading .top-tgrid {
  opacity: 0.5;
  transition: opacity 0.15s;
}

.top-tcard {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d6e0ea;
  border-radius: 10px;
  background-color: #fff;
}

/* Cards past the opening ones are folded by operator-page.js with the hidden attribute, which
   the card's display would otherwise override. */
.top-tcard[hidden] {
  display: none;
}

.top-tcard:hover {
  box-shadow: 0 4px 14px rgb(0 40 80 / 12%);
}

.top-tphoto {
  position: relative;
  height: 160px;
  background-color: #e6edf3;
}

.top-tphoto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-bonus {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  background-color: #e8414f;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
}

.top-tbody {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px 14px;
}

.top-tbody h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.top-tlink {
  color: #004a83;
  text-decoration: none;
}

.top-tlink::after {
  position: absolute;
  inset: 0;
  content: "";
}

.top-tcard:has(.top-tlink:focus-visible) {
  outline: 3px solid #004a83;
  outline-offset: 2px;
}

.top-tlink:focus-visible {
  outline: none;
}

.top-meta {
  margin: 0;
  color: #5b6b78;
  font-size: 13px;
  line-height: 1.4;
}

.top-dates {
  margin: 0;
  font-size: 13px;
}

.top-guaranteed {
  margin: 0;
  color: #1f7a3a;
  font-size: 13px;
  font-weight: bold;
}

.top-tprice {
  margin-top: auto;
  padding-top: 6px;
}

.top-price {
  margin: 0;
  color: #5b6b78;
  font-size: 13px;
}

.top-price strong {
  color: #004a83;
  font-size: 22px;
}

.top-price .top-contact {
  font-size: 15px;
}

.top-ppd {
  display: block;
}

.top-special {
  margin: 4px 0 0;
  color: #e8414f;
  font-size: 13px;
  font-weight: bold;
}

.top-note {
  margin: 4px 0 0;
  color: #5b6b78;
  font-size: 12px;
}

.top-view {
  display: block;
  margin-top: 10px;
  padding: 8px;
  border-radius: 4px;
  background-color: #004a83;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
}

.top-more-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

a.top-all {
  display: inline-block;
  text-decoration: none;
}

a.top-all[hidden] {
  display: none;
}

/* Trip length links, under the price table */

.top-lengths {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.top-lengths a {
  display: block;
  min-width: 190px;
  padding: 12px 16px;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  background-color: #fff;
  color: #1f2a37;
  font-size: 13px;
  text-decoration: none;
}

.top-lengths strong {
  display: block;
  color: #004a83;
  font-size: 14px;
}

/* When to Go: a sentence saying when most departures are, then each month with its
   departures first and its lowest price under them. */

.top-when-lede {
  max-width: 900px;
  color: #1f2a37;
  font-size: 17px;
  line-height: 1.45;
}

.top-when-note {
  margin: 0 0 16px;
  color: #5b6b78;
  font-size: 13px;
}

.top-when {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-when-month {
  display: flex;
}

.top-when-card {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  align-items: center;
  box-sizing: border-box;
  padding: 12px 4px;
  border: 1px solid #b7d3ea;
  border-radius: 8px;
  background-color: #fff;
  color: #1f2a37;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

a.top-when-card:hover,
a.top-when-card:focus-visible {
  border-color: #004a83;
  box-shadow: 0 0 0 1px #004a83;
  color: #1f2a37;
}

.top-when-month.is-empty .top-when-card {
  color: #5b6b78;
}

.top-when-name {
  color: #004a83;
  font-size: 16px;
  font-weight: bold;
}

.top-when-year {
  display: block;
  color: #5b6b78;
  font-size: 11px;
  font-weight: normal;
}

.top-when-bar {
  display: flex;
  align-items: flex-end;
  height: 84px;
  margin: 12px 0 8px;
}

.top-when-bar i {
  display: block;
  width: 28px;
  height: var(--share);
  border-radius: 3px 3px 0 0;
  background-color: #004a83;
}

.top-when-count strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.top-when-from {
  margin-top: 8px;
  color: #5b6b78;
}

/* The Busiest and Lowest labels sit in a row every card keeps, so the bars stay level. One month
   with both makes the row two labels tall on every card. */
.top-when-tags {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  margin-bottom: 6px;
}

.top-when.has-both .top-when-tags {
  min-height: 44px;
}

.top-when-tag {
  padding: 3px 8px;
  border-radius: 10px;
  background-color: #004a83;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  line-height: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.top-when-tag.is-price {
  background-color: #b4540a;
}

.top-when-month.is-lowest .top-when-card {
  border-color: #b4540a;
  box-shadow: 0 0 0 1px #b4540a;
}

.top-when-month.is-lowest .top-when-from {
  color: #a34a00;
  font-weight: bold;
}

/* Words for screen readers only: "Lowest price" where the label shows "Lowest". */
.top-when-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.top-when-month.is-busiest .top-when-card {
  border-color: #004a83;
  box-shadow: 0 0 0 1px #004a83;
}

.top-when-more {
  margin-top: auto;
  padding-top: 10px;
  color: #004a83;
  font-weight: bold;
}

.top-when-more::after {
  content: " \203A";
}

/* Price table and comparison */

.top-table-wrap {
  overflow-x: auto;
}

.top-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  font-size: 14px;
}

.top-table th,
.top-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #d6e0ea;
  text-align: left;
  white-space: nowrap;
}

/* Headings wrap ("Guaranteed / departures") so the columns are as wide as their figures. */
.top-table thead th {
  background-color: #f3f7fb;
  color: #004a83;
  font-size: 13px;
  vertical-align: bottom;
  white-space: normal;
}

.top-table tbody th {
  font-weight: bold;
}

.top-table tr.is-self th,
.top-table tr.is-self td {
  background-color: #f6fafd;
}

/* Figures right-aligned in digits of one width, so prices with and without cents line up. */
.top-table .top-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* How the comparison's rows are chosen and ordered, just above the table. */
.top-caption {
  margin-bottom: 8px;
  color: #5b6b78;
  font-size: 13px;
  text-align: left;
  caption-side: top;
}

.top-more {
  color: #5b6b78;
  white-space: nowrap;
}

/* The comparison as a white card in the tabs band, like the FAQs under it. */
[id="tabs_section"] > .top-card {
  margin-top: 32px;
  padding: 28px 32px 30px;
  border: 1px solid #b7d3ea;
  border-radius: 8px;
  background-color: #fff;
}

@media (width <= 760px) {
  /* On a phone the breadcrumbs stay first, as on every page, and the logo sits beside the
     title rather than above it: one row for who the operator is, then the rating and types. */
  .top-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 16px;
    align-items: center;
    padding-top: 10px;
  }

  .top-head > .top-head-text {
    display: contents;
  }

  .top-head .breadcrumbs {
    grid-area: 1 / 1 / 2 / 3;
  }

  .top-head .page_title {
    grid-area: 2 / 1;
  }

  .top-head-meta {
    grid-area: 3 / 1 / 4 / 3;
  }

  .top-head-logo {
    grid-area: 2 / 2;
    max-width: 120px;
    max-height: 40px;
    margin-bottom: 8px;
  }

  /* Headings and region names wrap so the tables fit the screen without scrolling sideways. */
  .top-table th,
  .top-table td {
    padding: 8px;
    white-space: normal;
  }

  /* When to Go: a row a month, the name, then a bar across with the departures under it, then
     the price, so the twelve months read down the screen instead of in a tall grid. */
  .top-when {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .top-when-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto 10px;
    align-items: center;
    column-gap: 12px;
    min-height: 48px;
    padding: 6px 12px;
    text-align: left;
  }

  .top-when-name {
    grid-area: 1 / 1 / span 2;
    font-size: 15px;
  }

  .top-when-bar {
    grid-area: 1 / 2;
    align-items: stretch;
    height: 10px;
    margin: 0;
    border-radius: 5px;
    background-color: #e6eff8;
  }

  .top-when-bar i {
    width: var(--share);
    height: auto;
    border-radius: 5px;
  }

  .top-when-count {
    grid-area: 2 / 2;
    margin-top: 4px;
    font-size: 13px;
  }

  .top-when-count strong {
    display: inline;
    font-size: 14px;
  }

  .top-when-tags,
  .top-when.has-both .top-when-tags {
    grid-area: 2 / 3;
    flex-direction: row;
    justify-content: flex-end;
    min-height: 0;
    margin: 0;
  }

  .top-when-tag {
    margin-top: 3px;
  }

  .top-when-from {
    grid-area: 1 / 3;
    margin: 0;
    font-size: 13px;
    text-align: right;
  }

  /* "See tours" stays the link's words for screen readers; the row shows an arrow. */
  .top-when-more {
    grid-area: 1 / 4 / span 2;
    margin: 0;
    padding: 0;
    font-size: 0;
  }

  .top-when-more::after {
    content: "\203A";
    font-size: 20px;
  }

  .top-facts li {
    flex-basis: 40%;
    border-bottom: 1px solid #d6e0ea;
  }

  [id="tabs_section"] > .top-card {
    padding: 20px 18px 22px;
  }
}

@media (width <= 920px) {
  /* Below 920px the comparison's eight columns no longer fit, so each operator becomes a card
     with its figures labeled, read top to bottom instead of scrolled sideways: two cards a row
     on a tablet, one on a phone. */
  .top-ctable thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .top-ctable,
  .top-ctable tr,
  .top-ctable tbody th,
  .top-ctable td {
    display: block;
  }

  .top-ctable {
    background-color: transparent;
  }

  .top-ctable .top-caption {
    display: block;
  }

  .top-ctable tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 12px;
  }

  .top-ctable tr {
    margin: 0;
    border: 1px solid #d6e0ea;
    border-radius: 8px;
    background-color: #fff;
  }

  .top-ctable tbody th {
    font-size: 16px;
  }

  .top-ctable td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    text-align: right;
  }

  .top-ctable td::before {
    flex: 0 0 auto;
    color: #5b6b78;
    font-size: 13px;
    text-align: left;
    content: attr(data-label);
  }

  .top-ctable tr > :last-child {
    border-bottom: 0;
  }

  .top-ctable td.top-wrap {
    min-width: 0;
  }

  /* The stars and the tier word stay together at the right. */
  .top-ctable .tc-stars,
  .top-ctable .top-stars {
    margin-left: auto;
  }

  .top-ctable td .top-tier {
    margin: 0 0 0 -8px;
  }
}

/* Twelve departure months a row need about 900px; a tablet gets two rows of six. */
@media (760px < width <= 920px) {
  .top-when {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
