/* ==========================================================================
   detail.css — per-project detail page (auto-generated)
   Layered on top of hub.css; reuses :root variables and the lightbox.
   ========================================================================== */

.detail-body { background: var(--bg); }

.detail-header {
  background: linear-gradient(180deg, var(--bg-elev) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
  text-decoration: none;
}
.back-link:hover { color: var(--accent); }

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.detail-header h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.detail-tagline {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 60ch;
  margin: 1rem 0 0;
}

.detail-meta {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-faint);
  align-items: center;
}
.detail-meta .external-link {
  color: var(--accent);
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.8rem;
  text-decoration: none;
}
.detail-meta .external-link:hover {
  background: var(--accent-soft);
  text-decoration: none;
}
.detail-meta .ext { opacity: 0.7; margin-left: 2px; }

.detail-header .tags { margin-top: 1rem; }
.detail-header .pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.7rem;
}

.detail-progress {
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 480px;
}
.detail-progress {
  height: auto;
  background: transparent;
}
.detail-progress-fill {
  height: 8px;
  flex: 1;
  background: linear-gradient(90deg, var(--accent) 0%, var(--green) 100%);
  border-radius: 999px;
  position: relative;
}
.detail-progress-pct {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.detail-progress > div:not(.detail-progress-fill) {
  flex: 1;
  height: 8px;
  background: var(--bg-elev);
  border-radius: 999px;
}

.meta-line {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.meta-line code {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.4rem;
  margin: 0 0.15rem;
  font-size: 0.78rem;
  color: var(--text);
}

/* ---- Hero strip below the header ---- */
.detail-hero {
  height: 280px;
  background: var(--bg-elev) no-repeat center/cover;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) { .detail-hero { height: 180px; } }

/* ---- Main column ---- */
.detail-main {
  padding: 2rem 0 4rem;
  max-width: 1000px;
}
.detail-section {
  margin: 0 0 2.5rem;
}
.detail-section h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ---- Stats panel ---- */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}
.stat-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-mono);
}

/* ---- How-to-use ---- */
.howto-row {
  margin-bottom: 1rem;
}
.howto-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.howto-code {
  background: #0a0c10;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  color: #cdd2dc;
}

/* ---- Detail gallery (clickable -> lightbox) ---- */
.detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.detail-gallery-item {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.detail-gallery-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.detail-gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  cursor: zoom-in;
}
.detail-gallery-item figcaption {
  padding: 0.5rem 0.8rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ---- Docs list ---- */
.detail-doclist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.detail-doclist li {
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--border);
}
.detail-doclist li:last-child { border-bottom: none; }
.detail-doclist a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}
.detail-doclist .ext { opacity: 0.6; }

/* ---- Notes ---- */
.detail-section p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0;
}

/* Reuse hub.css's .lightbox for image zoom — hub.js already wires it. */
/* The script attaches to any .detail-gallery-item img with data-full set,
   alongside the hub's .gallery-strip img. */

@media (max-width: 640px) {
  .detail-header h1 { font-size: 1.6rem; }
  .detail-main { padding: 1.5rem 0 3rem; }
  .stats-panel { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
