/**
 *  @package michael-travels-theme
 *
 *  Listing cards, the grid they sit in, pagination and the search form.
 *
 *  Named default-cards so Fuse loads it on every request alongside default.css
 *  — cards turn up on archives, on search results and inside blocks, which is
 *  most of the site.
 */

/*  ============================================================================
    The grid
    ============================================================================  */

.mt-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--mt-space-6);
}

@media screen and (min-width: 576px) {

  .mt-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media screen and (min-width: 992px) {

  .mt-entry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}




/*  ============================================================================
    The card
    ============================================================================  */

.mt-card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.mt-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--mt-ground-alt);
  border-radius: var(--mt-radius);
}

.mt-card-image--portrait {
  aspect-ratio: 4 / 5;
}

.mt-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.mt-card-link:hover .mt-card-image img,
.mt-card-link:focus-visible .mt-card-image img {
  transform: scale(1.03);
}

.mt-card-flag {
  position: absolute;
  bottom: var(--mt-space-3);
  left: var(--mt-space-3);
  padding: 6px 12px;
  background: var(--mt-dark);
  color: var(--mt-on-dark);
  border-radius: var(--mt-radius);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mt-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  padding: var(--mt-space-4);
  background: var(--mt-ground-alt);
  border-radius: var(--mt-radius);
}

.mt-card-logo img {
  width: auto;
  max-height: 100%;
  object-fit: contain;
}

.mt-card-body {
  padding-top: var(--mt-space-4);
}

.mt-card-title {
  margin-bottom: var(--mt-space-2);
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  transition: color 0.18s ease;
}

.mt-card-link:hover .mt-card-title,
.mt-card-link:focus-visible .mt-card-title {
  color: var(--mt-accent);
}

.mt-card-excerpt {
  margin: 0;
  color: var(--mt-muted);
}

.mt-card-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mt-space-3);
  margin: 0;
  color: var(--mt-muted);
  font-size: 0.8125rem;
}

/**
 *  A post's tags.
 *
 *  Drawn like the small secondary buttons the record pages file their terms
 *  under, so a tag looks the same wherever it is met -- but as static chips,
 *  because a card is a single anchor and cannot hold links of its own.
 */
.mt-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mt-space-2);
  margin: var(--mt-space-4) 0 0;
}

.mt-card-tag {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--mt-line);
  border-radius: var(--mt-radius);
  color: var(--mt-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.background-dark .mt-card-tag {
  border-color: var(--mt-line-dark);
  color: var(--mt-on-dark-muted);
}

/*  A company with no logo should not leave a hole where one would sit.  */
.mt-card--company .mt-card-body {
  padding-top: var(--mt-space-3);
}




/*  ============================================================================
    Nothing found
    ============================================================================  */

.mt-nothing-found {
  max-width: var(--mt-measure);
  padding: var(--mt-space-8) 0;
}




/*  ============================================================================
    Pagination
    ============================================================================  */

.mt-pagination {
  margin-top: var(--mt-space-8);
}

.mt-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mt-space-2);
  align-items: center;
  justify-content: center;
}

.mt-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--mt-space-3);
  border: 1px solid var(--mt-line);
  border-radius: var(--mt-radius);
  color: var(--mt-text);
  font-size: 0.875rem;
  text-decoration: none;
}

.mt-pagination a.page-numbers:hover {
  border-color: var(--mt-accent);
  color: var(--mt-accent);
}

.mt-pagination .page-numbers.current {
  background: var(--mt-accent);
  color: var(--mt-on-accent);
  border-color: var(--mt-accent);
}

.mt-pagination .page-numbers.dots {
  border-color: transparent;
}




/*  ============================================================================
    Search form
    ============================================================================  */

.mt-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mt-space-2);
  max-width: 520px;
  margin: var(--mt-space-5) 0;
}

.mt-search-field {
  flex: 1 1 220px;
  min-width: 0;
  padding: 12px 16px;
  background: var(--mt-ground);
  border: 1px solid var(--mt-line);
  border-radius: var(--mt-radius);
  color: var(--mt-text);
  font-family: inherit;
  font-size: 1rem;
}

.mt-search-field::placeholder {
  color: var(--mt-muted);
}

.mt-search-field:focus {
  border-color: var(--mt-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--mt-accent-rgb), 0.18);
}

.background-dark .mt-search-field {
  background: var(--mt-dark-alt);
  border-color: var(--mt-line-dark);
  color: var(--mt-on-dark);
}




/*  ============================================================================
    Assistance level archive

    Every trip, day or visit recorded at one grade of assistance.
    ============================================================================  */

/**
 *  The same shape as the disclosures block: two columns from tablet up, and
 *  each entry carrying its own rule rather than the stack sharing them.
 *  It is the same kind of list read in a different place, so it should not
 *  look like a different kind of list.
 */
.travels-assistance-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--mt-space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

/*  Two only when there are two, as in the disclosures block.  */
@media screen and (min-width: 768px) {

  .travels-assistance-list:has(> :nth-child(2)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--mt-space-7);
  }

}

.travels-assistance {
  padding-top: var(--mt-space-4);
  border-top: 1px solid var(--mt-line);
}

.travels-assistance-title {
  margin: 0 0 var(--mt-space-1);
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
}

.travels-assistance-title a {
  color: inherit;
  text-decoration: none;
}

.travels-assistance-title a:hover,
.travels-assistance-title a:focus-visible {
  color: var(--mt-accent);
}

.travels-assistance-provided {
  margin: 0 0 var(--mt-space-1);
  font-weight: 600;
}

/*  No measure of its own: the column is now the measure.  */
.travels-assistance-statement {
  margin: 0;
  color: var(--mt-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
