/* IRA: popupy — samodzielny, namespacowany CSS (.ira-pop*).
 * Niezależny od buildu Tailwind (nie podlega purge). Ładowany tylko
 * na stronach z popupami. Stylistyka spójna z motywem: ciemne tło,
 * czerwony akcent (#dc2626), animacja 300ms. */

.ira-pop {
	position: fixed;
	inset: 0;
	z-index: 80;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility 0s linear .3s;
}
.ira-pop.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity .3s ease, visibility 0s;
}

.ira-pop__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .85);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	cursor: pointer;
}

.ira-pop__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: 92vw;
	max-width: 640px;
	max-height: 88vh;
	overflow: hidden;
	background: #171717;
	color: #e5e5e5;
	box-shadow: 0 25px 60px rgba(0, 0, 0, .6);
	transform: translateY(12px) scale(.985);
	transition: transform .3s ease;
}
.ira-pop.is-open .ira-pop__panel { transform: none; }

/* rozmiary */
.ira-pop[data-size="sm"] .ira-pop__panel { max-width: 420px; }
.ira-pop[data-size="md"] .ira-pop__panel { max-width: 640px; }
.ira-pop[data-size="lg"] .ira-pop__panel { max-width: 900px; }
.ira-pop[data-size="full"] .ira-pop__panel {
	width: 95vw;
	max-width: 95vw;
	height: 92vh;
	max-height: 92vh;
}

/* górny czerwony pasek (jak w modalach oferty) */
.ira-pop__bar {
	position: absolute;
	inset-inline: 0;
	top: 0;
	height: 3px;
	background: #dc2626;
	z-index: 3;
}

.ira-pop__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	background: #000;
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	transition: background .2s ease;
}
.ira-pop__close:hover { background: #dc2626; }
.ira-pop__close:focus,
.ira-pop__close:focus-visible { outline: none; }

/* ---------- typ: treść ---------- */
.ira-pop__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
}
.ira-pop__media { position: relative; background: #262626; }
.ira-pop__media img {
	display: block;
	width: 100%;
	max-height: 42vh;
	object-fit: cover;
}
/* Gradient zlewający obraz w tło treści (mobile: pionowo w dół). */
.ira-pop__fade {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(to bottom, transparent 50%, #171717);
}

/* Układ pionowy (obraz góra/dół) — z gradientem odpowiednio w dół / w górę. */
.ira-pop__body.is-stack { display: flex; flex-direction: column; }
.ira-pop__body.is-stack.ira-pop--img-bottom { flex-direction: column-reverse; }
.ira-pop--img-bottom .ira-pop__fade { background: linear-gradient(to top, transparent 50%, #171717); }
.ira-pop__content { padding: 2rem; }
@media (min-width: 640px) { .ira-pop__content { padding: 2.5rem 3rem; } }

/* Split: obraz i tekst obok siebie (desktop), z poziomym przejściem. */
@media (min-width: 768px) {
	.ira-pop__body.is-split {
		display: grid;
		grid-template-columns: 44% 56%;
		overflow: hidden;
		height: 100%;
	}
	.ira-pop__body.is-split.ira-pop--img-right { grid-template-columns: 56% 44%; }

	.ira-pop__body.is-split .ira-pop__media { height: 100%; }
	.ira-pop__body.is-split .ira-pop__media img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		max-height: none;
	}
	.ira-pop__body.is-split .ira-pop__content {
		overflow-y: auto;
		max-height: 88vh;
	}
	.ira-pop[data-size="full"] .ira-pop__body.is-split .ira-pop__content { max-height: 92vh; }

	/* obraz po lewej (domyślnie) — fade w prawo; po prawej — fade w lewo */
	.ira-pop__body.is-split.ira-pop--img-left .ira-pop__fade {
		background: linear-gradient(to right, transparent 50%, #171717);
	}
	.ira-pop__body.is-split.ira-pop--img-right .ira-pop__fade {
		background: linear-gradient(to left, transparent 50%, #171717);
	}
	.ira-pop__body.is-split.ira-pop--img-right .ira-pop__media { order: 2; }
	.ira-pop__body.is-split.ira-pop--img-right .ira-pop__content { order: 1; }
}

.ira-pop__title {
	margin: 0 0 1rem;
	font-size: 1.6rem;
	font-weight: 900;
	line-height: 1.1;
	text-transform: uppercase;
	letter-spacing: .01em;
	color: #fff;
}
.ira-pop__prose { color: #d4d4d4; line-height: 1.65; }
.ira-pop__prose > :first-child { margin-top: 0; }
.ira-pop__prose > :last-child { margin-bottom: 0; }
.ira-pop__prose a { color: #f87171; text-decoration: underline; }
.ira-pop__prose a:hover { color: #fff; }
.ira-pop__prose img { max-width: 100%; height: auto; }

/* ---------- typ: wideo ---------- */
.ira-pop[data-type="video"] .ira-pop__panel { background: #000; }
.ira-pop__video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}
.ira-pop__video iframe,
.ira-pop__video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ---------- typ: galeria ---------- */
.ira-pop[data-type="gallery"] .ira-pop__panel { background: #0a0a0a; }
.ira-pop__gallery { position: relative; }
.ira-pop__slides {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 50vh;
}
.ira-pop__slide { display: none; margin: 0; }
.ira-pop__slide.is-active { display: block; }
.ira-pop__slide img {
	display: block;
	max-width: 100%;
	max-height: 80vh;
	margin: 0 auto;
	object-fit: contain;
}
.ira-pop__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 3rem;
	height: 3rem;
	border: 0;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	transition: background .2s ease;
}
.ira-pop__nav:hover { background: #dc2626; }
.ira-pop__nav--prev { left: .5rem; }
.ira-pop__nav--next { right: .5rem; }
.ira-pop__counter {
	position: absolute;
	bottom: .75rem;
	left: 50%;
	transform: translateX(-50%);
	padding: .25rem .7rem;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	font-size: .8rem;
	letter-spacing: .1em;
}

/* dostępność: ukrycie wizualne */
.ira-pop__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.ira-pop, .ira-pop__panel { transition: none; }
}
