/**
 * Otiumo: style kart, terminów, programu, galerii, strony imprezy i przycisku rezerwacji.
 *
 * Wszystko w warstwie `@layer otiumo` z selektorami `:where()` (zerowa specyficzność):
 * każdy CSS motywu wygrywa bez podnoszenia ważności reguł. Wygląd zmieniasz zmiennymi na `:root`
 * (wtyczka dopisuje je z ustawień „Wygląd” albo z theme.json motywu blokowego):
 *
 *   --otiumo-accent           kolor cen i przycisku
 *   --otiumo-accent-contrast  tekst na przycisku
 *   --otiumo-bg               tło kart i tabeli
 *   --otiumo-radius           zaokrąglenie rogów
 *   --otiumo-font             font elementów wtyczki (domyślnie font strony)
 *
 * Klasy w stylu BEM: .otiumo-card, .otiumo-card__price, .otiumo-terms__row …
 */

@layer otiumo {
	:where(.otiumo-single, .otiumo-archive, .otiumo-card, .otiumo-terms, .otiumo-program, .otiumo-includes, .otiumo-info, .otiumo-gallery, .otiumo-booking-button, .otiumo-ended, .otiumo-event-list, .otiumo-calendar, .otiumo-sample-note, .otiumo-facts, .otiumo-summary, .otiumo-pattern-card) {
		--_otiumo-accent: var(--otiumo-accent, #1c5df5);
		--_otiumo-accent-contrast: var(--otiumo-accent-contrast, #ffffff);
		--_otiumo-radius: var(--otiumo-radius, 12px);
		--_otiumo-border: color-mix(in srgb, currentColor 12%, transparent);
		--_otiumo-muted: color-mix(in srgb, currentColor 68%, transparent);
		--_otiumo-soft: color-mix(in srgb, currentColor 4%, transparent);
		--_otiumo-surface: var(--otiumo-bg, var(--wp--preset--color--base, Canvas));
		--_otiumo-shadow: 0 1px 2px color-mix(in srgb, currentColor 6%, transparent), 0 10px 30px -18px color-mix(in srgb, currentColor 35%, transparent);
		--_otiumo-shadow-hover: 0 2px 4px color-mix(in srgb, currentColor 8%, transparent), 0 22px 44px -22px color-mix(in srgb, currentColor 45%, transparent);
		--_otiumo-free: #17663a;
		--_otiumo-last: #a34700;
		--_otiumo-icon-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
		--_otiumo-icon-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
		--_otiumo-icon-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
		--_otiumo-icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
		--_otiumo-icon-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
		--_otiumo-icon-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='9' cy='9.5' r='1.6'/%3E%3Cpath d='m21 16-5.2-5.2a1.5 1.5 0 0 0-2.1 0L5 19.5'/%3E%3C/svg%3E");
		--_otiumo-icon-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12M7 10l5 5 5-5M5 21h14'/%3E%3C/svg%3E");
		--_otiumo-icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");
		box-sizing: border-box;
		font-family: var(--otiumo-font, inherit);
	}

	:where(.otiumo-card, .otiumo-terms, .otiumo-info, .otiumo-gallery, .otiumo-event-list, .otiumo-summary) :where(*, *::before, *::after) {
		box-sizing: inherit;
	}

	:where(.otiumo-sr-only) {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
		border: 0;
	}

	/* Ikona przed tekstem: `--_otiumo-icon` na elemencie. */
	:where(.otiumo-card__meta > *, .otiumo-facts .otiumo-fact--country, .otiumo-facts .otiumo-fact--date-range, .otiumo-facts .otiumo-fact--duration, .otiumo-summary .otiumo-fact--date-range, .otiumo-summary .otiumo-fact--duration)::before {
		content: "";
		flex: none;
		width: 1.05em;
		height: 1.05em;
		background: currentColor;
		-webkit-mask: var(--_otiumo-icon) center / contain no-repeat;
		mask: var(--_otiumo-icon) center / contain no-repeat;
	}

	:where(.otiumo-card__dates, .otiumo-fact--date-range) {
		--_otiumo-icon: var(--_otiumo-icon-calendar);
	}

	:where(.otiumo-card__duration, .otiumo-fact--duration) {
		--_otiumo-icon: var(--_otiumo-icon-clock);
	}

	:where(.otiumo-card__country, .otiumo-fact--country) {
		--_otiumo-icon: var(--_otiumo-icon-pin);
	}

	/* Lista imprez */
	:where(.otiumo-archive__header) {
		margin-block-end: 1.5rem;
	}

	:where(.otiumo-archive__title) {
		margin-block: 0 0.5rem;
	}

	/*
	 * Liczba kolumn według miejsca na listę, nie szerokości okna: w wąskiej kolumnie treści motywu
	 * (np. lista wstawiona w zwykły akapit strony) karty nie ściskają się po trzy. `columns` to
	 * najwięcej kolumn; karta ma co najmniej ok. 16rem.
	 */
	:where(.otiumo-event-list) {
		container-type: inline-size;
	}

	:where(.otiumo-event-list__grid) {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		gap: 2.5rem 1.75rem;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	@container (min-width: 34rem) {
		:where(.otiumo-event-list--columns-2, .otiumo-event-list--columns-3, .otiumo-event-list--columns-4) :where(.otiumo-event-list__grid) {
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}
	}

	@container (min-width: 50rem) {
		:where(.otiumo-event-list--columns-3, .otiumo-event-list--columns-4) :where(.otiumo-event-list__grid) {
			grid-template-columns: repeat(3, minmax(0, 1fr));
		}
	}

	@container (min-width: 66rem) {
		:where(.otiumo-event-list--columns-4) :where(.otiumo-event-list__grid) {
			grid-template-columns: repeat(4, minmax(0, 1fr));
		}
	}

	:where(.otiumo-event-list__item) {
		display: flex;
		min-width: 0;
		margin: 0;
	}

	:where(.otiumo-event-list__empty) {
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-event-list__pagination) {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem;
		justify-content: center;
		margin-top: 2.5rem;
	}

	:where(.otiumo-event-list__pagination .page-numbers) {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 2.75rem;
		min-height: 2.75rem;
		padding: 0.5rem 0.875rem;
		border: 1px solid var(--_otiumo-border);
		border-radius: 999px;
		text-align: center;
		text-decoration: none;
		transition: border-color 0.15s, background-color 0.15s;
	}

	:where(.otiumo-event-list__pagination a.page-numbers:hover, .otiumo-event-list__pagination a.page-numbers:focus-visible) {
		border-color: currentColor;
	}

	:where(.otiumo-event-list__pagination .page-numbers.current) {
		background: var(--_otiumo-accent);
		border-color: var(--_otiumo-accent);
		color: var(--_otiumo-accent-contrast);
	}

	/*
	 * Karta imprezy jak w katalogu podróży: zdjęcie niesie kartę, tekst stoi pod nim bez ramki
	 * i cienia. Karta bez zdjęcia (pole `image` wyłączone) dostaje cienką ramkę, żeby tekst nie
	 * wisiał w próżni.
	 */
	:where(.otiumo-card) {
		position: relative;
		display: flex;
		flex-direction: column;
		width: 100%;
		min-width: 0;
	}

	:where(.otiumo-card:not(.otiumo-card--has-media)) {
		border: 1px solid var(--_otiumo-border);
		border-radius: var(--_otiumo-radius);
		background: var(--_otiumo-surface);
	}

		/*
	 * Proporcje na kontenerze, a zdjęcie wypełnia go przez `min-height: 100%`: motywy nadpisują
	 * obrazkom `height` (np. Twenty Twenty-One `height: auto`), a przeglądarka obrazkom z
	 * `sizes="auto"` (leniwe ładowanie WordPressa) wymusza `contain: size`, przy którym
	 * `aspect-ratio` na samym obrazku daje złą wysokość. `min-height` motywy zostawiają.
	 */
	:where(.otiumo-card__media) {
		display: block;
		aspect-ratio: 4 / 3;
		overflow: hidden;
		/* Zaokrąglenie trzyma też powiększane zdjęcie (Safari bez `isolation` je gubi). */
		isolation: isolate;
		border-radius: var(--_otiumo-radius);
		background: var(--_otiumo-soft);
	}

	:where(.otiumo-card__media img, .otiumo-card__image) {
		display: block;
		width: 100%;
		height: 100%;
		min-height: 100%;
		object-fit: cover;
		background: var(--_otiumo-border);
		transition: transform 0.5s ease, filter 0.2s ease;
	}

	:where(.otiumo-card:hover .otiumo-card__media img) {
		transform: scale(1.03);
	}

	/* Impreza bez zdjęcia: miękkie tło w kolorze akcentu z ikoną zdjęcia zamiast pustej dziury. */
	:where(.otiumo-card__placeholder) {
		position: relative;
		display: block;
		width: 100%;
		height: 100%;
		background: linear-gradient(135deg, color-mix(in srgb, var(--_otiumo-accent) 14%, transparent), color-mix(in srgb, var(--_otiumo-accent) 4%, transparent));
	}

	:where(.otiumo-card__placeholder)::after {
		content: "";
		position: absolute;
		inset: 0;
		margin: auto;
		width: 3rem;
		height: 3rem;
		background: color-mix(in srgb, var(--_otiumo-accent) 45%, transparent);
		-webkit-mask: var(--_otiumo-icon-image) center / contain no-repeat;
		mask: var(--_otiumo-icon-image) center / contain no-repeat;
	}

	:where(.otiumo-card--closed, .otiumo-card--ended, .otiumo-card--none) :where(.otiumo-card__media img) {
		filter: grayscale(0.55);
	}

	:where(.otiumo-card__body) {
		display: flex;
		flex: 1;
		flex-direction: column;
		gap: 0.5rem;
		padding: 1rem 0.125rem 0;
	}

	:where(.otiumo-card:not(.otiumo-card--has-media) .otiumo-card__body) {
		padding: 1.125rem 1.25rem 1.25rem;
	}

	:where(.otiumo-card__body) > :where(*) {
		margin: 0;
	}

	:where(.otiumo-card__title) {
		font-size: 1.125em;
		font-weight: 600;
		line-height: 1.3;
		overflow-wrap: anywhere;
	}

	:where(.otiumo-card__title a) {
		color: inherit;
		text-decoration: none;
		text-decoration-thickness: 1px;
		text-underline-offset: 0.2em;
	}

	/* Cała karta jest linkiem: podkreślony tytuł mówi, dokąd prowadzi. */
	:where(.otiumo-card:hover .otiumo-card__title a) {
		text-decoration-line: underline;
	}

	/* Cały obszar karty prowadzi na stronę imprezy (link tytułu). */
	:where(.otiumo-card__title a)::after {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 1;
	}

	/* Obrys fokusu na całej karcie (warstwa `::after` linku ma rozmiar karty). */
	:where(.otiumo-card__title a:focus-visible) {
		outline: none;
	}

	:where(.otiumo-card__title a:focus-visible)::after {
		border-radius: var(--_otiumo-radius);
		outline: 2px solid var(--_otiumo-accent);
		outline-offset: 3px;
	}

	:where(.otiumo-card__meta) {
		display: flex;
		flex-wrap: wrap;
		gap: 0.375rem 1rem;
		font-size: 0.875em;
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-card__meta > *) {
		display: inline-flex;
		align-items: center;
		gap: 0.4rem;
	}

	:where(.otiumo-card__meta > .otiumo-card__country) {
		flex-basis: 100%;
	}

	:where(.otiumo-card__dates, .otiumo-card__duration, .otiumo-card__country) {
		font-size: 0.9375em;
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-card__meta) :where(.otiumo-card__dates, .otiumo-card__duration, .otiumo-card__country) {
		font-size: inherit;
	}

	:where(.otiumo-card__more-terms) {
		padding: 0.05rem 0.5rem;
		border-radius: 999px;
		background: var(--_otiumo-soft);
		font-size: 0.875em;
		white-space: nowrap;
	}

	/* Cena na dole karty (wyrównana w rzędzie siatki), „od” mniejsze i wyciszone. */
	:where(.otiumo-card__price) {
		margin-top: auto;
		padding-top: 0.25rem;
		font-size: 1.125em;
		font-weight: 700;
		line-height: 1.3;
		color: var(--_otiumo-accent);
	}

	:where(.otiumo-card__price-label) {
		font-size: 0.75em;
		font-weight: 500;
		color: var(--_otiumo-muted);
	}

	/* Status miejsc */
	:where(.otiumo-availability, .otiumo-fact--availability-label) {
		display: inline-flex;
		align-items: center;
		gap: 0.45em;
		width: fit-content;
		max-width: 100%;
		padding: 0.2em 0.7em;
		border-radius: 999px;
		background: var(--_otiumo-soft);
		font-size: 0.8125em;
		font-weight: 600;
		line-height: 1.4;
		white-space: nowrap;
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-availability, .otiumo-fact--availability-label)::before {
		content: "";
		flex: none;
		width: 0.5em;
		height: 0.5em;
		border-radius: 999px;
		background: currentColor;
	}

	:where(.otiumo-fact--availability-label:empty) {
		display: none;
	}

	:where(.otiumo-availability--free, .otiumo-fact--availability-label[data-otiumo-availability="free"]) {
		color: var(--_otiumo-free);
		background: color-mix(in srgb, var(--_otiumo-free) 11%, transparent);
	}

	:where(.otiumo-availability--last, .otiumo-fact--availability-label[data-otiumo-availability="last"]) {
		color: var(--_otiumo-last);
		background: color-mix(in srgb, var(--_otiumo-last) 12%, transparent);
	}

	/* Plakietka na zdjęciu karty (białe tło, czytelna na każdym zdjęciu). */
	:where(.otiumo-card--has-media .otiumo-card__availability) {
		position: absolute;
		top: 0.875rem;
		left: 0.875rem;
		z-index: 2;
		background: #ffffffeb;
		box-shadow: 0 2px 10px rgb(0 0 0 / 0.15);
		pointer-events: none;
	}

	:where(.otiumo-card--has-media .otiumo-card__availability.otiumo-availability--none, .otiumo-card--has-media .otiumo-card__availability.otiumo-availability--closed, .otiumo-card--has-media .otiumo-card__availability.otiumo-availability--ended, .otiumo-card--has-media .otiumo-card__availability.otiumo-availability--unknown) {
		color: #4a4f55;
	}

	/* Terminy i ceny */
	:where(.otiumo-terms) {
		width: 100%;
		overflow: hidden;
		border: 1px solid var(--_otiumo-border);
		border-radius: var(--_otiumo-radius);
		background: var(--_otiumo-surface);
		/* Wąska kolumna (np. obok programu) też dostaje układ kart, nie tylko telefon. */
		container-type: inline-size;
	}

	:where(.otiumo-terms__table) {
		width: 100%;
		margin: 0;
		border: 0;
		border-collapse: collapse;
		background: transparent;
	}

	:where(.otiumo-terms__table th, .otiumo-terms__table td) {
		padding: 0.875rem 1rem;
		border: 0;
		border-bottom: 1px solid var(--_otiumo-border);
		text-align: start;
		vertical-align: middle;
	}

	:where(.otiumo-terms__table tbody tr:last-child td) {
		border-bottom: 0;
	}

	:where(.otiumo-terms__table th) {
		padding-block: 0.75rem;
		background: transparent;
		font-size: 0.875em;
		font-weight: 600;
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-terms__row) {
		transition: background-color 0.15s;
	}

	:where(.otiumo-terms__row:hover) {
		background: var(--_otiumo-soft);
	}

	:where(.otiumo-terms__dates) {
		font-weight: 600;
		white-space: nowrap;
	}

	:where(.otiumo-terms__price) {
		font-weight: 700;
		color: var(--_otiumo-accent);
		white-space: nowrap;
	}

	/* Bez łamania „8 dni” i nagłówka „Długość” w szerokiej tabeli. */
	:where(.otiumo-terms__table .otiumo-terms__duration) {
		white-space: nowrap;
	}

	:where(.otiumo-terms__action) {
		text-align: end;
	}

	:where(.otiumo-terms__action .otiumo-booking-button) {
		padding: 0.5rem 1.125rem;
		font-size: 0.9375em;
	}

	/* Progi w em, nie w rem: w @container em to czcionka samej tabeli, więc progi rosną razem
	   z tekstem. Motyw z dużą czcionką (Twenty Twenty-Five ok. 22 px) w kolumnie ok. 645 px
	   miał cztery kolumny szersze od tabeli i ucięty przycisk „Rezerwuj”.
	   Średnia szerokość (np. kolumna treści motywu obok karty rezerwacji, ok. 770 px przy 16 px):
	   bez kolumny długości (jest w faktach imprezy), a pięć kolumn z przyciskiem nie mieści się
	   poniżej ok. 54em. Zakres (37.5em < width) styka się z progiem kart bez szczeliny: przy
	   min-width 37.5625em szczelina rosła z czcionką (przy 22 px ok. 1,4 px pięciu kolumn). */
	@container (37.5em < width <= 54em) {
		:where(.otiumo-terms__table .otiumo-terms__duration) {
			display: none;
		}
	}

	@container (max-width: 37.5em) {
		:where(.otiumo-terms__table thead) {
			position: absolute;
			width: 1px;
			height: 1px;
			overflow: hidden;
			clip: rect(0 0 0 0);
		}

		:where(.otiumo-terms__table, .otiumo-terms__table tbody, .otiumo-terms__row, .otiumo-terms__table td) {
			display: block;
			width: 100%;
		}

		:where(.otiumo-terms__row) {
			padding: 0.875rem 1rem;
			border-bottom: 1px solid var(--_otiumo-border);
		}

		:where(.otiumo-terms__row:last-child) {
			border-bottom: 0;
		}

		:where(.otiumo-terms__table td) {
			display: flex;
			justify-content: space-between;
			gap: 1rem;
			padding: 0.25rem 0;
			border: 0;
			text-align: end;
		}

		:where(.otiumo-terms__table td[data-label])::before {
			content: attr(data-label);
			font-weight: 400;
			color: var(--_otiumo-muted);
			text-align: start;
		}

		:where(.otiumo-terms__action) {
			justify-content: flex-start;
			padding-top: 0.625rem;
		}

		:where(.otiumo-terms__action .otiumo-booking-button) {
			width: 100%;
			text-align: center;
		}
	}

	/* Przycisk rezerwacji (motyw blokowy: styl przycisku z theme.json przez .wp-element-button) */
	:where(.otiumo-booking-button) {
		display: inline-block;
		padding: 0.75rem 1.5rem;
		border: 2px solid var(--_otiumo-accent);
		border-radius: var(--_otiumo-radius);
		background: var(--_otiumo-accent);
		color: var(--_otiumo-accent-contrast);
		font-weight: 600;
		line-height: 1.3;
		text-align: center;
		text-decoration: none;
		white-space: nowrap;
		cursor: pointer;
		transition: filter 0.15s, transform 0.15s;
	}

	:where(.otiumo-booking-button:hover, .otiumo-booking-button:focus-visible) {
		filter: brightness(0.9);
		color: var(--_otiumo-accent-contrast);
	}

	:where(.otiumo-booking-button:active) {
		transform: translateY(1px);
	}

	:where(.otiumo-booking-button:focus-visible) {
		outline: 2px solid var(--_otiumo-accent);
		outline-offset: 2px;
	}

	:where(.otiumo-booking-button--waiting-list) {
		background: transparent;
		color: var(--_otiumo-accent);
	}

	:where(.otiumo-booking-button--waiting-list:hover, .otiumo-booking-button--waiting-list:focus-visible) {
		color: var(--_otiumo-accent);
	}

	/* Strona imprezy */
	:where(.otiumo-single__title) {
		margin-block-end: 0;
	}

	/* Fakty pod tytułem (akapity z wiązaniami otiumo/event): wiersz z ikonami. */
	:where(.otiumo-facts) {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem 1.5rem;
		align-items: center;
	}

	:where(.otiumo-fact) {
		margin: 0;
	}

	:where(.otiumo-fact:empty) {
		display: none;
	}

	:where(.otiumo-facts .otiumo-fact--country, .otiumo-facts .otiumo-fact--date-range, .otiumo-facts .otiumo-fact--duration) {
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
		font-size: 1em;
		color: var(--_otiumo-muted);
	}

	/* Odstęp między faktami wewnątrz elementów: `gap` grupy ustawia układ bloku WordPressa (wygrywa z warstwą). */
	:where(.otiumo-facts) > :where(.otiumo-fact:not(:last-child)) {
		padding-inline-end: 0.875rem;
	}

	:where(.otiumo-facts .otiumo-fact--availability-label) {
		font-size: 0.875em;
	}

	:where(.otiumo-fact--price-from) {
		font-size: 1.25em;
		font-weight: 700;
		color: var(--otiumo-accent, inherit);
	}

	/* Dwie kolumny pod galerią: treść i karta rezerwacji (na telefonie karta zaraz pod galerią). */
	@media (min-width: 782px) {
		:where(.otiumo-event-aside) {
			order: 2;
		}

		/* Kolumny bloku mają wysokość rzędu (`align-items: normal`), więc karta jedzie z przewijaniem. */
		:where(.otiumo-event-aside .otiumo-summary) {
			position: sticky;
			top: calc(var(--wp-admin--admin-bar--height, 0px) + 1.5rem);
		}
	}

	:where(.otiumo-event-main) > :where(h2, .wp-block-otiumo-booking-button) {
		margin-top: 3rem;
	}

	:where(.otiumo-event-main) > :where(h2:first-child) {
		margin-top: 0;
	}

	/* Karta rezerwacji */
	:where(.otiumo-summary) {
		padding: 1.5rem;
		border: 1px solid var(--_otiumo-border);
		border-radius: var(--_otiumo-radius);
		background: var(--_otiumo-surface);
		box-shadow: var(--_otiumo-shadow);
	}

	:where(.otiumo-summary) > :where(*) {
		margin: 0;
	}

	:where(.otiumo-summary .otiumo-fact--price-from) {
		font-size: 1.5em;
		line-height: 1.15;
		letter-spacing: -0.01em;
	}

	:where(.otiumo-summary .otiumo-fact--date-range, .otiumo-summary .otiumo-fact--duration) {
		display: flex;
		align-items: center;
		gap: 0.5rem;
		font-size: 0.9375em;
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-summary .wp-block-otiumo-booking-button) {
		margin-top: 0.5rem;
	}

	:where(.otiumo-summary .otiumo-booking-button) {
		display: block;
		width: 100%;
		padding: 0.95rem 1.25rem;
		font-size: 1.0625em;
	}

	/* Pusty fakt (np. impreza bez kraju) znika — po regułach wyżej, które ustawiają `display`. */
	:where(.otiumo-facts, .otiumo-summary) :where(.otiumo-fact:empty) {
		display: none;
	}

	/* Karty z wzorców (pętla wpisów „Imprezy Otiumo” z akapitami związanymi z polami) */
	:where(.otiumo-pattern-card) {
		height: 100%;
		padding: 0 0 1rem;
		overflow: hidden;
		background: var(--otiumo-bg, transparent);
		border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
		border-radius: var(--otiumo-radius, 12px);
	}

	:where(.otiumo-pattern-card) > :where(:not(.wp-block-post-featured-image)) {
		margin-block: 0;
		padding-inline: 1rem;
	}

	:where(.otiumo-pattern-card .wp-block-post-featured-image) {
		margin: 0;
	}

	:where(.otiumo-pattern-card--horizontal) {
		padding: 1rem;
	}

	:where(.otiumo-pattern-card--horizontal) > :where(*) {
		padding-inline: 0;
	}

	:where(.otiumo-pattern-card--horizontal .wp-block-post-featured-image) {
		max-width: 100%;
		border-radius: var(--otiumo-radius, 12px);
		overflow: hidden;
	}

	:where(.otiumo-pattern-card__title a) {
		color: inherit;
		text-decoration: none;
	}

	/* Program: oś dni (linia po lewej, dzień = pogrubiony wiersz, a pod nim pogrubiony tytuł dnia). */
	:where(.otiumo-program__summary) {
		padding: 0.5rem 0;
		font-weight: 600;
		cursor: pointer;
	}

	:where(.otiumo-program__content) {
		--_otiumo-rail: 1.75rem;
		position: relative;
		padding-inline-start: var(--_otiumo-rail);
		border-inline-start: 2px solid var(--_otiumo-border);
	}

	@media (max-width: 599px) {
		:where(.otiumo-program__content) {
			--_otiumo-rail: 1.125rem;
		}
	}

	:where(.otiumo-program__content) > :where(:first-child) {
		margin-top: 0;
	}

	:where(.otiumo-program__content) > :where(:last-child) {
		margin-bottom: 0;
	}

	/*
	 * Nagłówek dnia: akapit z samym pogrubieniem (klasę `otiumo-program__day` nadaje
	 * `Program::format`) albo nagłówek h2–h6 z edytora. Punkt na osi, odstęp przed dniem.
	 */
	:where(.otiumo-program__content) > :where(.otiumo-program__day, h2, h3, h4, h5, h6) {
		position: relative;
		margin-block: 1.75rem 0.5rem;
		font-size: 1.0625em;
		font-weight: 700;
		line-height: 1.35;
	}

	:where(.otiumo-program__content) > :where(.otiumo-program__day, h2, h3, h4, h5, h6):first-child {
		margin-block-start: 0;
	}

	:where(.otiumo-program__content) > :where(.otiumo-program__day, h2, h3, h4, h5, h6)::before {
		content: "";
		position: absolute;
		top: 0.3em;
		inset-inline-start: calc(-1 * var(--_otiumo-rail) - 7px);
		width: 12px;
		height: 12px;
		border: 2px solid var(--_otiumo-accent);
		border-radius: 999px;
		background: var(--_otiumo-surface);
	}

	/* Dwa nagłówki pod rząd („Dzień 1”, potem tytuł dnia): pierwszy to mała etykieta, drugi bez punktu. */
	:where(.otiumo-program__content) > :where(.otiumo-program__day:has(+ .otiumo-program__day)) {
		margin-block-end: 0.125rem;
		font-size: 0.8125em;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		color: var(--_otiumo-accent);
	}

	:where(.otiumo-program__content) > :where(.otiumo-program__day + .otiumo-program__day) {
		margin-block-start: 0;
	}

	:where(.otiumo-program__content) > :where(.otiumo-program__day + .otiumo-program__day)::before {
		content: none;
	}

	/* Wyjustowany tekst z edytora Otiumo robi „rzeki” odstępów na wąskich ekranach. */
	:where(.otiumo-program__content, .otiumo-includes__content) :where(.ql-align-justify) {
		text-align: start;
	}

	/* Cena obejmuje / nie obejmuje */
	:where(.otiumo-includes) {
		display: grid;
		gap: 1rem;
		grid-template-columns: minmax(0, 1fr);
		align-items: start;
	}

	@media (min-width: 600px) {
		:where(.otiumo-includes--columns) {
			grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
		}
	}

	:where(.otiumo-includes__section) {
		padding: 1.25rem 1.5rem 1.375rem;
		border-radius: var(--_otiumo-radius);
		background: var(--_otiumo-soft);
	}

	:where(.otiumo-includes__title) {
		margin: 0 0 0.75rem;
		font-size: 1.125em;
	}

	:where(.otiumo-includes__content) > :where(:first-child) {
		margin-top: 0;
	}

	:where(.otiumo-includes__content) > :where(:last-child) {
		margin-bottom: 0;
	}

	:where(.otiumo-includes__content ul) {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	/* Flex zamiast znacznika listy: ikona nie zależy od wcięć i punktorów motywu. */
	:where(.otiumo-includes__content li) {
		display: flex;
		gap: 0.65rem;
		align-items: baseline;
		margin: 0;
		padding: 0.3rem 0;
	}

	:where(.otiumo-includes__content li)::before {
		content: "";
		flex: none;
		align-self: flex-start;
		margin-top: 0.2em;
		width: 1.05em;
		height: 1.05em;
		background: var(--_otiumo-free);
		-webkit-mask: var(--_otiumo-icon-check) center / contain no-repeat;
		mask: var(--_otiumo-icon-check) center / contain no-repeat;
	}

	:where(.otiumo-includes__section--excluded .otiumo-includes__content li)::before {
		background: var(--_otiumo-muted);
		-webkit-mask-image: var(--_otiumo-icon-x);
		mask-image: var(--_otiumo-icon-x);
	}

	/* Sekcje oferty (blok „Informacje”): tekst z Otiumo albo szczegóły z `templates/details/`. */
	:where(.otiumo-info__title) {
		margin: 0 0 0.75rem;
	}

	:where(.otiumo-info__content) > :where(:first-child),
	:where(.otiumo-details) > :where(:first-child),
	:where(.otiumo-details__description, .otiumo-details__hotel, .otiumo-details__group) > :where(:first-child) {
		margin-top: 0;
	}

	:where(.otiumo-info__content) > :where(:last-child),
	:where(.otiumo-details) > :where(:last-child),
	:where(.otiumo-details__description, .otiumo-details__hotel, .otiumo-details__group) > :where(:last-child) {
		margin-bottom: 0;
	}

	:where(.otiumo-info__content) :where(.ql-align-justify) {
		text-align: start;
	}

	:where(.otiumo-details__lead) {
		margin: 0 0 0.75rem;
		font-weight: 600;
	}

	:where(.otiumo-details__subtitle) {
		margin: 1.5rem 0 0.25rem;
	}

	:where(.otiumo-details__note) {
		margin: 0.75rem 0 0;
		font-size: 0.875em;
		color: var(--_otiumo-muted);
	}

	/* Motyw z lekkim fontem bazowym daje `strong` wagę 400 („bolder” od 300). */
	:where(.otiumo-details__subtitle, .otiumo-details__leg-title, .otiumo-details__hotel-name) > :where(strong) {
		font-weight: 600;
	}

	:where(.otiumo-details__subtitle) + :where(*) {
		margin-top: 0.25rem;
	}

	:where(.otiumo-details__group + .otiumo-details__group, .otiumo-details__hotel + .otiumo-details__hotel, .otiumo-details__hotel + .otiumo-details__list) {
		margin-top: 1.5rem;
	}

	/* Pozycja: nazwa po lewej, kwota po prawej; na wąskim ekranie kwota schodzi pod nazwę. */
	:where(.otiumo-details__list) {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	:where(.otiumo-details__item) {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		align-items: baseline;
		gap: 0.25rem 1.25rem;
		margin: 0;
		padding: 0.7rem 0;
		border-bottom: 1px solid var(--_otiumo-border);
	}

	:where(.otiumo-details__item:last-child) {
		border-bottom: 0;
	}

	:where(.otiumo-details__name) {
		flex: 1 1 14rem;
		min-width: 0;
	}

	:where(.otiumo-details__muted) {
		display: block;
		font-size: 0.875em;
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-details__price) {
		flex: none;
		font-weight: 600;
		font-variant-numeric: tabular-nums;
		color: var(--_otiumo-accent);
	}

	:where(.otiumo-details__group--discount .otiumo-details__price) {
		color: var(--_otiumo-free);
	}

	:where(.otiumo-details__description) {
		flex: 1 1 100%;
		font-size: 0.9375em;
		color: var(--_otiumo-muted);
	}

	/* Rozkład: wyjazd i powrót obok siebie, w każdym oś z godziną, miejscem i datą. */
	:where(.otiumo-details__legs) {
		display: grid;
		gap: 1rem;
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
	}

	:where(.otiumo-details__leg) {
		padding: 1.125rem 1.25rem 1.25rem;
		border-radius: var(--_otiumo-radius);
		background: var(--_otiumo-soft);
	}

	:where(.otiumo-details__leg-title) {
		margin: 0 0 0.875rem;
	}

	:where(.otiumo-details__leg-name) {
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-details__stops) {
		display: grid;
		gap: 1rem;
		padding-inline-start: 1.5rem;
	}

	:where(.otiumo-details__stop) {
		position: relative;
		display: flex;
		flex-wrap: wrap;
		column-gap: 0.6rem;
		margin: 0;
	}

	:where(.otiumo-details__stop)::before {
		content: "";
		position: absolute;
		inset-inline-start: -1.5rem;
		top: 0.4em;
		width: 12px;
		height: 12px;
		border: 2px solid var(--_otiumo-accent);
		border-radius: 999px;
		background: var(--_otiumo-surface);
	}

	:where(.otiumo-details__stop--arrival)::before {
		background: var(--_otiumo-accent);
	}

	/* Linia od kropki wyjazdu do kropki przyjazdu. */
	:where(.otiumo-details__stop--departure)::after {
		content: "";
		position: absolute;
		inset-inline-start: calc(-1.5rem + 5px);
		top: calc(0.4em + 14px);
		bottom: calc(-1rem - 0.4em);
		border-inline-start: 2px dotted color-mix(in srgb, var(--_otiumo-accent) 45%, transparent);
	}

	:where(.otiumo-details__hour) {
		font-weight: 700;
		font-variant-numeric: tabular-nums;
	}

	:where(.otiumo-details__place) {
		flex: 1 1 8rem;
	}

	:where(.otiumo-details__date) {
		flex-basis: 100%;
		font-size: 0.875em;
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-details__hotel-name) {
		margin: 0 0 0.375rem;
	}

	:where(.otiumo-details__stars) {
		margin-inline-start: 0.4rem;
		letter-spacing: 0.08em;
		color: #b07800;
	}

	:where(.otiumo-details__download) {
		display: inline-flex;
		align-items: center;
		gap: 0.4rem;
		font-weight: 600;
		color: var(--_otiumo-accent);
	}

	:where(.otiumo-details__download)::before {
		content: "";
		flex: none;
		width: 1em;
		height: 1em;
		background: currentColor;
		-webkit-mask: var(--_otiumo-icon-download) center / contain no-repeat;
		mask: var(--_otiumo-icon-download) center / contain no-repeat;
	}

	:where(.otiumo-details__documents .otiumo-details__download) {
		flex: none;
	}

	/* Galeria: siatka; na stronie imprezy zdjęcie główne i mozaika. */
	:where(.otiumo-gallery__items) {
		display: grid;
		gap: 0.5rem;
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
		margin: 0;
		padding: 0;
		list-style: none;
	}

	:where(.otiumo-gallery--slider .otiumo-gallery__items) {
		display: flex;
		gap: 0.75rem;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scrollbar-width: thin;
	}

	:where(.otiumo-gallery--slider .otiumo-gallery__item) {
		flex: 0 0 min(85%, 32rem);
		scroll-snap-align: start;
	}

	:where(.otiumo-gallery__item) {
		min-width: 0;
	}

	:where(.otiumo-gallery__figure) {
		margin: 0;
	}

	/* Proporcje na linku, zdjęcie wypełnia go (`min-height`) — jak w karcie imprezy. */
	:where(.otiumo-gallery__link) {
		display: block;
		aspect-ratio: 4 / 3;
		overflow: hidden;
		border-radius: var(--_otiumo-radius);
		background: var(--_otiumo-soft);
	}

	:where(.otiumo-gallery__image) {
		display: block;
		width: 100%;
		height: 100%;
		min-height: 100%;
		object-fit: cover;
		transition: transform 0.5s ease;
	}

	:where(.otiumo-gallery__link:hover .otiumo-gallery__image) {
		transform: scale(1.03);
	}

	:where(.otiumo-gallery__caption) {
		margin-top: 0.25rem;
		font-size: 0.875em;
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-single .otiumo-gallery--grid .otiumo-gallery__items) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* Telefon: pierwsze zdjęcie na całą szerokość, reszta po dwa (ostatnie bez pary też na całą). */
	:where(.otiumo-single .otiumo-gallery--grid .otiumo-gallery__item:first-child, .otiumo-single .otiumo-gallery--grid .otiumo-gallery__item:nth-child(even):last-child) {
		grid-column: 1 / -1;
	}

	:where(.otiumo-single .otiumo-gallery--grid .otiumo-gallery__item:first-child .otiumo-gallery__link) {
		aspect-ratio: 16 / 10;
	}

	@media (min-width: 782px) {
		/* Jedno zdjęcie: niższe niż 21:9, żeby cena i „Rezerwuj” były widoczne bez przewijania. */
		:where(.otiumo-single .otiumo-gallery--grid .otiumo-gallery__item:only-child .otiumo-gallery__link) {
			height: clamp(16rem, 30vw, 27rem);
			aspect-ratio: auto;
		}

		/*
		 * Mozaika (2+ zdjęcia): dwa rzędy o stałej wysokości, duże zdjęcie 2×2 po lewej, po prawej
		 * jedno (2 zdjęcia), dwa szerokie (3), trzy (4) albo cztery (5+) mniejsze; dalsze zdjęcia
		 * w niższych rzędach pod spodem. Zdjęcia wypełniają komórki przez `min-height: 100%`
		 * (motywy nadpisują obrazkom `height`).
		 */
		:where(.otiumo-single .otiumo-gallery--grid .otiumo-gallery__items:has(> :nth-child(2))) {
			grid-template-columns: repeat(4, minmax(0, 1fr));
			grid-template-rows: repeat(2, clamp(8rem, 15vw, 14rem));
			grid-auto-rows: clamp(6rem, 10vw, 9rem);
		}

		:where(.otiumo-single .otiumo-gallery--grid .otiumo-gallery__items:has(> :nth-child(2)) > *) :where(.otiumo-gallery__figure, .otiumo-gallery__link) {
			height: 100%;
			aspect-ratio: auto;
		}

		:where(.otiumo-single .otiumo-gallery--grid .otiumo-gallery__items:has(> :nth-child(2)) > :first-child) {
			grid-column: 1 / span 2;
			grid-row: 1 / span 2;
		}

		:where(.otiumo-single .otiumo-gallery--grid .otiumo-gallery__items:has(> :nth-child(2):last-child) > :nth-child(2)) {
			grid-column: 3 / span 2;
			grid-row: 1 / span 2;
		}

		:where(.otiumo-single .otiumo-gallery--grid .otiumo-gallery__items:has(> :nth-child(3):last-child) > :nth-child(n + 2)) {
			grid-column: 3 / span 2;
		}

		:where(.otiumo-single .otiumo-gallery--grid .otiumo-gallery__items:has(> :nth-child(4):last-child) > :nth-child(4)) {
			grid-column: 3 / span 2;
		}
	}

	/* Impreza zakończona */
	/* Oferta na zapytanie: informacja zamiast tabeli terminów. */
	:where(.otiumo-terms--inquiry) {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem 1.5rem;
		padding: 1rem 1.25rem;
		border: 1px solid var(--_otiumo-border);
		border-radius: var(--_otiumo-radius);
		background: var(--otiumo-bg, transparent);
	}

	:where(.otiumo-terms--inquiry p) {
		margin: 0;
	}

	:where(.otiumo-terms__inquiry-message) {
		font-weight: 600;
	}

	:where(.otiumo-ended) {
		padding: 1rem 1.25rem;
		border: 1px solid var(--_otiumo-border);
		border-radius: var(--_otiumo-radius);
		background: var(--otiumo-bg, transparent);
	}

	:where(.otiumo-ended p) {
		margin: 0;
	}

	:where(.otiumo-ended__message) {
		font-weight: 600;
	}

	:where(.otiumo-ended__more) {
		margin-top: 0.5rem;
	}

	/* Ostatnie miejsca: plakietka nad kartą (siatka jak lista imprez). */
	:where(.otiumo-last-call__item) {
		flex-direction: column;
		gap: 0.625rem;
	}

	:where(.otiumo-last-call__item > .otiumo-card) {
		flex: 1;
	}

	:where(.otiumo-last-call__badge) {
		align-self: flex-start;
		margin: 0;
		padding: 0.25rem 0.75rem;
		border-radius: 999px;
		background: color-mix(in srgb, var(--_otiumo-last) 12%, transparent);
		font-size: 0.875em;
		font-weight: 600;
		color: var(--_otiumo-last);
	}

	/* Kalendarz wyjazdów: miesiące z listą terminów; w wąskiej kolumnie wiersz w trzech liniach. */
	:where(.otiumo-calendar) {
		display: grid;
		gap: 2rem;
		container-type: inline-size;
	}

	:where(.otiumo-calendar__month-title) {
		margin: 0 0 0.75rem;
		font-size: 1.25em;
	}

	:where(.otiumo-calendar__list) {
		overflow: hidden;
		border: 1px solid var(--_otiumo-border);
		border-radius: var(--_otiumo-radius);
		background: var(--_otiumo-surface);
	}

	:where(.otiumo-calendar__row) {
		display: grid;
		grid-template-areas: "dates trip price availability action";
		grid-template-columns: 10.5rem minmax(0, 1fr) auto auto auto;
		gap: 0.375rem 1.25rem;
		align-items: center;
		padding: 0.875rem 1rem;
		border-bottom: 1px solid var(--_otiumo-border);
		transition: background-color 0.15s;
	}

	:where(.otiumo-calendar__row:last-child) {
		border-bottom: 0;
	}

	:where(.otiumo-calendar__row:hover) {
		background: var(--_otiumo-soft);
	}

	:where(.otiumo-calendar__dates) {
		grid-area: dates;
		font-weight: 600;
		white-space: nowrap;
	}

	:where(.otiumo-calendar__trip) {
		display: flex;
		grid-area: trip;
		flex-direction: column;
		min-width: 0;
	}

	:where(.otiumo-calendar__title) {
		font-weight: 600;
		color: inherit;
		text-decoration: none;
	}

	:where(.otiumo-calendar__title:hover, .otiumo-calendar__title:focus-visible) {
		text-decoration: underline;
	}

	:where(.otiumo-calendar__duration) {
		font-size: 0.875em;
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-calendar__price) {
		grid-area: price;
		font-weight: 700;
		color: var(--_otiumo-accent);
		white-space: nowrap;
	}

	:where(.otiumo-calendar__availability) {
		grid-area: availability;
		white-space: nowrap;
	}

	:where(.otiumo-calendar__action) {
		grid-area: action;
		text-align: end;
	}

	:where(.otiumo-calendar__action .otiumo-booking-button) {
		padding: 0.5rem 1.125rem;
		font-size: 0.9375em;
	}

	:where(.otiumo-calendar__empty) {
		margin: 0;
		padding: 0.875rem 1rem;
		border: 1px dashed var(--_otiumo-border);
		border-radius: var(--_otiumo-radius);
		color: var(--_otiumo-muted);
	}

	:where(.otiumo-calendar__nav) {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		gap: 1rem;
	}

	:where(.otiumo-calendar__next) {
		margin-inline-start: auto;
	}

	@container (max-width: 44rem) {
		:where(.otiumo-calendar__row) {
			grid-template-areas: "dates availability" "trip trip" "price action";
			grid-template-columns: minmax(0, 1fr) auto;
		}

		:where(.otiumo-calendar__availability) {
			text-align: end;
		}
	}

	/* Wyjazd przykładowy (tryb pokazowy, widzi tylko redakcja strony). */
	:where(.otiumo-sample-note) {
		margin: 0.5rem 0 0;
		font-size: 0.875em;
		color: var(--_otiumo-muted);
	}

	/* Podgląd w edytorze bez danych imprezy */
	:where(.otiumo-placeholder) {
		padding: 1rem;
		border: 1px dashed var(--_otiumo-border, #c3c4c7);
		border-radius: 4px;
		font-size: 0.875em;
		color: #50575e;
	}

	@media (prefers-reduced-motion: reduce) {
		:where(.otiumo-card__media img, .otiumo-gallery__image, .otiumo-booking-button, .otiumo-calendar__row) {
			transition: none;
		}

		:where(.otiumo-card:hover .otiumo-card__media img, .otiumo-gallery__link:hover .otiumo-gallery__image) {
			transform: none;
		}
	}
}
