/*
 * responsive.css - dostosowanie witryny do urządzeń mobilnych
 * oraz style galerii (siatka miniatur) i lightboxa (scripts/lightbox2.js).
 * Układ na dużych ekranach (>= 1020px) pozostaje bez zmian.
 */

/* ===== Siatka miniatur galerii (wszystkie szerokości) ===== */

.gallery-section .gallery-cat {
	display: block;
	margin: 0 0 8px 0;
	max-width: 100%;
	height: auto;
}

.thumb-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	align-items: center;
}

.thumb-grid a {
	display: block;
	line-height: 0;
}

.thumb-grid img {
	height: 96px;
	width: auto;
	display: block;
	border: 3px solid #CBC6C1;
	background: #fff;
}

.thumb-grid a:hover img {
	border-color: #8E6C6C;
}

.thumb-grid.certs img {
	height: 160px;
}

/* ===== Lightbox ===== */

.lb2-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(20, 12, 8, 0.92);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	touch-action: pan-y;
}

.lb2-img {
	max-width: 94vw;
	max-height: 82vh;
	box-shadow: 0 4px 30px rgba(0,0,0,0.7);
	border: 2px solid #F6EDE3;
	background: #fff;
}

.lb2-caption {
	color: #F6EDE3;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	max-width: 94vw;
	padding: 10px 12px 0;
}

.lb2-counter {
	color: #C3B7B7;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	padding-top: 4px;
}

.lb2-btn {
	position: absolute;
	border: 0;
	background: rgba(246, 237, 227, 0.12);
	color: #F6EDE3;
	font-family: Arial, Helvetica, sans-serif;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	border-radius: 6px;
}

.lb2-btn:hover {
	background: rgba(246, 237, 227, 0.28);
}

.lb2-prev, .lb2-next {
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 72px;
	font-size: 36px;
	line-height: 72px;
}

.lb2-prev { left: 6px; }
.lb2-next { right: 6px; }

.lb2-close {
	top: 8px;
	right: 8px;
	width: 44px;
	height: 44px;
	font-size: 26px;
	line-height: 44px;
}

/* ===== Układ mobilny ===== */

@media (max-width: 1019px) {

	body {
		font-size: 15px;
	}

	/* --- baner: skalowany do szerokości ekranu, menu pod banerem --- */

	div.topbanner, div.topbanner2 {
		position: relative;
		width: 100% !important;
		height: auto !important;
		padding-top: calc(100% * 346 / 1107);
		background-size: 100% auto;
		background-repeat: no-repeat;
		background-position: top center;
	}

	div.mainpagelink {
		position: absolute !important;
		top: 0 !important;
		left: 0 !important;
		width: 100% !important;
		height: auto !important;
		aspect-ratio: 1107 / 346;
	}

	div.menu {
		position: static !important;
		width: auto !important;
		height: auto !important;
		padding: 4px 2px 6px;
	}

	div.menu table, div.menu tbody, div.menu tr {
		display: block;
		width: auto !important;
		height: auto !important;
	}

	div.menu tr {
		text-align: center;
	}

	div.menu td {
		display: inline-block;
		padding: 7px 8px;
	}

	/* --- ramki treści: pełna szerokość, narożniki rysowane przez CSS --- */

	div.mainheader, div.mainbody, div.mainfooter {
		width: auto !important;
		left: 0 !important;
		margin: 0 8px;
	}

	div.mainheader {
		background-color: #F9F3ED;
		border-radius: 10px 10px 0 0;
	}

	div.mh1 {
		position: static !important;
	}

	div.mh2, div.mh3 {
		display: none;
	}

	div.mainfooter {
		background-color: #F9F3ED;
		border-radius: 0 0 10px 10px;
		height: 10px;
	}

	div.mf1, div.mf2, div.mf3 {
		display: none;
	}

	div.mb {
		width: auto !important;
		padding: 10px;
		line-height: 1.45;
	}

	div.mb table {
		width: 100% !important;
	}

	div.mb img, #r1 img, #r2 img, #r3 img, #o2 img {
		max-width: 100%;
		height: auto;
	}

	/* --- kolumna zakładek na stronach zabiegów --- */

	div.mainheader[style*="height:1px"] {
		background: none;
		border-radius: 0;
		height: auto !important;
		text-align: center;
		margin-bottom: 8px;
	}

	div.mainheader[style*="height:1px"] br {
		display: none;
	}

	div.mainheader[style*="height:1px"] div {
		display: inline-block;
		margin: 2px 1px;
	}

	/* --- boksy pozycjonowane absolutnie wchodzą w normalny przepływ --- */

	#r1, #r2, #r3 {
		position: static !important;
		width: auto !important;
		height: auto !important;
		margin-top: 12px;
	}

	#o2 {
		position: static !important;
		width: auto !important;
		height: auto !important;
		margin: 12px 0 0;
		text-align: center;
	}

	#o2 > div {
		position: static !important;
		display: inline-block;
		margin: 4px 6px;
	}

	iframe {
		max-width: 100%;
	}
}
