/**
 * Athenaeum layout for IssueM – design system and components
 * Extracted from prototype (issuem/pages) for use with shortcodes.
 * Scoped under .issuem-athenaeum.issuem-athenaeum-layout so theme styles do not override.
 */
.issuem-athenaeum.issuem-athenaeum-layout {
	--athenaeum-bg: #f4f1ea;
	--athenaeum-nav-bg: rgba(244, 241, 234, 0.98);
	--athenaeum-text: #1a1a1a;
	--athenaeum-text-muted: #595959;
	--athenaeum-accent: #967542;
	--athenaeum-accent-light: #c5a87a;
	--athenaeum-spine-width: 12px;
	--athenaeum-card-aspect: 2 / 3;
	--athenaeum-border: rgba(0, 0, 0, 0.12);
	--athenaeum-radius: 4px;
	--athenaeum-ease: cubic-bezier(0.165, 0.84, 0.44, 1);
	--athenaeum-transition: 0.4s;
}

@media (prefers-reduced-motion: reduce) {
	.issuem-athenaeum.issuem-athenaeum-layout * {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
	.issuem-athenaeum.issuem-athenaeum-layout .pub-card:hover .pub-cover-wrapper { transform: none !important; }
	.issuem-athenaeum.issuem-athenaeum-layout .author-card:hover { transform: none !important; }
}

@keyframes issuem-athenaeum-fadeInUp {
	from { opacity: 0; transform: translateY(15px); }
	to { opacity: 1; transform: translateY(0); }
}

.issuem-athenaeum.issuem-athenaeum-layout {
	box-sizing: border-box;
	font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
	background-color: var(--athenaeum-bg);
	color: var(--athenaeum-text);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

.issuem-athenaeum.issuem-athenaeum-layout *,
.issuem-athenaeum.issuem-athenaeum-layout *::before,
.issuem-athenaeum.issuem-athenaeum-layout *::after { box-sizing: border-box; }

.issuem-athenaeum.issuem-athenaeum-layout .sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0;
	margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

.issuem-athenaeum.issuem-athenaeum-layout :focus-visible {
	outline: 2px solid var(--athenaeum-accent);
	outline-offset: 2px;
}

/* --- Navigation --- */
.issuem-athenaeum.issuem-athenaeum-layout .athenaeum-nav {
	background: var(--athenaeum-nav-bg);
	border-bottom: 1px solid var(--athenaeum-border);
	z-index: 1000;
	display: flex;
	align-items: center;
	margin: 0 -9999px;
	padding: 0 9999px;
	height: 70px;
	margin-bottom: 0;
}

.issuem-athenaeum.issuem-athenaeum-layout .athenaeum-nav .nav-container {
	width: 100%; max-width: 1200px;
	margin: 0 auto; padding: 0 20px;
	display: flex; justify-content: space-between; align-items: center;
}

.issuem-athenaeum.issuem-athenaeum-layout .nav-brand {
	font-family: Georgia, serif;
	font-size: 1.25rem; font-weight: bold;
	text-decoration: none; color: var(--athenaeum-text);
	letter-spacing: -0.5px;
	display: inline-flex;
	align-items: center;
}

.issuem-athenaeum.issuem-athenaeum-layout .nav-brand.nav-brand-logo-link {
	line-height: 0;
}

.issuem-athenaeum.issuem-athenaeum-layout .nav-brand .nav-brand-logo {
	display: block;
	max-height: 44px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.issuem-athenaeum.issuem-athenaeum-layout .nav-links {
	display: flex; gap: 2rem; list-style: none; margin: 0; padding: 0;
}

.issuem-athenaeum.issuem-athenaeum-layout .nav-links a {
	text-decoration: none; color: var(--athenaeum-text-muted);
	font-size: 0.8rem; text-transform: uppercase;
	letter-spacing: 1.2px; font-weight: 600;
}

.issuem-athenaeum.issuem-athenaeum-layout .nav-links a:hover,
.issuem-athenaeum.issuem-athenaeum-layout .nav-links a.active { color: var(--athenaeum-accent); }

.issuem-athenaeum.issuem-athenaeum-layout .menu-toggle {
	display: none; background: none; border: none;
	cursor: pointer; padding: 10px; color: var(--athenaeum-text);
}

/* --- Librarian's Bar --- */
.issuem-athenaeum.issuem-athenaeum-layout .librarian-bar {
	max-width: 1200px; margin: 0 auto 30px;
	padding: 20px; display: flex;
	justify-content: space-between; align-items: center;
	border-bottom: 1px solid var(--athenaeum-border);
	flex-wrap: wrap; gap: 24px;
}

.issuem-athenaeum.issuem-athenaeum-layout .filter-group { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 4px; }
.issuem-athenaeum.issuem-athenaeum-layout .filter-btn {
	background: none; border: none; color: var(--athenaeum-text-muted);
	font-size: 0.75rem; text-transform: uppercase;
	letter-spacing: 1.5px; cursor: pointer; padding-bottom: 12px;
	position: relative; white-space: nowrap; font-weight: 600;
}
.issuem-athenaeum.issuem-athenaeum-layout .filter-btn[aria-selected="true"] { color: var(--athenaeum-accent); }
.issuem-athenaeum.issuem-athenaeum-layout .filter-btn[aria-selected="true"]::after {
	content: ''; position: absolute; bottom: 0; left: 0; right: 0;
	height: 2px; background: var(--athenaeum-accent);
}
.issuem-athenaeum.issuem-athenaeum-layout .filter-btn:hover:not([aria-selected="true"]) { color: var(--athenaeum-text); }
.issuem-athenaeum.issuem-athenaeum-layout .search-group {
	display: flex; align-items: center; gap: 10px;
	flex-grow: 1; max-width: 380px;
	background: rgba(0,0,0,0.04); padding: 10px 16px;
	border-radius: var(--athenaeum-radius); border: 1px solid transparent;
}
.issuem-athenaeum.issuem-athenaeum-layout .search-group:focus-within {
	background: #fff;
	border-color: var(--athenaeum-accent);
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.issuem-athenaeum.issuem-athenaeum-layout .search-input { background: none; border: none; font-size: 0.9rem; width: 100%; color: inherit; }
.issuem-athenaeum.issuem-athenaeum-layout .search-input:focus { outline: none; }
.issuem-athenaeum.issuem-athenaeum-layout .sort-group select {
	background: none; border: 1px solid var(--athenaeum-border);
	color: var(--athenaeum-text-muted); font-size: 0.75rem;
	text-transform: uppercase; letter-spacing: 1px;
	cursor: pointer; outline: none; padding: 8px 12px;
	border-radius: var(--athenaeum-radius);
}
.issuem-athenaeum.issuem-athenaeum-layout .sort-group select:hover { border-color: var(--athenaeum-accent); color: var(--athenaeum-text); }

/* --- Pagination / Load more (match Archives.html) --- */
.issuem-athenaeum.issuem-athenaeum-layout .pagination-area {
	display: flex; flex-direction: column; align-items: center;
	padding: 60px 0; border-top: 1px solid var(--athenaeum-border);
	background: linear-gradient(to bottom, rgba(0,0,0,0.02), transparent);
}
.issuem-athenaeum.issuem-athenaeum-layout .load-more-btn {
	background: var(--athenaeum-text); border: none; color: #fff;
	padding: 14px 40px; font-size: 0.85rem; text-transform: uppercase;
	letter-spacing: 2px; cursor: pointer; border-radius: var(--athenaeum-radius);
	font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.issuem-athenaeum.issuem-athenaeum-layout .load-more-btn:hover { background: var(--athenaeum-accent); transform: translateY(-1px); }
.issuem-athenaeum.issuem-athenaeum-layout .load-more-btn:active { transform: translateY(0); }
.issuem-athenaeum.issuem-athenaeum-layout .load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* --- Breadcrumb --- */
.issuem-athenaeum.issuem-athenaeum-layout .athenaeum-breadcrumb,
.issuem-athenaeum-profile .athenaeum-breadcrumb {
	margin-bottom: 20px;
}
.issuem-athenaeum.issuem-athenaeum-layout .breadcrumb-list,
.issuem-athenaeum-profile .breadcrumb-list {
	display: flex; flex-wrap: wrap; align-items: center;
	list-style: none; margin: 0; padding: 0;
	gap: 6px; font-size: 0.8rem; color: var(--athenaeum-text-muted);
}
.issuem-athenaeum.issuem-athenaeum-layout .breadcrumb-item a,
.issuem-athenaeum-profile .breadcrumb-item a {
	color: var(--athenaeum-text-muted);
	text-decoration: none;
}
.issuem-athenaeum.issuem-athenaeum-layout .breadcrumb-item a:hover,
.issuem-athenaeum-profile .breadcrumb-item a:hover {
	color: var(--athenaeum-accent);
}
.issuem-athenaeum.issuem-athenaeum-layout .breadcrumb-item[aria-current="page"],
.issuem-athenaeum-profile .breadcrumb-item[aria-current="page"] {
	color: var(--athenaeum-text); font-weight: 600;
}
.issuem-athenaeum.issuem-athenaeum-layout .breadcrumb-item:not(:last-child)::after,
.issuem-athenaeum-profile .breadcrumb-item:not(:last-child)::after {
	content: "\203a";
	margin-left: 6px;
	color: var(--athenaeum-text-muted);
	font-weight: normal;
}

/* --- Container & Shelf (fit viewport) --- */
.issuem-athenaeum.issuem-athenaeum-layout .athenaeum-container {
	max-width: 1200px; margin: 0 auto;
	padding: 20px max(20px, env(safe-area-inset-right)) 20px max(20px, env(safe-area-inset-left));
	overflow-x: hidden;
}
.issuem-athenaeum.issuem-athenaeum-layout .shelf-header { margin-bottom: 40px; text-align: center; }
.issuem-athenaeum.issuem-athenaeum-layout .shelf-header h1 {
	font-family: Georgia, serif;
	font-size: clamp(2rem, 5vw, 2.75rem);
	font-weight: 700;
	margin-bottom: 8px;
}
.issuem-athenaeum.issuem-athenaeum-layout .shelf-header p { color: var(--athenaeum-text-muted); font-size: 0.95rem; }

.issuem-athenaeum.issuem-athenaeum-layout .shelf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 48px 32px; margin-bottom: 80px;
	min-height: 200px;
	max-width: 100%;
}
@media (min-width: 600px) {
	.issuem-athenaeum.issuem-athenaeum-layout .shelf-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* --- Pub Card (fit viewport; feature image box) --- */
.issuem-athenaeum.issuem-athenaeum-layout .pub-card {
	text-decoration: none; color: inherit; display: block;
	animation: issuem-athenaeum-fadeInUp 0.5s var(--athenaeum-ease) both;
	border-radius: var(--athenaeum-radius);
	overflow: hidden;
}
.issuem-athenaeum.issuem-athenaeum-layout .pub-cover-container {
	position: relative;
	aspect-ratio: var(--athenaeum-card-aspect);
	perspective: 1200px; margin-bottom: 16px;
	overflow: hidden;
}
.issuem-athenaeum.issuem-athenaeum-layout .pub-cover-wrapper {
	position: relative; width: 100%; height: 100%;
	transform-style: preserve-3d; transition: transform var(--athenaeum-transition) var(--athenaeum-ease);
	border-radius: 4px 10px 10px 4px; overflow: hidden;
	box-shadow: 4px 6px 16px rgba(0,0,0,0.12); background-color: #ddd;
}
.issuem-athenaeum.issuem-athenaeum-layout .pub-spine {
	position: absolute; left: 0; top: 0; bottom: 0; width: 12px;
	background: linear-gradient(to right, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 85%);
	z-index: 2;
}
.issuem-athenaeum.issuem-athenaeum-layout .pub-cover-wrapper img {
	width: 100%; height: 100%;
	object-fit: cover; object-position: center;
	display: block; vertical-align: middle;
}
.issuem-athenaeum.issuem-athenaeum-layout .pub-cover-wrapper > div[style] {
	/* Placeholder when no featured image – fill box, match radius */
	position: absolute; inset: 0;
	width: 100%; height: 100%;
}
.issuem-athenaeum.issuem-athenaeum-layout .pub-overlay {
	position: absolute; inset: 0; background: rgba(0,0,0,0.85);
	display: flex; flex-direction: column; justify-content: center;
	align-items: center; opacity: 0; transition: opacity 0.3s ease;
	z-index: 3; color: #fff; padding: 20px; text-align: center;
}
.issuem-athenaeum.issuem-athenaeum-layout .pub-overlay span {
	font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
	letter-spacing: 1px; border-bottom: 1px solid var(--athenaeum-accent);
	padding-bottom: 4px;
}
@media (hover: hover) {
	.issuem-athenaeum.issuem-athenaeum-layout .pub-card:hover .pub-cover-wrapper { transform: rotateY(-12deg) scale(1.03); }
	.issuem-athenaeum.issuem-athenaeum-layout .pub-card:hover .pub-overlay { opacity: 1; }
}
.issuem-athenaeum.issuem-athenaeum-layout .pub-title {
	font-family: Georgia, serif; font-size: 1.1rem;
	font-weight: 700; margin-bottom: 4px; display: block;
	line-height: 1.3;
}
.issuem-athenaeum.issuem-athenaeum-layout .pub-meta {
	font-size: 0.75rem; color: var(--athenaeum-text-muted);
	text-transform: uppercase; letter-spacing: 1px;
	font-weight: 600;
}

.issuem-athenaeum.issuem-athenaeum-layout .shelf-empty {
	grid-column: 1 / -1; text-align: center; padding: 120px 0;
	color: var(--athenaeum-text-muted); font-family: Georgia, serif; font-size: 1.25rem;
}

/* --- Authors Grid --- */
.issuem-athenaeum.issuem-athenaeum-layout .authors-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 40px; margin-bottom: 80px;
}
.issuem-athenaeum.issuem-athenaeum-layout .author-card {
	text-decoration: none; color: inherit; display: block;
	background: #fff; border-radius: var(--athenaeum-radius);
	padding: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.05);
	transition: transform var(--athenaeum-transition) var(--athenaeum-ease), box-shadow var(--athenaeum-transition) var(--athenaeum-ease);
	animation: issuem-athenaeum-fadeInUp 0.5s var(--athenaeum-ease) both;
	border: 1px solid transparent;
}
.issuem-athenaeum.issuem-athenaeum-layout .author-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 24px rgba(0,0,0,0.1);
	border-color: var(--athenaeum-accent-light);
}
.issuem-athenaeum.issuem-athenaeum-layout .author-portrait-wrapper {
	width: 80px; height: 80px; margin-bottom: 20px;
	position: relative; border-radius: 50%; overflow: hidden;
	background: #eee;
}
.issuem-athenaeum.issuem-athenaeum-layout .author-portrait { width: 100%; height: 100%; object-fit: cover; }
.issuem-athenaeum.issuem-athenaeum-layout .author-name {
	font-family: Georgia, serif; font-size: 1.25rem;
	font-weight: 700; margin-bottom: 4px; display: block;
}
.issuem-athenaeum.issuem-athenaeum-layout .author-role {
	font-size: 0.75rem; color: var(--athenaeum-accent);
	text-transform: uppercase; letter-spacing: 1px;
	font-weight: 700; margin-bottom: 12px; display: block;
}
.issuem-athenaeum.issuem-athenaeum-layout .author-bio {
	font-size: 0.9rem; color: var(--athenaeum-text-muted);
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
	overflow: hidden; margin-bottom: 20px; line-height: 1.5;
}
.issuem-athenaeum.issuem-athenaeum-layout .author-link {
	font-size: 0.8rem; font-weight: 700; color: var(--athenaeum-text);
	text-transform: uppercase; letter-spacing: 0.5px;
	display: flex; align-items: center; gap: 8px;
}
.issuem-athenaeum.issuem-athenaeum-layout .author-link::after { content: '→'; transition: transform 0.2s ease; }
.issuem-athenaeum.issuem-athenaeum-layout .author-card:hover .author-link::after { transform: translateX(4px); }

/* --- Pagination --- */
.issuem-athenaeum.issuem-athenaeum-layout .athenaeum-pagination {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem;
	padding: 40px 0; border-top: 1px solid var(--athenaeum-border);
}
.issuem-athenaeum.issuem-athenaeum-layout .athenaeum-pagination a {
	display: inline-block;
	background: var(--athenaeum-text); color: #fff;
	padding: 12px 24px; font-size: 0.85rem; text-transform: uppercase;
	letter-spacing: 2px; text-decoration: none; border-radius: var(--athenaeum-radius);
	font-weight: 700;
}
.issuem-athenaeum.issuem-athenaeum-layout .athenaeum-pagination a:hover { background: var(--athenaeum-accent); }
.issuem-athenaeum.issuem-athenaeum-layout .athenaeum-pagination button {
	display: inline-block;
	background: var(--athenaeum-text); color: #fff;
	padding: 12px 24px; font-size: 0.85rem; text-transform: uppercase;
	letter-spacing: 2px; border: none; border-radius: var(--athenaeum-radius);
	font-weight: 700; cursor: pointer;
}
.issuem-athenaeum.issuem-athenaeum-layout .athenaeum-pagination button:hover { background: var(--athenaeum-accent); }
.issuem-athenaeum.issuem-athenaeum-layout .athenaeum-pagination-info {
	display: block;
	width: 100%;
	text-align: center;
	margin-bottom: 12px;
	color: var(--athenaeum-text-muted);
	font-size: 0.9rem;
}
.issuem-athenaeum.issuem-athenaeum-layout .athenaeum-pagination .athenaeum-pagination-prev { margin-right: 8px; }

/* --- Mobile --- */
@media (max-width: 768px) {
	.issuem-athenaeum.issuem-athenaeum-layout .menu-toggle { display: block; }
	.issuem-athenaeum.issuem-athenaeum-layout .nav-links {
		display: none; position: absolute; top: 70px; left: 0; right: 0;
		background: var(--athenaeum-nav-bg); flex-direction: column; gap: 0;
		border-bottom: 1px solid var(--athenaeum-border);
		box-shadow: 0 10px 20px rgba(0,0,0,0.05);
		margin: 0; padding: 0;
	}
	.issuem-athenaeum.issuem-athenaeum-layout .nav-links.active { display: flex; }
	.issuem-athenaeum.issuem-athenaeum-layout .nav-links li a { display: block; padding: 20px; border-top: 1px solid var(--athenaeum-border); }
	.issuem-athenaeum.issuem-athenaeum-layout .librarian-bar { flex-direction: column; align-items: stretch; gap: 16px; }
	.issuem-athenaeum.issuem-athenaeum-layout .search-group { max-width: none; }
}
