/* Projects gallery — compact tile system */
.project-index-card[hidden] { display: none !important; }

/* Kill the older editorial lead-card sizing so every visible tile is predictable. */
.project-index-grid .project-index-card,
.project-index-grid .project-index-card:nth-child(3n + 1),
.project-index-grid .project-index-card.is-featured {
  grid-column: auto !important;
  min-width: 0;
}

.project-index-grid .project-index-card .project-index-visual,
.project-index-grid .project-index-card:nth-child(3n + 1) .project-index-visual,
.project-index-grid .project-index-card.is-featured .project-index-visual {
  min-height: 0 !important;
}

/* All Work: three featured projects at the same half-width scale.
   This naturally gives Residential + Heritage on the first row, Commercial below. */
.project-index-grid[data-active-filter="all"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
  row-gap: 46px;
}

/* Category views: compact browse tiles. */
.project-index-grid:not([data-active-filter="all"]) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 34px;
}

.project-index-card {
  display: block;
}

.project-card-link {
  display: flex;
  height: 100%;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.project-card-link:hover,
.project-card-link:focus-visible { color: inherit; }
.project-card-link:focus-visible { outline: 2px solid var(--copper); outline-offset: 5px; }

.project-index-copy {
  order: 1;
  padding: 0 0 12px !important;
}

.project-card-category {
  min-height: 0 !important;
  margin: 0 0 7px !important;
  color: var(--muted) !important;
  font-size: 9px !important;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

.project-index-copy h3 {
  margin: 0 !important;
  font-size: clamp(24px, 2vw, 34px) !important;
  line-height: 1 !important;
}

.project-index-visual {
  order: 2;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0 !important;
  padding: 0;
  overflow: hidden;
}

.project-index-visual--photo {
  border: 0 !important;
  background: #e9e3da;
}

.project-index-visual--photo::before,
.project-index-visual--photo::after { display: none !important; }

.project-index-visual--photo img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
}

.project-index-visual--placeholder {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--review-red) !important;
  background: var(--review-red-soft) !important;
  color: var(--review-red) !important;
}

.project-index-visual--placeholder::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block !important;
  content: "";
  background:
    linear-gradient(34deg, transparent calc(50% - .5px), var(--review-red) 50%, transparent calc(50% + .5px)),
    linear-gradient(-34deg, transparent calc(50% - .5px), var(--review-red) 50%, transparent calc(50% + .5px));
  opacity: .72;
}

.project-index-visual--placeholder::after { display: none !important; }
.project-index-visual--placeholder > * { position: relative; z-index: 1; }
.project-index-photo-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.project-index-visual--placeholder > strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 400;
}

/* Category tiles are intentionally denser than the All Work overview. */
.project-index-grid:not([data-active-filter="all"]) .project-index-copy h3 {
  font-size: clamp(20px, 1.55vw, 27px) !important;
}
.project-index-grid:not([data-active-filter="all"]) .project-index-copy {
  padding-bottom: 10px !important;
}

@media (max-width: 1250px) {
  .project-index-grid:not([data-active-filter="all"]) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 850px) {
  .project-index-grid[data-active-filter="all"] {
    grid-template-columns: 1fr;
  }
  .project-index-grid:not([data-active-filter="all"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .project-index-grid:not([data-active-filter="all"]) {
    grid-template-columns: 1fr;
  }
  .project-index-grid {
    row-gap: 34px !important;
  }
}

/* All Work overview: use the category itself as the single large title. */
.project-index-grid[data-active-filter="all"] .project-index-copy .project-card-category {
  margin: 0 !important;
  min-height: 0 !important;
  color: var(--ink) !important;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 2.5vw, 42px) !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  text-transform: none !important;
}

.project-index-grid[data-active-filter="all"] .project-index-copy h3 {
  display: none !important;
}

/* LOCKED ALL WORK OVERVIEW: only Residential / Heritage / Commercial are shown as titles. */
.project-index-grid[data-active-filter="all"] .project-index-copy .project-card-category {
  display: block !important;
}
.project-index-grid[data-active-filter="all"] .project-index-copy h3 {
  display: none !important;
}
