/* A consistent, figure-first presentation for the Projects portfolio. */

.projects .category {
  margin-top: 2.75rem;
  margin-bottom: 1.25rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.projects .card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--global-divider-color, rgba(127, 127, 127, 0.25));
  border-radius: 0.65rem;
}

.projects .card figure {
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--global-code-bg-color, rgba(127, 127, 127, 0.07));
}

.projects .project-card-media {
  display: block;
  color: inherit;
  text-decoration: none;
}

.projects .card figure picture {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0.55rem;
}

.projects .card .card-img-top {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: contain;
}

.projects .card .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 9.75rem;
  padding: 1.35rem 1.45rem;
}

.projects .card .card-title {
  margin-bottom: 0.55rem;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
}

.projects .project-card-page-link {
  color: inherit;
  text-decoration: none;
}

.projects .project-card-page-link:hover {
  color: var(--global-theme-color);
  text-decoration: none;
}

.projects .card .card-text {
  margin-bottom: 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.project-card-actions {
  display: flex;
  align-items: center;
  margin-top: auto !important;
  padding-top: 0.8rem !important;
}

.project-repository-link,
.project-page-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--global-theme-color);
  border-radius: 0.35rem;
  color: var(--global-theme-color);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.project-repository-link:hover,
.project-page-link:hover {
  background: var(--global-theme-color);
  color: var(--global-bg-color);
  text-decoration: none;
}

.project-repository-callout {
  margin: 0 0 1.6rem;
}

.project-repository-callout .project-repository-link {
  padding: 0.58rem 0.82rem;
  font-size: 0.9rem;
}

.project-intro {
  max-width: 54rem;
  margin-bottom: 1.75rem;
  font-size: 1.03rem;
  line-height: 1.7;
}

.post article > p:first-of-type {
  max-width: 54rem;
  margin-bottom: 1.7rem;
  font-size: 1.03rem;
  line-height: 1.7;
}

.project-section-heading,
.post article > h2 {
  margin: 2.2rem 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.post article > ul {
  margin-top: 0.2rem;
  padding-left: 1.2rem;
}

.post article > ul > li {
  margin-bottom: 0.45rem;
  font-size: 0.93rem;
  line-height: 1.55;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
  margin: 1.2rem 0 2rem;
}

.project-figure {
  min-width: 0;
}

.project-figure figure {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--global-divider-color, rgba(127, 127, 127, 0.25));
  border-radius: 0.55rem;
  background: var(--global-card-bg-color, rgba(127, 127, 127, 0.06));
}

.project-figure picture {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  padding: 0.55rem;
  background: var(--global-code-bg-color, rgba(127, 127, 127, 0.07));
}

.project-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-figure .caption {
  margin: 0;
  padding: 0.72rem 0.85rem 0.8rem;
  color: var(--global-text-color);
  font-size: 0.81rem;
  font-style: normal;
  line-height: 1.45;
  text-align: left;
}

.project-figure:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

@media (max-width: 767.98px) {
  .project-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .project-figure:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .project-figure picture {
    aspect-ratio: 16 / 11;
  }
}
