.api-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.api-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.api-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--api-cards-card, transparent);
  border: 1px solid var(--api-cards-card-border, #343a45);
  border-radius: var(--api-cards-card-radius, 20px);
  transition: background-color 0.2s ease;
}

.api-card:hover {
  background-color: var(--api-cards-card-hover, #240925);
}

.api-card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
}

.api-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.api-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
}

.api-card-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

.api-card-date {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.api-card-text {
  margin: 0;
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.5;
}

.api-card-link {
  align-self: flex-start;
  margin-top: 4px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  transition: color 0.2s ease;
}

.api-card-link:hover {
  color: var(--api-cards-accent, #ef2b89);
}

.api-cards-empty {
  margin: 0;
  opacity: 0.7;
  font-style: italic;
}

.api-cards-app {
  --api-cards-sticky-top: 90px;

  display: flex;
  flex-direction: column;
  gap: 16px;
}

.api-cards-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.api-cards-filters {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: var(--api-cards-panel-padding, 24px);
  border: 1px solid var(--api-cards-border, #343a45);
  border-radius: 20px;
  background: var(--api-cards-panel, transparent);
  color: var(--api-cards-panel-text, #fff);
  box-sizing: border-box;
}

.api-cards-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 24px;
  align-items: start;
}

.api-cards-controls > * + .api-cards-filter-checkbox {
  padding-left: 20px;
  border-left: 1px solid var(--api-cards-rule, #343a45);
}

.api-cards-stacked > * + .api-cards-filter-checkbox,
.api-cards-layout-sidebar .api-cards-controls > * + .api-cards-filter-checkbox {
  padding-top: 18px;
  padding-left: 0;
  border-top: 1px solid var(--api-cards-rule, #343a45);
  border-left: 0;
}

.api-cards-layout-sidebar .api-cards-controls {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 900px) {
  .api-cards-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .api-cards-controls > * + .api-cards-filter-checkbox {
    padding-top: 18px;
    padding-left: 0;
    border-top: 1px solid var(--api-cards-rule, #343a45);
    border-left: 0;
  }
}

.api-cards-layout-sidebar {
  display: grid;
  grid-template-columns: minmax(200px, 25%) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.api-cards-layout-sidebar .api-cards-filters {
  position: sticky;
  top: var(--api-cards-sticky-top);
  max-height: calc(100vh - var(--api-cards-sticky-top) - 20px);
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .api-cards-layout-sidebar {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .api-cards-layout-sidebar .api-cards-filters {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

.api-cards-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.api-cards-filter > label {
  font-weight: 700;
  color: inherit;
}

.api-cards-filter select,
.api-cards-filter input[type="search"] {
  width: 100%;
  min-width: 180px;
  padding: 10px;
  border: 1px solid var(--api-cards-field-border, #ccc);
  border-radius: 6px;
  background: var(--api-cards-field, #fff);
  color: var(--api-cards-field-text, #1d2327);
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1rem;
}

.api-cards-filter-checkbox {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.api-cards-filter-checkbox legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: inherit;
}

.api-cards-opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.3;
}

.api-cards-opt input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-width: 0;
  margin: 2px 0 0;
  accent-color: var(--api-cards-accent, #ef2b89);
  cursor: pointer;
}

.api-cards-opt-all {
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--api-cards-rule, #343a45);
  font-weight: 600;
}

.api-cards-opt-all input {
  accent-color: var(--api-cards-accent-all, #ef2b89);
}

.api-cards-clear,
.api-cards-more {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background-color: var(--api-cards-button, #ef2b89);
  color: var(--api-cards-button-text, #fff);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.api-cards-clear:hover,
.api-cards-more:hover {
  background-color: var(--api-cards-button-hover, #a42362);
}

.api-cards-more {
  width: auto;
  min-width: 180px;
}

.api-cards-more[disabled] {
  opacity: 0.5;
  cursor: default;
}

.api-cards-count {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.7;
}

.api-cards-filters .api-cards-count {
  text-align: center;
}

.api-cards-more-wrap {
  margin: 0;
  text-align: center;
}

.api-cards-busy .api-cards {
  opacity: 0.5;
  transition: opacity 0.15s;
}

.api-cards-error::after {
  content: "The list could not be updated. Please retry.";
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fcf0f1;
  color: #b32d2e;
  font-size: 0.9rem;
}
