/* «Фотографії клініки» (tamplate_foto_gallery.php). Стиль узгоджено з npc-specialists.css */
.npc-gal {
	--npc-green: #007a53;
	--npc-green-dark: #00653f;
	--npc-ink: #2b2b2b;
	--npc-muted: #6b6b6b;
	--npc-line: #e3e3e3;
	--npc-tint: #e8f3ee;
	background: #f2f2f2;
	padding: 24px 0 72px;
	font-family: 'Open Sans', sans-serif;
	color: var(--npc-ink);
}
.npc-gal *, .npc-gal *::before, .npc-gal *::after { box-sizing: border-box; }
.npc-gal ul { list-style: none; margin: 0; padding: 0; }
.npc-gal li::before { display: none; content: none; }

/* ---------- Вступ ---------- */
.npc-gal__intro {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 32px;
	margin: 8px 0 28px;
}
.npc-gal .npc-gal__title {
	margin: 0 0 12px;
	padding: 0;
	font-family: 'Open Sans', sans-serif;
	font-size: 44px;
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-transform: none;
	text-align: left;
	color: var(--npc-ink);
}
.npc-gal__lead { max-width: 640px; margin: 0; font-size: 17px; line-height: 1.6; color: var(--npc-muted); }
.npc-gal .npc-gal__count {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 150px;
	margin: 0;
	padding: 16px 18px;
	background: #fff;
	border: 1px solid var(--npc-line);
	border-radius: 16px;
}
.npc-gal__count b { font-size: 30px; line-height: 1.1; font-weight: 700; color: var(--npc-green); }
.npc-gal__count span { font-size: 14px; color: var(--npc-muted); }

/* ---------- Мозаїка ---------- */
.npc-gal__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: 210px;
	grid-auto-flow: dense;
	gap: 14px;
	margin: 0 0 48px;
}
.npc-gal__item { margin: 0; min-width: 0; }
.npc-gal__item.is-big { grid-column: span 2; grid-row: span 2; }
.npc-gal__item.is-tall { grid-row: span 2; }
.npc-gal__item.is-wide { grid-column: span 2; }
.npc-gal__item > a {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: 18px;
	background: #e4e4e4;
	cursor: zoom-in;
	outline-offset: 3px;
}
.npc-gal__item img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .5s ease;
}
.npc-gal__item > a::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(9, 38, 26, 0) 50%, rgba(9, 38, 26, .45) 100%);
	opacity: 0;
	transition: opacity .3s ease;
}
.npc-gal__zoom {
	position: absolute;
	right: 14px;
	bottom: 14px;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #fff;
	color: var(--npc-green);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .25s ease, transform .25s ease;
}
.npc-gal__item > a:hover img,
.npc-gal__item > a:focus-visible img { transform: scale(1.04); }
.npc-gal__item > a:hover::after,
.npc-gal__item > a:focus-visible::after,
.npc-gal__item > a:hover .npc-gal__zoom,
.npc-gal__item > a:focus-visible .npc-gal__zoom { opacity: 1; transform: none; }
.npc-gal__item > a:focus-visible { outline: 3px solid var(--npc-green); }

/* ---------- Заклик ---------- */
.npc-gal__cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 28px 32px;
	background: #fff;
	border: 1px solid var(--npc-line);
	border-radius: 20px;
}
.npc-gal .npc-gal__cta-title { margin: 0 0 4px; font-size: 20px; font-weight: 700; color: var(--npc-ink); }
.npc-gal .npc-gal__cta-text { margin: 0; font-size: 15px; color: var(--npc-muted); }
.npc-gal .npc-gal__cta-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 14px 28px;
	border-radius: 999px;
	background: var(--npc-green);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: background .2s ease;
}
.npc-gal .npc-gal__cta-btn:hover { background: var(--npc-green-dark); color: #fff; text-decoration: none; }

/* ---------- Повноекранний перегляд ---------- */
html.npc-lb-open { overflow: hidden; }
.npc-lb {
	position: fixed;
	inset: 0;
	z-index: 10000;
	background: rgba(8, 20, 15, .94);
	opacity: 0;
	transition: opacity .2s ease;
	font-family: 'Open Sans', sans-serif;
}
.npc-lb[hidden] { display: none; }
.npc-lb.is-open { opacity: 1; }
.npc-lb__stage {
	position: absolute;
	inset: 72px 88px 40px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.npc-lb__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	border-radius: 14px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
	transition: opacity .2s ease;
	user-select: none;
}
.npc-lb.is-loading .npc-lb__img { opacity: .35; }
.npc-lb__top {
	position: absolute;
	top: 16px;
	left: 24px;
	right: 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.npc-lb .npc-lb__count { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .08em; color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums; }
.npc-lb__count b { color: #fff; }
.npc-lb__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .45);
	border-radius: 50%;
	background: rgba(255, 255, 255, .06);
	color: #fff;
	cursor: pointer;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.npc-lb__btn:hover,
.npc-lb__btn:focus-visible { background: #fff; border-color: #fff; color: #007a53; outline: none; }
.npc-lb__prev,
.npc-lb__next { position: absolute; top: 50%; margin-top: -24px; }
.npc-lb__prev { left: 24px; }
.npc-lb__next { right: 24px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1199px) {
	.npc-gal__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 190px; }
}
@media (max-width: 991px) {
	.npc-gal__intro { flex-direction: column; align-items: flex-start; }
	.npc-gal .npc-gal__title { font-size: 34px; }
}
@media (max-width: 767px) {
	.npc-gal { padding: 16px 0 48px; }
	.npc-gal .npc-gal__title { font-size: 28px; }
	.npc-gal__lead { font-size: 16px; }
	.npc-gal__intro { gap: 16px; margin-bottom: 20px; }
	.npc-gal .npc-gal__count { flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; padding: 10px 16px; }
	.npc-gal__count b { font-size: 22px; }
	.npc-gal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 140px; gap: 10px; margin-bottom: 36px; }
	.npc-gal__item.is-wide { grid-column: span 2; }
	.npc-gal__item > a { border-radius: 14px; }
	.npc-gal__zoom { display: none; }
	.npc-gal__cta { flex-direction: column; align-items: stretch; padding: 20px; }
	.npc-lb__stage { inset: 64px 10px 84px; }
	.npc-lb__top { left: 16px; right: 12px; top: 10px; }
	.npc-lb__prev, .npc-lb__next { top: auto; bottom: 18px; margin: 0; }
	.npc-lb__prev { left: calc(50% - 60px); }
	.npc-lb__next { right: calc(50% - 60px); }
}
@media (prefers-reduced-motion: reduce) {
	.npc-gal__item img, .npc-lb, .npc-gal__zoom { transition: none; }
}
