﻿/* Projects page: category tabs and full-width project rows. */

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

.projects-nav {
  padding: 28px 0 0;
  border-bottom: 0;
}

.projects-nav .wrap {
  display: flex;
  justify-content: center;
}

.project-tabs {
  position: relative;
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg2);
  -webkit-overflow-scrolling: touch;
}

.project-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 600 0.88rem/1.2 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease;
}

.project-tab:hover {
  color: var(--fg);
}

.project-tab.is-active {
  color: #ffffff;
}

.tab-indicator {
  position: absolute;
  z-index: 0;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  border-radius: 8px;
  background: var(--accent-dim);
  transition: transform 0.24s ease, width 0.24s ease;
}

.project-panel {
  padding-top: 34px;
}

.project-panel:not([hidden]) {
  animation: panel-in 0.26s ease;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Full-width project rows, content left aligned, status top right. */
.project-rows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(220px, 30%) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg2);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.project-media {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
}

.project-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.project-body {
  min-width: 0;
  padding: 8px 0 4px;
}

.project-row:hover {
  border-color: #30363d;
  transform: translateY(-1px);
}

:root[data-theme="light"] .project-row:hover {
  border-color: #c7d2e0;
}

.project-row-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.project-row h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.97rem;
  letter-spacing: -0.012em;
  line-height: 1.35;
}

.project-row .tag {
  flex: 0 0 auto;
  margin: 0;
  padding: 2px 8px;
  font-size: 0.62rem;
}

.project-row .metric {
  display: block;
  margin-top: 9px;
  font-size: 0.79rem;
  font-style: normal;
}

.project-row p {
  max-width: 78ch;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.project-row .pills {
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(63, 185, 80, 0.3);
}

.project-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--accent-dim);
  border-radius: 7px;
  background: var(--accent-dim);
  color: #ffffff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.15s ease;
}

.project-action:hover {
  border-color: var(--action-hover);
  background: var(--action-hover);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.project-action .arrow-mark {
  transition: transform 0.15s ease;
}

.project-action:hover .arrow-mark {
  transform: translateX(2px);
}

.project-row .pills span {
  padding: 3px 8px;
  font-size: 0.69rem;
}

.project-row .arrow {
  display: inline-block;
  margin-top: 9px;
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .project-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }
}

@media (max-width: 700px) {
  .projects-nav .wrap {
    display: block;
  }

  .project-tabs {
    display: flex;
    width: 100%;
  }

  .project-tab {
    flex: 1;
    padding-inline: 12px;
  }

  .project-row {
    padding: 14px;
  }

  .project-row h3 {
    font-size: 0.94rem;
  }

  .project-row p {
    font-size: 0.86rem;
  }

  .project-foot {
    flex-wrap: wrap;
  }

  .project-action {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-indicator,
  .project-tab,
  .project-panel:not([hidden]),
  .project-row {
    transition: none;
    animation: none;
  }
}

