@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
:root {
	--brand: #1f6aa5;
	--brand-2: #2f7fbe;
	--text: #0f172a;
	--muted: #5b6472;
	--bg: #ffffff;
	--alt: #f6f8fb;
	--card: #ffffff;
	--border: #e6eaf0;
	--shadow: 0 10px 30px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
	margin: 0;
	font-family: 'Outfit', system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
	color: var(--text);
	background: var(--bg);
	line-height: 1.7;
	font-size: 17px;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }

.container { width: 92%; max-width: 1160px; margin: 0 auto; }
.section { padding: 72px 0; }
.section.alt { background: var(--alt); }
/* Tighter spacing between intro and vantaggi */
#intro.section { padding-bottom: 56px; }
#investimento.section { padding-top: 48px; }

/* Fix section offset for sticky header */
#intro, #investimento, #tipologie, #vivere, #contatti { 
	scroll-margin-top: 80px; 
}
.grid.two { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 900px) { .grid.two { grid-template-columns: 1fr 1fr; gap: 40px; } }

h1, h2, h3 { line-height: 1.2; margin: 0 0 16px; }
h1.headline { font-size: clamp(28px, 4.2vw, 54px); letter-spacing: .5px; font-weight: 700; }
.subtitle { font-size: clamp(16px, 2.2vw, 22px); color: #17324d; margin: 8px 0 20px; }
.subtitle.on-image { color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.45); }

.btn { display: inline-block; padding: 12px 18px; border-radius: 10px; text-decoration: none; font-weight: 600; transition: transform .2s ease, box-shadow .2s ease, background .2s; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-1px); background: var(--brand-2); }
.btn-outline { border: 2px solid var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.9); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.brand-logo { height: 64px; width: auto; }
.site-footer .brand-logo { height: 96px; }
.main-nav { display: flex; }
.main-nav a { color: var(--text); text-decoration: none; margin-left: 18px; font-weight: 600; }
.main-nav a:hover { color: var(--brand); }

/* Mobile hamburger menu */
.hamburger { display: none; flex-direction: column; cursor: pointer; padding: 4px; }
.hamburger span { width: 25px; height: 3px; background: var(--text); margin: 3px 0; transition: 0.3s; border-radius: 2px; }
.hamburger.active span:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

@media (max-width: 768px) {
	.hamburger { display: flex; }
	.main-nav { 
		position: fixed; 
		top: 0; 
		right: -100%; 
		width: 280px; 
		height: 100vh; 
		background: #fff; 
		flex-direction: column; 
		padding: 80px 20px 20px; 
		box-shadow: -2px 0 10px rgba(0,0,0,.1); 
		transition: right 0.3s ease;
		z-index: 100;
	}
	.main-nav.active { right: 0; }
	.main-nav a { 
		margin: 0 0 20px 0; 
		padding: 12px 0; 
		border-bottom: 1px solid var(--border); 
		font-size: 18px;
	}
	.main-nav a:last-child { border-bottom: none; }
}

.hero { position: relative; }
.hero-slide { position: relative; min-height: 66vh; background-size: cover; background-position: center; display: grid; align-items: end; }
.hero .overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3,21,39,.10) 0%, rgba(3,21,39,.55) 100%); }
.hero .overlay.strong { background: linear-gradient(180deg, rgba(6,18,30,.25) 0%, rgba(6,18,30,.68) 100%); }
.hero-content { position: relative; padding: 64px 0; color: #fff; }

.media-card { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: var(--card); }
/* Equal heights for intro/investimento media on desktop */
@media (min-width: 900px) {
	#intro .media-card, #investimento .media-card { height: 420px; }
	#intro .media-card img, #investimento .media-card img { width: 100%; height: 100%; object-fit: cover; }
}

/* Video container - remove white space */
#investimento .media-card {
	display: flex;
	align-items: stretch;
}
#investimento .media-card video {
	flex: 1;
	object-fit: cover;
}

/* Vivere il lago image - horizontal and large */
#vivere .media-card { 
	height: 200px; 
	overflow: hidden;
}
#vivere .media-card img { 
	width: 100%; 
	height: 100%; 
	object-fit: cover; 
	object-position: center;
}
@media (min-width: 900px) {
	#vivere .media-card { height: 280px; }
}

/* Reduce text section to give more space to image */
#vivere .grid.two {
	grid-template-columns: 1fr 1.5fr;
	gap: 30px;
}
@media (max-width: 900px) {
	#vivere .grid.two {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

.features { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 0; list-style: none; }
@media (min-width: 700px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .features { grid-template-columns: 1fr 1fr 1fr; } }
.features li { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }

.portfolio-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 760px) { .portfolio-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .portfolio-grid { grid-template-columns: repeat(4, 1fr); } }
.portfolio-card { display: block; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--border); text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease; }
.portfolio-card:hover { transform: translateY(-6px); box-shadow: 0 20px 50px rgba(0,0,0,.16); }
.portfolio-card .card-body { padding: 14px 14px 16px; }
.portfolio-card h3 { margin: 0 0 6px; font-size: 18px; }
.portfolio-card p { margin: 0; color: var(--muted); }

.card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.muted { color: var(--muted); margin-top: 0; }
label { display: block; font-weight: 600; margin: 10px 0 12px; }
input, textarea { width: 100%; padding: 12px 12px; border-radius: 10px; border: 1px solid var(--border); outline: none; font-family: inherit; }
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,106,165,.12); }
.checkbox { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.checkbox input { width: 18px; height: 18px; }
.form-success { color: #0a7a2f; font-weight: 700; margin-top: 8px; }

.maps { display: grid; grid-template-columns: 1fr; gap: 12px; }
.maps iframe { width: 100%; height: 240px; border: 0; border-radius: 12px; box-shadow: var(--shadow); }
@media (min-width: 900px) { .maps { grid-template-columns: 1fr 1fr; } }

/* Contact section */
.lead-cta { font-size: inherit; color: var(--text); margin: 0 0 18px; }
.lead-cta .hero-line { display: inline-block; font-size: clamp(22px, 3vw, 28px); font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.inline-form { align-self: start; }
.map-only iframe { width: 100%; height: 100%; min-height: 420px; }

/* Footer */
.site-footer.rich { border-top: 1px solid var(--border); background: #fff; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 24px; padding: 28px 0; }
.footer-grid .f-col h4 { margin: 0 0 10px; }
.footer-grid .f-col a { display: block; color: var(--muted); text-decoration: none; margin: 6px 0; }
.footer-grid .f-col a:hover { color: var(--brand); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.2fr 1fr 1fr 1fr; } }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 24px; border-top: 1px solid var(--border); color: var(--muted); }

/* Portfolio internal pages */
.portfolio-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 980px) { .portfolio-layout { grid-template-columns: 1.6fr .9fr; } }
.gallery { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .gallery { grid-template-columns: 1fr 1fr; } }
.gallery img { border-radius: 12px; box-shadow: var(--shadow); cursor: zoom-in; }
.sidebar { position: sticky; top: 90px; height: fit-content; }

/* Lightbox */
.lightbox-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none; align-items: center; justify-content: center; z-index: 999; }
.lightbox-backdrop.open { display: flex; }
.lightbox-image { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox-backdrop button { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 8px 12px; border-radius: 8px; cursor: pointer; }

/* Section separator style (kept for potential reuse) */
.section.sep { position: relative; }
.section.sep::before { content: ""; position: absolute; left: 50%; transform: translateX(-50%); top: -1px; width: min(160px, 28%); height: 4px; background: linear-gradient(90deg, transparent, var(--brand), transparent); border-radius: 4px; }

/* Carousel styles */
.carousel-container { position: relative; }
.carousel { position: relative; overflow: hidden; border-radius: 14px; box-shadow: var(--shadow); }
.carousel-slides { display: flex; transition: transform 0.3s ease; }
.carousel-slide { min-width: 100%; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-prev, .carousel-next { 
	position: absolute; 
	top: 50%; 
	transform: translateY(-50%); 
	background: rgba(255,255,255,0.9); 
	border: none; 
	width: 40px; 
	height: 40px; 
	border-radius: 50%; 
	cursor: pointer; 
	font-size: 20px; 
	font-weight: bold; 
	color: var(--brand); 
	z-index: 10;
	transition: background 0.2s ease;
}
.carousel-prev:hover, .carousel-next:hover { background: rgba(255,255,255,1); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-indicators { 
	position: absolute; 
	bottom: 15px; 
	left: 50%; 
	transform: translateX(-50%); 
	display: flex; 
	gap: 8px; 
	z-index: 10;
}
.carousel-indicators .indicator { 
	width: 12px; 
	height: 12px; 
	border-radius: 50%; 
	border: none; 
	background: rgba(255,255,255,0.5); 
	cursor: pointer; 
	transition: background 0.2s ease;
}
.carousel-indicators .indicator.active { background: rgba(255,255,255,1); }

/* Portfolio card buttons */
.portfolio-card-button { 
	display: block; 
	border-radius: 14px; 
	background: #fff; 
	border: 2px solid var(--brand); 
	text-decoration: none; 
	color: var(--brand); 
	box-shadow: var(--shadow); 
	transition: all .25s ease; 
	cursor: default;
}
.portfolio-card-button:hover { 
	transform: translateY(-2px); 
	box-shadow: 0 15px 40px rgba(31,106,165,.2); 
	background: var(--brand); 
	color: #fff;
}
.portfolio-card-button .card-body { padding: 20px; text-align: center; }
.portfolio-card-button h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.portfolio-card-button p { margin: 0; font-size: 16px; font-weight: 500; }

/* Phone highlight button */
.phone-highlight { 
	text-align: center; 
	margin-top: 20px; 
}
.btn-phone { 
	background: var(--brand); 
	color: #fff; 
	font-size: 16px; 
	font-weight: 600; 
	padding: 12px 20px; 
	border-radius: 10px; 
	text-decoration: none; 
	display: block; 
	width: 100%; 
	box-shadow: var(--shadow); 
	transition: all 0.2s ease;
}
.btn-phone:hover { 
	background: var(--brand-2); 
	transform: translateY(-1px); 
	box-shadow: 0 15px 40px rgba(31,106,165,0.2); 
	color: #fff;
}

/* Video styles */
video { 
	width: 100%; 
	height: auto; 
	border-radius: 14px; 
	display: block;
}

/* Animazioni leggere */
.section, .card, .portfolio-card, .features li { animation: fadeUp .6s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
