/**
 * Author archive — custom profile stylesheet.
 *
 * Enqueued only when the queried user has `use_custom_profile = true`
 * (see upcomer_author_archive_assets() in functions.php). Author pages for
 * users who haven't opted in fall through to the default archive template and
 * never load this file.
 *
 * Tokens reuse the gamurs top-nav container so the page lines up with the site
 * nav at every breakpoint; colours reuse the existing site palette (the light
 * surface tokens shared by category.css + the editorial red accent already used
 * by team-member-grid / highlight-card-row — no new colors per CLAUDE.md).
 */

.author-archive {
	--aa-fg:          var(--wp--custom--light--general-color--h-1, #171717);
	--aa-fg-body:     var(--wp--custom--light--general-color--paragraph, #494949);
	--aa-fg-muted:    var(--wp--custom--light--general-color--caption, #5D5D5D);
	--aa-rule:        rgba(15, 15, 15, 0.12);
	--aa-rule-strong: rgba(15, 15, 15, 0.22);
	--aa-surface:     var(--wp--custom--light--general-color-bg--minimal, #FEFEFE);
	--aa-accent:      #c81e1e; /* Established editorial red — see docs/blocks-color-tokens.md. */

	color: var(--aa-fg-body);
	background: var(--aa-surface);
	padding-block: clamp(1.25rem, 2.5vw, 2rem) clamp(2.5rem, 5vw, 4rem);
}

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

/* Container — same width tokens the gamurs top-nav uses. */
.author-archive__inner {
	max-width: calc(1px * var(--wp--custom--top-nav--primary-container-spacing--desktop--max-width, 1200));
	margin-inline: auto;
	padding-inline: clamp(1rem, 3vw, 1.5rem);
}

@media (max-width: 1247px) {
	.author-archive__inner {
		max-width: calc(1px * var(--wp--custom--top-nav--primary-container-spacing--laptop--max-width, 1200));
	}
}

@media (max-width: 943px) {
	.author-archive__inner {
		max-width: unset;
		padding-inline: clamp(0.75rem, 3vw, 1.25rem);
	}
}

/* Home-only breadcrumb above the profile hero (custom-profile author path). */
.author-archive__inner > .upcomer-breadcrumb {
	margin-bottom: clamp(1rem, 2.5vw, 1.75rem);
}

/* ---- Hero ----------------------------------------------------------- */

.author-archive__hero {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	grid-template-areas:
		"photo    identity"
		"photo    bio"
		"photo    expertise";
	column-gap: clamp(1.5rem, 3vw, 2.5rem);
	row-gap: clamp(0.75rem, 1.5vw, 1.25rem);
	align-items: start;
	padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
	border-bottom: 1px solid var(--aa-rule);
}

/* Photo — round, left column, spans the identity/bio/expertise rows. */
.hero__photo {
	grid-area: photo;
	width: 240px;
	height: 240px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--aa-rule);
	color: var(--aa-fg-muted);
}

.hero__photo img,
.hero__photo svg {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero__identity {
	grid-area: identity;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
}

.hero__name {
	margin: 0;
	font-family: "Barlow Condensed", "Barlow", sans-serif;
	font-weight: 800;
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	line-height: 1.05;
	color: var(--aa-fg);
}

.hero__role {
	margin: 0;
	font-family: "Barlow", sans-serif;
	font-weight: 600;
	font-size: clamp(0.9375rem, 1.4vw, 1.0625rem);
	color: var(--aa-fg-muted);
}

/* Verified-expert badge. */
.badge--verified-expert {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.25rem 0.625rem;
	border-radius: 999px;
	background: var(--aa-accent);
	color: #fff;
	font-family: "Barlow", sans-serif;
	font-weight: 700;
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.badge--verified-expert .badge__icon {
	width: 1rem;
	height: 1rem;
	flex: none;
}

/* Social icon row. */
.hero__socials {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.25rem 0 0;
	padding: 0;
	list-style: none;
}

.hero__social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border: 1px solid var(--aa-rule-strong);
	border-radius: 50%;
	color: var(--aa-fg);
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.hero__social-link svg {
	width: 1.25rem;
	height: 1.25rem;
}

.hero__social-link:hover,
.hero__social-link:focus-visible {
	background: var(--aa-fg);
	color: var(--aa-surface);
	border-color: var(--aa-fg);
}

/* Bio + expand toggle. */
.hero__bio {
	grid-area: bio;
	max-width: 64ch;
}

.hero__bio-summary {
	margin: 0;
	font-family: "Barlow", sans-serif;
	font-size: clamp(0.9375rem, 1.3vw, 1.0625rem);
	line-height: 1.6;
	color: var(--aa-fg-body);
}

.hero__bio-full {
	margin-top: 0.75rem;
	font-family: "Barlow", sans-serif;
	font-size: clamp(0.9375rem, 1.3vw, 1.0625rem);
	line-height: 1.6;
	color: var(--aa-fg-body);
}

.hero__bio-full[hidden] {
	display: none;
}

.hero__bio-full > :first-child {
	margin-top: 0;
}

.hero__bio-full > :last-child {
	margin-bottom: 0;
}

.bio-toggle {
	margin-top: 0.5rem;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	font-family: "Barlow", sans-serif;
	font-weight: 700;
	font-size: 0.875rem;
	letter-spacing: 0.02em;
	color: var(--aa-accent);
}

.bio-toggle:hover,
.bio-toggle:focus-visible {
	text-decoration: underline;
}

/* Expertise pills. */
.hero__expertise {
	grid-area: expertise;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hero__expertise .pill {
	display: inline-flex;
	align-items: center;
	padding: 0.3125rem 0.75rem;
	border: 1px solid var(--aa-accent);
	border-radius: 999px;
	font-family: "Barlow", sans-serif;
	font-weight: 700;
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--aa-accent);
	text-decoration: none;
	transition: background-color 150ms ease, color 150ms ease;
}

a.pill:hover,
a.pill:focus-visible {
	background: var(--aa-accent);
	color: #fff;
}

/* Mobile — stack the hero into a single centred column. */
@media (max-width: 720px) {
	.author-archive__hero {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"photo"
			"identity"
			"bio"
			"expertise";
		justify-items: center;
		text-align: center;
	}

	.hero__photo {
		width: 120px;
		height: 120px;
	}

	.hero__identity {
		align-items: center;
	}

	.hero__bio {
		text-align: left;
	}
}

/* ---- Publications --------------------------------------------------- */

.author-archive__publications {
	margin-top: clamp(1.75rem, 3.5vw, 2.75rem);
}

.author-archive .section-eyebrow {
	margin: 0 0 clamp(1rem, 2vw, 1.5rem);
	font-family: "Barlow Condensed", "Barlow", sans-serif;
	font-weight: 800;
	font-size: clamp(0.9375rem, 1.4vw, 1.0625rem);
	line-height: 1.2;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--aa-fg);
}

.publications-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: clamp(1.25rem, 2.5vw, 1.75rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* gamurs-tile variant — fixed 3-up grid to match the Top News layout. */
.publications-grid--tiles {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
	.publications-grid--tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.publications-grid--tiles {
		grid-template-columns: minmax(0, 1fr);
	}
}

.publications-grid > li {
	display: block;
	min-width: 0;
}

.author-archive__empty {
	margin: 0;
	font-family: "Barlow", sans-serif;
	color: var(--aa-fg-muted);
}

/* ---- Pagination (matches category.css) ------------------------------ */

.author-archive__pagination {
	margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
}

.author-archive__pagination .page-numbers {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.375rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: "Barlow", sans-serif;
	font-weight: 600;
	font-size: clamp(0.8125rem, 1vw, 0.9375rem);
}

.author-archive__pagination .page-numbers > li {
	display: block;
}

.author-archive__pagination .page-numbers a,
.author-archive__pagination .page-numbers span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding-inline: 0.625rem;
	border: 1px solid var(--aa-rule-strong);
	border-radius: 999px;
	background: transparent;
	color: var(--aa-fg);
	text-decoration: none;
	letter-spacing: 0.04em;
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.author-archive__pagination .page-numbers a:hover,
.author-archive__pagination .page-numbers a:focus-visible {
	background: var(--aa-fg);
	color: var(--aa-surface);
	border-color: var(--aa-fg);
}

.author-archive__pagination .page-numbers .current {
	background: var(--aa-fg);
	color: var(--aa-surface);
	border-color: var(--aa-fg);
}

.author-archive__pagination .page-numbers .dots {
	border-color: transparent;
	background: transparent;
}

.author-archive__pagination .page-numbers .prev,
.author-archive__pagination .page-numbers .next {
	font-weight: 400;
	font-size: 1.125rem;
}
