/*
 * Wydarzenia filters (template-parts/events/filters.php). No section
 * mockup; built from the preview docs/preview/wydarzenia_v4.png: a panel
 * the width of the container with view tabs, three selects, a submit
 * button, a reset link and a hint to the other view.
 * Layout: one row from 82em; from 64em the fields in a row and the buttons
 * below; from 48em two columns; narrower, the fields one under another.
 */

.hf-events-filters
{
	padding-bottom: var(--hf-space-l);
}

.hf-events-filters__panel
{
	--hf-events-filters-pad: var(--hf-space-l);
	--hf-events-filters-divider: color-mix(in srgb, var(--hf-color-line) 18%, transparent);

	padding-inline: var(--hf-events-filters-pad);
	border-radius: var(--hf-radius-m);
	background: var(--hf-color-band);
}

/* View tabs: links with the current one underlined on the divider. */

.hf-events-filters__tabs
{
	display: flex;
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--hf-events-filters-divider);
	list-style: none;
}

/* The link fills its item, so both underlines sit on the divider even when
   one label wraps (phones). */
.hf-events-filters__tab-item
{
	display: flex;
}

.hf-events-filters__tab
{
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin-bottom: -1px;
	padding: 1.25rem var(--hf-space-s) var(--hf-space-m);
	border-bottom: 2px solid transparent;
	color: var(--hf-color-text);
	font-size: var(--hf-text-l);
	line-height: 1.2;
	text-decoration: none;
	transition: color var(--hf-transition), border-color var(--hf-transition);
}

.hf-events-filters__tab:hover
{
	color: var(--hf-color-heading);
	border-bottom-color: var(--hf-color-outline);
}

.hf-events-filters__tab[aria-current="page"]
{
	border-bottom-color: var(--hf-color-primary);
	color: var(--hf-color-heading);
}

/* Line icon before the label (assets/icons/calendar-ahead.svg, history.svg).
   The library draws them for 48 px; at about 26 px the stroke is raised so
   it stays a fine, but whole, line. */
.hf-events-filters__tab-icon
{
	flex: none;
	width: 1.1em;
	height: 1.1em;
	stroke-width: 2.2;
	opacity: 0.8;
	transition: opacity var(--hf-transition);
}

.hf-events-filters__tab:hover .hf-events-filters__tab-icon,
.hf-events-filters__tab[aria-current="page"] .hf-events-filters__tab-icon
{
	color: var(--hf-color-icon);
	opacity: 1;
}

/* Filter form. */

.hf-events-filters__form
{
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: end;
	gap: var(--hf-space-m) calc(var(--hf-space-m) + var(--hf-space-xs));
	padding: calc(var(--hf-space-m) + var(--hf-space-xs)) var(--hf-space-s);
	border-bottom: 1px solid var(--hf-events-filters-divider);
}

.hf-events-filters__label
{
	display: block;
	margin-bottom: var(--hf-space-xs);
	color: var(--hf-color-heading);
	font-size: var(--hf-text-control);
	line-height: 1.3;
}

.hf-events-filters__select-wrap
{
	position: relative;
	display: block;
}

/* Chevron drawn with a mask, so its colour comes from the tokens. */
.hf-events-filters__select-wrap::after
{
	position: absolute;
	top: 50%;
	right: 1.1rem;
	width: 1rem;
	height: 1rem;
	background: var(--hf-color-icon);
	content: "";
	pointer-events: none;
	translate: 0 -50%;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 9 7 7 7-7' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 9 7 7 7-7' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.hf-events-filters__select
{
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-height: var(--hf-button-height);
	margin: 0;
	padding: 0 3rem 0 var(--hf-space-s);
	border: 1px solid var(--hf-color-field-border);
	border-radius: var(--hf-radius-s);
	background: var(--hf-color-surface);
	color: var(--hf-color-text);
	font-family: var(--hf-font-text);
	font-size: var(--hf-text-control);
	line-height: 1.2;
	text-overflow: ellipsis;
	cursor: pointer;
	appearance: none;
}

.hf-events-filters__select:hover
{
	border-color: var(--hf-color-primary);
}

.hf-events-filters__select:focus-visible
{
	border-color: var(--hf-color-primary);
	outline: 2px solid var(--hf-color-focus);
	outline-offset: 1px;
}

.hf-events-filters__actions
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--hf-space-s) var(--hf-space-m);
}

/* As tall as the selects next to it (the button padding alone gives 57 px
   at 1440, the selects 52). */
.hf-events-filters__submit
{
	padding-block: 0;
}

.hf-events-filters__reset
{
	color: var(--hf-color-heading);
	font-size: var(--hf-text-control);
	text-decoration-color: var(--hf-color-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.3em;
}

.hf-events-filters__reset:hover
{
	color: var(--hf-color-primary-hover);
}

/* Hint to the other view, centred under the form. */

.hf-events-filters__hint
{
	margin: 0;
	padding-block: var(--hf-space-m);
	color: var(--hf-color-text);
	font-size: var(--hf-text-control);
	line-height: 1.4;
	text-align: center;
	text-wrap: balance;
}

/* Padding with an equal negative margin: a touch target about 44 px high
   (22 px before, 2026-11-02) that moves nothing on the page. */
.hf-events-filters__hint-link
{
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	margin-block: -0.7rem;
	padding-block: 0.7rem;
	color: var(--hf-color-heading);
	text-decoration: none;
}

.hf-events-filters__hint-text
{
	text-decoration: underline;
	text-decoration-color: var(--hf-color-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.3em;
}

.hf-events-filters__hint-link:hover
{
	color: var(--hf-color-primary-hover);
}

.hf-events-filters__hint-icon
{
	flex: none;
	width: 1.15em;
	height: 1.15em;
	transition: transform var(--hf-transition);
}

.hf-events-filters__hint-link:hover .hf-events-filters__hint-icon
{
	transform: translateX(3px);
}

/* Tablets: two columns; with three fields the buttons take the free cell
   next to the third one. */
@media (min-width: 48em) and (max-width: 63.99em)
{
	.hf-events-filters__form
	{
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hf-events-filters__form--2 .hf-events-filters__actions
	{
		grid-column: 1 / -1;
	}
}

/* Fields in a row, buttons below. */
@media (min-width: 64em)
{
	.hf-events-filters__form--3
	{
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.hf-events-filters__form--2
	{
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hf-events-filters__actions
	{
		grid-column: 1 / -1;
	}
}

/* Everything in one row, as in the preview at 1440. */
@media (min-width: 82em)
{
	.hf-events-filters__form--3
	{
		grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
	}

	.hf-events-filters__form--2
	{
		grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
	}

	.hf-events-filters__actions
	{
		grid-column: auto;
		flex-wrap: nowrap;
		min-height: var(--hf-button-height);
	}
}

/* Phones: a slimmer panel; the icon above the label, and the two tabs share
   the width by their text, so both fit side by side at 390 px (at 320 the
   longer label wraps). */
@media (max-width: 40em)
{
	.hf-events-filters__panel
	{
		--hf-events-filters-pad: var(--hf-space-s);
	}

	.hf-events-filters__tab-item
	{
		flex: 1 1 auto;
	}

	.hf-events-filters__tab
	{
		flex-direction: column;
		gap: 0.3em;
		padding-inline: var(--hf-space-xs);
		text-align: center;
		text-wrap: balance;
	}

	.hf-events-filters__form
	{
		padding-inline: 0;
	}
}
