/* Arkebuz – Wyszukiwarka aktualności. Kolory i kształty jak w reszcie strony (#DD133C, przyciski-pigułki). */

.ans {
	--ans-red: #dd133c;
	--ans-red-dark: #b80023;
	--ans-text: #191919;
	--ans-body: #404040;
	--ans-muted: #8a8a8a;
	--ans-line: #e2e2e2;
	--ans-tint: rgba( 221, 19, 60, 0.12 );
}

/* Motyw ustawia przyciskom wielkie litery – filtry i linki czytelniejsze zwykłymi. */
.ans .ans-chips .ans-chip,
.ans .ans-status .ans-reset,
.ans .ans-empty .ans-reset {
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
}

/* Pasek: wyszukiwarka + sortowanie */

.ans .ans-toolbar {
	display: flex;
	gap: 12px;
	align-items: center;
	margin: 0;
}

.ans .ans-search {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}

.ans .ans-search__icon {
	position: absolute;
	top: 50%;
	left: 18px;
	width: 20px;
	height: 20px;
	transform: translateY( -50% );
	fill: none;
	stroke: var( --ans-muted );
	stroke-width: 2;
	stroke-linecap: round;
	pointer-events: none;
}

.ans .ans-search .ans-search__input {
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 48px 0 50px;
	border: 1px solid var( --ans-line );
	border-radius: 30px;
	background: #fff;
	box-shadow: none;
	color: var( --ans-text );
	font-size: 16px;
	line-height: 1;
	-webkit-appearance: none;
	appearance: none;
}

.ans .ans-search .ans-search__input::-webkit-search-cancel-button {
	display: none;
}

.ans .ans-search .ans-search__input:focus {
	border-color: var( --ans-red );
	outline: none;
	box-shadow: 0 0 0 4px var( --ans-tint );
}

.ans .ans-search .ans-search__clear {
	position: absolute;
	top: 50%;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var( --ans-muted );
	transform: translateY( -50% );
	cursor: pointer;
}

.ans .ans-search .ans-search__clear[hidden] {
	display: none;
}

.ans .ans-search .ans-search__clear:hover,
.ans .ans-search .ans-search__clear:focus {
	background: #f0f0f0;
	color: var( --ans-text );
}

.ans .ans-search__clear svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.ans .ans-sort {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	margin: 0;
}

.ans .ans-sort__label {
	position: absolute;
	top: 7px;
	left: 20px;
	color: var( --ans-muted );
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	pointer-events: none;
}

.ans .ans-sort .ans-sort__select {
	height: 52px;
	min-width: 220px;
	margin: 0;
	padding: 16px 44px 0 19px;
	border: 1px solid var( --ans-line );
	border-radius: 30px;
	background: #fff url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23191919' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E" ) no-repeat right 18px center / 16px;
	box-shadow: none;
	color: var( --ans-text );
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ans .ans-sort .ans-sort__select:focus {
	border-color: var( --ans-red );
	outline: none;
	box-shadow: 0 0 0 4px var( --ans-tint );
}

/* Filtry */

.ans .ans-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 28px;
	margin-top: 18px;
}

.ans .ans-filters[hidden] {
	display: none;
}

.ans .ans-filter {
	display: flex;
	gap: 10px;
	align-items: center;
	min-width: 0;
}

.ans .ans-filter__label {
	flex: 0 0 auto;
	color: var( --ans-muted );
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ans .ans-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ans .ans-chips .ans-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var( --ans-line );
	border-radius: 20px;
	background: #fff;
	box-shadow: none;
	color: var( --ans-text );
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

/* Filtry tematów dostają --ans-topic (kolor tematu), pozostałe zostają czerwone. */
.ans .ans-chips .ans-chip:hover,
.ans .ans-chips .ans-chip:focus {
	border-color: var( --ans-topic, var( --ans-red ) );
	background: #fff;
	color: var( --ans-topic, var( --ans-red ) );
}

.ans .ans-chips .ans-chip:focus-visible {
	outline: 2px solid var( --ans-topic, var( --ans-red ) );
	outline-offset: 2px;
}

.ans .ans-chips .ans-chip[aria-pressed="true"] {
	border-color: var( --ans-topic, var( --ans-red ) );
	background: var( --ans-topic, var( --ans-red ) );
	color: #fff;
}

.ans .ans-chip__dot {
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var( --ans-topic );
}

.ans .ans-chip[aria-pressed="true"] .ans-chip__dot {
	background: #fff;
}

.ans .ans-chips .ans-chip[disabled] {
	opacity: 0.4;
	cursor: default;
}

.ans .ans-chips .ans-chip[disabled]:hover {
	border-color: var( --ans-line );
	color: var( --ans-text );
}

.ans .ans-chip__count {
	color: var( --ans-muted );
	font-size: 12px;
}

.ans .ans-chip[aria-pressed="true"] .ans-chip__count {
	color: rgba( 255, 255, 255, 0.8 );
}

/* Status wyników */

.ans .ans-status {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	align-items: center;
	min-height: 24px;
	margin: 22px 0 22px;
	color: var( --ans-muted );
	font-size: 14px;
}

.ans .ans-reset {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: var( --ans-red );
	font-size: 14px;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

.ans .ans-reset:hover,
.ans .ans-reset:focus {
	background: none;
	color: var( --ans-red-dark );
}

/* Siatka i karty */

.ans .ans-grid {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 35px 30px;
}

.ans .ans-group {
	grid-column: 1 / -1;
	margin: 10px 0 -10px;
	padding-bottom: 8px;
	border-bottom: 2px solid var( --ans-topic, var( --ans-red ) );
	color: var( --ans-text );
	font-size: 20px;
	line-height: 1.3;
}

.ans .ans-group:first-child {
	margin-top: 0;
}

.ans .ans-group span {
	color: var( --ans-muted );
	font-size: 15px;
	font-weight: 400;
}

.ans .ans-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 0 10px rgba( 0, 0, 0, 0.08 );
	animation: ans-in 0.3s ease both;
}

@keyframes ans-in {
	from {
		opacity: 0;
		transform: translateY( 8px );
	}
}

.ans .ans-card__media {
	position: relative;
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: #e9e9e9;
}

.ans .ans-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	transition: transform 0.35s ease-out;
}

.ans .ans-card:hover .ans-card__media img {
	transform: scale( 1.05 );
}

.ans .ans-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient( 135deg, #2a2a2a, #4a4a4a );
}

.ans .ans-card__topic,
.ans .ans-card__photos {
	position: absolute;
	padding: 5px 11px;
	border-radius: 20px;
	background: rgba( 0, 0, 0, 0.6 );
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.04em;
}

.ans .ans-card__topic {
	top: 14px;
	right: 14px;
	background: var( --ans-topic, rgba( 0, 0, 0, 0.6 ) );
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.25 );
	text-transform: uppercase;
}

.ans .ans-card__photos {
	bottom: 14px;
	left: 14px;
}

.ans .ans-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 26px 30px 24px;
}

.ans .ans-card__title {
	margin: 0 0 14px;
	font-size: 21px;
	line-height: 1.3;
}

.ans .ans-card__title a {
	color: var( --ans-red );
	text-decoration: none;
}

.ans .ans-card__title a:hover,
.ans .ans-card__title a:focus {
	color: var( --ans-red-dark );
}

.ans .ans-card__excerpt {
	flex: 1 1 auto;
	margin: 0 0 18px;
	color: var( --ans-body );
	font-size: 15px;
	line-height: 1.6;
}

.ans mark {
	padding: 0 2px;
	border-radius: 2px;
	background: var( --ans-tint );
	color: inherit;
}

.ans .ans-card__more {
	align-self: flex-start;
	color: var( --ans-red );
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-decoration: none;
	text-transform: uppercase;
}

.ans .ans-card__more:hover,
.ans .ans-card__more:focus {
	color: var( --ans-red-dark );
}

.ans .ans-card__meta {
	padding: 15px 30px;
	border-top: 1px solid #eee;
	color: #adadad;
	font-size: 12px;
}

.ans .ans-empty {
	grid-column: 1 / -1;
	padding: 48px 24px;
	border-radius: 6px;
	background: #fff;
	color: var( --ans-body );
	text-align: center;
}

.ans .ans-empty p {
	margin: 0 0 8px;
}

/* Załaduj kolejne – jak przyciski na stronie głównej */

.ans .ans-more {
	margin-top: 40px;
	text-align: center;
}

.ans .ans-more[hidden] {
	display: none;
}

.ans .ans-more .ans-more__btn {
	margin: 0;
	padding: 17px 40px;
	border: 0;
	border-radius: 30px;
	background: var( --ans-red );
	box-shadow: none;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.3s ease;
}

.ans .ans-more .ans-more__btn:hover,
.ans .ans-more .ans-more__btn:focus {
	background: var( --ans-red-dark );
	color: #fff;
}

/* Tablet */

@media ( max-width: 1024px ) {
	.ans .ans-grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

/* Telefon */

@media ( max-width: 767px ) {
	.ans .ans-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.ans .ans-sort .ans-sort__select {
		width: 100%;
	}

	/* nowrap: przy zawijaniu kolumna przyjęłaby szerokość najdłuższego rzędu filtrów. */
	.ans .ans-filters {
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 12px;
	}

	.ans .ans-filter {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
		width: 100%;
	}

	/* Filtry przewijane w bok zamiast łamania na kilka linii. */
	.ans .ans-chips {
		flex-wrap: nowrap;
		width: 100%;
		max-width: 100%;
		overflow-x: auto;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	.ans .ans-chips::-webkit-scrollbar {
		display: none;
	}

	.ans .ans-grid {
		grid-template-columns: minmax( 0, 1fr );
		gap: 24px;
	}

	.ans .ans-card__body {
		padding: 22px 22px 20px;
	}

	.ans .ans-card__meta {
		padding: 14px 22px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.ans .ans-card {
		animation: none;
	}

	.ans .ans-card__media img {
		transition: none;
	}

	.ans .ans-card:hover .ans-card__media img {
		transform: none;
	}
}
