/* Frontend Styles */



.aib-alphabet-index {
	--aib-primary-color: #076dff;
	--aib-primary-hover: #076dff;
	--aib-border-color: #076dff;
	--aib-bg-light: #076dff0f;
	--aib-text-color: #1a3c34;
	--aib-text-muted: #042b62;
	--aib-columns: 4;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}



/* Nawigacja alfabetyczna */
.aib-nav {
	background: #fff;
	padding: 1rem 0;
	margin-bottom: 2rem;
	border-bottom: 1px solid var(--aib-border-color);
}

.aib-nav-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
	justify-content: center;
}

.aib-nav-item {
	margin: 0;
	padding: 0;
}

.aib-nav-link {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	min-width: 2.5rem;
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.aib-nav-link--active {
	color: var(--aib-primary-color);
	background: var(--aib-bg-light);
}

.aib-nav-link--active:hover,
.aib-nav-link--active:focus {
	color: #fff;
	background: var(--aib-primary-color);
}

.aib-nav-link--active:hover .aib-nav-count,
.aib-nav-link--active:focus .aib-nav-count {
	color: rgba(255, 255, 255, 0.8);
}

.aib-nav-link--disabled {
	color: var(--aib-text-muted);
	opacity: 0.4;
	cursor: default;
}

.aib-nav-count {
	font-size: 0.625rem;
	font-weight: 400;
	color: var(--aib-text-muted);
	line-height: 1;
	margin-top: 0.125rem;
	transition: color 0.2s ease;
}



/* Grupy literowe */
.aib-groups {
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
}

.aib-group {
	scroll-margin-top: 5rem;
}

.aib-group-title {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--aib-text-color);
	margin: 0 0 1rem 0;
	padding-bottom: 0.5rem;
	border-bottom: 3px solid var(--aib-primary-color);
}

.aib-group-count {
	font-size: 1rem;
	font-weight: 400;
	color: var(--aib-text-muted);
}

/* Lista terminów */
.aib-terms-list {
	display: grid;
	grid-template-columns: repeat(var(--aib-columns), 1fr);
	gap: 0.5rem 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.aib-term-item {
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	height: 120px;
}

.aib-term-link {
	display: block;
	padding: 0.5rem 0;
	color: var(--aib-text-color);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: all 0.2s ease;
}

/* Linki z logotypami - bez podkreślenia */
.aib-term-link:has(.aib-term-logo) {
	border-bottom: none;
}

.aib-term-link:hover,
.aib-term-link:focus {
	color: var(--aib-primary-color);
	border-bottom-color: var(--aib-primary-color);
}

/* Linki z logotypami - bez podkreślenia również przy hover */
.aib-term-link:has(.aib-term-logo):hover,
.aib-term-link:has(.aib-term-logo):focus {
	border-bottom: none;
}

/* Puste terminy (bez postów) - wyszarzone ale klikalne */
.aib-term-link--empty {
	color: var(--aib-text-muted);
}

.aib-term-link--empty:hover,
.aib-term-link--empty:focus {
}



/* Logo terminów */

.aib-term-logo {
	display: block;
	width: auto;
	height: 1.5rem;
	max-width: 8rem;
	object-fit: contain;
}

/* Logo jako sprite (background-image) */
.aib-term-logo--sprite {
	display: block;
	width: var(--aib-sprite-width, 200px);
	height: var(--aib-sprite-height, 100px);
	max-width: 100%;
	background-repeat: no-repeat;
	background-size: auto;
}

/* Logo jako fallback (bezpośredni link, np. SVG) */
.aib-term-logo--fallback {
	display: block;
	width: var(--aib-sprite-width, 200px);
	height: var(--aib-sprite-height, 100px);
	max-width: 100%;
	object-fit: contain;
}




/* Przycisk "Powrót do góry" */
.aib-back-to-top {
	position: fixed;
	bottom: 2rem;
	right: 2rem;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	color: #fff;
	background: var(--aib-primary-color);
	border: none;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(1rem);
	transition: all 0.3s ease;
}

.aib-back-to-top--visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.aib-back-to-top:hover,
.aib-back-to-top:focus {
	background: var(--aib-primary-hover);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.aib-back-to-top svg {
	width: 1.25rem;
	height: 1.25rem;
}



/* Komunikat o braku elementów */
.aib-no-terms {
	text-align: center;
	padding: 2rem;
	color: var(--aib-text-muted);
	font-style: italic;
}



/* Responsywność */
@media (max-width: 1200px) {
	.aib-terms-list {
		--aib-columns: 3;
	}
}

@media (max-width: 900px) {
	.aib-terms-list {
		--aib-columns: 2;
	}

	.aib-nav-link {
		min-width: 2rem;
		padding: 0.375rem 0.5rem;
		font-size: 0.8125rem;
	}
}

@media (max-width: 600px) {
	.aib-terms-list {
		--aib-columns: 1;
	}

	.aib-nav {
		padding: 0.75rem 0;
	}

	.aib-nav-list {
		gap: 0.125rem;
	}

	.aib-nav-link {
		min-width: 1.75rem;
		padding: 0.25rem 0.375rem;
		font-size: 0.75rem;
	}

	.aib-nav-count {
		display: none;
	}

	.aib-group-title {
		font-size: 1.5rem;
	}

	.aib-back-to-top {
		bottom: 1rem;
		right: 1rem;
		width: 2.5rem;
		height: 2.5rem;
	}
}



/* Preferencje użytkownika */
@media (prefers-reduced-motion: reduce) {
	.aib-nav-link,
	.aib-term-link,
	.aib-back-to-top {
		transition: none;
	}
}

