/* Compact systems for the lower homepage sections. */

.portfolio-section {
  margin: 38px 0 42px;
}

.doc-home .portfolio-section > .home-section-title {
  margin-bottom: 6px;
}

.doc-home .portfolio-intro {
  max-width: 680px;
  margin: 0 0 16px;
  color: #64748b;
  font-family: sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.credential-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.credential-card {
  display: flex;
  min-width: 0;
  padding: 12px;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.credential-card img {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: contain;
}

.credential-card div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.doc-home .credential-card strong {
  color: #333;
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.doc-home .credential-card span {
  margin-top: 2px;
  color: #888;
  font-family: sans-serif;
  font-size: 11px;
  line-height: 1.35;
}

.writing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.doc-home .writing-card {
  display: flex;
  min-width: 0;
  min-height: 188px;
  padding: 15px;
  color: #333;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  flex-direction: column;
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.doc-home .writing-card--lead {
  grid-column: span 2;
}

.doc-home .writing-card:hover,
.doc-home .writing-card:focus-visible {
  color: #333;
  border-color: #aaa;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.09);
  outline: none;
  transform: translateY(-2px);
}

.doc-home .portfolio-kicker {
  color: #888;
  font-family: sans-serif;
  font-size: 11px;
  line-height: 1.35;
}

.doc-home .writing-card h3,
.doc-home .project-card h3 {
  padding: 0;
  margin: 7px 0 0;
  color: #333;
  font-family: sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  border: 0;
}

.doc-home .writing-card--lead h3 {
  max-width: 480px;
  font-size: 18px;
}

.doc-home .writing-card p,
.doc-home .project-card p {
  margin: 7px 0 0;
  color: #666;
  font-family: sans-serif;
  font-size: 12px;
  line-height: 1.45;
}

.doc-home .portfolio-action {
  margin-top: auto;
  padding-top: 14px;
  color: #2563eb;
  font-family: sans-serif;
  font-size: 11px;
  font-weight: 600;
}

.doc-home .portfolio-subtitle {
  padding: 0;
  margin: 24px 0 9px;
  color: #333;
  font-family: sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  border: 0;
}

.research-list {
  border-top: 1px solid #e5e7eb;
}

.doc-home .research-list a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(170px, auto);
  padding: 11px 2px;
  color: #333;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e5e7eb;
  text-decoration: none;
}

.doc-home .research-list a:hover strong,
.doc-home .research-list a:focus-visible strong {
  color: #2563eb;
}

.doc-home .research-list span,
.doc-home .research-list em {
  color: #888;
  font-family: sans-serif;
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.doc-home .research-list strong {
  color: #333;
  font-family: sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.doc-home .research-list em {
  text-align: right;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.project-card {
  display: flex;
  min-width: 0;
  min-height: 174px;
  padding: 14px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  flex-direction: column;
}

.project-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-card__header img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.project-card__header .project-card__logo--dark {
  padding: 4px;
  background: #111;
  border-radius: 3px;
}

.doc-home .project-card__header span {
  color: #888;
  font-family: sans-serif;
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.project-card__links {
  display: flex;
  margin-top: auto;
  padding-top: 12px;
  gap: 12px;
}

.doc-home .project-card__links a {
  color: #2563eb;
  font-family: sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.doc-home .project-card__links a:hover,
.doc-home .project-card__links a:focus-visible {
  text-decoration: underline;
}

.portfolio-link-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.doc-home .portfolio-link-row a {
  display: flex;
  min-width: 0;
  padding: 11px 12px;
  color: #333;
  flex-direction: column;
  text-decoration: none;
}

.doc-home .portfolio-link-row a + a {
  border-left: 1px solid #e5e7eb;
}

.doc-home .portfolio-link-row strong {
  overflow: hidden;
  font-family: sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-home .portfolio-link-row span {
  margin-top: 3px;
  color: #2563eb;
  font-family: sans-serif;
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .writing-grid,
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-home .writing-card--lead {
    grid-column: span 2;
  }

  .credential-grid,
  .portfolio-link-row {
    grid-template-columns: 1fr;
  }

  .doc-home .portfolio-link-row a + a {
    border-top: 1px solid #e5e7eb;
    border-left: 0;
  }
}

@media (max-width: 520px) {
  .portfolio-section {
    margin: 32px 0 36px;
  }

  .writing-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .doc-home .writing-card--lead {
    grid-column: auto;
  }

  .doc-home .writing-card,
  .project-card {
    min-height: 0;
  }

  .doc-home .research-list a {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .doc-home .research-list em {
    display: none;
  }
}
