/**
 * Author page — info card (avatar + name/role/socials/bio) and posts heading.
 */

.author-card {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

/* ---------- Photo ---------- */

.author-card__photo {
	overflow: hidden;
	border-radius: var(--radius-md);
}

.author-card__photo img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

/* ---------- Body ---------- */

.author-card__body {
	flex: 1;
	min-width: 0;
	padding: 15px;
	border: 3px solid var(--color-gray-border);
	border-radius: var(--radius-md);
}

.author-card__name {
	margin: 0;
	font-size: var(--font-size-h1);
	font-weight: var(--font-weight-bold);
	line-height: 1.1;
}

.author-card__role {
	margin-top: 12px;
	font-family: var(--font-family);
	font-size: 18px;
	font-weight: var(--font-weight-medium);
	line-height: 1.4;
}

.author-card__socials {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.author-social {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 1px solid var(--color-gray-border);
	border-radius: var(--radius-pill);
	transition: border-color var(--transition-hover);
}

.author-social img {
	display: block;
	width: 15px;
	height: 15px;
}

.author-social:hover,
.author-social:focus-visible {
	border-color: var(--color-pink);
}

.author-card__bio {
	margin-top: 16px;
	font-size: 16px;
	line-height: 1.4;
}

.author-card__bio p {
	margin: 0 0 16px;
}

.author-card__bio p:last-child {
	margin-bottom: 0;
}

/* ---------- Posts heading ---------- */

.author-posts-title {
	margin: 40px 0 20px;
	font-size: var(--font-size-h2);
	font-weight: var(--font-weight-bold);
	line-height: 1;
}

/* ---------- Desktop layout ---------- */

@media (min-width: 768px) {
	.author-card {
		flex-direction: row;
		align-items: stretch;
		gap: 15px;
		min-height: 300px;
	}

	/* Photo column width = one posts-grid card: (container − 2 gaps of 15px) / 3. */
	.author-card__photo {
		position: relative;
		flex: 0 0 calc((100% - 30px) / 3);
	}

	/* Cover image fills the column height without dictating it (height comes from
	   the text block, min 300px). */
	.author-card__photo img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
	}

	.author-card__body {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"name socials"
			"role role"
			"bio  bio";
		align-items: start;
		column-gap: 16px;
		padding: 20px 25px;
	}

	.author-card__name {
		grid-area: name;
	}

	.author-card__socials {
		grid-area: socials;
		margin-top: 0;
	}

	.author-card__role {
		grid-area: role;
	}

	.author-card__bio {
		grid-area: bio;
	}
}

