/*!
 * Skeleton Loading – style front-end
 * Zmienne: --skl-base, --skl-highlight, --skl-speed, --skl-radius, --skl-overlay-bg
 */

:root {
	--skl-base: #e2e5e9;
	--skl-highlight: #f4f6f8;
	--skl-speed: 1.4s;
	--skl-radius: 6px;
	--skl-overlay-bg: #ffffff;
}

/* ------------------------------------------------------------------
 * Powierzchnia skeletonu (wspólna dla wszystkich typów)
 * ---------------------------------------------------------------- */
.skl-block,
.skl-el,
html.skl-js img.skl-img:not(.skl-loaded) {
	background-color: var(--skl-base) !important;
	background-image: linear-gradient(90deg, var(--skl-base) 25%, var(--skl-highlight) 37%, var(--skl-base) 63%) !important;
	background-size: 400% 100% !important;
	background-repeat: no-repeat !important;
	border-radius: var(--skl-radius);
	animation: skl-shimmer var(--skl-speed) ease-in-out infinite;
}

/* Pulse */
.skl-anim-pulse .skl-block,
.skl-anim-pulse .skl-el,
html.skl-js.skl-anim-pulse img.skl-img:not(.skl-loaded) {
	background-image: none !important;
	animation: skl-pulse var(--skl-speed) ease-in-out infinite;
}

/* Statyczny */
.skl-anim-none .skl-block,
.skl-anim-none .skl-el,
html.skl-js.skl-anim-none img.skl-img:not(.skl-loaded) {
	background-image: none !important;
	animation: none;
}

@keyframes skl-shimmer {
	0%   { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}

@keyframes skl-pulse {
	0%, 100% { background-color: var(--skl-base); }
	50%      { background-color: var(--skl-highlight); }
}

@keyframes skl-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ------------------------------------------------------------------
 * Obrazki
 * ---------------------------------------------------------------- */
html.skl-js img.skl-img:not(.skl-loaded):not([height]) {
	min-height: 120px;
}

html.skl-js img.skl-img.skl-fadein {
	animation: skl-fade .4s ease-out both;
}

.no-skeleton.skl-img,
.no-skeleton .skl-img {
	background: none !important;
	animation: none !important;
	min-height: 0 !important;
}

/* ------------------------------------------------------------------
 * Elementy zakrywane skeletonem (.skl-el / data-skeleton / selektory z ustawień)
 * ---------------------------------------------------------------- */
.skl-el,
html.skl-js:not(.skl-ready) [data-skeleton] {
	color: transparent !important;
	border-color: transparent !important;
	box-shadow: none !important;
	pointer-events: none;
	user-select: none;
}

.skl-el > *,
html.skl-js:not(.skl-ready) [data-skeleton] > * {
	visibility: hidden !important;
}

html.skl-js:not(.skl-ready) [data-skeleton] {
	background-color: var(--skl-base) !important;
	background-image: linear-gradient(90deg, var(--skl-base) 25%, var(--skl-highlight) 37%, var(--skl-base) 63%) !important;
	background-size: 400% 100% !important;
	border-radius: var(--skl-radius);
	animation: skl-shimmer var(--skl-speed) ease-in-out infinite;
}

html.skl-js.skl-anim-pulse:not(.skl-ready) [data-skeleton] {
	background-image: none !important;
	animation: skl-pulse var(--skl-speed) ease-in-out infinite;
}

html.skl-js.skl-anim-none:not(.skl-ready) [data-skeleton] {
	background-image: none !important;
	animation: none;
}

.skl-fade-content.skl-revealed {
	animation: skl-fade .4s ease-out both;
}

/* ------------------------------------------------------------------
 * Placeholdery z shortcode [skeleton]
 * ---------------------------------------------------------------- */
.skl-ph {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.skl-ph *,
.skl-ph *::before,
.skl-ph *::after {
	box-sizing: border-box;
}

.skl-line {
	display: block;
	height: .85em;
	min-height: 10px;
	margin: 0 0 .75em;
	width: 100%;
}

.skl-line:last-child { margin-bottom: 0; }
.skl-line.is-short  { width: 60%; }
.skl-line.is-mid    { width: 82%; }

.skl-title {
	display: block;
	height: 1.6em;
	min-height: 20px;
	width: 70%;
	margin: 0 0 1em;
}

.skl-avatar {
	display: block;
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 50% !important;
}

.skl-image {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
}

.skl-button {
	display: inline-block;
	width: 130px;
	height: 42px;
}

.skl-card {
	display: block;
	padding: 16px;
	border: 1px solid rgba(0, 0, 0, .06);
	border-radius: calc(var(--skl-radius) + 4px);
	background: transparent;
}

.skl-card .skl-image { margin-bottom: 16px; }
.skl-card .skl-title { width: 75%; }

.skl-list-item {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 16px;
}

.skl-list-item:last-child { margin-bottom: 0; }
.skl-list-item .skl-lines { flex: 1 1 auto; }

.skl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
}

/* ------------------------------------------------------------------
 * [skeleton_wrap] – skeleton nad treścią, dopóki się nie wczyta
 * ---------------------------------------------------------------- */
.skl-wrap {
	display: grid;
}

.skl-wrap > .skl-wrap__ph,
.skl-wrap > .skl-wrap__content {
	grid-area: 1 / 1;
	min-width: 0;
}

.skl-wrap > .skl-wrap__content {
	opacity: 0;
	transition: opacity .4s ease-out;
}

.skl-wrap > .skl-wrap__ph {
	z-index: 1;
	transition: opacity .3s ease-out;
}

.skl-wrap.is-done > .skl-wrap__content { opacity: 1; }

.skl-wrap.is-done > .skl-wrap__ph {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.skl-wrap.is-done.is-instant > * { transition: none; }

/* ------------------------------------------------------------------
 * Pełnoekranowy ekran ładowania
 * ---------------------------------------------------------------- */
.skl-overlay {
	display: none;
}

html.skl-overlay-on {
	overflow: hidden !important;
}

html.skl-overlay-on .skl-overlay {
	display: block;
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	overflow: hidden;
	background: var(--skl-overlay-bg);
	opacity: 1;
	transition: opacity .35s ease-out;
}

html.skl-overlay-out .skl-overlay {
	opacity: 0;
	pointer-events: none;
}

.admin-bar .skl-overlay { top: 32px; }

@media (max-width: 782px) {
	.admin-bar .skl-overlay { top: 46px; }
}

.skl-overlay__inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 24px 24px 0;
}

.skl-overlay__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-bottom: 24px;
	margin-bottom: 40px;
	border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.skl-overlay__logo { width: 140px; height: 36px; }

.skl-overlay__nav {
	display: flex;
	gap: 18px;
}

.skl-overlay__nav .skl-block { width: 70px; height: 14px; }

.skl-overlay__hero { margin-bottom: 40px; }
.skl-overlay__hero .skl-title { width: 55%; height: 42px; }
.skl-overlay__hero .skl-image { aspect-ratio: 21 / 7; margin-top: 28px; }

.skl-overlay__cols {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 40px;
}

@media (max-width: 760px) {
	.skl-overlay__nav { display: none; }
	.skl-overlay__cols { grid-template-columns: 1fr; }
	.skl-overlay__cols > :nth-child(2) { display: none; }
	.skl-overlay__hero .skl-title { width: 85%; }
	.skl-overlay__hero .skl-image { aspect-ratio: 16 / 9; }
}

/* ------------------------------------------------------------------
 * Tryb automatyczny – warstwa z kształtami odwzorowującymi stronę
 * ---------------------------------------------------------------- */
.skl-auto-layer {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2147483000;
	pointer-events: none;
	opacity: 1;
	transition: opacity .4s ease-out;
	contain: layout style;
}

.skl-auto-layer--fixed {
	position: fixed;
	inset: 0;
	overflow: hidden;
	z-index: 2147483001;
}

.skl-auto-layer.is-out { opacity: 0; }

.skl-auto-layer.skl-auto-layer--under { z-index: 1; }

.skl-auto-layer .skl-s {
	position: absolute;
	display: block;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	border-radius: 4px;
	background-color: var(--skl-base);
	/* Wspólny, zsynchronizowany połysk dla całej strony. */
	background-image: linear-gradient(90deg, var(--skl-base) 30%, var(--skl-highlight) 45%, var(--skl-base) 60%);
	background-size: 300vw 100%;
	background-attachment: fixed;
	background-repeat: no-repeat;
	animation: skl-shimmer calc(var(--skl-speed) * 1.3) linear infinite;
}

/* Tła sekcji / kart – delikatniej, bez animacji. */
.skl-auto-layer .skl-s--b {
	background-image: none;
	animation: none;
	opacity: .4;
}

/* Same obramowania (np. białe karty z ramką). */
.skl-auto-layer .skl-s--o {
	background: none;
	animation: none;
	border: 1px solid var(--skl-base);
}

.skl-anim-pulse .skl-auto-layer .skl-s:not(.skl-s--b):not(.skl-s--o) {
	background-image: none;
	animation: skl-pulse var(--skl-speed) ease-in-out infinite;
}

.skl-anim-none .skl-auto-layer .skl-s {
	background-image: none;
	animation: none;
}

/* SkeletonLoading.auto(el) dla pojedynczego kontenera */
.skl-auto-target { color: transparent !important; }
.skl-auto-target > * { opacity: 0 !important; }
.skl-auto-target.skl-auto-target--out { color: inherit !important; }
.skl-auto-target.skl-auto-target--out > * {
	opacity: 1 !important;
	transition: opacity .4s ease-out;
}

/* Dostępność */
.skl-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.skl-block,
	.skl-el,
	html.skl-js img.skl-img,
	html.skl-js [data-skeleton],
	.skl-fade-content.skl-revealed {
		animation: none !important;
	}

	.skl-auto-layer .skl-s { animation: none !important; }

	.skl-overlay,
	.skl-auto-layer,
	.skl-wrap > * {
		transition: none !important;
	}
}

@media print {
	.skl-overlay,
	.skl-auto-layer,
	.skl-wrap__ph { display: none !important; }
	.skl-wrap__content { opacity: 1 !important; }
}
