/*
 * ZAJMIJ.TO catalogue. Uses the tokens of the ZAJMIJ.TO theme (--zt-*, DESIGN.md) when it is
 * active, so light and dark mode follow the theme; the fallbacks are the same values of the
 * theme ("Grafik obiektu" in the colours of the brand, 20.10.2026) for any other theme. The label
 * of the type is coloured like the legend of the theme's schedule and the categories of the app:
 * facilities in the platform blue, activities in violet, events in orange.
 */

.zto-catalogue,
.zto-gminy,
.zto-empty {
	--zto-surface: var(--zt-sheet, #fff);
	--zto-sunken: var(--zt-tint, #f5f5f7);
	--zto-raised: var(--zt-raised, #e8e8ed);
	--zto-text: var(--zt-ink, #1d1d1f);
	--zto-muted: var(--zt-muted, #5c5c61);
	--zto-line: var(--zt-line-strong, #d1d1d6);
	--zto-field: var(--zt-field-line, #8e8e93);
	--zto-accent: var(--zt-accent, #0062cc);
	--zto-cta: var(--zt-cta, linear-gradient(135deg, #005cbf, #833ea7));
	--zto-cta-hover: var(--zt-cta-hover, linear-gradient(135deg, #004a99, #6c2f8c));
	--zto-on-cta: #fff;
	--zto-booking: var(--zt-booking, #005cbf);
	--zto-class: var(--zt-class, #833ea7);
	--zto-event: var(--zt-event, #ea580c);
	--zto-radius: var(--zt-radius, 8px);
	--zto-radius-lg: var(--zt-radius-lg, 14px);
	--zto-shadow: var(--zt-shadow-sm, 0 1px 2px rgb(0 0 0 / 5%), 0 2px 6px rgb(0 0 0 / 5%));
	--zto-shadow-md: var(--zt-shadow-md, 0 2px 4px rgb(0 0 0 / 5%), 0 10px 24px -6px rgb(0 0 0 / 12%));
	color: var(--zto-text);
}

.zto-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.zto-icon {
	flex-shrink: 0;
}

/* Search form ---------------------------------------------------------------- */

.zto-search {
	display: grid;
	gap: 1rem;
	margin: 0 0 2.5rem;
	padding: clamp(1rem, 3vw, 1.5rem);
	border: 1px solid var(--zto-line);
	border-radius: var(--zto-radius-lg);
	background: var(--zto-surface);
	box-shadow: var(--zto-shadow);
}

.zto-search-main {
	display: flex;
	align-items: flex-end;
	gap: 0.75rem;
}

.zto-field {
	display: grid;
	gap: 0.35rem;
	min-width: 0;
}

.zto-field-q {
	flex: 1;
}

.zto-field label {
	font-size: 0.875rem;
	font-weight: 600;
}

.zto-field input,
.zto-field select {
	width: 100%;
	min-height: 48px;
	padding: 0.65rem 0.9rem;
	border: 1px solid var(--zto-field);
	border-radius: var(--zto-radius);
	background: var(--zto-surface);
	color: var(--zto-text);
	font: inherit;
}

.zto-field input::placeholder {
	color: var(--zto-muted);
	opacity: 1;
}

.zto-field input:focus-visible,
.zto-field select:focus-visible {
	border-color: var(--zto-accent);
	outline: 3px solid var(--zto-accent);
	outline-offset: 1px;
}

.zto-submit {
	min-height: 48px;
	padding: 0.7rem 1.4rem;
	border: 0;
	border-radius: var(--zto-radius);
	background: var(--zto-cta);
	color: var(--zto-on-cta);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.zto-submit:hover {
	background: var(--zto-cta-hover);
}

.zto-submit:focus-visible {
	outline: 3px solid var(--zto-accent);
	outline-offset: 3px;
}

.zto-filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 0.75rem;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.zto-reset {
	margin: 0;
	font-size: 0.9rem;
}

.zto-reset a,
.zto-empty a {
	color: var(--zto-accent);
	font-weight: 600;
}

/* Results -------------------------------------------------------------------- */

.zto-results-title {
	margin: 0 0 0.25rem;
	font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.zto-count,
.zto-stale,
.zto-note {
	margin: 0 0 1.5rem;
	color: var(--zto-muted);
	font-size: 0.9rem;
}

.zto-stale {
	padding: 0.6rem 0.9rem;
	border-radius: var(--zto-radius);
	background: var(--zto-sunken);
}

.zto-note {
	margin-top: 2rem;
}

.zto-empty {
	padding: 2rem;
	border: 1px dashed var(--zto-field);
	border-radius: var(--zto-radius-lg);
	background: var(--zto-sunken);
	text-align: center;
}

.zto-empty p {
	margin: 0 auto;
}

.zto-empty p + p {
	margin-top: 0.75rem;
}

.zto-grid {
	display: grid;
	/* Three cards in the 1200 px column of the theme, so the booking button keeps one line. */
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.zto-grid > li {
	display: flex;
	margin: 0;
}

/* Card, as PortalListingCard of the app: rounded-2xl, hairline border, shadow-sm. */
.zto-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	border: 1px solid var(--zto-line);
	border-radius: var(--zto-radius-lg);
	background: var(--zto-surface);
	box-shadow: var(--zto-shadow);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.zto-card:hover {
	box-shadow: var(--zto-shadow-md);
}

@media (prefers-reduced-motion: no-preference) {
	.zto-card:hover {
		transform: translateY(-2px);
	}
}

.zto-card-media {
	position: relative;
	aspect-ratio: 16 / 10;
	background: var(--zto-raised);
}

.zto-card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* No photo: a free slot of the schedule (light hatching of the accent) instead of a grey box. */
.zto-card-media:has(.zto-card-placeholder) {
	background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--zto-accent) 8%, transparent) 0 6px, transparent 6px 12px), var(--zto-sunken);
}

.zto-card-placeholder {
	display: grid;
	place-items: center;
	height: 100%;
	color: var(--zto-accent);
	opacity: 0.55;
}

.zto-card-placeholder .zto-icon {
	width: 36px;
	height: 36px;
}

.zto-card-type {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.2rem 0.6rem;
	border-radius: 6px;
	background: var(--zto-surface);
	color: var(--zto-text);
	font-size: 0.75rem;
	font-stretch: 88%;
	font-weight: 650;
	box-shadow: var(--zto-shadow);
}

.zto-card-type::before {
	content: "";
	width: 9px;
	height: 9px;
	border-radius: 2px;
	background: var(--zto-booking);
}

.zto-card-activity .zto-card-type::before {
	background: var(--zto-class);
}

.zto-card-event .zto-card-type::before {
	background: var(--zto-event);
}

.zto-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.6rem;
	padding: 1rem 1rem 1.1rem;
}

.zto-card-title {
	margin: 0;
	font-size: 1.08rem;
	font-weight: 680;
	line-height: 1.35;
	text-wrap: balance;
}

.zto-card-meta {
	display: grid;
	gap: 0.3rem;
	margin: 0;
	color: var(--zto-muted);
	font-size: 0.875rem;
}

.zto-card-meta > div {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.zto-card-meta dd {
	margin: 0;
}

.zto-card-price {
	margin: 0;
	font-weight: 600;
}

.zto-card-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 44px;
	margin-top: auto;
	padding: 0.6rem 1rem;
	border-radius: var(--zto-radius);
	background: var(--zto-cta);
	color: var(--zto-on-cta);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
}

.zto-card-link:hover {
	background: var(--zto-cta-hover);
	color: var(--zto-on-cta);
}

.zto-card-link:focus-visible {
	outline: 3px solid var(--zto-accent);
	outline-offset: 3px;
}

/* Pagination ----------------------------------------------------------------- */

.zto-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 2rem 0 0;
	padding: 0;
	list-style: none;
}

.zto-pagination a,
.zto-pagination [aria-current],
.zto-gap {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.8rem;
	border-radius: var(--zto-radius);
	font-weight: 600;
}

.zto-pagination a {
	border: 1px solid var(--zto-line);
	background: var(--zto-surface);
	color: var(--zto-text);
	text-decoration: none;
}

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

.zto-pagination [aria-current] {
	background: var(--zto-cta);
	color: var(--zto-on-cta);
}

.zto-gap {
	color: var(--zto-muted);
}

/* List of gminy -------------------------------------------------------------- */

.zto-gminy {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.zto-gmina {
	display: flex;
	margin: 0;
}

.zto-gmina-link {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	width: 100%;
	padding: 1rem;
	border: 1px solid var(--zto-line);
	border-radius: var(--zto-radius-lg);
	background: var(--zto-surface);
	color: var(--zto-text);
	text-decoration: none;
	box-shadow: var(--zto-shadow);
}

.zto-gmina-link:hover {
	border-color: var(--zto-accent);
}

.zto-gmina-link:hover .zto-gmina-name {
	color: var(--zto-accent);
	text-decoration: underline;
}

.zto-gmina-link:focus-visible {
	outline: 3px solid var(--zto-accent);
	outline-offset: 3px;
}

.zto-gmina-link > .zto-icon {
	margin-left: auto;
	color: var(--zto-muted);
}

/* The badge of the app header (initials on the accent); a gmina colour is >= 4.5:1 to white. */
.zto-gmina-badge {
	display: inline-grid;
	place-items: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: var(--zto-radius);
	background: var(--zto-gmina-color, var(--zto-cta));
	color: #fff;
	font-size: 0.8rem;
	font-weight: 700;
}

.zto-gmina-logo {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: var(--zto-radius);
	object-fit: contain;
}

.zto-gmina-text {
	display: grid;
	min-width: 0;
}

.zto-gmina-name {
	font-weight: 600;
}

.zto-gmina-detail {
	overflow-wrap: anywhere;
	color: var(--zto-muted);
	font-size: 0.85rem;
}

@media (max-width: 600px) {
	.zto-search-main {
		flex-direction: column;
		align-items: stretch;
	}
}

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

@media print {
	.zto-search,
	.zto-pagination,
	.zto-card-link .zto-icon {
		display: none;
	}
}
