/* In Picture Studio — project gallery presentation */

:root {
	--ips-gallery-image-max-vh: 72vh;
	--ips-gallery-image-max-vh-mobile: 56vh;
}

@supports (height: 100dvh) {
	:root {
		--ips-gallery-image-max-vh: 72dvh;
		--ips-gallery-image-max-vh-mobile: 56dvh;
	}
}

.wp-block-jetpack-slideshow {
	margin: 2.5rem auto 3.5rem;
	max-width: min(1200px, 94vw);
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_container {
	border-radius: 2px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
	background: #0a0a0a;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_image {
	display: block;
	height: auto;
	margin-left: auto;
	margin-right: auto;
	max-height: min(var(--ips-gallery-image-max-vh), 820px);
	max-width: 100%;
	object-fit: contain;
	width: auto;
	background: #0a0a0a;
}

.wp-block-jetpack-slideshow .swiper-slide figure {
	align-items: center;
	display: flex;
	height: 100%;
	justify-content: center;
	margin: 0;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-next,
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-prev {
	opacity: 0.72;
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-next:hover,
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-prev:hover,
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-next:focus,
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-prev:focus {
	opacity: 1;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_pagination.swiper-pagination-bullets {
	padding: 14px 0 6px;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_pagination.swiper-pagination-bullets .swiper-pagination-bullet {
	opacity: 0.35;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_pagination.swiper-pagination-bullets .swiper-pagination-bullet-active {
	opacity: 1;
	transform: scale(1.05);
}

.wp-block-jetpack-slideshow {
	position: relative;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_pagination .swiper-pagination-simple {
	background: rgba(0, 0, 0, 0.55);
	border-radius: 2px;
	color: rgba(255, 255, 255, 0.92);
	font-size: 0.72rem;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.08em;
	padding: 0.35rem 0.55rem;
	pointer-events: none;
	position: absolute;
	right: 12px;
	top: 12px;
	width: auto;
	z-index: 4;
}

.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_pagination {
	bottom: auto;
	left: auto;
	padding: 0;
	pointer-events: none;
	position: absolute;
	right: 0;
	top: 0;
	width: auto;
	z-index: 4;
}

/* Category headings on PROJECTS / VIDEOS pages — theme #primary caps at 760px; widen content */
.page-projekty #primary,
.page-id-1448 #primary,
.page-works #primary,
.page-id-205 #primary {
	margin-left: auto;
	margin-right: auto;
	max-width: min(1200px, 94vw);
	width: 100%;
}

.page-projekty .entry-content,
.page-id-1448 .entry-content,
.page-works .entry-content,
.page-id-205 .entry-content {
	margin-left: auto;
	margin-right: auto;
	max-width: 100%;
	width: 100%;
}

.page .entry-content > p strong,
.page .entry-content .ips-project-section > p strong,
.page .entry-content > h3,
.page .entry-content > h4,
.page .entry-content .ips-project-section > p.has-text-align-center {
	display: block;
	margin: 3rem auto 0.75rem;
	max-width: min(1200px, 94vw);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.72);
}

.page .entry-content > p:not(:has(.wp-block-jetpack-slideshow)),
.page .entry-content .ips-project-section > p:not(:has(.wp-block-jetpack-slideshow)) {
	max-width: min(720px, 90vw);
	margin-left: auto;
	margin-right: auto;
	line-height: 1.75;
	color: rgba(255, 255, 255, 0.82);
}

.page .entry-content .wp-block-buttons {
	align-items: center;
	justify-content: center;
}

.page .entry-content .wp-block-buttons .wp-block-button {
	flex: 0 0 auto;
	margin-left: auto;
	margin-right: auto;
	width: auto;
}

.page .entry-content .wp-block-buttons .wp-block-button__link {
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 2px;
	box-sizing: border-box;
	color: rgba(255, 255, 255, 0.78);
	display: inline-block;
	font-size: 0.68rem;
	letter-spacing: 0.18em;
	margin: 0.75rem auto 0;
	padding: 0.55rem 1.1rem;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
	white-space: nowrap;
	width: auto;
}

.page .entry-content .wp-block-buttons .wp-block-button__link::after {
	content: " \2192";
	opacity: 0.75;
}

.page .entry-content .wp-block-buttons .wp-block-button__link:hover,
.page .entry-content .wp-block-buttons .wp-block-button__link:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.65);
	color: #fff;
}

/* Homepage gallery — same presentation as project sections */
.home .ips-page-level-2 #primary {
	margin-left: auto;
	margin-right: auto;
	max-width: min(1200px, 94vw);
	width: 100%;
}

.home .ips-page-level-2 .entry-content {
	margin-left: auto;
	margin-right: auto;
	max-width: 100%;
	width: 100%;
}

.home .ips-page-level-2 .wp-block-jetpack-slideshow.alignfull {
	margin-left: auto;
	margin-right: auto;
	max-width: min(1200px, 94vw);
	width: 100%;
}

/* Home level 2: centered gallery card — same placement as Projects sections */
.home .ips-page-level-2 .wp-block-jetpack-slideshow {
	margin: 0 auto;
	max-height: var(--ips-home-slideshow-max-height, none);
}

.home .ips-page-level-2 .wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_container {
	height: auto !important;
	max-height: 100%;
}

.home .ips-page-level-2 .wp-block-jetpack-slideshow .swiper-slide,
.home .ips-page-level-2 .wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_slide,
.home .ips-page-level-2 .wp-block-jetpack-slideshow .swiper-slide figure {
	height: auto !important;
}

.home .ips-page-level-2 .wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_image {
	height: auto !important;
	max-height: min(var(--ips-home-gallery-max-height, var(--ips-gallery-image-max-vh)), 820px) !important;
	max-width: 100% !important;
	object-fit: contain !important;
	width: auto !important;
}

.home .ips-page-level-2 .entry-content .wp-block-buttons,
.home .ips-page-level-2 .ips-section-stack .wp-block-buttons {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.home .ips-page-level-2 .entry-content .wp-block-buttons .wp-block-button__link,
.home .ips-page-level-2 .ips-section-stack .wp-block-buttons .wp-block-button__link {
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 2px;
	box-sizing: border-box;
	color: rgba(255, 255, 255, 0.78);
	display: inline-block;
	font-size: 0.68rem;
	letter-spacing: 0.18em;
	padding: 0.55rem 1.1rem;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
	white-space: nowrap;
}

.home .ips-page-level-2 .entry-content .wp-block-buttons .wp-block-button__link::after,
.home .ips-page-level-2 .ips-section-stack .wp-block-buttons .wp-block-button__link::after {
	content: " \2192";
	opacity: 0.75;
}

/* Projects / Videos sections — shrink gallery to fit one viewport */
body.ips-section-levels .ips-section-stack .wp-block-jetpack-slideshow {
	max-height: var(--ips-section-slideshow-max-height, none);
}

body.ips-section-levels .ips-section-stack .wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_container {
	height: auto !important;
	max-height: 100%;
}

body.ips-section-levels .ips-section-stack .wp-block-jetpack-slideshow .swiper-slide,
body.ips-section-levels .ips-section-stack .wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_slide,
body.ips-section-levels .ips-section-stack .wp-block-jetpack-slideshow .swiper-slide figure {
	height: auto !important;
}

body.ips-section-levels .ips-section-stack .wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_image {
	height: auto !important;
	max-height: min(var(--ips-section-gallery-max-height, var(--ips-gallery-image-max-vh)), 820px) !important;
	max-width: 100% !important;
	object-fit: contain !important;
	width: auto !important;
}

body.ips-section-levels .ips-section-stack > p.has-text-align-center {
	margin: 0 auto 0.5rem;
}

@media (max-width: 599px) {
	.wp-block-jetpack-slideshow {
		margin: 1.75rem auto 2.5rem;
	}

	.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_image {
		max-height: var(--ips-gallery-image-max-vh-mobile);
	}
}
