/* Explorer surfaces, part 2 — tables, code, forms, focus, scrollbars
   and the mobile rules. Loaded after app-grid.css. */
/* ── Tables ────────────────────────────────────────────── */
table {
	border-collapse: collapse;
}
th,
td {
	border-color: var(--border);
}
th {
	background: var(--bg-card);
	font-family: var(--font-mono);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-tertiary);
}

/* ── Code blocks ───────────────────────────────────────── */
code,
.codeblock {
	font-family: var(--font-mono);
	font-size: 0.82rem;
}
code {
	border: 1px solid var(--border);
	border-radius: 5px;
	background: var(--bg-elevated);
	padding: 0.08em 0.36em;
	color: var(--text-primary);
}
pre,
pre.codeblock,
.markdown-content pre {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg-card);
	padding: var(--space-3) var(--space-4);
	overflow-x: auto;
	line-height: 1.65;
}
pre code {
	border: 0;
	background: none;
	padding: 0;
}
.markdown-content {
	max-width: var(--measure);
	line-height: var(--leading-body);
	color: var(--text-secondary);
}
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
	font-family: var(--font-display);
	letter-spacing: -0.02em;
	color: var(--text-primary);
}
.markdown-content a {
	color: var(--accent);
}

/* ── Forms + buttons ───────────────────────────────────── */
input,
select,
textarea,
button {
	font-family: var(--font-body);
	font-size: 0.86rem;
}
input[type="text"],
input[type="search"],
select,
textarea {
	border: 1px solid var(--border-strong);
	border-radius: 8px;
	background: var(--bg-elevated);
	color: var(--text-primary);
}
input:focus,
select:focus,
textarea:focus {
	border-color: var(--accent);
	outline: none;
}
button,
button.outline,
button.regular {
	border-radius: 8px;
	border: 1px solid var(--border-strong);
	background: var(--bg-elevated);
	color: var(--text-primary);
	font-family: var(--font-display);
	font-weight: 600;
	letter-spacing: -0.01em;
	transition:
		border-color var(--rmm-dur) var(--rmm-ease),
		color var(--rmm-dur) var(--rmm-ease);
}
button:hover,
button.outline:hover {
	border-color: var(--accent);
	color: var(--accent);
}

/* ── Links, focus, scrollbars ──────────────────────────── */
a {
	color: var(--accent);
	transition: color var(--rmm-dur) var(--rmm-ease);
}
a:hover {
	color: var(--accent-bright);
}
/* The shipped index.css removes every outline. One visible ring everywhere.
   Pagination (`text-button` / `current-page`, and any aria-current control)
   is styled by the Svelte bundle with a higher-specificity `outline: none`,
   so it gets the ring by name. */
:focus-visible,
.text-button:focus-visible,
.current-page:focus-visible,
button[aria-current]:focus-visible {
	outline: 2px solid var(--accent) !important;
	outline-offset: 2px;
	border-radius: 6px;
}
/* The pager's current page is focusable but not `:focus-visible` (the bundle
   focuses it programmatically with tabindex=-1), so it takes the ring on
   `:focus` — otherwise it is the one focusable control with no visible state. */
.current-page:focus,
button[aria-current]:focus {
	outline: 2px solid var(--accent) !important;
	outline-offset: 2px;
	border-radius: 6px;
}
::selection {
	background: rgba(0, 255, 136, 0.22);
	color: var(--text-primary);
}
* {
	scrollbar-width: thin;
	scrollbar-color: #2c2c2c transparent;
}
*::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}
*::-webkit-scrollbar-thumb {
	border: 3px solid var(--bg-deepest);
	border-radius: 99px;
	background: #2c2c2c;
}
*::-webkit-scrollbar-thumb:hover {
	background: #3a3a3a;
}

/* ── Footer safety: the SPA paints past the flow on some routes ── */
.content ~ #rmm-footer,
#rmm-footer {
	margin-top: auto;
}

/* ── Mobile: one column, nothing overflows ─────────────── */
@media (max-width: 720px) {
	.repo-grid {
		grid-template-columns: 1fr;
		gap: var(--space-3);
		padding: var(--space-2) 16px var(--space-5);
	}
	.repo-card,
	.repo-card.compact {
		min-height: 0;
		padding: var(--space-3);
	}
	.repo-name {
		font-size: 1rem;
	}
	.sidebar-wrapper {
		border-right: 0;
		border-bottom: 1px solid var(--border);
	}
	pre,
	pre.codeblock {
		padding: var(--space-3);
		font-size: 0.76rem;
	}
}
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
	.repo-card:hover {
		transform: none;
	}
}
