/* Selected option A: four-column cards and Materials-style capsule filters.
   Scoped to this page 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 {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface-black), var(--surface-gray));
}
.page-projects .project-index-card[hidden] { display: none; }

.page-projects .project-index-card figure {
  flex: none;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.page-projects .project-index-card figure > .media-frame {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  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 {
  flex: 1;
  align-items: stretch;
  min-height: 132px;
  padding: 16px 18px;
}
.page-projects .project-index-card-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 20px;
  margin-bottom: 10px;
}
.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: var(--brand-gold);
}
.page-projects .project-index-card-meta > .project-index-card-year {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-gray-on-dark);
  font-variant-numeric: tabular-nums;
}
.page-projects .project-index-card-content > h2 {
  margin: 0;
  color: var(--surface-white);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.page-projects .project-index-card-footer {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}
.page-projects .project-index-card-footer > b {
  flex-shrink: 0;
  margin: 0 0 0 auto;
  padding: 0;
  color: var(--brand-gold);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
}
.page-projects .project-index-card-footer > b > span {
  margin-left: 5px;
  color: inherit;
  font-size: 14px;
}

@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 > .project-index-card-content {
    min-height: 132px;
  }
}
