/**
 * GP Base — author archive.
 *
 * Everything here reads the theme's existing tokens (--gp-accent, --gp-radius,
 * --card, --line, fonts) so dark mode and per-page accent overrides keep
 * working. Only the bento's 20px cell radius is a local addition.
 */

.author-page {
	--gp-bento-radius: 20px;
	--gp-bento-gap: 12px;
	padding-bottom: 48px;
}

/* Breadcrumb ------------------------------------------------------------- */

.author-page .gp-crumbs {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 18px 0 6px;
	font-size: 13px;
	color: var(--gp-muted, #6b7280);
}

.author-page .gp-crumbs a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.author-page .gp-crumbs a:hover,
.author-page .gp-crumbs a:focus-visible {
	color: var(--gp-accent);
	border-bottom-color: currentColor;
}

.author-page .gp-crumbs-sep {
	opacity: 0.5;
}

.author-page .gp-crumbs-cur {
	color: var(--gp-text, inherit);
	font-weight: 600;
}

/* Top block: author box left, bento right --------------------------------- */

.author-top {
	display: grid;
	grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
	gap: 20px;
	align-items: start;
	margin: 10px 0 22px;
}

/* Author box ------------------------------------------------------------- */

.gp-author-hero {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	padding: 22px;
	background: var(--card, #fff);
	border: 1px solid var(--gp-line, #e6e6e9);
	border-radius: var(--gp-bento-radius);
	box-shadow: 0 1px 2px rgba(16, 18, 22, 0.04), 0 12px 28px -18px rgba(16, 18, 22, 0.22);
}

.gp-ah-photo img {
	display: block;
	width: 160px;
	height: 160px;
	max-width: none;
	border-radius: 16px;
	object-fit: cover;
	background: var(--gp-line, #eee);
}

.gp-ah-body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.gp-ah-eyebrow {
	margin: 0;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--gp-accent);
}

.gp-ah-name {
	margin: 0;
	font-family: var(--gp-font-display, inherit);
	font-size: clamp(24px, 2.4vw, 32px);
	line-height: 1.1;
}

.gp-ah-role {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--gp-muted, #6b7280);
}

.gp-ah-role a {
	color: var(--gp-accent);
	text-decoration: none;
}

.gp-ah-bio {
	margin: 4px 0 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--gp-muted, #6b7280);
}

.gp-ah-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.gp-ah-meta li {
	display: flex;
	flex-direction: column;
}

.gp-ah-meta-label {
	font-size: 10px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--gp-muted, #6b7280);
}

.gp-ah-meta-value {
	font-size: 13px;
	font-weight: 600;
}

.gp-ah-socials {
	display: flex;
	gap: 8px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.gp-ah-socials a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 1px solid var(--gp-line, #e6e6e9);
	border-radius: 50%;
	color: var(--gp-muted, #6b7280);
	text-decoration: none;
}

.gp-ah-socials a:hover,
.gp-ah-socials a:focus-visible {
	color: var(--gp-accent);
	border-color: var(--gp-accent);
}

.gp-ah-socials svg {
	width: 15px;
	height: 15px;
}

/* Bento grid ------------------------------------------------------------- */

.gp-bento {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: var(--gp-bento-gap);
}

.gp-bento-cell {
	grid-column: span 2;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px;
	background: var(--card, #fff);
	border: 1px solid var(--gp-line, #e6e6e9);
	border-radius: var(--gp-bento-radius);
	box-shadow: 0 1px 2px rgba(16, 18, 22, 0.04), 0 12px 28px -18px rgba(16, 18, 22, 0.22);
}

.gp-bento-wide {
	grid-column: span 3;
}

.gp-bc-label {
	margin: 0;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--gp-muted, #6b7280);
}

.gp-bc-figure {
	margin: 2px 0 0;
	font-family: var(--gp-font-display, inherit);
	font-size: clamp(26px, 2.6vw, 34px);
	font-weight: 700;
	line-height: 1;
}

.gp-bc-figure-unit {
	font-family: var(--gp-font-body, inherit);
	font-size: 12px;
	font-weight: 600;
	color: var(--gp-muted, #6b7280);
}

.gp-bc-sub {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--gp-accent);
}

.gp-bc-note {
	margin: auto 0 0;
	padding-top: 6px;
	font-size: 11px;
	color: var(--gp-muted, #6b7280);
}

.gp-bc-empty {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--gp-muted, #6b7280);
}

/* Share bars (content mix + beats) -------------------------------------- */

.gp-bar-list,
.gp-beat-list {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.gp-bar-list li {
	display: grid;
	grid-template-columns: 66px minmax(0, 1fr) 34px;
	align-items: center;
	gap: 8px;
	font-size: 12px;
}

.gp-bar-name {
	color: var(--gp-muted, #6b7280);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gp-bar-track {
	display: block;
	height: 6px;
	border-radius: 999px;
	background: var(--gp-line, #ececf0);
	overflow: hidden;
}

.gp-bar-fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--gp-accent);
}

.gp-bar-value,
.gp-beat-count {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	text-align: right;
}

.gp-beat-list {
	counter-reset: gp-beat;
}

.gp-beat-list li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 96px 44px;
	align-items: center;
	gap: 10px;
	font-size: 13px;
}

.gp-beat-name {
	color: inherit;
	text-decoration: none;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gp-beat-name:hover,
.gp-beat-name:focus-visible {
	color: var(--gp-accent);
}

/* Review buckets -------------------------------------------------------- */

.gp-bucket-list {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 12px;
	color: var(--gp-muted, #6b7280);
}

.gp-bucket-list li {
	display: flex;
	justify-content: space-between;
	gap: 10px;
}

.gp-bucket-list li span:last-child {
	font-weight: 600;
	color: var(--gp-text, inherit);
	font-variant-numeric: tabular-nums;
}

/* Year sparkline -------------------------------------------------------- */

.gp-spark {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 92px;
	margin: 10px 0 0;
}

.gp-spark-col {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: center;
	height: 100%;
	gap: 4px;
}

.gp-spark-bar {
	display: block;
	width: 100%;
	min-height: 2px;
	border-radius: 4px 4px 2px 2px;
	background: color-mix(in srgb, var(--gp-accent) 55%, var(--gp-line, #ececf0));
}

.gp-spark-col.is-peak .gp-spark-bar {
	background: var(--gp-accent);
}

.gp-spark-year {
	font-size: 9px;
	line-height: 1;
	color: var(--gp-muted, #6b7280);
	font-variant-numeric: tabular-nums;
}

/* Filter bar ------------------------------------------------------------ */

.gp-author-filters {
	margin: 0 0 16px;
}

.gp-af-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 12px;
	background: var(--card, #fff);
	border: 1px solid var(--gp-line, #e6e6e9);
	border-radius: var(--gp-radius, 10px);
}

.gp-af-form select,
.gp-af-form input[type="search"] {
	max-width: 100%;
	padding: 8px 10px;
	font: inherit;
	font-size: 13px;
	color: inherit;
	background: transparent;
	border: 1px solid var(--gp-line, #e6e6e9);
	border-radius: var(--gp-radius, 10px);
}

.gp-af-search {
	flex: 1 1 200px;
}

.gp-af-search input[type="search"] {
	width: 100%;
}

.gp-af-submit {
	padding: 9px 16px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: var(--gp-accent);
	border: 0;
	border-radius: var(--gp-radius, 10px);
	cursor: pointer;
}

.gp-af-submit:hover,
.gp-af-submit:focus-visible {
	filter: brightness(0.94);
}

.gp-af-clear {
	font-size: 13px;
	font-weight: 600;
	color: var(--gp-accent);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

.gp-af-result {
	margin: 10px 0 0;
	font-size: 13px;
	color: var(--gp-muted, #6b7280);
}

/* Grid, ad row, empty state -------------------------------------------- */

.author-ad-row {
	grid-column: 1 / -1;
}

.author-ad-row:empty {
	display: none;
}

.author-paging {
	margin: 26px 0 0;
	display: flex;
	justify-content: center;
}

.author-empty {
	padding: 42px 20px;
	text-align: center;
	background: var(--card, #fff);
	border: 1px solid var(--gp-line, #e6e6e9);
	border-radius: var(--gp-radius, 10px);
}

.author-empty-title {
	margin: 0 0 6px;
	font-size: 18px;
}

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

/* Staggered reveal -------------------------------------------------------
 * CSS-only on purpose. An IntersectionObserver version left off-screen cards
 * at opacity 0 until they were scrolled to, which means any failure of that
 * script renders invisible articles. A keyframe animation always completes,
 * and fill-mode backwards (not both) keeps the element's own styles after it
 * ends, so the theme's card hover transform still works.
 */

@keyframes gp-author-rise {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.author-grid[data-gp-reveal] > * {
	animation: gp-author-rise 0.42s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}

.gp-bento-cell {
	animation: gp-author-rise 0.42s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}

.author-grid[data-gp-reveal] > :nth-child(1),
.gp-bento-cell:nth-child(1) { animation-delay: 0ms; }
.author-grid[data-gp-reveal] > :nth-child(2),
.gp-bento-cell:nth-child(2) { animation-delay: 45ms; }
.author-grid[data-gp-reveal] > :nth-child(3),
.gp-bento-cell:nth-child(3) { animation-delay: 90ms; }
.author-grid[data-gp-reveal] > :nth-child(4),
.gp-bento-cell:nth-child(4) { animation-delay: 135ms; }
.author-grid[data-gp-reveal] > :nth-child(5),
.gp-bento-cell:nth-child(5) { animation-delay: 180ms; }
.author-grid[data-gp-reveal] > :nth-child(6) { animation-delay: 225ms; }
.author-grid[data-gp-reveal] > :nth-child(7) { animation-delay: 270ms; }
.author-grid[data-gp-reveal] > :nth-child(8) { animation-delay: 315ms; }
.author-grid[data-gp-reveal] > :nth-child(9) { animation-delay: 360ms; }
.author-grid[data-gp-reveal] > :nth-child(n + 10) { animation-delay: 405ms; }

@media (prefers-reduced-motion: reduce) {
	.author-grid[data-gp-reveal] > *,
	.gp-bento-cell {
		animation: none;
	}
}

/* Dark mode — the "dark instrument" treatment --------------------------- */

html[data-theme="dark"] .gp-bento-cell,
html[data-theme="dark"] .gp-author-hero {
	background: color-mix(in srgb, var(--card, #14161a) 92%, #000 8%);
	box-shadow: none;
}

html[data-theme="dark"] .gp-bc-figure,
html[data-theme="dark"] .gp-ah-name {
	color: #fff;
}

html[data-theme="dark"] .gp-spark-bar {
	background: color-mix(in srgb, var(--gp-accent) 70%, #000 30%);
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 1100px) {
	.author-top {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 860px) {
	.gp-bento {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.gp-bento-cell {
		grid-column: span 1;
	}

	.gp-bento-wide {
		grid-column: span 2;
	}
}

@media (max-width: 560px) {
	.gp-author-hero {
		flex-direction: column;
	}

	.gp-ah-photo img {
		width: 96px;
		height: 96px;
	}

	.gp-bento {
		grid-template-columns: minmax(0, 1fr);
	}

	.gp-bento-cell,
	.gp-bento-wide {
		grid-column: span 1;
	}

	.gp-beat-list li {
		grid-template-columns: minmax(0, 1fr) 60px 36px;
	}
}
