/**
 * Gallery with listing
 *
 * A `.gallery-with-listing` galériák köztes nézete (képek listája).
 * A panel z-indexe kisebb, mint az Elementor lightboxé (9999), hogy a nagy kép fölé nyíljon.
 */

/* Az oldalon csak a galéria első képe (borító) látszik */
.gallery-with-listing .elementor-gallery-item:not(:first-child) {
	display: none;
}

.gallery-with-listing .elementor-gallery-item {
	width: 100% !important;
	max-width: 100% !important;
	border-radius: 24px;
}

.gallery-with-listing .elementor-gallery-item img {
	width: 100%;
	height: auto;
}

/* Háttér görgetésének tiltása nyitott panelnél */
html.gwl-locked,
html.gwl-locked body {
	overflow: hidden;
}

/* Képszám jelzés a borítón */
.gallery-with-listing .e-gallery-item {
	cursor: pointer;
}

.gallery-with-listing .gwl-badge {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 0.875rem;
	line-height: 1.2;
	pointer-events: none;
}

.gallery-with-listing .gwl-badge__icon {
	display: block;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
}

/* Panel: a sötét háttér nem görög, csak a fehér doboz tartalma */
.gwl-panel {
	position: fixed;
	inset: 0;
	z-index: 9990;
	display: flex;
	align-items: flex-start;
	overflow: hidden;
	padding: 40px 20px;
	background: rgba(0, 0, 0, 0.75);
}

.gwl-panel[hidden] {
	display: none;
}

.gwl-panel__inner {
	width: 100%;
	max-width: 1200px;
	max-height: 100%;
	margin: 0 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 32px 32px;
	border-radius: 24px;
	/* A görgetősáv se lógjon ki a lekerekített sarkokból */
	clip-path: inset(0 round 24px);
	background: #fff;
	scrollbar-width: thin;
	scrollbar-color: var(--e-global-color-accent, #CDA274) transparent;
}

/* Opening animation: restarts every time the panel goes from display:none to visible */
.gwl-panel {
	animation: gwl-backdrop-in 250ms ease-out;
}

.gwl-panel__inner {
	animation: gwl-inner-in 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes gwl-backdrop-in {
	from {
		background-color: rgba(0, 0, 0, 0);
	}
}

@keyframes gwl-inner-in {
	from {
		opacity: 0;
		transform: translateY(24px) scale(0.98);
	}
}

.gwl-panel__header {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
	padding: 24px 0 16px;
	border-bottom: 1px solid var(--e-global-color-accent, #CDA274);
	background: #fff;
}

.gwl-panel__title {
	margin: 0;
	color: var(--e-global-color-primary, #292F36);
	font-family: "DM Serif Display", serif;
	font-size: 2.25rem;
	font-weight: 400;
	line-height: 1.2;
}

/* A gombszabályok `.gwl-panel` előtagot kapnak, hogy erősebbek legyenek
   a Hello Elementor téma `button` / `[type="button"]` alapstílusainál. */
.gwl-panel .gwl-panel__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--e-global-color-accent, #CDA274);
	border-radius: 50%;
	background: #fff;
	color: var(--e-global-color-primary, #292F36);
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

.gwl-panel .gwl-panel__close:hover,
.gwl-panel .gwl-panel__close:focus {
	border-color: var(--e-global-color-accent, #CDA274);
	background: var(--e-global-color-accent, #CDA274);
	color: #fff;
}

.gwl-panel .gwl-panel__close svg {
	display: block;
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
}

/* Képrács: desktop 3, tablet 2, mobil 1 oszlop */
.gwl-panel__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gwl-panel .gwl-panel__item,
.gwl-panel .gwl-panel__item:hover,
.gwl-panel .gwl-panel__item:focus {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: 24px;
	overflow: hidden;
	background: #f2f2f2;
	cursor: pointer;
}

.gwl-panel__item img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* Ugyanaz a hover, mint az oldalon a galéria borítóképén (Elementor Pro overlay):
   50%-os fekete fátyol, 800 ms-os áttűnéssel. */
.gwl-panel__item::after {
	content: "";
	position: absolute;
	inset: 0;
	background-color: transparent;
	transition: background-color 800ms;
	pointer-events: none;
}

.gwl-panel__item:hover::after,
.gwl-panel__item:focus-visible::after {
	background-color: rgba(0, 0, 0, 0.5);
}

.gwl-panel .gwl-panel__item:focus-visible {
	outline: 3px solid var(--e-global-color-accent, #CDA274);
	outline-offset: 3px;
}

@media (max-width: 1024px) {
	.gwl-panel__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	/* Mobilon a panel körül 10 px-es sávban látszik a sötét háttér */
	.gwl-panel {
		padding: 10px;
	}

	.gwl-panel__inner {
		padding: 0 16px 24px;
		border-radius: 16px;
		clip-path: inset(0 round 16px);
	}

	.gwl-panel__header {
		padding-top: 16px;
	}

	.gwl-panel__title {
		font-size: 1.75rem;
	}

	.gwl-panel__grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gwl-panel,
	.gwl-panel__inner {
		animation: none;
	}

	.gwl-panel .gwl-panel__close,
	.gwl-panel__item::after {
		transition: none;
	}
}
