.ams-projects-archive {
  scroll-margin-top: 1rem;
}

.ams-projects-listing {
  --ams-projects-gap: clamp(1rem, 2vw, 1.5rem);
  --ams-projects-border: rgba(18, 18, 18, 0.14);
  --ams-projects-muted: rgba(18, 18, 18, 0.62);
  --ams-projects-surface: #f5f3ee;
  --ams-projects-accent: #c73f2d;
  margin-inline: calc(50% - 50cqw);
  width: 100cqw;
}

.projects-filters,
.projects-status,
.projects-results {
  margin-inline: auto;
  max-width: var(--afcoop-page-width);
  padding-inline: var(--afcoop-page-gutter);
}

.projects-filters {
  margin-block: 0 1.5rem;
}

.projects-search-form {
  padding: clamp(0.625rem, 1.5vw, 0.875rem);
  border-radius: 12px;
  background: #f7f6f3;
  box-shadow: 0 1px 2px rgba(18, 18, 18, 0.04);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.projects-search-form .form-text,
.projects-search-form .form-select {
  min-height: 3rem;
  border: 1px solid var(--ams-projects-border);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font-size: 1rem;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.projects-search-form .form-text:hover,
.projects-search-form .form-select:hover {
  border-color: rgba(18, 18, 18, 0.24);
}

.projects-search-form .form-text:focus,
.projects-search-form .form-select:focus {
  border-color: rgba(18, 18, 18, 0.42);
  box-shadow: 0 0 0 3px rgba(18, 18, 18, 0.08);
  outline: none;
}

.projects-search-form .form-text {
  flex: 1 1 18rem;
  min-width: min(100%, 16rem);
  padding-inline: 1rem;
}

.projects-search-form .form-text::placeholder {
  color: rgba(18, 18, 18, 0.5);
}

.projects-search-form .form-select {
  appearance: none;
  flex: 0 1 11rem;
  padding-inline: 1rem 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23121212' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 1rem center;
  background-repeat: no-repeat;
}

.projects-search-form .button {
  min-height: 3rem;
  border: 1px solid var(--ams-projects-border);
  border-radius: 8px;
  background: #ebe9e4;
  color: #121212;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 1.25rem;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.projects-search-form .button:hover {
  border-color: rgba(18, 18, 18, 0.24);
  background: #e2dfd9;
}

.projects-search-form .button:focus-visible {
  border-color: rgba(18, 18, 18, 0.42);
  box-shadow: 0 0 0 3px rgba(18, 18, 18, 0.08);
  outline: none;
}

.projects-search-form [data-ams-projects-clear] {
  background: transparent;
}

@media (max-width: 39.999rem) {
  .projects-search-form .form-text {
    flex-basis: 100%;
  }

  .projects-search-form .form-select,
  .projects-search-form .button {
    flex: 1 1 auto;
  }
}

.projects-status {
  min-height: 1.5rem;
  margin-block-end: 1rem;
  color: var(--ams-projects-muted);
  font-size: 0.95rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: var(--ams-projects-gap);
  min-width: 0;
}

.project-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--ams-projects-border);
  border-radius: 8px;
  background: #fff;
}

.project-card__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  height: 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.project-card__image {
  aspect-ratio: 4 / 3;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: var(--ams-projects-surface);
}

.project-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.project-card__link:hover .project-card__image img,
.project-card__link:focus-visible .project-card__image img,
.project-card__link:focus-within .project-card__image img {
  transform: scale(1.05);
}

.project-card__content {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
}

.project-card__title {
  margin: 0;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.2;
}

.project-card__synopsis {
  margin: 0;
  max-width: 100%;
  min-width: 0;
  color: var(--ams-projects-muted);
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.project-card__meta {
  margin: 0;
  max-width: 100%;
  min-width: 0;
  color: var(--ams-projects-muted);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.project-card__badge {
  justify-self: start;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  margin-block-start: 0.25rem;
  border-radius: 999px;
  background: var(--ams-projects-surface);
  padding: 0.25rem 0.625rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card--placeholder .project-card__image,
.project-card__placeholder-line {
  position: relative;
  overflow: hidden;
  background: var(--ams-projects-surface);
}

.project-card--placeholder .project-card__image::after,
.project-card__placeholder-line::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
  content: "";
  transform: translateX(-100%);
  animation: ams-projects-loading 1.4s ease-in-out infinite;
}

.project-card__placeholder-line {
  height: 0.85rem;
  border-radius: 999px;
}

.project-card__placeholder-line--title {
  width: 72%;
  height: 1.1rem;
}

.project-card__placeholder-line--meta {
  width: 44%;
}

.projects-pager {
  margin-block-start: 2rem;
}

.projects-pager__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.projects-pager__link {
  display: inline-flex;
  min-width: 2.5rem;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ams-projects-border);
  border-radius: 4px;
  padding-inline: 0.75rem;
  text-decoration: none;
}

.projects-pager__item.is-active .projects-pager__link {
  border-color: var(--ams-projects-accent);
  background: var(--ams-projects-accent);
  color: #fff;
}

.projects-empty {
  border: 1px solid var(--ams-projects-border);
  border-radius: 8px;
  padding: 1.25rem;
  background: #fff;
}

.projects-empty p {
  margin-block: 0 1rem;
}

.projects-empty p:last-child {
  margin-block-end: 0;
}

@keyframes ams-projects-loading {
  to {
    transform: translateX(100%);
  }
}
