@charset "UTF-8";
/**
 * CAI Resource Grid — grid/list layout for the cai_resource_grid widget.
 *
 * The compact card's own intrinsic styles live in resource-card.scss (shared
 * across widgets, enqueued via the `cai-resource-card` handle). These rules
 * only handle the grid/list view scoping — both [data-view] states render the
 * exact same markup, only layout differs.
 */
.cai-resource-grid {
  display: grid;
  gap: 32px;
}

/* -------------------------------------------------------------------------
 * Loop Item template items (Source: Dynamic with a template selected).
 * The template owns the card design; this wrapper only makes it fill its grid
 * cell. [data-view] still controls the column count, but not the template's
 * own internal layout — a template built as a vertical card stays vertical in
 * list view.
 * ---------------------------------------------------------------------- */
.cai-resource-grid__item {
  display: flex;
}

.cai-resource-grid__item > .elementor {
  width: 100%;
}

/* -------------------------------------------------------------------------
 * Grid view — 2-col vertical cards (image on top)
 * ---------------------------------------------------------------------- */
/* Columns are responsive: mobile always 1, tablet always 2, and desktop is the
   chosen count (data-columns). Default (2) stays 2 on desktop; the "3" option
   steps up to 3 only on desktop — still 2 on tablet, 1 on mobile. */
.cai-resource-grid[data-view=grid] {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .cai-resource-grid[data-view=grid] {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .cai-resource-grid[data-view=grid][data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
  }
}
.cai-resource-grid[data-view=grid] .cai-resource-card__media {
  aspect-ratio: 16/9;
}

/* Bottom-align the CTAs across a row: let the content column grow to fill the
   stretched card, then pin the CTA to its foot. margin-top:auto absorbs the
   free space above; padding-top keeps a gap on the tallest card where auto
   collapses to 0. Scoped to grid view so the horizontal list card (which
   centres its content) is untouched. */
.cai-resource-grid[data-view=grid] .cai-resource-card__content {
  flex: 1;
}

.cai-resource-grid[data-view=grid] .cai-resource-card__link {
  margin-top: auto;
  padding-top: 4px;
}

/* -------------------------------------------------------------------------
 * List view — 1-col horizontal cards (image on the left)
 * ---------------------------------------------------------------------- */
.cai-resource-grid[data-view=list] {
  grid-template-columns: 1fr;
  gap: var(--cai-spacer-4);
}

.cai-resource-grid[data-view=list] .cai-resource-card {
  flex-direction: row;
  gap: var(--cai-spacer-4);
}

.cai-resource-grid[data-view=list] .cai-resource-card__media {
  width: 262px;
  flex-shrink: 0;
  aspect-ratio: 4/3;
}

.cai-resource-grid[data-view=list] .cai-resource-card__content {
  padding-top: 0;
  justify-content: center;
}

@media (max-width: 640px) {
  .cai-resource-grid[data-view=list] .cai-resource-card {
    flex-direction: column;
  }
  .cai-resource-grid[data-view=list] .cai-resource-card__media {
    width: 100%;
  }
}
/* Empty state — shown by the widget when Filter mode yields no matches
   (only rendered when "Respond to filter toolbar" is on). */
.cai-resource-grid__empty {
  margin: 0;
  padding: 40px 0;
  font-family: var(--cai-font-base, Arial, Helvetica, sans-serif);
  font-size: var(--cai-fs-subtitle, 18px);
  line-height: var(--cai-lh-subtitle, 1.5);
  color: var(--cai-color-ink-80, rgba(20, 20, 20, 0.8));
}
