/* Mandioni Costruzioni — main stylesheet */

:root {
	--grey: #6d6d68;
	--red: #d61f1f;
	--tan: #b8875a;
	--dark: #191919;
	--border: #e2e2e2;
	--text: #2b2b2b;
	--font-title: 'Arial Rounded MT Bold', 'Helvetica Rounded', 'Nunito', Arial, sans-serif;
	--font-text: 'Gilda Display', Georgia, serif;
	--font-ui: 'Lato', Helvetica, Arial, sans-serif;
	--gutter: clamp(16px, 4vw, 35px);
	--maxw: 1300px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font-text);
	color: var(--text);
	background: #fff;
	line-height: 1.6;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, p, ul { margin: 0; }

h1, h2 {
	font-family: var(--font-title);
	font-weight: 800;
	font-size: clamp(1.9rem, 4vw, 2.5rem);
	line-height: 1.15;
	color: var(--grey);
	margin-bottom: 1.5rem;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: #000;
	color: #fff;
	padding: .5rem 1rem;
	z-index: 1000;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--tan); outline-offset: 2px; }

/* ---------- Top bar ---------- */

.top-info {
	font-family: var(--font-text);
	text-align: center;
	padding: .6rem var(--gutter);
	font-size: .95rem;
}
.top-info a { color: var(--red); }
.top-info a:hover { text-decoration: underline; }
.top-info .sep { color: #bbb; margin: 0 .4em; }

/* ---------- Header ---------- */

.site-header {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	background: #333 url(../img/header_bg.jpg) center / cover no-repeat;
	color: #fff;
	padding: 0 var(--gutter);
	font-family: var(--font-ui);
}

.logo {
	font-family: var(--font-title);
	font-weight: 800;
	font-size: clamp(1.6rem, 5vw, 3.125rem);
	text-align: center;
	line-height: 1.1;
	margin: clamp(1.5rem, 4vw, 3.125rem) 0;
	letter-spacing: .01em;
	text-shadow: 0 1px 6px rgba(0, 0, 0, .25);
}

.main-nav { margin-bottom: 1.25rem; }
.main-nav ul {
	list-style: none;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .25rem 1.4rem;
	font-weight: 700;
	letter-spacing: .02em;
}
.main-nav a { display: inline-block; padding: .25rem 0; transition: color .2s; }
.main-nav a:hover { color: #000; }
.main-nav a[aria-current="page"] { color: #000; }

.menu-toggle {
	display: none;
	position: absolute;
	top: 50%;
	right: var(--gutter);
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border: 0;
	background: transparent;
	cursor: pointer;
	padding: 10px 7px;
}
.menu-toggle span {
	display: block;
	height: 3px;
	background: #fff;
	border-radius: 2px;
	margin-bottom: 6px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.menu-toggle span:last-child { margin-bottom: 0; }

/* Mobile menu overlay */
.mobile-menu {
	position: fixed;
	inset: 0;
	z-index: 200;
	background: rgba(0, 0, 0, .96);
	color: #f5f5f5;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s, visibility .3s;
	font-family: var(--font-ui);
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }
.mobile-menu ul { list-style: none; padding: 0; width: 100%; max-width: 420px; }
.mobile-menu li { margin-bottom: 5px; }
.mobile-menu a {
	display: block;
	padding: 18px;
	text-align: center;
	text-transform: uppercase;
	font-size: 1.3rem;
	background: #111;
	letter-spacing: .05em;
}
.mobile-menu a:hover, .mobile-menu a:focus-visible { background: #1d1d1d; }
.mobile-menu a[aria-current="page"] { color: #ff4a4a; }

.close-btn {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 44px;
	height: 44px;
	border: 0;
	background: transparent;
	cursor: pointer;
}
.close-btn::before, .close-btn::after {
	content: '';
	position: absolute;
	left: 10px;
	top: 20px;
	width: 24px;
	height: 3px;
	background: #fff;
	border-radius: 2px;
}
.close-btn::before { transform: rotate(45deg); }
.close-btn::after { transform: rotate(-45deg); }

/* ---------- Layout ---------- */

main {
	flex: 1;
	width: 100%;
	max-width: var(--maxw);
	margin: clamp(2rem, 5vw, 3.125rem) auto;
	padding: 0 var(--gutter);
}

.text p { text-align: justify; hyphens: auto; margin-bottom: 1rem; }
.text p:last-child { margin-bottom: 0; }
.text ul { padding-left: 1.2rem; margin-bottom: 1rem; }
.text li { margin-bottom: .35rem; }

/* Pages with gallery */
.page-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: start;
}
.page-grid .text { position: sticky; top: 1.5rem; }

.gallery {
	list-style: none;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
	gap: .5rem;
}
.gallery a {
	display: block;
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: #eee;
}
.gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease, opacity .2s;
}
.gallery a:hover img { transform: scale(1.05); opacity: .85; }
.gallery .cap {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	padding: .5rem .7rem;
	font-family: var(--font-ui);
	font-size: .8rem;
	line-height: 1.3;
	color: #fff;
	background: linear-gradient(transparent, rgba(0, 0, 0, .75));
	opacity: 0;
	transition: opacity .25s;
}
.gallery a:hover .cap, .gallery a:focus-visible .cap { opacity: 1; }

/* ---------- Home ---------- */

.banner { overflow: hidden; max-height: 600px; }
.banner img {
	width: 100%;
	height: auto;
	animation: banner-zoom 30s ease-in-out infinite;
}
@keyframes banner-zoom {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.1); }
}

main.home { margin-top: -150px; position: relative; }

.home-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	gap: 1rem;
	align-items: start;
}

.about-card {
	background: #fff;
	padding: clamp(1.25rem, 3vw, 2rem);
	border: 1px solid #eaeaea;
	box-shadow: 0 0 14px rgba(0, 0, 0, .12);
	position: relative;
	z-index: 2;
}
.about-card .kicker {
	font-family: var(--font-ui);
	font-weight: 300;
	color: var(--tan);
	text-align: center;
	letter-spacing: .08em;
	margin-bottom: .75rem;
	font-size: 1rem;
}
.about-card h2 { text-align: center; }

.sectors {
	list-style: none;
	padding: 0;
	margin-top: 170px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}
.sector {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: #ddd;
}
.sector img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}
.sector span {
	position: absolute;
	left: 0; right: 0;
	top: 100%;
	height: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-ui);
	font-weight: 700;
	font-size: clamp(1.1rem, 2.2vw, 1.5rem);
	letter-spacing: .03em;
	color: #000;
	background: rgba(255, 255, 255, .6);
	transition: top .35s cubic-bezier(.46, .03, .38, 1.03);
}
.sector:hover span, .sector:focus-visible span { top: 50%; }
.sector:hover img { transform: scale(1.05); }

/* ---------- Contatti ---------- */

.contact-grid {
	display: grid;
	grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
	gap: 1.25rem;
	align-items: stretch;
}
.card { padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid #d0d0d0; }

.contact-info { display: flex; flex-direction: column; }
.contact-info h3 {
	font-family: var(--font-title);
	color: var(--grey);
	font-size: clamp(1.25rem, 2.5vw, 1.6rem);
	line-height: 1.3;
	margin-bottom: 1.5rem;
}
.contact-info .trainer {
	display: flex;
	align-items: center;
	gap: .75rem;
	margin-bottom: 1.5rem;
	font-family: var(--font-title);
	color: var(--grey);
}
.contact-info .trainer img { width: 70px; height: 70px; }
.contact-info address { font-style: normal; line-height: 1.8; overflow-wrap: anywhere; margin-bottom: 2rem; }
.contact-info a { color: var(--red); }
.contact-info a:hover { text-decoration: underline; }
.contact-info .mail-btn {
	margin-top: auto;
	display: block;
	text-align: center;
	padding: .9rem 1rem;
	font-family: var(--font-ui);
	font-weight: 700;
	letter-spacing: .05em;
	color: #fff;
	background: #000;
	border-radius: 5px;
	transition: background .2s;
}
.contact-info .mail-btn:hover { background: #333; text-decoration: none; }

.map {
	min-height: max(480px, calc(100vh - 330px));
	border: 1px solid #d0d0d0;
	background: #eee;
}
.map iframe { width: 100%; height: 100%; min-height: inherit; border: 0; display: block; }

/* ---------- Footer ---------- */

.site-footer {
	font-family: var(--font-ui);
	background: var(--dark);
	color: rgba(255, 255, 255, .6);
	text-align: center;
	font-size: .75rem;
	letter-spacing: 1px;
	padding: clamp(2rem, 5vw, 3.125rem) var(--gutter);
	line-height: 1.7;
}
.site-footer strong { font-weight: 700; }
.site-footer p { font-weight: 300; }
.site-footer a:hover { color: #fff; }
.site-footer .copyright { margin-top: .6rem; }
.site-footer img { width: 80px; height: 80px; margin: 1.2rem auto 0; }

/* ---------- Lightbox ---------- */

.lightbox {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .9);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s, visibility .3s;
	touch-action: pan-y;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox figure {
	margin: 0;
	max-width: min(92vw, 1600px);
	display: flex;
	flex-direction: column;
	align-items: center;
}
.lightbox img {
	max-width: 100%;
	max-height: calc(100vh - 140px);
	max-height: calc(100dvh - 140px);
	width: auto;
	box-shadow: 0 0 30px rgba(0, 0, 0, .6);
}
.lightbox figcaption {
	color: #fff;
	font-family: var(--font-ui);
	text-align: center;
	padding: .75rem 1rem 0;
	line-height: 1.4;
	min-height: 2.5rem;
}
.lightbox .counter { color: rgba(255, 255, 255, .55); margin-left: .6rem; font-size: .85em; }
.lb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 72px;
	border: 0;
	background: rgba(0, 0, 0, .35);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
}
.lb-nav:hover { background: rgba(0, 0, 0, .6); }
.lb-nav img { width: 18px; height: auto; filter: invert(1); box-shadow: none; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
	.sectors { margin-top: 0; }
	main.home { margin-top: -80px; }
}

@media (max-width: 1023px) {
	.top-info { display: none; }
	.home-grid, .page-grid { grid-template-columns: 1fr; }
	.page-grid .text { position: static; }
	.sector span { top: 50%; }
	.contact-grid { grid-template-columns: 1fr; }
	.map { min-height: 70vh; }
}

@media (max-width: 767px) {
	.main-nav { display: none; }
	.menu-toggle { display: block; }
	.logo { padding-right: 48px; padding-left: 48px; }
	.banner img { animation: none; }
	main.home { margin-top: 1.5rem; }
	.sectors { grid-template-columns: 1fr; }
	.text p { text-align: left; }
	.gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.gallery .cap { opacity: 1; font-size: .7rem; }
	.lb-nav { width: 40px; height: 56px; }
	.lb-prev { left: 4px; }
	.lb-next { right: 4px; }
}

@media (max-width: 420px) {
	.gallery { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
