/* Project directory. Reuses the home page's column, chapter labels and bordered
   cards (styles.css); only what the directory adds is defined here. */

.directory-hero h1 span {
  color: var(--text-lighter);
}

/* The home page enlarges this line on phones; here it is a caption. */
.directory-hero .hero-line {
  margin-top: 0.9rem;
  color: var(--text-light);
  font-size: clamp(1rem, 1.2vw, 1.1rem);
}

.level-nav {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  gap: 0.2rem;
  margin-top: 2rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgba(23, 23, 23, 0.88);
}

.level-nav a {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  white-space: nowrap;
  border-radius: 0.7rem;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 620;
  text-decoration: none;
  transition: background 0.22s var(--spring), color var(--motion-fast) var(--spring);
}

.level-nav a:hover,
.level-nav a:focus-visible {
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.04);
}

.level-nav a[aria-current="page"] {
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.08);
}

.level-lock {
  flex: none;
  width: 11px;
  height: 12px;
  color: var(--text-lighter);
}

.directory-chapter {
  margin-top: 4rem;
}

.directory-hero + .directory-chapter {
  margin-top: 4.5rem;
}

/* A wider label column than the home page, so a logo has room beside the cards. */
@media (min-width: 761px) {
  .directory-chapter {
    grid-template-columns: 136px minmax(0, 1fr);
    width: min(100%, calc(var(--content) + 18px));
  }
}

.directory-chapter h2 {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  align-self: start;
  min-height: 1.5rem;
}

.section-logo {
  flex: none;
  width: auto;
  max-width: 100%;
  opacity: 0.82;
}

.project-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  text-decoration: none;
  transition: background 0.25s var(--spring), border-color 0.25s var(--spring), transform 0.25s var(--spring);
}

.project-card:hover,
.project-card:focus-visible {
  background: color-mix(in srgb, var(--bg-light) 44%, transparent);
  transform: translateY(-1px);
}

.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-card:active {
  transform: translateY(0);
}

.project-cover {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--panel);
}

.project-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s var(--spring);
}

.project-card:hover .project-cover img {
  transform: scale(1.03);
}

.project-copy {
  display: block;
  padding: 0.75rem 0.3rem 0.3rem;
}

.project-name {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.4rem;
  align-items: baseline;
  color: var(--text-dark);
  font-size: 1.02rem;
  font-weight: 620;
  line-height: 1.3;
}

.project-name span:not(.sr-only) {
  color: var(--text-light);
  font-size: 0.84rem;
  font-weight: 520;
  opacity: 0.78;
}

.project-out {
  align-self: center;
  width: 15px;
  height: 15px;
  margin-left: auto;
  color: var(--text-lighter);
  transition: transform 0.25s var(--spring), color var(--motion-fast) var(--spring);
}

.project-card:hover .project-out {
  color: var(--text-dark);
  transform: translate(1px, -1px);
}

.project-about {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .level-nav a {
    padding-inline: 0.65rem;
    font-size: 0.86rem;
  }

  .directory-chapter,
  .directory-hero + .directory-chapter {
    margin-top: 3rem;
  }
}

@media (max-width: 520px) {
  .project-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-card,
  .project-cover img,
  .project-out {
    transition: none;
  }

  .project-card:hover,
  .project-card:hover .project-cover img,
  .project-card:hover .project-out {
    transform: none;
  }
}

/* All pages: a plain searchable list for the private areas. Hairlines, square corners, one accent. */
.index-search input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text-dark);
  font: inherit;
}

.index-search input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.index-count {
  margin: 0.75rem 0 0.25rem;
  color: var(--text-lighter);
  font-size: 0.85rem;
}

.index-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.index-row {
  border-top: 1px solid var(--line);
}

.index-row:last-child {
  border-bottom: 1px solid var(--line);
}

.index-row[hidden] {
  display: none;
}

.index-row a {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0.25rem;
  text-decoration: none;
}

.index-row a:hover .index-title,
.index-row a:focus-visible .index-title {
  color: var(--accent);
}

.index-row a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.index-title {
  color: var(--text-dark);
  font-weight: 620;
}

.index-about {
  color: var(--text-light);
  font-size: 0.92rem;
}

.index-meta {
  color: var(--text-lighter);
  font-size: 0.8rem;
}

.index-path {
  word-break: break-all;
}

.index-empty {
  margin-top: 1rem;
  color: var(--text-light);
}
