/* ==============================================================================
   CARDS BLOCK
   ============================================================================== */

.cards__grid {
  display: grid;
  gap: var(--spacing-lg);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  background: var(--paper-bg);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* A small lift on hover says the card is one unit; the global
   prefers-reduced-motion guard in main.css cancels the transition. */
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card__image {
  width: 100%;
  border-radius: var(--radius-md);
}

.card__title {
  margin: 0;
  color: var(--text-primary);
}

.card__text {
  color: var(--text-muted);
  line-height: 1.6;
  /* Keeps a card's link pinned to the bottom even when a neighbour's text
     runs longer and stretches the row. */
  flex-grow: 1;
}

/* A grid with a single card (cards__grid--single, the root's one client)
   centres it at about the width of a card in a full row, instead of
   letting auto-fit stretch it across the whole column. */
.cards__grid--single {
  grid-template-columns: minmax(0, 24rem);
  justify-content: center;
}

/* A card's icon (content.CardIcons, drawn inline by tenant/partials/
   icon.html): large enough to lead the card, in the brand's ink with the
   terracotta accent, both from 03-components/brand.css so they follow
   the light and dark themes the same way the AurisPass name does. The
   ink and the light terracotta clear the 3:1 of a graphic on the card
   in both modes (brand.css lists the measured pairs). */
.card__icon {
  --icon-accent: var(--wordmark-pass);
  color: var(--wordmark-ink);
  line-height: 0;
}

.card__icon .icon {
  width: 2.5rem;
  height: 2.5rem;
}

.card__icon .icon__accent-fill {
  fill: var(--icon-accent);
}

.card__icon .icon__accent-stroke {
  stroke: var(--icon-accent);
}

/* The ticket's ear is drawn on the ticket itself. In light mode the
   terracotta stands out on the dark ink; in dark mode the ink is the
   light text, and the ear is cut out of it in the card's own colour, as
   the tourist's page does (tenant.css, .icon--ticket). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card__icon .icon--ticket {
    --icon-accent: var(--paper-bg);
  }
}

:root[data-theme="dark"] .card__icon .icon--ticket {
  --icon-accent: var(--paper-bg);
}

/* A client's card (card--logo) leads with the logo and centres its
   contents under it: the logo is the client's own shape and reads best
   as the card's middle. */
.card--logo {
  align-items: center;
  text-align: center;
}

/* The logo is larger here than in the bars (client-logo.html sizes it at
   26 and 34 px), since it is the card's subject; the white plate of dark
   mode comes with it from brand.css. */
.card__logo .client-logo__img {
  height: 3.5rem;
  max-width: 100%;
}

/* The heading of a one-card block stands over the card, centred like it;
   a browser without :has() keeps it on the left, which still reads. */
.block-cards:has(> .cards__grid--single) > h2 {
  text-align: center;
}
