/* In Picture Studio — site UX (scroll, header, nav, a11y) */

html {
	scroll-behavior: smooth;
}

/* Hide hero-layout shell until ips-ux.js finishes DOM setup — avoids first-paint layout blink */
html.ips-ux-pending body.ips-ux-shell #page.site {
	visibility: hidden;
}

html.ips-ux-ready body.ips-ux-shell #page.site {
	visibility: visible;
}

html.ips-ux-pending .ips-project-section {
	opacity: 1;
	transform: none;
	transition: none !important;
}

:root {
	--ips-sticky-nav-top: 0px;
	--ips-anchor-offset: calc(var(--ips-sticky-nav-top) + 4.5rem);
	--ips-site-header-height: 156px;
	--ips-level-vh: 100vh;
	--ips-level-vh-small: 100vh;
	--ips-lightbox-max-vh: 92vh;
	--ips-site-footer-height: 5rem;
}

@supports (height: 100dvh) {
	:root {
		--ips-level-vh: 100dvh;
		--ips-lightbox-max-vh: 92dvh;
	}
}

@supports (height: 100svh) {
	:root {
		--ips-level-vh-small: 100svh;
	}
}

/* Phase 0: hide duplicate scroll-to-top (keep to-top plugin, bottom-right) */
#cwt_to_top_scrollup {
	display: none !important;
}

/* Site search removed — Bold Photography theme toggle + forms */
#primary-search-wrapper,
#social-search-toggle,
.mobile-social-search .search-container,
.jetpack-instant-search,
.jetpack-instant-search__overlay,
#jetpack-instant-search,
body.search .search-form {
	display: none !important;
}

/* Social links live in header — drop duplicate footer strip */
#footer-instagram {
	display: none !important;
}

/* Header bar: no enter/fade animations — social icons visible immediately on desktop */
.site-header-main,
.site-header-menu,
#social-menu-wrapper,
#social-menu-wrapper .menu-inside-wrapper,
.navigation-default #primary-menu-wrapper .menu-inside-wrapper {
	animation: none !important;
	transition: none !important;
}

@media screen and (min-width: 48em) {
	#social-menu-wrapper {
		display: block;
		float: left;
	}

	#social-menu-wrapper .menu-toggle-wrapper {
		display: none !important;
	}

	#social-menu-wrapper .menu-inside-wrapper,
	#social-menu-wrapper.ips-header-social .menu-inside-wrapper {
		background: transparent;
		border: 0;
		box-shadow: none;
		opacity: 1 !important;
		overflow: visible;
		position: static;
		right: 0 !important;
		top: auto;
		visibility: visible !important;
		width: auto;
	}

	#social-menu-wrapper .social-navigation,
	#social-menu-wrapper.ips-header-social .social-navigation {
		align-items: center;
		display: flex;
	}

	#social-menu-wrapper .social-links-menu,
	#social-menu-wrapper.ips-header-social .social-links-menu {
		align-items: center;
		display: flex;
		gap: 0.15rem;
		list-style: none;
		margin: 0;
		opacity: 1 !important;
		padding: 24px 7px;
		transform: none !important;
		visibility: visible !important;
	}

	#social-menu-wrapper .social-navigation a,
	#social-menu-wrapper.ips-header-social .social-navigation a {
		align-items: center;
		display: inline-flex;
		height: 36px;
		justify-content: center;
		margin: 0;
		opacity: 0.78;
		transition: none !important;
		width: 36px;
	}

	#social-menu-wrapper .social-navigation a:hover,
	#social-menu-wrapper .social-navigation a:focus-visible,
	#social-menu-wrapper.ips-header-social .social-navigation a:hover,
	#social-menu-wrapper.ips-header-social .social-navigation a:focus-visible {
		opacity: 1;
	}

	#social-menu-wrapper .social-navigation .icon,
	#social-menu-wrapper.ips-header-social .social-navigation .icon {
		height: 16px;
		position: static;
		top: auto;
		width: 16px;
	}
}

/* Mobile menu: social icons at the bottom of the slide-out nav panel */
@media screen and (max-width: 47.99em) {
	#social-menu-wrapper {
		display: none !important;
	}

	#primary-menu-wrapper.is-open .menu-inside-wrapper {
		bottom: 0;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		height: auto;
		left: 0;
		max-height: none;
		min-height: 0 !important;
		overflow: hidden;
		position: fixed;
		right: 0;
		top: var(--ips-mobile-menu-top, 50px);
		width: 100%;
		z-index: 99999;
	}

	#primary-menu-wrapper .menu-inside-wrapper .main-navigation {
		flex: 1 1 auto;
		min-height: 0;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.mobile-social-search {
		display: block !important;
		flex: 0 0 auto;
		margin-top: 0;
		padding: 0 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
		width: 100%;
	}

	#header-menu-social {
		border-top: 1px solid rgba(255, 255, 255, 0.12);
		padding-top: 1.25rem;
	}

	#header-menu-social .social-navigation,
	#header-menu-social .menu-social-container,
	#header-menu-social .social-links-menu {
		align-items: center;
		display: flex;
		justify-content: center;
	}

	#header-menu-social .social-links-menu {
		flex-wrap: wrap;
		gap: 0.35rem;
		list-style: none;
		margin: 0;
		padding: 0;
	}

	#header-menu-social .social-navigation a {
		align-items: center;
		display: inline-flex;
		height: 44px;
		justify-content: center;
		opacity: 0.85;
		width: 44px;
	}

	#header-menu-social .social-navigation a:focus-visible,
	#header-menu-social .social-navigation a:hover {
		opacity: 1;
	}

	#header-menu-social .social-navigation .icon {
		height: 18px;
		position: static;
		top: auto;
		width: 18px;
	}
}

@media screen and (min-width: 100em) {
	.site-content.section {
		padding-top: 0;
	}
}

/* Scroll progress bar (PROJECTS) */
.ips-scroll-progress {
	background: rgba(255, 255, 255, 0.92);
	height: 2px;
	left: 0;
	pointer-events: none;
	position: fixed;
	top: 0;
	transform-origin: left center;
	transform: scaleX(0);
	width: 100%;
	z-index: 99999;
}

/* Header: solid background after scroll (no slide/transform animation) */
.site-header {
	transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.ips-header-scrolled {
	background-color: rgba(12, 12, 12, 0.92);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.site-header.ips-header-hidden {
	transform: translateY(-105%);
}

/* Sticky category nav (PROJECTS) */
.ips-category-nav {
	backdrop-filter: blur(8px);
	background: rgba(12, 12, 12, 0.82);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	margin: 0 auto 1.5rem;
	max-width: min(1200px, 94vw);
	overflow-x: auto;
	position: sticky;
	scrollbar-width: none;
	top: var(--ips-sticky-nav-top);
	z-index: 50;
	-webkit-overflow-scrolling: touch;
}

.ips-category-nav::-webkit-scrollbar {
	display: none;
}

.ips-category-nav ul {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.25rem;
	justify-content: center;
	list-style: none;
	margin: 0 auto;
	max-width: 100%;
	padding: 0.55rem 0.75rem;
	width: max-content;
}

.ips-category-nav a {
	border-radius: 2px;
	color: rgba(255, 255, 255, 0.55);
	display: block;
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	padding: 0.45rem 0.65rem;
	text-decoration: none;
	text-transform: uppercase;
	transition: color 0.2s ease, background-color 0.2s ease;
	white-space: nowrap;
}

.ips-category-nav a:hover,
.ips-category-nav a:focus-visible {
	color: #fff;
}

.ips-category-nav a.is-active {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

/* Primary nav scrollspy highlight */
.primary-menu .menu-item > a {
	transition: opacity 0.2s ease;
}

.primary-menu .menu-item:not(.ips-nav-active) > a {
	opacity: 0.72;
}

.primary-menu .menu-item.ips-nav-active > a {
	opacity: 1;
}

/* PROJECTS / VIDEOS — each section is a hero scroll level */
html:has(body.page-projekty),
html:has(body.page-id-1448),
html:has(body.page-works),
html:has(body.page-id-205) {
	scroll-padding-top: var(--ips-anchor-offset);
	scroll-snap-type: y mandatory;
}

body.ips-section-levels .custom-header.header-media,
body.ips-section-levels .ips-project-section {
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

/* PROJECTS / VIDEOS — header + intro fill exactly one viewport before first section */
body.ips-section-preamble .ips-page-level-2 .site-content .wrapper {
	padding-top: 0;
}

body.ips-section-preamble .ips-page-preamble {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: calc(var(--ips-level-vh) - var(--ips-site-header-height));
	padding: 1.5rem 0 2rem;
	position: relative;
}

body.ips-section-preamble .ips-page-preamble .wp-block-spacer {
	display: none !important;
}

body.ips-section-preamble .ips-page-preamble > .wp-block-heading,
body.ips-section-preamble .ips-page-preamble > #projects,
body.ips-section-preamble .ips-page-preamble > #videos {
	margin-top: 0;
}

.ips-project-section {
	align-items: center;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: var(--ips-level-vh);
	padding: 2rem 0 3rem;
	scroll-margin-top: var(--ips-anchor-offset);
	scroll-snap-align: start;
	scroll-snap-stop: always;
	width: 100%;
}

body.ips-section-levels .ips-project-section {
	box-sizing: border-box;
	height: var(--ips-level-vh);
	max-height: var(--ips-level-vh);
	min-height: var(--ips-level-vh);
	overflow: hidden;
	padding: clamp(0.75rem, 2vh, 1.5rem) 0 clamp(0.75rem, 2.5vh, 1.5rem);
}

body.ips-section-levels .ips-section-stack {
	align-items: center;
	display: flex;
	flex: 0 1 auto;
	flex-direction: column;
	justify-content: center;
	max-height: 100%;
	width: 100%;
}

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

body.ips-section-levels .ips-section-stack .wp-block-jetpack-slideshow {
	flex: 0 1 auto;
	margin: 0 auto;
	max-height: var(--ips-section-slideshow-max-height, none);
	min-height: 0;
	width: 100%;
}

body.ips-section-levels .ips-section-stack .wp-block-buttons {
	flex: 0 0 auto;
	margin: 0.5rem auto 0;
}

body.ips-section-levels .ips-section-stack .wp-block-embed {
	flex: 0 1 auto;
	margin: 0 auto;
	max-height: var(--ips-section-video-max-height, none);
	max-width: min(960px, 100%);
	min-height: 0;
	width: 100%;
}

body.ips-section-levels .ips-section-stack .wp-block-embed iframe {
	aspect-ratio: 16 / 9;
	height: auto;
	max-height: var(--ips-section-video-max-height, 56vh);
	width: 100%;
}

.ips-project-section .wp-block-jetpack-slideshow {
	align-self: center;
	margin-left: auto;
	margin-right: auto;
	max-width: 100%;
	width: 100%;
}

.ips-project-section .wp-block-buttons {
	align-items: center;
	align-self: center;
	display: flex;
	justify-content: center;
	max-width: 100%;
	width: auto;
}

.ips-project-section .wp-block-buttons .wp-block-button {
	flex: 0 0 auto;
	margin-left: auto;
	margin-right: auto;
	width: auto;
}

.ips-project-section > p.has-text-align-center {
	margin-top: 0;
}

.ips-video-section {
	padding: 2.5rem 0 3rem;
}

.ips-video-section .wp-block-embed {
	margin-left: auto;
	margin-right: auto;
	max-width: min(960px, 100%);
	width: 100%;
}

.ips-video-section .wp-block-embed iframe {
	aspect-ratio: 16 / 9;
	height: auto;
	width: 100%;
}

/* Fade-in on scroll — only after initial layout is ready (see html.ips-ux-ready) */
html.ips-ux-ready .ips-project-section {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.55s ease, transform 0.55s ease;
}

html.ips-ux-ready .ips-project-section.ips-visible {
	opacity: 1;
	transform: none;
}

/* Homepage: full-viewport hero, then gallery + footer (wheel handled in JS) */
.home .custom-header.header-media {
	min-height: var(--ips-level-vh-small);
}

/* Other tabs: compact header band — content visible below; first scroll enters level 2 */
body:not(.home) .custom-header.header-media {
	height: var(--ips-site-header-height);
	max-height: var(--ips-site-header-height);
	min-height: 0;
	overflow: hidden;
}

body:not(.home) .custom-header.header-media .wrapper,
body:not(.home) .custom-header.header-media .custom-header-media,
body:not(.home) .custom-header.header-media .custom-header-content,
body:not(.home) .custom-header.header-media .custom-header-overlay {
	height: 100%;
	min-height: 0;
}

body:not(.home) .custom-header.header-media .custom-header-content {
	padding: 0;
}

body:not(.home) .custom-header.header-media .wrapper:before {
	height: 100%;
}

.home .ips-page-level-2 {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	height: var(--ips-level-vh-small);
	min-height: var(--ips-level-vh-small);
	overflow: hidden;
}

.home .ips-page-level-2 .site-content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	justify-content: center;
	min-height: 0;
	overflow: hidden;
}

.home .ips-page-level-2 .site-content .wrapper,
.home .ips-page-level-2 .site-content .content-area,
.home .ips-page-level-2 .site-content .site-main,
.home .ips-page-level-2 .site-content article,
.home .ips-page-level-2 .site-content .entry-content,
.home .ips-page-level-2 .ips-hero-section {
	align-items: center;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	justify-content: center;
	min-height: 0;
}

.home .ips-page-level-2 .ips-hero-section {
	flex: 0 1 auto;
	width: 100%;
}

.home .ips-page-level-2 .ips-section-stack {
	align-items: center;
	display: flex;
	flex: 0 1 auto;
	flex-direction: column;
	justify-content: center;
	max-height: 100%;
	width: 100%;
}

.home .ips-page-level-2 .ips-section-stack .wp-block-jetpack-slideshow {
	flex: 0 1 auto;
	margin: 0 auto;
	max-height: var(--ips-home-slideshow-max-height, none);
	min-height: 0;
	width: 100%;
}

.home .ips-page-level-2 .ips-section-stack .wp-block-buttons {
	flex: 0 0 auto;
	gap: 0.75rem;
	margin: 0.75rem auto 0;
}

.home .ips-page-level-2 .ips-section-stack .wp-block-buttons .wp-block-button {
	flex: 0 0 auto;
	margin: 0;
}

/* Leading 80px spacers before page section headings (WordPress block content) */
.wp-block-spacer[style*='height:80px'],
.wp-block-spacer[style*='height: 80px'] {
	display: none !important;
}

.home .ips-page-level-2 .wp-block-spacer {
	display: none;
}

.home .ips-page-level-2 .widget-area {
	flex: 0 0 auto;
}

/* Copyright — centered on all pages; fixed overlay only on hero tabs */
#site-generator {
	align-items: center;
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	text-align: center;
	width: 100%;
}

#site-generator .site-info {
	display: block;
	margin: 0;
	text-align: center;
	width: 100%;
}

body.ips-hero-levels .site-footer,
body.ips-section-levels .site-footer {
	bottom: 0;
	left: 0;
	pointer-events: none;
	position: fixed;
	right: 0;
	z-index: 40;
}

body.ips-hero-levels #site-generator,
body.ips-section-levels #site-generator {
	padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom, 0px));
}

body.ips-hero-levels .site-info,
body.ips-section-levels .site-info {
	pointer-events: auto;
}

.ips-hero-section {
	align-items: center;
	display: flex;
	flex-direction: column;
	justify-content: center;
	left: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	max-width: 100vw;
	position: relative;
	right: 50%;
	width: 100vw;
}

.home .ips-page-level-2 .ips-hero-section {
	left: auto;
	margin-left: 0;
	margin-right: 0;
	max-width: 100%;
	position: relative;
	right: auto;
	width: 100%;
}

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

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

.home .ips-page-level-2 .ips-section-stack .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;
}

/* Lightbox */
.ips-lightbox {
	align-items: center;
	background: rgba(0, 0, 0, 0.94);
	box-sizing: border-box;
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 1.5rem;
	position: fixed;
	z-index: 100000;
}

.ips-lightbox img {
	max-height: var(--ips-lightbox-max-vh);
	max-width: min(1400px, 96vw);
	object-fit: contain;
}

.ips-lightbox-close {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.35);
	color: #fff;
	cursor: pointer;
	font-size: 1.25rem;
	line-height: 1;
	min-height: 44px;
	min-width: 44px;
	padding: 0.35rem 0.55rem;
	position: absolute;
	right: max(1rem, env(safe-area-inset-right));
	top: max(1rem, env(safe-area-inset-top));
}

.ips-lightbox-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Focus styles */
.primary-menu a:focus-visible,
.ips-category-nav a:focus-visible,
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-next:focus-visible,
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_button-prev:focus-visible,
.page .entry-content .wp-block-button__link:focus-visible,
#to_top_scrollup:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.85);
	outline-offset: 3px;
}

/* Hero level 1: keep scroll-up in DOM, invisible (plugin uses display:none at scroll top) */
body.ips-hero-levels.ips-at-hero-level-1 #to_top_scrollup {
	display: inline !important;
	opacity: 0 !important;
	pointer-events: none !important;
	visibility: hidden !important;
}

body.ips-hero-levels.ips-at-hero-level-2 #to_top_scrollup {
	display: inline !important;
	pointer-events: auto;
	visibility: visible;
}

/* Home: scroll-down stays in the hero header */
body.ips-hero-levels.home.ips-at-hero-level-1 .custom-header.header-media .scroll-down {
	display: flex !important;
}

body.ips-hero-levels.home.ips-at-hero-level-2 .custom-header.header-media .scroll-down {
	display: none !important;
}

/* Projects / Videos: scroll-down lives in the preamble, not the compact header band */
body.ips-section-preamble .custom-header.header-media .scroll-down {
	display: none !important;
}

body.ips-section-preamble.ips-at-hero-level-1 .ips-page-preamble .scroll-down {
	display: flex !important;
}

body.ips-section-preamble.ips-at-hero-level-2 .ips-page-preamble .scroll-down {
	display: none !important;
}

body.ips-section-preamble .ips-page-preamble .scroll-down {
	bottom: 1.25rem;
	height: 50px;
	position: absolute;
	right: 30px;
	width: 50px;
	z-index: 2;
}

/* Wheel-over-gallery hint — active slide/image only, not full block width */
.wp-block-jetpack-slideshow_slide:hover,
.wp-block-jetpack-slideshow .wp-block-jetpack-slideshow_image:hover {
	cursor: ns-resize;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.home .ips-page-level-2 {
		min-height: auto;
	}

	.ips-project-section {
		min-height: auto;
		opacity: 1;
		transform: none;
		transition: none;
	}

	html.ips-ux-ready .ips-project-section:not(.ips-visible) {
		opacity: 1;
		transform: none;
	}

	body.ips-section-levels .ips-project-section {
		height: var(--ips-level-vh);
		max-height: var(--ips-level-vh);
		min-height: var(--ips-level-vh);
	}

	.site-header {
		transition: none;
	}

	.site-header.ips-header-hidden {
		transform: none;
	}
}

@media (max-width: 599px) {
	:root {
		--ips-sticky-nav-top: env(safe-area-inset-top);
		--ips-anchor-offset: calc(var(--ips-sticky-nav-top) + 4rem);
	}

	.ips-project-section {
		min-height: auto;
		padding: 1.25rem 0 2rem;
	}

	body.ips-section-levels .ips-project-section {
		height: var(--ips-level-vh);
		max-height: var(--ips-level-vh);
		min-height: var(--ips-level-vh);
		padding: clamp(0.5rem, 2vh, 1.25rem) 0 clamp(0.75rem, 2vh, 1.25rem);
	}

	.ips-category-nav a {
		align-items: center;
		display: inline-flex;
		font-size: 0.58rem;
		min-height: 44px;
		padding: 0.5rem 0.6rem;
	}

	input,
	select,
	textarea,
	button {
		font-size: 16px;
	}
}

@media (max-width: 899px) {
	.site-header.ips-header-hidden {
		transform: none;
	}
}

@media (hover: none) and (pointer: coarse) {
	html:has(body.ips-hero-levels),
	html:has(body.ips-section-levels),
	html:has(body.page-projekty),
	html:has(body.page-id-1448),
	html:has(body.page-works),
	html:has(body.page-id-205) {
		scroll-snap-type: y mandatory;
	}

	body.ips-hero-levels .custom-header.header-media,
	body.ips-hero-levels .ips-page-level-2,
	body.ips-section-levels .custom-header.header-media,
	body.ips-section-levels .ips-project-section {
		scroll-snap-align: start;
		scroll-snap-stop: always;
	}

	.home .custom-header.header-media {
		min-height: var(--ips-level-vh-small);
	}

	.home .ips-page-level-2 {
		height: auto;
		min-height: var(--ips-level-vh-small);
		overflow: visible;
	}

	.home .ips-page-level-2 .site-content {
		overflow: visible;
	}
}
