/* Új Mosoly Kampányok */

.umk {
	--umk-green: #588157;
	--umk-bg: #ffffff;
	--umk-fg: #676565;
	--umk-ease: cubic-bezier(.2, .8, .2, 1);
	box-sizing: border-box;
	font-family: inherit;
	line-height: 1.6;
	text-align: left;
}
.umk *,
.umk *::before,
.umk *::after {
	box-sizing: inherit;
}
.umk[hidden] {
	display: none !important;
}
html.umk-lock {
	overflow: hidden;
}

.umk__panel {
	position: relative;
	background: var(--umk-bg);
	color: var(--umk-fg);
	outline: none;
}

/* Tartalom (a betűstílusok a content.css-ben vannak) */
/* Üres sorok (üres bekezdések) nem foglalnak helyet. A szerkesztőben továbbra is látszanak. */
.umk .umk__content p:empty { display: none; }

/* A tartalom széle és a Csoport blokk széle sem kap plusz margót (a sablon 30 px-et adna). */
.umk .umk__content .wp-block-group {
	margin-top: 0 !important;
	margin-bottom: 20px !important;
}
.umk .umk__content .wp-block-group:last-child {
	margin-bottom: 0 !important;
}
.umk .umk__content :is(.wp-block-group, .wp-block-group__inner-container, .wp-block-column) > :first-child,
.umk__content > :first-child { margin-top: 0 !important; }
.umk .umk__content :is(.wp-block-group, .wp-block-group__inner-container, .wp-block-column) > :last-child,
.umk__content > :last-child { margin-bottom: 0 !important; }
.umk__content img { max-width: 100%; height: auto; }
.umk__content a:not(.wp-block-button__link) {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: .2em;
}

/* Bezárás gomb: zöld négyzet, ugyanazzal az 5 px-es sarokkal, mint az oldal gombjai. */
.umk .umk__close {
	all: unset;
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 35px;
	height: 35px;
	border-radius: 5px;
	background: var(--umk-green);
	color: #fff;
	cursor: pointer;
	transition: filter .15s, transform .15s;
}
/* A sablon minden gombra rak egy szögletes, besöprő hover-réteget (::before). Itt ezt kikapcsoljuk. */
.umk .umk__close::before,
.umk .umk__close::after {
	content: none !important;
	display: none !important;
}
.umk .umk__close:hover { filter: brightness(1.1); }
.umk .umk__close:active { transform: scale(.94); }
.umk .umk__close:focus-visible {
	outline: 2px solid var(--umk-green);
	outline-offset: 2px;
}
.umk .umk__close svg {
	display: block;
	width: 18px;
	height: 18px;
}

/* Ha a háttér maga is zöld, a gomb áttetszővé válik. */
.umk--bar .umk__close,
.umk[style*="#588157"] .umk__close {
	background: transparent;
	color: inherit;
	box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 40%, transparent);
}

/* Középső modal */
.umk--modal,
.umk--fullscreen {
	position: fixed;
	inset: 0;
	z-index: 99990;
}
.umk--modal {
	display: grid;
	place-items: center;
	padding: 16px;
}
.umk__backdrop {
	position: absolute;
	inset: 0;
	background: rgb(31 52 46 / .62);
	opacity: 0;
	transition: opacity .3s var(--umk-ease);
}
/* Hosszú tartalomnál csak a szöveg görög, a bezárás gomb a helyén marad. */
.umk--modal .umk__panel {
	display: flex;
	flex-direction: column;
	width: min(100%, var(--umk-w, 600px));
	max-height: calc(100dvh - 32px);
	overflow: hidden;
	padding: clamp(28px, 5vw, 48px);
	border-radius: 8px;
	box-shadow: 0 30px 80px -20px rgb(15 26 18 / .45);
	opacity: 0;
	transform: translateY(14px) scale(.98);
	transition: opacity .3s var(--umk-ease), transform .3s var(--umk-ease);
}
.umk--modal .umk__content {
	min-height: 0;
	overflow: auto;
	overscroll-behavior: contain;
}
.umk--size-small { --umk-w: 420px; }
.umk--size-medium { --umk-w: 600px; }
.umk--size-large { --umk-w: 860px; }
.umk--modal.is-open .umk__backdrop { opacity: 1; }
.umk--modal.is-open .umk__panel { opacity: 1; transform: none; }

/* A cím ne fusson a bezárás gomb alá. */
.umk:is(.umk--modal, .umk--corner) .umk__content > :is(h1, h2, h3, h4, h5, h6, p):first-child,
.umk:is(.umk--modal, .umk--corner) .umk__content > .wp-block-group:first-child > .wp-block-group__inner-container > :is(h1, h2, h3, h4, h5, h6, p):first-child {
	padding-right: 36px;
}

/* Teljes képernyős */
.umk--fullscreen .umk__panel {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	overflow: auto;
	padding: clamp(72px, 10vw, 120px) clamp(20px, 6vw, 80px);
	opacity: 0;
	transition: opacity .35s var(--umk-ease);
}
.umk--fullscreen .umk__content {
	width: min(100%, 880px);
	margin: auto;
	transform: translateY(16px);
	transition: transform .45s var(--umk-ease);
}
.umk--fullscreen .umk__close {
	position: fixed;
	top: 20px;
	right: 20px;
	width: 48px;
	height: 48px;
	border-radius: 6px;
}
.umk--fullscreen .umk__close svg { width: 22px; height: 22px; }
.umk--fullscreen.is-open .umk__panel { opacity: 1; }
.umk--fullscreen.is-open .umk__content { transform: none; }

/* Hírsáv */
.umk--bar {
	--umk-bg: var(--umk-green);
	--umk-fg: #ffffff;
	position: relative;
	z-index: 99980;
	width: 100%;
}
.umk--bar.umk--pos-bottom {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
}
.umk--bar .umk__panel {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 12px 64px;
	opacity: 0;
	transition: opacity .3s var(--umk-ease), transform .3s var(--umk-ease);
}
.umk--bar.umk--pos-bottom .umk__panel {
	transform: translateY(100%);
	box-shadow: 0 -10px 30px -14px rgb(15 26 18 / .35);
}
.umk--bar.is-open .umk__panel { opacity: 1; transform: none; }
.umk--bar .umk__content {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 20px;
	max-width: 1200px;
	font-size: 15px;
	text-align: center;
}
.umk--bar .umk__content > * { margin: 0; }
.umk--bar .umk__content .wp-block-buttons { gap: 8px; }
.umk--bar .umk__close {
	top: 50%;
	right: 12px;
	width: 32px;
	height: 32px;
	margin-top: -16px;
}

/* Sarokkártya */
.umk--corner {
	position: fixed;
	right: var(--umk-x, 24px);
	bottom: var(--umk-y, 24px);
	z-index: 99985;
	width: min(360px, calc(100vw - 32px));
}
.umk--corner.umk--pos-left {
	right: auto;
	left: var(--umk-x, 24px);
}
.umk--corner .umk__panel {
	padding: 32px 28px 28px;
	border-radius: 8px;
	box-shadow: 0 18px 50px -12px rgb(15 26 18 / .35), 0 0 0 1px rgb(15 26 18 / .06);
	opacity: 0;
	transform: translateY(16px);
	transition: opacity .3s var(--umk-ease), transform .3s var(--umk-ease);
}
.umk--corner .umk__close {
	top: 10px;
	right: 10px;
	width: 30px;
	height: 30px;
	border-radius: 5px;
}
.umk--corner.is-open .umk__panel { opacity: 1; transform: none; }

/* Csak képből álló kampány: a kép körül egyenletes, keskeny keret marad (mint a régi Széchenyi-dobozon). */
.umk--image-only .umk__panel {
	padding: 16px;
}
.umk--image-only .umk__content {
	padding-top: 0 !important;
}
/* A sablon minden képblokkra 30 px-es margót tesz; itt ez nem kell. */
.umk--image-only .umk__content > .wp-block-image {
	margin: 0 !important;
}
.umk--image-only .umk__content > p:empty {
	display: none;
}
.umk--image-only .umk__content img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0;
}

/* Mobil */
@media (max-width: 767px) {
	.umk--bar .umk__panel {
		justify-content: flex-start;
		padding: 12px 56px 12px 16px;
	}
	.umk--bar .umk__content {
		justify-content: flex-start;
		font-size: 14px;
		text-align: left;
	}
	/* Mobilon a kártya a saját sarkában marad és kisebb lesz, hogy ne takarja az oldalt.
	   Az alsó távolság megmarad (pl. a süti gomb fölött), oldalt legfeljebb 16 px. */
	.umk--corner {
		right: min(var(--umk-x, 24px), 16px);
		width: min(320px, calc(100vw - 32px));
	}
	.umk--corner.umk--pos-left {
		right: auto;
		left: min(var(--umk-x, 24px), 16px);
	}
	.umk--corner .umk__panel {
		padding: 26px 20px 20px;
	}
	/* Csak képes kártya: kb. a képernyő fele széles. */
	.umk--corner.umk--image-only {
		width: min(200px, 52vw);
	}
	.umk--corner.umk--image-only .umk__panel {
		padding: 8px;
	}
	.umk--corner.umk--image-only .umk__close,
	.umk--corner.umk--image-only.umk--close-left .umk__close {
		top: 4px;
		width: 24px;
		height: 24px;
		border-radius: 4px;
	}
	.umk--corner.umk--image-only .umk__close { right: 4px; }
	.umk--corner.umk--image-only.umk--close-left .umk__close { right: auto; left: 4px; }
	.umk--corner.umk--image-only .umk__close svg {
		width: 14px;
		height: 14px;
	}
	.umk--bar.umk--close-left .umk__panel {
		padding: 12px 16px 12px 56px;
	}
}

/* Bezárás gomb a bal oldalon */
.umk--close-left .umk__close {
	right: auto;
	left: 14px;
}
.umk--corner.umk--close-left .umk__close { left: 10px; }
.umk--bar.umk--close-left .umk__close { left: 12px; }
.umk--fullscreen.umk--close-left .umk__close { left: 20px; }
/* Bal oldali X-nél a tartalom kicsit lejjebb indul, így a gomb nem lóg bele. */
.umk:is(.umk--modal, .umk--corner).umk--close-left .umk__content > :is(h1, h2, h3, h4, h5, h6, p):first-child,
.umk:is(.umk--modal, .umk--corner).umk--close-left .umk__content > .wp-block-group:first-child > .wp-block-group__inner-container > :is(h1, h2, h3, h4, h5, h6, p):first-child {
	padding-right: 0;
}
.umk--modal.umk--close-left .umk__content { padding-top: 20px; }
.umk--corner.umk--close-left .umk__content { padding-top: 16px; }

@media (prefers-reduced-motion: reduce) {
	.umk .umk__panel,
	.umk .umk__content,
	.umk .umk__backdrop {
		transition-duration: .01ms !important;
		transform: none !important;
	}
}
