/**
 * Pelagia Book Store — Author Pages (Single & Archive)
 *
 * Covers:
 *   - product-author-link  (inline link in product cards / single product)
 *   - single-pelagia_author layout
 *   - archive-pelagia_author A–Z index
 *
 * @package Pelagia
 */

/* ─────────────────────────────────────────────
   Shared: author link that appears in product cards
   ───────────────────────────────────────────── */
.product-author-link {
	color: var(--color-primary);
	text-decoration: none;
	font-weight: var(--font-weight-semibold);
	transition: color var(--transition-fast);
}
.product-author-link:hover,
.product-author-link:focus {
	color: var(--color-primary-light);
	text-decoration: underline;
}

/* ─────────────────────────────────────────────
   Single Author Page
   ───────────────────────────────────────────── */

/* Page wrapper */
.single-author-page {
	padding-top: 3rem;
	padding-bottom: 5rem;
}

/* Hero: photo + info two-column */
.single-author__hero {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 3rem;
	align-items: start;
	margin-bottom: 4rem;
}

@media (max-width: 767px) {
	.single-author__hero {
		grid-template-columns: 1fr;
		gap: 2rem;
	}
}

/* Photo column */
.single-author__photo-col {}

.single-author__photo-wrap {
	position: relative;
	border-radius: var(--radius-md);
	overflow: hidden;
	background: var(--color-bg-gray);
	aspect-ratio: 3 / 4;
}

.single-author__photo-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.single-author__photo-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
}

.single-author__initials {
	font-size: 4rem;
	font-weight: var(--font-weight-black);
	color: rgba(255, 255, 255, 0.9);
	letter-spacing: -0.03em;
	line-height: 1;
}

/* Info column */
.single-author__info {}

.single-author__category {
	font-size: var(--text-xs);
	font-weight: var(--font-weight-bold);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--color-primary);
	margin-bottom: 0.75rem;
}

.single-author__name {
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: var(--font-weight-black);
	line-height: var(--line-height-tight);
	letter-spacing: -0.03em;
	color: var(--color-dark);
	margin-bottom: 1rem;
}

.single-author__nationality {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: var(--text-sm);
	color: var(--color-muted);
	margin-bottom: 1.5rem;
}

.single-author__nationality svg {
	flex-shrink: 0;
}

/* Bio */
.single-author__bio {
	font-size: var(--text-md);
	line-height: var(--line-height-relaxed);
	color: var(--color-body);
	margin-bottom: 2rem;
	max-width: 65ch;
}

.single-author__bio p {
	margin-bottom: 1rem;
}

.single-author__bio p:last-child {
	margin-bottom: 0;
}

/* Social links */
.single-author__social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.single-author__social-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	border: 1.5px solid var(--color-border);
	border-radius: var(--radius-full);
	font-size: var(--text-sm);
	font-weight: var(--font-weight-semibold);
	color: var(--color-body);
	text-decoration: none;
	transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.single-author__social-link:hover,
.single-author__social-link:focus {
	border-color: var(--color-primary);
	color: var(--color-primary);
	background: rgba(179, 73, 47, 0.06);
}

.single-author__social-link svg {
	flex-shrink: 0;
}

/* Books by this author section */
.single-author__books {
	padding-top: 3rem;
	border-top: 1.5px solid var(--color-border);
}

.single-author__books-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 2rem;
	flex-wrap: wrap;
}

.single-author__books-title {
	font-size: var(--text-2xl);
	font-weight: var(--font-weight-black);
	letter-spacing: -0.02em;
	color: var(--color-dark);
}

.single-author__books-count {
	font-size: var(--text-sm);
	color: var(--color-muted);
	font-weight: var(--font-weight-medium);
}

.single-author__books-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
	gap: var(--grid-gap);
}

.single-author__no-books {
	padding: 3rem 0;
	text-align: center;
	color: var(--color-muted);
	font-size: var(--text-md);
}

/* ─────────────────────────────────────────────
   Author Archive — A–Z Index Page
   ───────────────────────────────────────────── */

/* Page hero */
.authors-archive-hero {
	background: var(--color-secondary); /* Deep Navy */
	padding: 4rem 0 3rem;
	margin-bottom: 0;
}

.authors-archive-hero__eyebrow {
	font-size: var(--text-xs);
	font-weight: var(--font-weight-bold);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: rgba(255, 255, 255, 0.6);
	margin-bottom: 0.75rem;
}

.authors-archive-hero__title {
	font-size: clamp(2.5rem, 5vw, 4rem);
	font-weight: var(--font-weight-black);
	letter-spacing: -0.04em;
	color: #ffffff;
	margin-bottom: 0.5rem;
}

.authors-archive-hero__desc {
	font-size: var(--text-md);
	color: rgba(255, 255, 255, 0.7);
	max-width: 50ch;
}

/* A–Z sticky nav */
.author-az-nav {
	position: sticky;
	top: 0;
	z-index: var(--z-sticky);
	background: var(--color-bg);
	border-bottom: 1.5px solid var(--color-border);
	padding: 0.75rem 0;
	box-shadow: var(--shadow-sm);
}

.author-az-nav__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	align-items: center;
	justify-content: center;
}

.author-az-nav__label {
	font-size: var(--text-xs);
	font-weight: var(--font-weight-bold);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
	margin-right: 0.5rem;
}

.author-az-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: var(--radius-sm);
	font-size: var(--text-sm);
	font-weight: var(--font-weight-bold);
	text-decoration: none;
	color: var(--color-body);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: background var(--transition-fast), color var(--transition-fast);
}

.author-az-btn:hover,
.author-az-btn:focus {
	background: var(--color-primary); /* Terracotta */
	color: #ffffff;
	outline: none;
}

.author-az-btn--active {
	background: var(--color-primary);
	color: #ffffff;
}

.author-az-btn--empty {
	color: var(--color-border);
	cursor: default;
	pointer-events: none;
}

/* Archive body */
.authors-archive-body {
	padding-top: 3rem;
	padding-bottom: 5rem;
}

/* Letter section */
.author-letter-section {
	margin-bottom: 3.5rem;
	scroll-margin-top: 5rem; /* Offset for sticky nav */
}

.author-letter-heading {
	font-size: var(--text-5xl);
	font-weight: var(--font-weight-black);
	letter-spacing: -0.05em;
	color: var(--color-primary);
	line-height: 1;
	margin-bottom: 1.25rem;
	padding-bottom: 0.75rem;
	border-bottom: 3px solid var(--color-primary);
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
}

.author-letter-heading__count {
	font-size: var(--text-base);
	font-weight: var(--font-weight-medium);
	color: var(--color-muted);
	letter-spacing: 0;
}

/* Author cards grid (archive) */
.author-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
}

/* Archive author card - Compact Horizontal Profile */
.author-archive-card {
	display: flex;
	flex-direction: row;
	align-items: center;
	padding: 1.25rem;
	text-decoration: none;
	border-radius: 16px;
	overflow: hidden;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
	transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
	min-height: 100px;
}

.author-archive-card:hover,
.author-archive-card:focus-within {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
	border-color: var(--color-primary);
}

.author-archive-card__photo-wrap {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--color-bg-gray);
	flex-shrink: 0;
	margin-right: 1.25rem;
	overflow: hidden;
	position: relative;
}

.author-archive-card__photo-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--transition-slow);
}

.author-archive-card:hover .author-archive-card__photo-wrap img {
	transform: scale(1.05);
}

.author-archive-card__photo-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
}

.author-archive-card__initials {
	font-size: 1.5rem;
	font-weight: var(--font-weight-black);
	color: rgba(255, 255, 255, 0.9);
	letter-spacing: -0.03em;
}

.author-archive-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
}

.author-archive-card__name {
	font-size: 1.125rem; /* 18px */
	font-family: var(--font-family);
	font-weight: var(--font-weight-bold);
	color: var(--color-dark);
	line-height: 1.2;
	margin: 0 0 0.25rem 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color var(--transition-fast);
}

.author-archive-card:hover .author-archive-card__name {
	color: var(--color-primary);
}

.author-archive-card__nationality {
	font-size: 0.8125rem; /* 13px */
	color: var(--color-muted);
	margin: 0 0 0.15rem 0;
	line-height: 1.2;
}

.author-archive-card__footer {
	margin: 0;
	padding: 0;
	border: none;
}

.author-archive-card__book-count {
	font-size: 0.8125rem; /* 13px */
	color: var(--color-muted);
	font-weight: var(--font-weight-regular);
	background: none;
	padding: 0;
}

/* No authors found */
.authors-archive-empty {
	text-align: center;
	padding: 5rem 0;
	color: var(--color-muted);
}

.authors-archive-empty p {
	font-size: var(--text-lg);
	margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
	.author-archive-grid {
		grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	}
}

@media (max-width: 767px) {
	.single-author__books-grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}

	.author-archive-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: 1.25rem;
	}

	.author-az-nav__label {
		display: none;
	}

	.author-letter-heading {
		font-size: var(--text-4xl);
	}
}

@media (max-width: 480px) {
	.author-archive-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1rem;
	}

	.single-author__books-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ─────────────────────────────────────────────
   Author Archive — Circular Card Variant
   (.author-archive-card--circular) - Deprecated
   ───────────────────────────────────────────── */

.author-archive-card--circular {
	/* No longer needed, layout is horizontal by default */
}

/* Static bottom A–Z nav (not sticky) */
.author-az-nav--bottom {
	position: static;
	top: auto;
	border-top: 1.5px solid var(--color-border);
	border-bottom: none;
	margin-top: 3rem;
	box-shadow: none;
}

/* ─────────────────────────────────────────────
   Publisher Archive — A–Z Page
   Mirrors the author archive structure exactly.
   ───────────────────────────────────────────── */

/* Page hero */
.publishers-archive-hero {
	background: var(--color-secondary); /* Deep Navy */
	padding: 4rem 0 3rem;
	margin-bottom: 0;
}

.publishers-archive-hero__eyebrow {
	font-size: var(--text-xs);
	font-weight: var(--font-weight-bold);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: rgba(255, 255, 255, 0.6);
	margin-bottom: 0.75rem;
}

.publishers-archive-hero__title {
	font-size: clamp(2.5rem, 5vw, 4rem);
	font-weight: var(--font-weight-black);
	letter-spacing: -0.04em;
	color: #ffffff;
	margin-bottom: 0.5rem;
}

.publishers-archive-hero__desc {
	font-size: var(--text-md);
	color: rgba(255, 255, 255, 0.7);
	max-width: 50ch;
}

/* A–Z sticky nav */
.publisher-az-nav {
	position: sticky;
	top: 0;
	z-index: var(--z-sticky);
	background: var(--color-bg);
	border-bottom: 1.5px solid var(--color-border);
	padding: 0.75rem 0;
	box-shadow: var(--shadow-sm);
}

.publisher-az-nav__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	align-items: center;
	justify-content: center;
}

.publisher-az-nav__label {
	font-size: var(--text-xs);
	font-weight: var(--font-weight-bold);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
	margin-right: 0.5rem;
}

.publisher-az-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: var(--radius-sm);
	font-size: var(--text-sm);
	font-weight: var(--font-weight-bold);
	text-decoration: none;
	color: var(--color-body);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: background var(--transition-fast), color var(--transition-fast);
}

.publisher-az-btn:hover,
.publisher-az-btn:focus {
	background: var(--color-primary); /* Terracotta */
	color: #ffffff;
	outline: none;
}

.publisher-az-btn--active {
	background: var(--color-primary);
	color: #ffffff;
}

.publisher-az-btn--empty {
	color: var(--color-border);
	cursor: default;
	pointer-events: none;
}

/* Static bottom nav */
.publisher-az-nav--bottom {
	position: static;
	top: auto;
	border-top: 1.5px solid var(--color-border);
	border-bottom: none;
	margin-top: 3rem;
	box-shadow: none;
}

/* Archive body */
.publishers-archive-body {
	padding-top: 3rem;
	padding-bottom: 5rem;
}

/* Letter section */
.publisher-letter-section {
	margin-bottom: 3.5rem;
	scroll-margin-top: 5rem;
}

.publisher-letter-heading {
	font-size: var(--text-5xl);
	font-weight: var(--font-weight-black);
	letter-spacing: -0.05em;
	color: var(--color-primary);
	line-height: 1;
	margin-bottom: 1.25rem;
	padding-bottom: 0.75rem;
	border-bottom: 3px solid var(--color-primary);
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
}

.publisher-letter-heading__count {
	font-size: var(--text-base);
	font-weight: var(--font-weight-medium);
	color: var(--color-muted);
	letter-spacing: 0;
}

/* Publisher cards grid */
.publisher-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
}

/* Publisher archive card - Compact Horizontal Profile */
.publisher-archive-card {
	display: flex;
	flex-direction: row;
	align-items: center;
	padding: 1.25rem;
	text-decoration: none;
	border-radius: 16px;
	overflow: hidden;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
	transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
	min-height: 100px;
}

.publisher-archive-card:hover,
.publisher-archive-card:focus-within {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
	border-color: var(--color-primary);
}

.publisher-archive-card__photo-wrap {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--color-bg-gray);
	flex-shrink: 0;
	margin-right: 1.25rem;
	margin-bottom: 0;
	overflow: hidden;
	position: relative;
	display: block;
}

.publisher-archive-card__photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--transition-slow);
}

.publisher-archive-card:hover .publisher-archive-card__photo {
	transform: scale(1.05);
}

.publisher-archive-card__photo-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
}

.publisher-archive-card__initials {
	font-size: 1.5rem;
	font-weight: var(--font-weight-black);
	color: rgba(255, 255, 255, 0.9);
	letter-spacing: -0.03em;
}

.publisher-archive-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	gap: 0.15rem;
	min-width: 0;
}

.publisher-archive-card__name {
	font-size: 1.125rem; /* 18px */
	font-weight: var(--font-weight-bold);
	color: var(--color-dark);
	line-height: 1.2;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	width: 100%;
}

.publisher-archive-card__name a {
	color: inherit;
	text-decoration: none;
	transition: color var(--transition-fast);
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
}

.publisher-archive-card:hover .publisher-archive-card__name a,
.publisher-archive-card__name a:hover {
	color: var(--color-primary);
}

.publisher-archive-card__footer {
	margin: 0;
	padding: 0;
	border: none;
}

.publisher-archive-card__book-count {
	font-size: 0.8125rem; /* 13px */
	color: var(--color-muted);
	font-weight: var(--font-weight-regular);
}

/* Empty state */
.publishers-archive-empty {
	text-align: center;
	padding: 5rem 0;
	color: var(--color-muted);
}
.publishers-archive-empty p {
	font-size: var(--text-lg);
	margin-bottom: 1.5rem;
}

/* Publisher archive responsive */
@media (max-width: 1024px) {
	.publisher-archive-grid {
		grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	}
}

@media (max-width: 767px) {
	.publisher-archive-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: 1.25rem;
	}

	.publisher-az-nav__label { display: none; }

	.publisher-letter-heading { font-size: var(--text-4xl); }
}

@media (max-width: 480px) {
	.publisher-archive-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1rem;
	}
}
