/* ==========================================================================
   KIRUR NISIM THEME - css/nisim/pages/gallery_inner.css    (owner: galleries)
   Project page - view/pages/gallery_inner.tpl + the item components
   view/components/gallery_inner_image.tpl / gallery_inner_video.tpl.
   From base.css: .nis-pagehero, .nis-kicker, .nis-rich, .nis-pager, .nis-cta,
   .nis-btn (--gold, --ghost), .nis-vh, .dn.
   Page blocks: .nis-prj (page), .nis-thumbgrid + .nis-thumb (item component),
   the skin of the legacy Magnific Popup lightbox (body .mfp-gallery ...).
   Minifier-safe: one declaration per line, single spaces, slash-star comments.
   ========================================================================== */

/* the project name is one weight (no light / bold split) */
.nis-prj .nis-pagehero__title {
	font-weight: 700;
}
/* the projects mocks set the crumbs and the kicker at the font's normal line height */
.nis-prj .nis-pagehero__in > .Breadcrumbs,
.nis-prj .nis-pagehero__in > .nis-kicker {
	line-height: 1.36;
}
/* lead "{type} — ...": the type and the pale dash are written by galleries.js */
.nis-prj__dash {
	color: rgba(26, 48, 82, .34);
}

.nis-prj__body {
	padding: clamp(40px, 4.4vw, 68px) var(--nis-gutter) clamp(56px, 6vw, 88px);
	background: var(--nis-cream);
}
/* CMS "content top" / "content bottom" (empty today): two rich-text columns in
   the secondary look of owner rule R3 (hairline above, 15.5px / 1.85 muted
   text, 21px / 500 titles, 62ch) */
.nis-prj__cms {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
	gap: var(--nis-gap-cols);
	margin-bottom: clamp(28px, 3vw, 44px);
	padding-top: 26px;
	border-top: 1px solid var(--nis-line-3);
}
.nis-prj__cms > .nis-rich {
	max-width: 62ch;
	color: var(--nis-text-muted);
	font-size: 15.5px;
	line-height: 1.85;
}
.nis-prj__cms > .nis-rich h1,
.nis-prj__cms > .nis-rich h2,
.nis-prj__cms > .nis-rich h3,
.nis-prj__cms > .nis-rich h4,
.nis-prj__cms > .nis-rich h5,
.nis-prj__cms > .nis-rich h6 {
	margin: 1.2em 0 .4em;
	font-size: 21px;
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: 0;
}
.nis-prj__cms > .nis-rich:empty {
	display: none;
}
.nis-prj__cms--bottom {
	margin: clamp(28px, 3vw, 44px) 0 0;
}

/* ---------- thumbnails ----------
   #gallery > li are bound to the legacy lightbox by their index: the list
   items stay direct children, in the order of the JSON in #galleryImages. */
.nis-thumbgrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 15vw, 240px), 1fr));
	gap: clamp(12px, 1.3vw, 20px);
}
.nis-thumbgrid > li {
	min-width: 0;
	cursor: zoom-in;
	transition: opacity .25s ease;
}
/* legacy "load more" path: clones arrive hidden and are shown one by one */
.nis-thumbgrid > li.giHidden {
	opacity: 0;
}
/* clicked before the legacy bundle was ready: galleries.js replays the click */
.nis-thumbgrid > li.is-wait {
	cursor: progress;
}
.nis-thumbgrid .nis-thumb {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--nis-line-2);
	border-radius: var(--nis-r-thumb);
	background: var(--nis-mist);
}
.nis-thumbgrid .nis-thumb__link {
	position: relative;
	display: block;
	color: inherit;
	cursor: inherit;
}
.nis-thumbgrid .nis-thumb__link:focus-visible {
	outline-offset: -4px;
}
.nis-thumbgrid .nis-thumb__img {
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
}
.nis-thumbgrid .nis-thumb__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s var(--nis-ease);
}
.nis-thumbgrid .nis-thumb__ov {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: grid;
	place-items: center;
	background: rgba(18, 35, 59, .34);
	opacity: 0;
	transition: opacity .3s ease;
}
.nis-thumbgrid .nis-thumb__ov .zoom,
.nis-thumbgrid .nis-thumb__ov .zoomMiddle {
	display: contents;
}
.nis-thumbgrid .nis-thumb__ov .icon {
	color: var(--nis-on-navy);
	font-size: 28px;
}
@media (hover: hover) {
	.nis-thumbgrid > li:hover .nis-thumb__img img {
		transform: scale(1.05);
	}
	.nis-thumbgrid > li:hover .nis-thumb__ov {
		opacity: 1;
	}
}
.nis-thumbgrid .nis-thumb__link:focus-visible .nis-thumb__ov,
.nis-thumbgrid > li.is-wait .nis-thumb__ov {
	opacity: 1;
}
/* mouse only: the click goes straight to the list item (that is where the
   lightbox is bound), so the anchor's title - a file name - is not shown as a
   tooltip; touch and keyboard keep using the anchor */
@media (hover: hover) and (pointer: fine) {
	.nis-thumbgrid .nis-thumb__link {
		pointer-events: none;
	}
}

/* ---------- previous / next project (base: .nis-pager) ---------- */
.nis-prj__pager {
	margin-top: clamp(30px, 3vw, 44px);
}
@supports selector(:has(*)) {
	.nis-prj__pager:not(:has(a)) {
		display: none;
	}
}
.nis-prj__pager .nis-pager__mid {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 12px;
	transition: color var(--nis-t-color);
}
@media (hover: hover) {
	.nis-prj__pager .nis-pager__mid:hover {
		color: var(--nis-gold-bronze);
	}
}

/* ---------- responsive ---------- */
@media (max-width: 599.98px) {
	.nis-prj__body {
		padding-top: 32px;
		padding-bottom: 48px;
	}
	.nis-thumbgrid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
	.nis-thumbgrid .nis-thumb {
		border-radius: 12px;
	}
	/* stacked full-width pills: both texts start at the same edge */
	.nis-prj__pager .nis-pager__item--next .nis-pager__text {
		align-items: flex-start;
	}
}

/* ==========================================================================
   Lightbox = the legacy Magnific Popup, restyled (markup and behaviour stay
   with the legacy bundle). The vendor css is appended after all head css, so
   every rule carries the "body" prefix. .mfp-gallery sits on .mfp-wrap; the
   wholesale login modal opens with mainClass "mfp-fade" and is left alone.
   ========================================================================== */
body .mfp-bg:not(.mfp-fade) {
	background: rgba(11, 21, 36, .9);
	opacity: 0;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: opacity .25s ease;
}
body .mfp-bg.mfp-ready:not(.mfp-fade) {
	opacity: 1;
}
body .mfp-wrap.mfp-gallery {
	opacity: 0;
	transition: opacity .25s ease;
	overscroll-behavior: contain;
	touch-action: pan-y pinch-zoom;
}
body .mfp-wrap.mfp-gallery.mfp-ready {
	opacity: 1;
}
body .mfp-gallery .mfp-container {
	padding: 0 clamp(16px, 4vw, 56px);
}
body .mfp-gallery img.mfp-img {
	max-width: min(100%, 1200px);
	max-height: 82vh !important;
	padding: 0;
	border-radius: 14px;
}
body .mfp-gallery .mfp-figure::after {
	display: none;
}
body .mfp-gallery .mfp-bottom-bar {
	position: fixed;
	top: auto;
	bottom: clamp(18px, 2.4vw, 34px);
	left: 0;
	width: 100%;
	margin: 0;
	text-align: center;
	pointer-events: none;
}
body .mfp-gallery .mfp-title {
	display: none;
}
body .mfp-gallery .mfp-bottom-bar > .mfp-counter {
	position: static;
	display: inline-block;
	padding: 9px 18px;
	border: 1px solid rgba(247, 242, 234, .2);
	border-radius: 999px;
	color: #F7F2EA;
	font-family: var(--nis-font);
	font-size: 13.5px;
	font-weight: 300;
	line-height: 1.4;
	letter-spacing: .1em;
	direction: ltr;
	unicode-bidi: isolate;
}
body .mfp-gallery .mfp-counter .mfp-counter {
	position: static;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}
body .mfp-gallery button.mfp-close,
body .mfp-gallery button.mfp-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border-radius: 50%;
	color: #F7F2EA;
	opacity: 1;
	transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}
/* the glyphs of the design (Phosphor Light: x, caret-left, caret-right) replace
   the vendor "x" character and its css triangles */
body .mfp-gallery button.mfp-close::before,
body .mfp-gallery button.mfp-arrow::before {
	position: static;
	display: block;
	width: auto;
	height: auto;
	margin: 0;
	border: 0;
	font-family: 'Phosphor-Light';
	font-style: normal;
	font-weight: normal;
	line-height: 1;
	opacity: 1;
}
body .mfp-gallery button.mfp-arrow::after {
	display: none;
}
body .mfp-gallery button.mfp-close {
	position: fixed;
	top: clamp(16px, 2.4vw, 34px);
	right: auto;
	left: clamp(16px, 2.4vw, 34px);
	width: 52px;
	height: 52px;
	border: 1px solid rgba(247, 242, 234, .35);
	background: transparent;
	font-size: 0;
	line-height: 0;
	cursor: pointer;
}
body .mfp-gallery button.mfp-close::before {
	content: "\e4f6";
	font-size: 22px;
}
body .mfp-gallery button.mfp-arrow {
	top: 50%;
	width: 56px;
	height: 56px;
	border: 1px solid rgba(247, 242, 234, .3);
	background: rgba(18, 35, 59, .4);
	transform: translateY(-50%);
}
body .mfp-gallery button.mfp-arrow::before {
	font-size: 24px;
}
body .mfp-gallery button.mfp-arrow-left {
	left: clamp(12px, 2vw, 30px);
}
body .mfp-gallery button.mfp-arrow-left::before {
	content: "\e138";
}
body .mfp-gallery button.mfp-arrow-right {
	right: clamp(12px, 2vw, 30px);
}
body .mfp-gallery button.mfp-arrow-right::before {
	content: "\e13a";
}
@media (hover: hover) {
	body .mfp-gallery button.mfp-close:hover,
	body .mfp-gallery button.mfp-arrow:hover {
		border-color: #FFFFFF;
		background: #FFFFFF;
		color: #12233B;
	}
}
body .mfp-gallery button.mfp-close:active,
body .mfp-gallery button.mfp-arrow:active {
	border-color: #FFFFFF;
	background: #FFFFFF;
	color: #12233B;
}
body .mfp-gallery button.mfp-close:focus-visible,
body .mfp-gallery button.mfp-arrow:focus-visible {
	outline: 2px solid #FFFFFF;
	outline-offset: 3px;
}
@media (max-width: 599.98px) {
	body .mfp-gallery .mfp-container {
		padding: 0 12px;
	}
	body .mfp-gallery img.mfp-img {
		max-height: 72vh !important;
		border-radius: 10px;
	}
	body .mfp-gallery button.mfp-close {
		top: 14px;
		left: 14px;
		width: 44px;
		height: 44px;
	}
	body .mfp-gallery button.mfp-arrow {
		top: auto;
		bottom: 14px;
		width: 44px;
		height: 44px;
		transform: none;
	}
	body .mfp-gallery button.mfp-close::before,
	body .mfp-gallery button.mfp-arrow::before {
		font-size: 20px;
	}
	body .mfp-gallery .mfp-bottom-bar {
		bottom: 20px;
	}
}
@media (prefers-reduced-motion: reduce) {
	body .mfp-bg:not(.mfp-fade),
	body .mfp-wrap.mfp-gallery {
		transition: none;
	}
}
