/* Catalogue styles: summer camps page only (spec 010: finder form, count, results, "partly" boxes). Loaded after catalog-list.css. */
.ee-camps {
	scroll-margin-top: 6rem;
}

.ee-camps h2 {
	margin-top: 0;
}

/* The form: one column on phones; age and destination side by side from 600 px. */
.ee-camps__form {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
	padding: 1.1rem 1.25rem;
	border: 1px solid var(--ee-border);
	border-radius: var(--ee-r);
	background: #fff;
	box-shadow: var(--ee-shadow);
}

/* On phones the form is not a card: every pixel of width goes to the controls (From and To side by side at 360 px). */
@media (max-width: 599px) {
	.ee-camps__form {
		padding: 0;
		border: 0;
		background: transparent;
		box-shadow: none;
	}
}

@media (min-width: 600px) {
	.ee-camps__form {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.ee-camps__form > fieldset,
	.ee-camps__form > .ee-camps__presets,
	.ee-camps__form > .ee-camps__actions {
		grid-column: 1 / -1;
	}
}

.ee-camps__form p {
	margin: 0;
}

.ee-camps__form label,
.ee-camps__form legend {
	display: block;
	margin-bottom: 0.35rem;
	padding: 0;
	font-weight: 600;
	font-size: 1rem;
}

.ee-camps__form select,
.ee-camps__form input[type="date"],
.ee-camps__form input[type="text"] {
	box-sizing: border-box;
	width: 100%;
	min-height: 2.75rem;
	padding: 0.4rem 0.6rem;
	border: 2px solid #6d7a83;
	border-radius: 6px;
	background: var(--wp--preset--color--base, #fff);
	color: inherit;
	font: inherit;
}

.ee-camps__form [aria-invalid="true"] {
	border-color: var(--ee-error, #b3261e);
}

.ee-camps__form fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

/* From and To side by side (each at least 150 px wide); stacked on very narrow screens. Legend, hint and errors span the row. */
.ee-camps__dates {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
	gap: 0.75rem 1rem;
}

.ee-camps__dates > .ee-camps__hint,
.ee-camps__dates > .ee-camps__error {
	grid-column: 1 / -1;
}

.ee-camps__hint,
.ee-camps__error {
	margin: 0;
	font-size: 0.9em;
	color: var(--ee-muted);
}

/* The hidden default button: Enter in a field presses "Show camps", never a quick-choice button. Never visible. */
.ee-camps__default {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	border: 0;
}

.ee-camps__error {
	color: var(--ee-error, #b3261e);
	font-weight: 600;
}

/* Quick choice: buttons in the chip look. */
.ee-camps__presets {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	border: 0;
}

.ee-camps__presets-label {
	flex: 0 0 100%;
	font-weight: 600;
}

.ee-camps__presets button {
	min-height: 2.75rem;
	padding: 0.4rem 1rem;
	border: 2px solid #6d7a83;
	border-radius: 999px;
	background: #fff;
	color: var(--ee-blue);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.ee-camps__presets button:hover {
	background: var(--ee-soft);
	border-color: var(--ee-blue);
}

/* Long words in card titles (Polish "z zakwaterowaniem") must wrap inside the card at 320 px. */
.ee-camps .ee-item,
.ee-camps .ee-item > *,
.ee-camps .ee-item__title {
	min-width: 0;
	overflow-wrap: anywhere;
}

.ee-camps input[type="date"]:focus-within {
	outline: 3px solid var(--ee-blue, #243b4a); /* the calendar button inside the field keeps the outline */
	outline-offset: 2px;
}

/* One clear focus outline for every control of the finder (same token as the buttons: currentColor would vanish on the blue button). */
.ee-camps :is(select, input, button, a, summary):focus-visible {
	outline: 3px solid var(--ee-blue, #243b4a);
	outline-offset: 2px;
}

.ee-camps__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
}

.ee-camps__actions .wp-element-button,
.ee-camps__actions button[type="submit"] {
	min-height: 2.75rem;
	width: 100%;
}

.ee-camps__reset {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
}

@media (min-width: 600px) {
	.ee-camps__actions .wp-element-button,
	.ee-camps__actions button[type="submit"] {
		width: auto;
	}
}

/* Count line and results. */
.ee-camps__count {
	margin: 1.25rem 0 0.75rem;
	font-weight: 600;
}

.ee-camps__results {
	min-width: 0;
	scroll-margin-top: 6rem;
}

.ee-camps__results[aria-busy="true"] {
	opacity: 0.55;
	transition: opacity 0.15s;
}

.ee-camps__none {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--ee-blue);
	background: var(--ee-soft);
}

/* "Partly in your dates" and "Dates not published yet": closed boxes below the list. */
.ee-camps__more {
	margin: 1.25rem 0 0;
	border: 1px solid var(--ee-border);
	border-radius: var(--ee-r);
	background: #fff;
	box-shadow: var(--ee-shadow);
}

.ee-camps__more > summary {
	display: flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.5rem 1.25rem;
	font-weight: 600;
	cursor: pointer;
}

.ee-camps__more[open] > summary {
	border-bottom: 1px solid var(--ee-border);
}

.ee-camps__more > :not(summary) {
	margin: 1rem 1.25rem;
}

.ee-camps__list {
	display: grid;
	gap: 1rem;
	padding: 0;
	list-style: none;
}

.ee-camps__item {
	margin: 0;
}

/* Note and enquiry line under the list (after the swapped region). */
.ee-camps__after {
	margin-top: 1.5rem;
}

.ee-camps__days {
	margin: 0 0 1rem;
	font-size: 0.9em;
	color: var(--ee-muted);
}

.ee-camps__ask {
	margin: 0 0 0.75rem;
	font-weight: 600;
}

.ee-camps__after .wp-block-buttons {
	margin: 0;
}

@media (prefers-reduced-motion: reduce) {
	.ee-camps__results[aria-busy="true"] {
		transition: none;
	}
}
