/* ModraSova – grid warsztatów
   Kolory pobrane bezpośrednio z projektu. */

.msw {
	--msw-bg:      #f2f8fe;
	--msw-card:    #ffffff;
	--msw-ink:     #11171b;
	--msw-muted:   #6a6e71;
	--msw-faint:   #828587;
	--msw-line:    #e5eaf2;
	--msw-accent:  #4365ae;
	--msw-badge:   #d3433b;
	--msw-radius:  16px;
	--msw-kids-bg: ;

	/*background: var(--msw-card);*/
	background-image: linear-gradient(to bottom, var(--msw-card) 0%, transparent 100%);
	padding: 28px 24px 40px;
	border-radius: 20px;
	/* Dziedziczy krój po motywie, żeby grid nie odstawał od reszty strony. */
	color: var(--msw-ink);
}
/*.msw[data-grupa="dorosli"]{*/
/*	background-image: linear-gradient(to bottom, #fff 0%, transparent 100%);*/
/*}*/
.msw[data-grupa="dzieci"]{
	background-image: linear-gradient(to bottom, #fff 0%, transparent 100%);
}
.msw *,
.msw *::before,
.msw *::after { box-sizing: border-box; }

/* ------------------------------------------------------------- filtry */

.msw-filters {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	margin: 0 0 18px;
}

.msw-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.msw-label {
	font-size: 15px;
	font-weight: 600;
	color: var(--msw-muted);
	line-height: 1.2;
}

.msw-input,
.msw-select {
	width: 100%;
	background: var(--msw-card);
	border: 1px solid var(--msw-line);
	border-radius: 10px;
	padding: 13px 16px;
	font-size: 15px;
	color: var(--msw-ink);
	line-height: 1.3;
	appearance: none;
	-webkit-appearance: none;
}

.msw-input::placeholder { color: var(--msw-faint); }

.msw-input:focus-visible,
.msw-select:focus-visible {
	outline: 2px solid var(--msw-accent);
	outline-offset: 2px;
}

.msw-select-wrap { position: relative; }

.msw-select { padding-right: 44px; cursor: pointer; }

/* Strzałka rysowana pseudoelementem — natywna jest ukryta przez appearance. */
.msw-select-wrap::after {
	content: "";
	position: absolute;
	right: 18px;
	top: 50%;
	width: 10px;
	height: 10px;
	margin-top: -6px;
	border-right: 2px solid var(--msw-muted);
	border-bottom: 2px solid var(--msw-muted);
	transform: rotate(45deg);
	pointer-events: none;
}

.msw-apply {
	grid-column: 1 / -1;
	justify-self: start;
	background: var(--msw-accent);
	color: #fff;
	border: 0;
	border-radius: 10px;
	padding: 12px 22px;
	font-size: 15px;
	cursor: pointer;
}

/* ---------------------------------------------------------- sortowanie */

.msw-sortbar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	margin: 0 0 20px;
}

.msw-sort-label { font-size: 15px; color: var(--msw-muted); }

.msw-select-wrap--bare::after { right: 4px; border-color: var(--msw-ink); }

.msw-select--bare {
	background: transparent;
	border: 0;
	padding: 0 22px 0 0;
	font-weight: 600;
	color: var(--msw-ink);
	width: auto;
}

/* --------------------------------------------------------------- siatka */

.msw-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}

.msw-card {
	display: flex;
	flex-direction: column;
	background: var(--msw-card);
	border-radius: var(--msw-radius);
	padding: 10px 10px 0;
	box-shadow: 0 1px 3px rgba(17, 23, 27, .06);
	transition: box-shadow .18s ease, transform .18s ease;
}

.msw-card:hover {
	box-shadow: 0 8px 24px rgba(17, 23, 27, .10);
	transform: translateY(-2px);
}

.msw-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.msw-card-link:focus-visible {
	outline: 2px solid var(--msw-accent);
	outline-offset: 3px;
	border-radius: 12px;
}

.msw-thumb {
	position: relative;
	aspect-ratio: 7 / 6;
	border-radius: 12px;
	overflow: hidden;
	background: #edf0f6;
}

.msw-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.msw-thumb-empty { display: block; width: 100%; height: 100%; }

.msw-badge {
	position: absolute;
	top: 0;
	right: 0;
	background: var(--msw-badge);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	padding: 9px 14px;
	border-radius: 0 12px 0 10px;
}

.msw-body { padding: 16px 8px 14px; }

.msw-title {
	margin: 0;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--msw-ink);
}

.msw-cat {
	margin: 6px 0 0;
	font-size: 15px;
	color: var(--msw-faint);
}

/* ------------------------------------------------------- metadane karty */

.msw-meta {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: auto 0 0;
	padding: 12px 8px 14px;
	border-top: 1px solid var(--msw-line);
	list-style: none;
}

.msw-meta-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 15px;
	color: #4d5154;
	white-space: nowrap;
	min-width: 0;
}

.msw-icon {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	fill: var(--msw-muted);
}

/* --------------------------------------------------------- stronicowanie */

.msw-pagination { margin: 32px 0 0; }

.msw-pagination ul {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.msw-pagination a,
.msw-pagination span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 48px;
	padding: 0 12px;
	border-radius: 10px;
	background: var(--msw-card);
	border: 1px solid var(--msw-line);
	color: var(--msw-ink);
	font-size: 16px;
	text-decoration: none;
}

.msw-pagination a:hover { border-color: var(--msw-accent); }

.msw-pagination .current {
	background: var(--msw-accent);
	border-color: var(--msw-accent);
	color: #fff;
	font-weight: 600;
}

/* ------------------------------------------------------ stany i komunikaty */

.msw-empty,
.msw-notice {
	margin: 24px 0 0;
	padding: 28px;
	background: var(--msw-card);
	border-radius: var(--msw-radius);
	text-align: center;
	color: var(--msw-muted);
}

.msw-empty a { color: var(--msw-accent); }

/* ------------------------------------------------------------ responsywność */

@media (max-width: 1100px) {
	.msw-grid    { grid-template-columns: repeat(3, 1fr); }
	.msw-filters { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 782px) {
	.msw       { padding: 20px 16px 32px; }
	.msw-grid  { grid-template-columns: repeat(2, 1fr); gap: 16px; }
	.msw-title { font-size: 17px; }
	.msw-meta  { gap: 12px; }
}

@media (max-width: 520px) {
	.msw-grid    { grid-template-columns: 1fr; }
	.msw-filters { grid-template-columns: 1fr; gap: 14px; }
	.msw-sortbar { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	.msw-card { transition: none; }
	.msw-card:hover { transform: none; }
}

/* ------------------------------------------------------------- ładowanie */

.msw-results { position: relative; min-height: 120px; }

/* Wyniki przygasają zamiast znikać — układ się nie przeskakuje,
   a użytkownik widzi, że poprzednia lista jest już nieaktualna. */
.msw-results > .msw-grid,
.msw-results > .msw-pagination,
.msw-results > .msw-empty {
	transition: opacity .15s ease;
}

.msw.is-loading .msw-results > .msw-grid,
.msw.is-loading .msw-results > .msw-pagination,
.msw.is-loading .msw-results > .msw-empty {
	opacity: .35;
	pointer-events: none;
}

.msw-loader {
	position: absolute;
	inset: 0;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding-top: 80px;
	pointer-events: none;
}

.msw.is-loading .msw-loader { display: flex; }

.msw-loader span {
	width: 38px;
	height: 38px;
	border: 3px solid rgba(67, 101, 174, .22);
	border-top-color: var(--msw-accent);
	border-radius: 50%;
	animation: msw-spin .7s linear infinite;
}

@keyframes msw-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.msw-loader span {
		animation: none;
		border-top-color: rgba(67, 101, 174, .22);
		border-right-color: var(--msw-accent);
	}
	.msw-results > .msw-grid,
	.msw-results > .msw-pagination,
	.msw-results > .msw-empty { transition: none; }
}
