/**
 * Keywords Index Page Styles
 *
 * Single-column layout, sticky letter navigation,
 * and alphabetically grouped keyword lists.
 *
 * @package NEC_Archives
 * @since 1.0.0
 */

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */

.keywords-index-content {
	padding: 0;
	overflow: visible;
}

.keywords-index-container {
	max-width: 900px;
	max-width: 1080px;
	margin: 2rem auto;
	padding: 0 2rem;
	overflow: visible;
}

.no-keywords-message {
	text-align: center;
	color: #6b7280;
	font-size: 15px;
	padding: 3rem 1rem;
}

/* ========================================
   PAGE TITLE (extends existing .page-title)
   ======================================== */

.keywords-index-content .page-title {
	margin: 0;
	color: #fff;
}

.keywords-index-content .page-title h1 {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 0.5rem;
}

.keywords-index-content .page-title .archive-name {
	font-size: 1.25rem;
	font-weight: 400;
	opacity: 0.85;
	letter-spacing: 0.02em;
}

/* ========================================
   STICKY LETTER NAVIGATION
   ======================================== */

.keywords-letter-nav {
	position: sticky;
	top: 110px;
	z-index: 1000;
	background: #ffffffcc;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid #e5e7eb;
	margin: 0 -2rem 2rem;
	padding: 0.75rem 2rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	overflow: visible;
}

.keywords-sections {
	overflow: visible;
}

.keyword-letter-group {
	scroll-margin-top: 5rem;
	overflow: visible;
}

.letter-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.25rem 0.125rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.letter-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	height: 2rem;
	padding: 0 0.35rem;
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 600;
	color: #334196;
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	transition: all 0.15s;
}

.letter-link:hover {
	background: #334196;
	border-color: #334196;
	color: #fff;
}

/* ========================================
   LETTER SECTIONS
   ======================================== */

.keywords-sections {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.letter-heading {
	font-size: 1.75rem;
	font-weight: 700;
	color: #1f2937;
	margin: 0 0 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid #334196;
	display: inline-block;
}

.keyword-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0;
	align-items: baseline;
}

/* ========================================
   KEYWORD ITEMS (clickable links)
   ======================================== */

.keyword-item {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4rem;
	padding: 0.25rem 0.6rem;
	margin: 0.25rem;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.15s;
}

.keyword-item:hover {
	background: #f3f4f6;
	border-color: #334196;
}

.keyword-label {
	font-size: 0.9rem;
	color: #374151;
	line-height: 1.5;
}

.keyword-count {
	font-size: 0.75rem;
	font-weight: 700;
	color: #6b7280;
	background: #e5e7eb;
	border-radius: 10px;
	padding: 0.1rem 0.5rem;
	min-width: 1.5rem;
	text-align: center;
	line-height: 1.5;
}

.keyword-item:hover .keyword-count {
	background: #d1d5db;
	color: #1f2937;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
	.keywords-index-container {
		padding: 0 1rem;
	}

	.keywords-letter-nav {
		margin: 0 -1rem 1.5rem;
		padding: 0.6rem 1rem;
	}

	.letter-link {
		min-width: 1.6rem;
		height: 1.6rem;
		font-size: 0.75rem;
		padding: 0 0.25rem;
	}

	.keyword-item {
		padding: 0.2rem 0.5rem;
		margin: 0.2rem;
	}

	.keyword-label {
		font-size: 0.85rem;
	}

	.keyword-count {
		font-size: 0.7rem;
	}
}
