/* Cẩm Giang — author.css: danh mục tác giả và trang một tác giả. */

/* ===== Danh mục ===== */
.cg-authors__head {
	padding: clamp(20px, 2.6vw, 30px) 0 clamp(22px, 2.6vw, 30px);
	border-bottom: 1px solid var(--cg-border);
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
}

.cg-authors__intro {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 62ch;
}

.cg-authors__title {
	margin: 0;
	font-family: var(--cg-font-serif);
	font-size: clamp(30px, 5vw, 46px);
	line-height: 1.12;
	font-weight: 500;
	letter-spacing: -0.01em;
}

.cg-authors__desc {
	margin: 0;
	font-size: clamp(14px, 1.4vw, 15.5px);
	line-height: 1.75;
	color: var(--cg-text-soft);
	text-wrap: pretty;
}

.cg-authors__search {
	display: flex;
	align-items: center;
	gap: 9px;
	border-bottom: 1px solid var(--cg-border-search);
	padding: 8px 2px;
	width: min(280px, 100%);
}

.cg-authors__search input {
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	font-size: 14px;
	color: var(--cg-text);
	width: 100%;
}

.cg-authors__letters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: clamp(18px, 2.2vw, 24px) 0 clamp(16px, 2vw, 20px);
	border-bottom: 1px solid var(--cg-border);
}

/* Nút thật nên phải xoá kiểu mặc định của <button>. */
.cg-authors__letter {
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--cg-border-btn);
	background: var(--cg-bg);
	color: var(--cg-text-footer);
	font: inherit;
	font-size: 13.5px;
	font-weight: 400;
	letter-spacing: 0.06em;
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.cg-authors__letter.is-active {
	border-color: var(--cg-accent);
	background: var(--cg-accent);
	color: var(--cg-on-dark);
	font-weight: 600;
}

/* Thiết kế dùng #d3ccc3; token gần nhất là --cg-text-ghost (#c9c2b8). Dùng token,
   lệch đã ghi ở spec §8 — đừng thêm token mới. */
.cg-authors__letter[disabled] {
	color: var(--cg-text-ghost);
	cursor: default;
}

.cg-authors__list {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0 clamp(24px, 3.4vw, 48px);
	border-top: 1px solid var(--cg-border);
	margin-top: clamp(22px, 2.8vw, 32px);
	/* Thiết kế bọc danh sách trong div có padding dưới clamp(30px,4vw,52px);
	   ở đây gộp thành margin của chính lưới để khỏi thêm một lớp bọc vô nghĩa. */
	margin-bottom: clamp(30px, 4vw, 52px);
}

/* Bắt buộc phải có: luật display bên dưới thắng [hidden]{display:none} của trình
   duyệt, nên không có dòng này thì JS lọc gắn hidden mà dòng vẫn hiện nguyên.
   Cùng lý do đã có .cg-video-modal[hidden] và .cg-zoom[hidden]. */
.cg-author-row[hidden] {
	display: none;
}

.cg-author-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 15px 2px;
	border-bottom: 1px solid var(--cg-border-light);
	min-height: 54px;
}

.cg-author-row__label {
	display: flex;
	align-items: baseline;
	gap: 12px;
	min-width: 0;
}

.cg-author-row__initial {
	font-family: var(--cg-font-serif);
	font-size: 13px;
	color: var(--cg-gold);
	width: 14px;
	flex: none;
}

.cg-author-row__name {
	font-family: var(--cg-font-serif);
	font-size: clamp(17px, 1.9vw, 19px);
	font-weight: 500;
	line-height: 1.35;
	text-wrap: pretty;
}

.cg-author-row__count {
	font-size: 12.5px;
	color: var(--cg-text-faint);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cg-authors__empty {
	margin: 18px 0 0;
	font-size: 15px;
	color: var(--cg-text-meta);
}

/* ===== Trang một tác giả ===== */
.cg-author__head {
	padding: clamp(20px, 2.6vw, 30px) 0 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 62ch;
}

.cg-author__name {
	margin: 0;
	font-family: var(--cg-font-serif);
	font-size: clamp(30px, 5vw, 46px);
	line-height: 1.12;
	font-weight: 500;
	letter-spacing: -0.01em;
}

.cg-author__range {
	font-size: 12.5px;
	color: var(--cg-text-meta);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	padding-top: 2px;
}

.cg-author__works {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: clamp(26px, 3vw, 40px) clamp(22px, 2.6vw, 34px);
	padding-top: clamp(26px, 3.2vw, 38px);
}

.cg-author__empty {
	margin: clamp(26px, 3.2vw, 38px) 0 0;
	font-size: 15px;
	color: var(--cg-text-meta);
}

/* Đặt sau các rule base ở trên: cùng độ đặc hiệu, khối @media phải đứng sau
   trong nguồn thì mới thắng được .cg-author__works { grid-template-columns:
   repeat(2, 1fr) } khi cascade — đặt trước (như ở khối @media của mục "Danh
   mục" phía trên) sẽ bị rule base định nghĩa muộn hơn đè mất dù media khớp. */
@media (max-width: 619.98px) {
	.cg-authors__list {
		grid-template-columns: 1fr;
	}

	.cg-author__works {
		grid-template-columns: 1fr;
	}
}
