/* ════════════════════════════════════════
   FIZJOEVIDENCE — SŁOWNIK FIZJOTERAPEUTY
   ════════════════════════════════════════ */

body.post-type-archive-glossary,
body.tax-glossary_category,
body.single-glossary {
	--fe-page-max-width: 1320px;
}

.fe-glossary-page {
	box-sizing: border-box;
	margin-inline: auto;
	max-width: min(var(--fe-page-max-width, 1320px), 1320px);
	padding-inline: clamp(1rem, 3vw, 2.5rem);
	padding-top: 0;
	padding-bottom: clamp(3rem, 7vw, 6rem);
	width: 100%;
	color: var(--fe-text, #1e293b);
}

/* ════════════════════════════════════════
   HERO & SEARCH
   ════════════════════════════════════════ */
.fe-glossary-hero {
	max-width: 100%;
	padding: 1.25rem 0 0.5rem;
	margin: 0 0 1.25rem 0;
}

@media (min-width: 961px) {
	html[data-fe-theme="dark"] .fe-glossary-hero {
		background: transparent !important;
		border: 0 !important;
		border-top: 2px solid var(--fe-brand-primary, #d96722) !important;
		border-radius: 0;
		padding: 1rem 0 1.1rem;
	}
}

.fe-glossary-eyebrow,
.fe-glossary-badge {
	color: var(--fe-brand-primary, #d96722);
	font-size: 0.82rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin: 0;
	display: block;
	background: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	padding: 0 !important;
}

.fe-glossary-badge-dot {
	display: none !important;
}

.fe-glossary-title,
.fe-glossary-hero h1 {
	font-size: clamp(2rem, 3.8vw, 2.75rem);
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -.02em;
	color: #0f172a;
	margin: .25rem 0 .4rem;
}

.fe-glossary-lead {
	font-size: 1rem;
	line-height: 1.5;
	color: var(--fe-text-muted, #64748b);
	margin: 0 0 1.25rem;
	max-width: 760px;
}

.fe-glossary-search-form {
	margin-bottom: 20px;
}

.fe-glossary-search-box {
	display: flex;
	align-items: center;
	background: #ffffff;
	border: 1.5px solid #d1d5db;
	border-radius: 12px;
	padding: 6px 6px 6px 16px;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	max-width: 680px;
}

.fe-glossary-search-box:focus-within {
	border-color: var(--fe-brand-primary, #d96722);
	box-shadow: 0 0 0 3px rgba(217, 103, 34, 0.15);
}

.fe-glossary-search-icon {
	display: flex;
	align-items: center;
	color: var(--fe-brand-primary, #d96722);
	margin-right: 10px;
	flex-shrink: 0;
}

.fe-glossary-search-box input {
	flex: 1;
	min-width: 0;
	border: none !important;
	outline: none !important;
	background: transparent !important;
	font-size: 16px;
	color: #0f172a;
	padding: 8px 0;
	font-family: inherit;
}

.fe-glossary-search-box input::placeholder {
	color: #94a3b8;
}

.fe-glossary-search-btn {
	padding: 10px 22px;
	border: none;
	border-radius: 10px;
	background: var(--fe-brand-primary, #d96722);
	color: #ffffff;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
	flex-shrink: 0;
}

.fe-glossary-search-btn:hover {
	background: var(--fe-brand-primary-strong, #c45717);
}

/* ════════════════════════════════════════
   ALPHABET FILTER & CATEGORIES
   ════════════════════════════════════════ */
.fe-glossary-alphabet {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 20px 0 28px;
}

.fe-glossary-alphabet a,
.fe-glossary-alphabet-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	border-radius: 9px;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	color: #334155;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.15s ease;
}

.fe-glossary-alphabet a:hover,
.fe-glossary-alphabet-chip:hover {
	border-color: #356859;
	color: #356859;
	background: rgba(53, 104, 89, 0.06);
}

.fe-glossary-alphabet [aria-current=page],
.fe-glossary-alphabet .is-active {
	background: #356859 !important;
	border-color: #356859 !important;
	color: #ffffff !important;
	box-shadow: 0 2px 6px rgba(53, 104, 89, 0.25);
}

.fe-glossary-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 24px;
}

.fe-glossary-cat-chip,
.fe-glossary-categories a {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	border-radius: 999px;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	color: #475569;
	font-size: 12.5px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.15s ease;
}

.fe-glossary-cat-chip:hover,
.fe-glossary-categories a:hover {
	background: rgba(53, 104, 89, 0.1);
	border-color: #356859;
	color: #356859;
}

/* ════════════════════════════════════════
   GRID & CARDS
   ════════════════════════════════════════ */
.fe-glossary-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}

.fe-glossary-card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	padding: 24px;
	border-radius: 16px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.fe-glossary-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.07);
	border-color: #356859;
}

.fe-glossary-card__header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 10px;
}

.fe-glossary-card__title,
.fe-glossary-card h2 {
	font-size: 1.22rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0;
	color: #0f172a;
}

.fe-glossary-card__title a,
.fe-glossary-card h2 a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.fe-glossary-card:hover .fe-glossary-card__title a,
.fe-glossary-card:hover h2 a {
	color: #356859;
}

.fe-glossary-card-link::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: 16px;
}

.fe-glossary-card__arrow {
	color: #94a3b8;
	font-size: 1.15rem;
	font-weight: 600;
	transition: color 0.15s ease, transform 0.15s ease;
	flex-shrink: 0;
}

.fe-glossary-card:hover .fe-glossary-card__arrow {
	color: #356859;
	transform: translateX(3px);
}

.fe-glossary-card__desc,
.fe-glossary-card p {
	font-size: 0.92rem;
	line-height: 1.6;
	color: #475569;
	margin: 0;
}

.fe-glossary-empty {
	grid-column: 1 / -1;
	padding: 48px 24px;
	text-align: center;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 16px;
}

.fe-glossary-empty p {
	font-size: 1.05rem;
	color: #64748b;
	margin: 0 0 16px;
}

.fe-glossary-btn-reset {
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	border-radius: 8px;
	background: #356859;
	color: #ffffff;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
}

/* ════════════════════════════════════════
   PAGINATION
   ════════════════════════════════════════ */
.fe-glossary-archive .navigation.pagination,
.fe-glossary-page .navigation.pagination {
	margin: 44px 0 20px;
	padding: 0;
}

.fe-glossary-archive .nav-links,
.fe-glossary-page .nav-links {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

.fe-glossary-archive .page-numbers,
.fe-glossary-page .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border-radius: 9px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	color: #334155;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.15s ease;
}

.fe-glossary-archive a.page-numbers:hover,
.fe-glossary-page a.page-numbers:hover {
	border-color: #356859;
	color: #356859;
	background: rgba(53, 104, 89, 0.06);
}

.fe-glossary-archive .page-numbers.current,
.fe-glossary-page .page-numbers.current {
	background: #356859 !important;
	border-color: #356859 !important;
	color: #ffffff !important;
	box-shadow: 0 2px 6px rgba(53, 104, 89, 0.25);
}

/* ════════════════════════════════════════
   SINGLE TERM VIEW
   ════════════════════════════════════════ */
.fe-glossary-single {
	width: min(860px, calc(100% - 36px));
	margin: 0 auto;
}

.fe-glossary-single .fe-glossary-article {
	width: 100%;
	margin: 0 auto;
}

.fe-glossary-single .fe-glossary-hero,
.fe-glossary-single .fe-glossary-section {
	max-width: 100%;
	margin-inline: auto;
}

.fe-glossary-breadcrumb {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 24px;
	font-size: 0.92rem;
	color: #64748b;
}

.fe-glossary-breadcrumb a {
	color: #356859;
	text-decoration: none;
	font-weight: 500;
}

.fe-glossary-breadcrumb a:hover {
	text-decoration: underline;
}

.fe-glossary-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 16px 0 24px;
}

.fe-glossary-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	font-size: 0.88rem;
	color: #1e293b;
	background: #ffffff;
	text-decoration: none;
	transition: all 0.15s ease;
}

a.fe-glossary-chip:hover {
	border-color: #356859;
	color: #356859;
	background: rgba(53, 104, 89, 0.06);
}

.fe-glossary-section {
	padding: 24px;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	background: #ffffff;
	max-width: 820px;
	margin: 20px 0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.fe-glossary-section h2 {
	font-size: 1.25rem;
	font-weight: 700;
	margin-top: 0;
	margin-bottom: 12px;
	color: #0f172a;
}

.fe-glossary-prose {
	line-height: 1.75;
	color: #334155;
	font-size: 1rem;
}

.fe-glossary-section ul {
	margin: 8px 0 0 20px;
	padding: 0;
}

.fe-glossary-section ul li {
	margin-bottom: 6px;
	color: #475569;
}

.fe-glossary-section ul li a {
	color: #356859;
	text-decoration: none;
}

.fe-glossary-section ul li a:hover {
	text-decoration: underline;
}

/* ════════════════════════════════════════
   POPOVER & HIGHLIGHT MARKS
   ════════════════════════════════════════ */
.fe-glossary-mark {
	border: 0;
	border-bottom: 2px dotted #356859;
	background: transparent;
	color: inherit;
	padding: 0 1px;
	cursor: help;
	text-decoration: none;
	font: inherit;
	line-height: inherit;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.fe-glossary-mark:hover {
	color: #356859;
	border-bottom-style: solid;
	background: rgba(53, 104, 89, 0.08);
	border-radius: 2px;
}

.fe-glossary-mark:focus-visible,
.fe-glossary-close:focus-visible {
	outline: 3px solid #356859;
	outline-offset: 3px;
}

.fe-glossary-popover {
	position: fixed;
	z-index: 999999;
	width: min(380px, calc(100vw - 32px));
	padding: 24px;
	border: 1px solid #cbd5e1;
	border-radius: 18px;
	background: #ffffff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16);
	pointer-events: auto;
}

.fe-glossary-popover[hidden] {
	display: none !important;
}

.fe-glossary-popover h2 {
	margin: 0 36px 10px 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: #0f172a;
}

.fe-glossary-popover p {
	font-size: 0.94rem;
	line-height: 1.6;
	color: #475569;
	margin: 0 0 14px;
}

.fe-glossary-popover a {
	display: inline-flex;
	align-items: center;
	font-weight: 600;
	font-size: 0.9rem;
	color: #356859;
	text-decoration: none;
}

.fe-glossary-popover a:hover {
	text-decoration: underline;
}

.fe-glossary-close {
	position: absolute;
	right: 14px;
	top: 12px;
	border: 0;
	background: none;
	font-size: 1.6rem;
	color: #94a3b8;
	cursor: pointer;
	line-height: 1;
	padding: 4px;
}

.fe-glossary-close:hover {
	color: #0f172a;
}

@media (max-width: 921px) {
	.fe-glossary-popover {
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		top: auto !important;
		width: 100%;
		max-width: none;
		border-radius: 20px 20px 0 0;
		padding: 24px 24px max(24px, env(safe-area-inset-bottom));
	}
	.fe-glossary-page {
		width: min(100% - 24px, 1200px);
	}
}

/* ════════════════════════════════════════
   DARK THEME (CZARNY STYL)
   ════════════════════════════════════════ */
html[data-fe-theme="dark"] .fe-glossary-page,
@media (prefers-color-scheme: dark) {
	html:not([data-fe-theme="light"]) .fe-glossary-page {
		color: #f1f5f9;
	}
}

html[data-fe-theme="dark"] .fe-glossary-eyebrow,
html[data-fe-theme="dark"] .fe-glossary-badge {
	background: transparent !important;
	border: none !important;
	color: var(--fe-brand-primary, #d96722) !important;
}

html[data-fe-theme="dark"] .fe-glossary-badge-dot {
	display: none !important;
}

html[data-fe-theme="dark"] .fe-glossary-title,
html[data-fe-theme="dark"] .fe-glossary-hero h1 {
	color: var(--fe-text-strong, #f8fafc) !important;
}

html[data-fe-theme="dark"] .fe-glossary-lead {
	color: var(--fe-text-muted, #94a3b8) !important;
}

html[data-fe-theme="dark"] .fe-glossary-search-box {
	background: #161c19 !important;
	border-color: rgba(255, 255, 255, 0.15) !important;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html[data-fe-theme="dark"] .fe-glossary-search-box:focus-within {
	border-color: var(--fe-brand-primary, #d96722) !important;
	box-shadow: 0 0 0 3px rgba(217, 103, 34, 0.25) !important;
}

html[data-fe-theme="dark"] .fe-glossary-search-icon {
	color: var(--fe-brand-primary, #d96722) !important;
}

html[data-fe-theme="dark"] .fe-glossary-search-box input {
	color: #f8fafc !important;
	-webkit-text-fill-color: #f8fafc !important;
}

html[data-fe-theme="dark"] .fe-glossary-search-box input::placeholder {
	color: #64748b !important;
	-webkit-text-fill-color: #64748b !important;
}

html[data-fe-theme="dark"] .fe-glossary-search-btn {
	background: var(--fe-brand-primary, #d96722) !important;
	color: #ffffff !important;
}

html[data-fe-theme="dark"] .fe-glossary-alphabet a,
html[data-fe-theme="dark"] .fe-glossary-alphabet-chip {
	background: #171e1b !important;
	border-color: rgba(255, 255, 255, 0.12) !important;
	color: #cbd5e1 !important;
}

html[data-fe-theme="dark"] .fe-glossary-alphabet a:hover,
html[data-fe-theme="dark"] .fe-glossary-alphabet-chip:hover {
	background: #202b26 !important;
	border-color: var(--fe-brand-primary, #d96722) !important;
	color: #ffffff !important;
}

html[data-fe-theme="dark"] .fe-glossary-alphabet [aria-current=page],
html[data-fe-theme="dark"] .fe-glossary-alphabet .is-active {
	background: var(--fe-brand-primary, #d96722) !important;
	border-color: var(--fe-brand-primary, #d96722) !important;
	color: #ffffff !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

html[data-fe-theme="dark"] .fe-glossary-cat-chip,
html[data-fe-theme="dark"] .fe-glossary-categories a {
	background: #171e1b !important;
	border-color: rgba(255, 255, 255, 0.1) !important;
	color: #94a3b8 !important;
}

html[data-fe-theme="dark"] .fe-glossary-cat-chip:hover,
html[data-fe-theme="dark"] .fe-glossary-categories a:hover {
	background: #202b26 !important;
	border-color: #72b9a4 !important;
	color: #ffffff !important;
}

html[data-fe-theme="dark"] .fe-glossary-card {
	background: #161c19 !important;
	border-color: rgba(255, 255, 255, 0.1) !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

html[data-fe-theme="dark"] .fe-glossary-card:hover {
	background: #1b2320 !important;
	border-color: rgba(114, 185, 164, 0.5) !important;
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55) !important;
}

html[data-fe-theme="dark"] .fe-glossary-card__title,
html[data-fe-theme="dark"] .fe-glossary-card h2,
html[data-fe-theme="dark"] .fe-glossary-card__title a,
html[data-fe-theme="dark"] .fe-glossary-card h2 a {
	color: #f8fafc !important;
}

html[data-fe-theme="dark"] .fe-glossary-card:hover .fe-glossary-card__title a,
html[data-fe-theme="dark"] .fe-glossary-card:hover h2 a {
	color: #72b9a4 !important;
}

html[data-fe-theme="dark"] .fe-glossary-card__arrow {
	color: #64748b !important;
}

html[data-fe-theme="dark"] .fe-glossary-card:hover .fe-glossary-card__arrow {
	color: #72b9a4 !important;
}

html[data-fe-theme="dark"] .fe-glossary-card__desc,
html[data-fe-theme="dark"] .fe-glossary-card p {
	color: #94a3b8 !important;
}

html[data-fe-theme="dark"] .fe-glossary-empty {
	background: #161c19 !important;
	border-color: rgba(255, 255, 255, 0.15) !important;
}

html[data-fe-theme="dark"] .fe-glossary-empty p {
	color: #94a3b8 !important;
}

html[data-fe-theme="dark"] .fe-glossary-archive .page-numbers,
html[data-fe-theme="dark"] .fe-glossary-page .page-numbers {
	background: #171e1b !important;
	border-color: rgba(255, 255, 255, 0.12) !important;
	color: #cbd5e1 !important;
}

html[data-fe-theme="dark"] .fe-glossary-archive a.page-numbers:hover,
html[data-fe-theme="dark"] .fe-glossary-page a.page-numbers:hover {
	background: #202b26 !important;
	border-color: #72b9a4 !important;
	color: #ffffff !important;
}

html[data-fe-theme="dark"] .fe-glossary-archive .page-numbers.current,
html[data-fe-theme="dark"] .fe-glossary-page .page-numbers.current {
	background: #356859 !important;
	border-color: #72b9a4 !important;
	color: #ffffff !important;
}

html[data-fe-theme="dark"] .fe-glossary-breadcrumb {
	color: #64748b !important;
}

html[data-fe-theme="dark"] .fe-glossary-breadcrumb a {
	color: #72b9a4 !important;
}

html[data-fe-theme="dark"] .fe-glossary-breadcrumb span {
	color: #cbd5e1 !important;
}

html[data-fe-theme="dark"] .fe-glossary-section {
	background: #161c19 !important;
	border-color: rgba(255, 255, 255, 0.1) !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

html[data-fe-theme="dark"] .fe-glossary-section h2 {
	color: #f8fafc !important;
}

html[data-fe-theme="dark"] .fe-glossary-prose,
html[data-fe-theme="dark"] .fe-glossary-prose p {
	color: #cbd5e1 !important;
}

html[data-fe-theme="dark"] .fe-glossary-chip {
	background: #171e1b !important;
	border-color: rgba(255, 255, 255, 0.12) !important;
	color: #cbd5e1 !important;
}

html[data-fe-theme="dark"] a.fe-glossary-chip:hover {
	background: #202b26 !important;
	border-color: #72b9a4 !important;
	color: #ffffff !important;
}

html[data-fe-theme="dark"] .fe-glossary-chip strong {
	color: #72b9a4 !important;
}

html[data-fe-theme="dark"] .fe-glossary-section ul li {
	color: #94a3b8 !important;
}

html[data-fe-theme="dark"] .fe-glossary-section ul li a {
	color: #72b9a4 !important;
}

html[data-fe-theme="dark"] .fe-glossary-popover {
	background: #161c19 !important;
	border-color: rgba(255, 255, 255, 0.16) !important;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
	color: #cbd5e1 !important;
}

html[data-fe-theme="dark"] .fe-glossary-popover h2 {
	color: #f8fafc !important;
}

html[data-fe-theme="dark"] .fe-glossary-popover p {
	color: #94a3b8 !important;
}

html[data-fe-theme="dark"] .fe-glossary-popover a {
	color: #72b9a4 !important;
}

html[data-fe-theme="dark"] .fe-glossary-close {
	color: #94a3b8 !important;
}

html[data-fe-theme="dark"] .fe-glossary-close:hover {
	color: #ffffff !important;
}

html[data-fe-theme="dark"] .fe-glossary-mark {
	border-bottom-color: #72b9a4 !important;
	color: inherit !important;
}

html[data-fe-theme="dark"] .fe-glossary-mark:hover {
	color: #72b9a4 !important;
	border-bottom-color: #72b9a4 !important;
	background: rgba(114, 185, 164, 0.14) !important;
}
