/* The dataset card's own furniture: its badge, title, picture and grid
   surface. Dataset-page styling stays in pages/resources.css. */

.resource-type-badge {
  margin: 0 0 var(--space-2xs);
  color: var(--color-accent-tint-70);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resource-card__title a {
  color: inherit;
  text-decoration: none;
}

.resource-card__title a::after {
  position: absolute;
  content: "";
  inset: 0;
}

.resource-card {
  position: relative;
}

/* Glass cards: see the --card-glass-* tokens. The children that spell out
   their own accent colour have to be told again here, because a colour set
   on the child beats one inherited from the card. */
.resource-cards .resource-card {
  background: var(--card-glass-surface);
  border-color: var(--card-glass-border);
}

/* The picture sits inset from the card's edge, with its own border and
   corners: at full width an opaque plate joins the card's silhouette and reads
   as a hole punched in the glass. It takes whatever width the margin leaves
   rather than a fixed one, because a fixed width was both too small for the
   artwork's own detail and, between roughly 520px and 900px, wider than the
   card itself, so the surplus was cropped away. */
.resource-cards .resource-card .resource-card__image {
  margin: var(--space-md) var(--space-md) 0;
  border: 1px solid var(--card-glass-border);
  border-radius: var(--card-radius);
  background: var(--color-surface);
}

.resource-cards .resource-card:hover,
.resource-cards .resource-card:focus-within {
  background: var(--card-glass-surface-hover);
  border-color: var(--card-glass-border-hover);
}

/* Three steps, so the card reads as a hierarchy rather than one flat wash:
   the title is the brightest thing in it, the copy sits just below, and the
   supporting labels stay pale blue. The `p.` on the muted selectors is not
   decoration -- without it the `.resource-card__body p` rule above is more
   specific and every label is dragged back up to the copy's brightness. */
.resource-cards .resource-card .resource-card__title {
  color: var(--color-text-bright);
}

.resource-cards .resource-card .resource-card__body p,
.resource-cards .resource-card .resource-card__body li,
.resource-cards .resource-card .guide-row__name {
  color: var(--color-text-bright);
}

.resource-cards .resource-card .resource-card__body p.resource-type-badge,
.resource-cards .resource-card .resource-card__body p.resource-card__status,
.resource-cards .resource-card .resource-card__body p.guide-list__label,
.resource-cards .resource-card .guide-row__why,
.resource-cards .resource-card .guide-action--pending {
  color: var(--color-text-on-dark-muted);
}

/* An accent-filled pill would sink into a dark card, so it inverts too. */
.resource-cards .resource-card .guide-action--ready {
  background: var(--color-text-on-dark);
  color: var(--color-accent);
}

.resource-card__image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

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

/* A logo has to be seen whole, and one drawn for white paper disappears on a
   dark card, so a fitted picture gets a light plate and room around it. */
.resource-card__image--contain {
  padding: var(--space-md);
  background: var(--color-surface);
}

.resource-card__image--contain img {
  object-fit: contain;
}

/* The card title's ::after overlay covers the card so the whole surface is
   clickable, so a dataset's per-route guide links sit above it. */
.guide-action--ready {
  position: relative;
  z-index: 1;
}

.resource-card--coming-soon {
  border-style: dashed;
  opacity: 0.72;
}

.resource-card__status {
  margin: var(--space-xs) 0 0;
  color: var(--color-accent-tint-70);
  font-size: 0.75rem;
  font-style: italic;
}

.resource-grid__empty {
  margin: 0;
  padding: var(--space-panel-xl);
  border: 1px dashed var(--color-brand-light-tint-40);
  border-radius: var(--space-panel-lg);
  color: var(--color-text-on-dark);
  text-align: center;
}

.resource-search {
  display: flex;
  margin-bottom: var(--space-lg);
  flex-direction: column;
  gap: var(--space-2xs);
}

.resource-search[hidden] {
  display: none;
}

.resource-search__label {
  color: var(--color-text-on-dark);
  font-size: 0.8rem;
  font-weight: 700;
}

.resource-search__input {
  width: 100%;
  max-width: 28rem;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-accent-tint-20);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-accent);
  font: inherit;
  font-size: 0.9rem;
}

.resource-search__input:focus-visible {
  border-color: var(--color-accent);
  outline: 2px solid var(--color-accent-tint-40);
  outline-offset: 1px;
}

.resource-filters {
  display: flex;
  margin-bottom: var(--space-lg);
  flex-direction: column;
  gap: var(--space-sm);
}

.resource-filters[hidden] {
  display: none;
}

.resource-filters__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2xs) var(--space-sm);
}

.resource-filters__row[hidden] {
  display: none;
}

.resource-filters__label {
  margin: 0;
  min-width: 6rem;
  color: var(--color-text-on-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.resource-filters__chips {
  display: flex;
  margin: 0;
  padding: 0;
  flex: 1;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  list-style: none;
}

/* A chip only acts on this page, so it is a button, and the rule resets what
   a button would otherwise bring with it: its own background and font. */
.resource-chip {
  display: inline-block;
  padding: 0.2rem var(--space-sm);
  border: 1px solid var(--color-brand-light-tint-40);
  border-radius: 999px;
  background: none;
  color: var(--color-text-on-dark);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.resource-chip:hover,
.resource-chip:focus-visible {
  border-color: var(--color-brand-light);
  background: var(--color-brand-light-tint-15);
}

/* The band is dark, so the selected chip inverts to a light fill. */
.resource-chip.is-active {
  border-color: var(--color-brand-light);
  background: var(--color-brand-light);
  color: var(--color-accent);
}

@media (max-width: 720px) {
  .resource-filters__label {
    min-width: 100%;
  }
}
