/* Project listing + detail */
.project-card--link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.project-card--link:hover { color: inherit; }
.project-card--link .card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #C8102E;
}
.projects-grid--linked .project-card--link {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  padding-bottom: 1rem;
}
.projects-grid--linked .img-frame { border-radius: 0; }
.projects-grid--linked figcaption,
.projects-grid--linked .card-link { padding-inline: 1rem; }

/* Homepage projects: 8 square cards, text on image */
#projects .projects-grid--home {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

#projects .project-card--overlay {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

#projects .project-card--overlay .img-frame {
  aspect-ratio: 1 / 1;
  margin-bottom: 0;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

#projects .project-card--overlay .img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

#projects .project-card--overlay:hover .img-frame img {
  transform: scale(1.04);
}

#projects .project-card-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.35rem 0.9rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

#projects .project-card-caption strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.25;
  margin: 0;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 2px 10px rgba(0, 0, 0, 0.85),
    0 0 1px rgba(0, 0, 0, 1);
}

#projects .project-card-caption > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.3;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 2px 8px rgba(0, 0, 0, 0.8);
}

@media (max-width: 900px) {
  #projects .projects-grid--home {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  #projects .project-card-caption {
    padding: 1.1rem 0.7rem 0.7rem;
  }

  #projects .project-card-caption strong {
    font-size: 0.8rem;
  }

  #projects .project-card-caption > span {
    font-size: 0.7rem;
  }
}

.project-layout {
  display: grid;
  grid-template-columns: 1.5fr 0.85fr;
  gap: 2rem;
  align-items: start;
}
.project-hero-figure {
  margin-bottom: 2rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.project-hero-figure .img-frame { aspect-ratio: 16 / 9; border-radius: 0; }
.project-hero-figure figcaption,
.project-gallery-item figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--hairline);
  background: var(--white);
}
.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.project-gallery-item {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}
.project-gallery-item .img-frame {
  aspect-ratio: 4 / 3;
  border-radius: 0;
}
.project-aside { position: sticky; top: calc(var(--header-h) + 1rem); }
.project-facts {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--ice);
}
.project-facts h2 { font-size: 1.05rem; margin-bottom: 0.85rem; }
.project-facts p { margin-top: 0.75rem; font-size: 0.92rem; }
.project-facts ul { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.4rem; }
.project-facts li {
  font-size: 0.9rem;
  color: var(--ink-muted);
  padding-left: 0.85rem;
  position: relative;
}
.project-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #C8102E;
}
@media (max-width: 900px) {
  .project-layout { grid-template-columns: 1fr; }
  .project-aside { position: static; }
  .project-gallery { grid-template-columns: 1fr; }
}

.project-meta-line {
  margin-top: 0.85rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
}
.project-card-service {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.project-main h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.project-main > p {
  margin-top: 0.85rem;
}
