/* 作者頁（author.php）與作者列表頁（templates/authors-page.php）樣式（WEB-5028）。
   只在這兩頁載入（inc/authors.php 的 sbt_authors_enqueue_assets），相依 style.css 的 :root token
   與 archivePage 版面；個人資料卡與作者卡的版型（頭像＋名字同列、圓形頭像、padding／陰影／hover）
   對齊 /about/「5 個面向」的 .about-topic-card（about.css）。 */

/* ── 共用：頭像（1:1，未設定或載入失敗時顯示品牌色剪影）──────────────────── */
.page-authors .authorAvatar {
	position: relative;
	flex: 0 0 auto;
	display: block;
	border: 1px solid rgba(0, 109, 99, 0.18);
	border-radius: 50%;
	background: var(--color-brand-soft);
	overflow: hidden;
}

.page-authors .authorAvatar__fallback {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 60%;
	height: 60%;
	fill: #a6c1bb;
}

.page-authors .authorAvatar img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
}

/* ── 作者頁：個人資料區（版型同 .about-topic-card：頭像＋名字同列，下接職稱／簡介）──── */
.page-authors .authorProfile {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: var(--space-6);
	padding: 30px;
	border: 1px solid var(--color-border);
	border-radius: 14px;
	background: #fff;
	box-shadow: var(--shadow-soft);
}

.page-authors .authorProfile__head {
	display: flex;
	align-items: center;
	gap: 16px;
}

.page-authors .authorProfile__avatar {
	width: 72px;
	height: 72px;
}

.page-authors .authorProfile__name {
	/* 無空格的長英文顯示名稱（如帳號名）不撐破卡片 */
	overflow-wrap: anywhere;
	margin: 0;
	color: var(--color-brand-dark);
	font-family: var(--font-serif);
	font-weight: 800;
	font-size: 32px;
	line-height: 1.2;
}

.page-authors .authorProfile__title {
	margin: 0;
	color: var(--color-text-primary);
	font-family: var(--font-serif);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
}

.page-authors .authorProfile__bio {
	margin: 0;
	color: var(--color-text-secondary);
	font-size: 16px;
	line-height: 1.8;
	white-space: pre-line;
}

.page-authors .authorProfile__fields {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2) var(--space-3);
}

.page-authors .authorProfile__fieldsLabel {
	color: var(--color-text-tertiary);
	font-size: 13px;
	font-weight: 700;
}

.page-authors .authorFields {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.page-authors .authorFields li,
.page-authors .authorFields__item {
	padding: 4px 12px;
	border-radius: var(--radius-pill);
	background: var(--color-tag-bg);
	color: var(--color-tag-text);
	font-size: 13px;
	line-height: 1.5;
}

/* 文章數＋排序列在 .archivePage__hero 之外（上方是個人資料卡），需自補 hero 的 padding-bottom，
   否則排序 tab 的底線會直接貼在下方分隔線上（與分類頁 term-archive.php 對齊）。 */
.page-authors .authorPage__countRow {
	margin-top: var(--space-8);
	padding-bottom: var(--space-6);
}

/* ── 作者列表頁：卡片格（格線維持三欄靠左；卡片內部同 .about-topic-card）──────── */
.page-authors .authorsGrid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--space-4);
	margin: var(--space-6) 0 var(--space-12);
	padding: 0;
	list-style: none;
}

.page-authors .authorCard {
	height: 100%;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 30px;
	border: 1px solid var(--color-border);
	border-radius: 14px;
	background: #fff;
	box-shadow: var(--shadow-soft);
	color: inherit;
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.page-authors .authorCard:hover,
.page-authors .authorCard:focus-visible {
	transform: translateY(-2px);
	box-shadow: var(--shadow-card, 0 4px 16px rgba(0, 0, 0, 0.06));
}

.page-authors .authorCard__head {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

/* 人像卡的頭像是辨識主體，比面向卡的 46px 圖示放大一級 */
.page-authors .authorCard__avatar {
	width: 56px;
	height: 56px;
}

.page-authors .authorCard__identity {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.page-authors .authorCard__name {
	/* 無空格的長英文顯示名稱（如帳號名）不撐破卡片 */
	overflow-wrap: anywhere;
	color: var(--color-brand-dark);
	font-family: var(--font-serif);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.3;
}

/* 職稱 · 文章數：同屬身分資訊，收成名字下的一行 meta。職稱過長時只截職稱（…），
   文章數永遠留在同一行；完整職稱見 title 屬性與作者頁。 */
.page-authors .authorCard__meta {
	display: flex;
	align-items: baseline;
	gap: 6px;
	min-width: 0;
	font-size: 14px;
	line-height: 1.5;
}

.page-authors .authorCard__title {
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--color-text-primary);
	font-weight: 700;
}

.page-authors .authorCard__metaSep,
.page-authors .authorCard__count {
	flex: 0 0 auto;
	white-space: nowrap;
	color: var(--color-text-tertiary);
}

/* 簡介＝面向卡的 desc；限 3 行避免同排卡片高度落差過大，完整內容在作者頁 */
.page-authors .authorCard__bio {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	color: var(--color-text-secondary);
	font-size: 15px;
	line-height: 1.7;
}

/* 關注領域貼卡片底部：同排卡片簡介長短不一時，留白落在簡介下方，標籤列仍對齊 */
.page-authors .authorCard__fields {
	margin-top: auto;
}

.page-authors .authorFields__item--more {
	background: transparent;
	color: var(--color-text-tertiary);
}

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

@media (max-width: 640px) {
	.page-authors .authorsGrid {
		grid-template-columns: 1fr;
	}

	.page-authors .authorProfile__avatar {
		width: 60px;
		height: 60px;
	}

	.page-authors .authorProfile__name {
		font-size: 26px;
	}
}
