/* Approved image-led project cards and existing application filters.
   Scoped to the index so project detail pages keep their existing layout. */
.page-projects .projects-index-filters {
  gap: 10px 12px;
  padding: 20px 0 16px;
}

.page-projects .projects-index-filters button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  padding: 7px 18px;
  border: 1px solid var(--line-on-dark-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--surface-white);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  transition: border-color .18s ease, background .18s ease;
}

.page-projects .projects-index-filters button::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-red);
  transform: translateY(-50%);
  opacity: 0;
}

.page-projects .projects-index-filters button small {
  margin: 0;
  color: var(--text-gray-on-dark);
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  opacity: 1;
}

.page-projects .projects-index-filters button:hover {
  border-color: var(--brand-gold);
  background: var(--surface-gray);
}

.page-projects .projects-index-filters button.is-active {
  padding-left: 44px;
  font-weight: 600;
  border-color: var(--brand-red);
  background: rgba(155, 32, 36, .14);
}

.page-projects .projects-index-filters button.is-active::before { opacity: 1; }
.page-projects .projects-index-filters button:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 3px;
}

.page-projects .project-filter-label-short { display: none; }

.page-projects .projects-index-status {
  margin: 16px 0 20px;
  font-size: 13px;
  font-weight: 600;
}

.page-projects .projects-index-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.page-projects .project-index-card {
  position: relative;
  display: block;
  isolation: isolate;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: var(--surface-black);
}
.page-projects .project-index-card[hidden] { display: none; }

.page-projects .project-index-card figure {
  margin: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.page-projects .project-index-card figure > .media-frame {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.page-projects .project-index-card .media-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-projects .project-index-card > .project-index-card-content {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  align-items: stretch;
  min-height: 0;
  padding: 16px 18px 18px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .65);
}
.page-projects .project-index-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(9, 9, 10, 0) 40%,
    rgba(9, 9, 10, .15) 53%,
    rgba(9, 9, 10, .38) 65%,
    rgba(9, 9, 10, .60) 76%,
    rgba(9, 9, 10, .73) 87%,
    rgba(9, 9, 10, .82) 100%);
}
.page-projects .project-index-card-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 19px;
  margin-bottom: 6px;
}
.page-projects .project-index-card-meta > span {
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
}
.page-projects .project-index-card-meta > .project-index-card-category {
  color: #e4c995;
}
.page-projects .project-index-card-meta > .project-index-card-year {
  margin-left: 0;
  flex-shrink: 0;
  color: #f0ede7;
  font-variant-numeric: tabular-nums;
}
.page-projects .project-index-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}
.page-projects .project-index-card-heading > h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--surface-white);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  overflow-wrap: break-word;
}
.page-projects .project-index-card-heading > .project-index-card-cue {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(211, 193, 153, .55);
  border-radius: 50%;
  background: transparent;
  color: #d3c199;
  pointer-events: none;
  transition: border-color .18s ease, color .18s ease;
}
.page-projects .project-index-card-cue::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("/assets/project-cards/caret-right.svg") center / contain no-repeat;
  mask: url("/assets/project-cards/caret-right.svg") center / contain no-repeat;
}
.page-projects .project-index-card:is(:hover, :focus-visible) .project-index-card-cue {
  border-color: #d3c199;
  color: #f0ede7;
}
html[dir="rtl"] .project-index-card-cue::before {
  transform: scaleX(-1);
}

@media (max-width: 1100px) {
  .page-projects .projects-index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .page-projects .projects-index-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    gap: 8px;
    padding: 18px 0;
  }
  .page-projects .projects-index-filters button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    max-width: 100%;
    min-height: 48px;
    padding: 6px 10px 6px 26px;
    padding-inline: 26px 10px;
    border-radius: 12px;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    text-align: start;
  }
  .page-projects .projects-index-filters button.is-active {
    padding: 6px 10px 6px 26px;
    padding-inline: 26px 10px;
    font-weight: 500;
  }
  .page-projects .projects-index-filters button::before {
    left: auto;
    inset-inline-start: 11px;
    width: 6px;
    height: 6px;
  }
  .page-projects .project-index-filter-label { min-width: 0; }
  .page-projects .project-filter-label-full { display: none; }
  .page-projects .project-filter-label-short { display: inline; }
  .page-projects .projects-index-filters button small {
    justify-self: end;
    white-space: nowrap;
    font-size: 11px;
  }
}

@media (max-width: 640px) {
  .page-projects .projects-index-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .page-projects .project-index-card-heading > h2 {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-projects .project-index-card,
  .page-projects .project-index-card .media-frame > img,
  .page-projects .project-index-card-cue {
    transition: none;
    transform: none;
  }
  .page-projects .project-index-card:is(:hover, :focus-visible) .media-frame > img {
    transform: none;
  }
}
