/*
 * Boho Kursy - the popup window and its two widgets. Loaded only on a page that has a popup (and in the Elementor editor).
 * The window is fixed on purpose: a close button always, a small card on a phone. Everything inside is the layout's.
 */

/* ---------- Window ---------- */

.boho-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	box-sizing: border-box;
	width: min(var(--boho-popup-szerokosc, 560px), calc(100vw - 32px));
	max-width: none;
	height: fit-content;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	margin: auto;
	padding: 0;
	overflow: visible;
	color: #1A202C;
	background: transparent;
	border: 0;
}

.boho-popup[open] {
	display: flex;
	flex-direction: column;
	animation: boho-popup-wejscie 0.22s ease-out;
}

.boho-popup::backdrop {
	background: rgba(26, 32, 44, 0.55);
}

.boho-popup--bottom-right {
	inset: auto 24px 24px auto;
	margin: 0;
}

.boho-popup--bottom-left {
	inset: auto auto 24px 24px;
	margin: 0;
}

.boho-popup--bottom {
	inset: auto 0 24px;
	margin: 0 auto;
}

.boho-popup__tresc {
	min-height: 0;
	overflow: auto;
	background-color: #fff;
	border-radius: var(--boho-popup-zaokraglenie, 20px);
	box-shadow: 0 18px 50px rgba(26, 32, 44, 0.3);
}

.boho-popup__tresc:focus {
	outline: 0;
}

/*
 * White disc with a dark mark: readable on any photo or colour the layout puts under it. The button is the 44 px target, the
 * 36 px disc sits inside it. The mark is drawn, not a "×" from a font: fonts do not centre that character.
 * Two classes on purpose: the theme paints every hovered or focused button gold (button:focus), and one class loses to that.
 */
.boho-popup .boho-popup__zamknij {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: #1A202C;
	cursor: pointer;
	background: none;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	transition: none; /* The theme animates everything on a button: the keyboard's outline flashed grey for a moment. */
}

.boho-popup .boho-popup__zamknij::before {
	position: absolute;
	inset: 4px;
	content: "";
	background-color: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 6px rgba(26, 32, 44, 0.3);
	transition: background-color 0.15s ease;
}

.boho-popup .boho-popup__zamknij svg {
	position: relative;
	display: block;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 1.75;
}

.boho-popup .boho-popup__zamknij:hover,
.boho-popup .boho-popup__zamknij:focus {
	color: #1A202C;
	background: none;
	box-shadow: none;
}

.boho-popup .boho-popup__zamknij:hover::before {
	background-color: #F4EDE5;
}

/* Only for someone moving with the keyboard. The ring is the disc's own shadow, so it cannot run out of line with the disc. */
.boho-popup .boho-popup__zamknij:focus-visible {
	outline: 2px solid transparent; /* Shadows are not drawn in Windows high contrast mode, an outline is. */
}

.boho-popup .boho-popup__zamknij:focus-visible::before {
	box-shadow: 0 0 0 3px #068268;
}

/* Phone: always a card at the bottom that leaves the page visible and usable (Google advises against covering it). */
@media (max-width: 767px) {
	.boho-popup,
	.boho-popup--bottom-right,
	.boho-popup--bottom-left,
	.boho-popup--bottom {
		inset: auto 8px 8px;
		width: auto;
		max-height: 72vh;
		max-height: 72dvh;
		margin: 0;
	}
}

@keyframes boho-popup-wejscie {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.boho-popup[open] {
		animation: none;
	}
}

/* ---------- Boho: Dane wydarzenia ---------- */

:where(.e-con, .e-con-inner) > :where(.elementor-widget-boho-popup-dane, .elementor-widget-boho-popup-lista) {
	width: 100%;
}

.boho-popup-dane__tekst {
	margin: 0;
	overflow-wrap: anywhere;
}

/* The site's heading font; a font chosen in the widget's Style tab still wins (it is more specific). */
.boho-popup-dane--title .boho-popup-dane__tekst,
.boho-popup-lista__tytul {
	font-family: var(--e-global-typography-primary-font-family), serif;
	font-weight: 700;
}

.boho-popup-dane__zdjecie {
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.boho-popup-dane__zdjecie a {
	display: contents;
}

.boho-popup-dane__zdjecie img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.boho-popup-dane__przycisk {
	display: inline-block;
	padding: 12px 26px;
	font-family: var(--e-global-typography-primary-font-family), serif;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	text-align: center;
	text-decoration: none;
	background-color: #068268;
	border-radius: 37px;
	transition: background-color 0.2s ease;
}

.boho-popup-dane__przycisk:hover,
.boho-popup-dane__przycisk:focus-visible {
	color: #fff;
	background-color: #05636A;
}

.boho-popup-dane__przycisk:focus-visible {
	outline: 3px solid #068268;
	outline-offset: 2px;
}

/* ---------- Boho: Lista wydarzeń ---------- */

.boho-popup-lista {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.boho-popup-lista__pozycja {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	padding: 0;
	margin: 0;
}

.boho-popup-lista__zdjecie {
	flex: none;
	width: 96px;
	height: 96px;
	overflow: hidden;
	border-radius: 14px;
}

.boho-popup-lista__zdjecie img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.boho-popup-lista__opis {
	min-width: 0;
}

.boho-popup-lista__tytul {
	padding-right: 36px; /* The first title stays clear of the close button. */
	margin: 0 0 4px;
	font-size: 20px;
	line-height: 1.25;
	text-transform: none;
}

.boho-popup-lista__tytul a {
	color: inherit;
	text-decoration: none;
}

.boho-popup-lista__tytul a:hover {
	text-decoration: underline;
}

.boho-popup-lista__tekst {
	margin: 0 0 2px;
	font-size: 15px;
	line-height: 1.4;
	color: #4A5568;
}

.boho-popup-lista__przycisk {
	padding: 8px 18px;
	margin-top: 8px;
	font-size: 14px;
}

@media (max-width: 767px) {
	.boho-popup-lista__zdjecie {
		width: 72px;
		height: 72px;
	}
}
