*, *::before, *::after { box-sizing: border-box; }

footer {
  padding: 1rem;
  margin-top: 2rem;
  color: var(--secondary);
  font-size: .875rem;
  text-align: center;
}

html { overflow-x: clip; }

body {
  font-family: var(--font-body);
  max-width: 860px;
  margin: 0 auto;
  padding: 0;
  background: var(--background);
  color: var(--primary);
}

header {
  padding: .75rem 1rem;
  margin-bottom: .75rem;
}

header ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: 1.2rem;
  min-width: 0;
}

header li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

header li:first-child { flex-shrink: 0; }
header li:last-child { flex-shrink: 1; }

header li + li::before {
  content: '/';
  margin-right: .25rem;
  color: var(--secondary);
}

header a {
  color: var(--primary);
  text-decoration: none;
}

header a:hover {
  color: var(--emphasized);
  text-decoration: underline;
  text-underline-offset: 4px;
}

main > h1, main > p {
  padding-left: 1rem;
  padding-right: 1rem;
}

main > h1 { margin-bottom: .75rem; }
main > p { margin-top: 0; }
.repo-commit-count { color: var(--secondary); }
main > article { padding: 0 1rem; }

.repo-list {
  display: flex;
  flex-direction: column;
}

.repo-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
}

.repo-card:hover { background: var(--highlight); }

.repo-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--emphasized);
}

.repo-desc {
  font-size: 1rem;
  color: var(--primary);
}

.repo-meta {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  color: var(--secondary);
}

details {
  background: var(--highlight);
}

details:first-of-type {
  border-top: 1px solid var(--secondary);
}

summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  min-height: 50px;
  font-family: var(--font-body);
  font-weight: bold;
}

summary::before {
  content: '+';
  font-family: var(--font-mono);
  margin-right: .5rem;
  color: var(--primary);
}

details[open] summary::before {
  content: '−';
}

details[open] summary {
  color: var(--emphasized);
}


summary span {
  color: var(--secondary);
  margin-left: auto;
}

details > *:not(summary) {
  padding: 0 1rem .75rem;
  margin-bottom: 0;
}

details > ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

details ul li {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 50px;
  padding: 0 1rem;
  color: var(--secondary);
  font-family: var(--font-mono);
  font-size: 1rem;
}

details ul li:has(a), details ul li:has(button) {
  padding: 0;
}

details ul li a,
details ul li button {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  min-height: 50px;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 1rem;
}

details ul li a:hover,
details ul li button:hover {
  background: var(--background);
}

/* First span grows to fill available space in both link and button rows */
details ul li a span:first-child,
details ul li button span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--primary);
}

/* Clone rows: animate URL text on copy, label fixed width on right */
details ul li button span:first-child { transition: opacity .1s; }
details ul li button span:nth-child(2) {
  flex-shrink: 0;
  min-width: 4rem;
  text-align: right;
  color: var(--secondary);
}

/* Branch/tag rows: remaining spans fixed on the right */
details ul li a span:not(:first-child) {
  flex-shrink: 0;
  color: var(--secondary);
}
