/* ==========================================================================
   Lusso Costruzioni — layout mobile / tablet verticale
   Si attiva solo sotto i 1024px: il layout desktop resta invariato.
   Nota: functions.js applica stili inline con jQuery.animate()
   (opacity, bottom, visibility, dimensioni immagini): dove serve
   sovrascriverli è obbligatorio usare !important.
   ========================================================================== */

@media screen and (max-width: 1023px) {

	/* ---------- base ---------- */
	html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
	body {
		font-size: 14px;
		background: #000 url(../images/bg-site.jpg) top center / cover no-repeat;
		overflow-x: hidden;
	}
	body.menu-open { overflow: hidden; }

	/* ---------- slideshow di sfondo (#upsize) → hero fisso ---------- */
	#upsize { position: fixed; inset: 0; z-index: 0; }
	#upsize li img,
	#upsize li.trasform img {
		position: absolute !important;
		top: 0 !important;
		left: 0 !important;
		width: 100% !important;
		height: 100% !important;
		margin: 0 !important;
		object-fit: cover;
	}
	/* velatura per leggibilità di logo e testi sopra la foto */
	#upsize::after {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 40;
		background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.05) 40%, rgba(0,0,0,.85) 100%);
		pointer-events: none;
	}

	/* ---------- header: logo + titolo pagina ---------- */
	#content { position: relative; z-index: 1000; }
	#area {
		margin: 0;
		padding: 22px 22px 26px;
		min-height: 46vh;
		min-height: 46svh;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
	}
	#logo img { width: 168px; height: auto; display: block; }

	#titolo-pagina {
		margin-top: auto;
		width: auto;
		max-width: 300px;
		opacity: 1 !important;
		border-bottom-color: rgba(255,255,255,.6);
		padding-bottom: 8px;
	}
	#titolo-pagina h1 { font-size: 24px; letter-spacing: .03em; color: #fff; }
	body#scheda #titolo-pagina { max-width: none; }

	/* ---------- home: hero a tutto schermo + vetrina ---------- */
	body.is-home #area {
		min-height: 100vh;
		min-height: 100svh;
		padding-bottom: 32px;
	}
	body.is-home #frase {
		margin-top: auto;
		font-size: 20px;
		line-height: 1.4;
		opacity: .85 !important;
	}
	/* "PROPOSTE IN VETRINA": in home diventa l'intestazione della card */
	body.is-home .app {
		width: auto;
		align-self: flex-start;
		margin-top: 22px;
		padding: 12px 20px;
		font-size: 17px;
		opacity: .9 !important;
		border-color: rgba(255,255,255,.7);
		cursor: default;
	}
	body.is-home .close-box { display: none !important; }
	body.is-home .area-news {
		position: static !important;
		visibility: visible !important;
		opacity: 1 !important;
		width: auto !important;
		height: auto !important;
		padding: 0 !important;
		margin-top: 12px;
		overflow: visible !important;
	}
	body.is-home .box-news { margin: 0 0 10px; }
	body.is-home .descrizione-box {
		padding: 16px 18px 12px;
		border-color: rgba(255,255,255,.55);
		background: rgba(0,0,0,.55);
		font-size: 15px;
		line-height: 1.4;
	}
	body.is-home .d-box:first-child { font-size: 19px; }
	body.is-home .d-box a { display: block; }

	/* pagine interne: la vetrina si raggiunge dalla barra in basso */
	body:not(.is-home) .app,
	body:not(.is-home) .area-news,
	body:not(.is-home) .close-box { display: none !important; }

	/* ---------- menu principale → overlay a tutto schermo ---------- */
	#menu-principale,
	#menu-principale.page {
		display: none;
		position: fixed !important;
		inset: 0 !important;
		bottom: 0 !important;
		height: auto !important;
		width: auto !important;
		opacity: 1 !important;
		visibility: visible !important;
		z-index: 6000;
		overflow-y: auto;
		background: #000 url(../images/bg-site.jpg) top center / cover no-repeat;
		padding: 96px 22px 40px;
		box-sizing: border-box;
	}
	body.menu-open #menu-principale { display: block; }
	#menu-principale ul { margin: 0; border-top: 1px solid #262626; }
	#menu-principale li { float: none; margin: 0; border-bottom: 1px solid #262626; }
	#menu-principale a {
		display: flex;
		align-items: center;
		height: auto;
		min-height: 58px;
		padding: 0 4px;
		background: none;
		font-family: London, Verdana, sans-serif;
		font-size: 21px;
		letter-spacing: .04em;
		color: #c9c5c5;
	}
	#menu-principale li.in a { color: #fff; }

	/* pulsante hamburger (creato da mobile.js) */
	.m-burger {
		position: absolute;
		top: 16px;
		right: 18px;
		z-index: 7000;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 1px solid rgba(255,255,255,.6);
		background: rgba(0,0,0,.25);
		cursor: pointer;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 5px;
	}
	.m-burger span {
		display: block;
		width: 20px;
		height: 1px;
		background: #fff;
		transition: transform .2s, opacity .2s;
	}
	body.menu-open .m-burger { position: fixed; }
	body.menu-open .m-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
	body.menu-open .m-burger span:nth-child(2) { opacity: 0; }
	body.menu-open .m-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

	/* ---------- pannello contenuti (#pagina) → flusso normale ---------- */
	#pagina {
		position: relative !important;
		bottom: auto !important;
		height: auto !important;
		opacity: 1 !important;
		z-index: 4000;
		background: rgba(0,0,0,.88);
	}
	#pagina-content,
	#pagina-content.proposte {
		display: block !important;   /* annulla eventuale fadeOut di option01 */
		width: auto !important;
		height: auto !important;
		max-width: 720px;
		margin: 0 auto !important;
		padding: 30px 22px 36px;
		box-sizing: border-box;
		overflow: visible !important;
	}
	/* jScrollPane non viene inizializzato su mobile (vedi mobile.js),
	   queste regole coprono il caso di cache/resize */
	.jspContainer, .jspPane {
		position: static !important;
		width: auto !important;
		height: auto !important;
		padding: 0 !important;
		overflow: visible !important;
	}
	.jspVerticalBar, .jspHorizontalBar { display: none !important; }

	h2 { font-size: 14px; letter-spacing: .05em; margin-bottom: 4px; }
	#titolo {
		font-size: 19px;
		line-height: 1.3;
		margin: 14px 0 16px;
	}
	#testo, .testo {
		margin: 0 0 18px;
		font-size: 14px;
		line-height: 1.7;
		color: #c4c0c0;
	}
	#testo strong { color: #fff; font-weight: normal; letter-spacing: .03em; }
	#testo a { text-decoration: underline; }

	/* ---------- elenchi immobili (proposte / costruzione / realizzazioni) ---------- */
	.box {
		float: none;
		width: auto;
		height: auto;
		margin: 0 0 16px;
		padding: 0;
		border: 1px solid #2c2c2c;
		background: #0b0b0b;
	}
	.img-box {
		float: none;
		width: auto;
		height: 200px;
		margin: 0;
		padding: 0;
		border: 0;
	}
	.img-box a { width: 100%; height: 100%; }
	.img-box img {
		width: 100%;
		height: 100%;
		margin: 0;
		object-fit: cover;
		display: block;
	}
	.descrizione {
		margin: 0;
		padding: 16px 18px 18px;
		font-size: 13px;
		line-height: 1.6;
	}
	.descrizione .ev,
	.descrizione .ev a {
		font-family: London, Verdana, sans-serif;
		font-size: 19px;
		color: #fff;
	}
	.box a:hover { text-decoration: none; }

	/* ---------- scheda immobile ---------- */
	.option01, .option02 { display: none !important; }   /* toggle fullscreen: non serve su touch */
	.box-scheda-01,
	.box-scheda-02 {
		float: none;
		width: auto;
		margin: 0;
		padding: 0 0 12px;
	}
	.box-scheda-01 #testo { text-align: left; }
	.info {
		width: auto;
		display: inline-block;
		margin: 4px 0 24px;
		padding: 12px 20px;
		font-size: 16px;
		color: #fff;
		border-color: rgba(255,255,255,.7);
		opacity: 1 !important;
	}
	/* indicatori slideshow [•] sopra la foto */
	#thumb {
		top: 70px;
		left: auto;
		right: 12px;
		z-index: 1100;
	}
	#thumb li { margin: 0; padding: 10px 6px; font-size: 14px; }
	.arrow { display: none !important; }

	/* ---------- form contatti / richiesta info ---------- */
	#contactForm { margin-top: 10px; }
	#contactForm.form-scheda { padding-top: 24px; }
	#contactForm div[style] { float: none !important; width: auto !important; }
	#contactForm input[type="text"],
	#contactForm input[type="email"],
	#contactForm input[type="tel"],
	#contactForm textarea {
		width: 100%;
		box-sizing: border-box;
		height: 48px;
		padding: 10px 12px;
		font-size: 16px;   /* 16px: evita lo zoom automatico di iOS */
		border-color: #555151;
	}
	#contactForm textarea { height: 140px; }
	#contactForm input[type="radio"] {
		width: 22px !important;
		height: 22px;
		vertical-align: middle;
		margin: 6px 4px 0 0;
		accent-color: #979292;
	}
	#contactForm .botton,
	#contactForm.form-scheda .botton {
		width: 100%;
		height: 52px;
		margin: 0;
		padding: 0 12px;
		font-size: 17px;
		color: #fff;
		border-color: rgba(255,255,255,.7);
		-webkit-appearance: none;
		appearance: none;
		border-radius: 0;
	}

	/* contatti: due colonne → una */
	#testo.area01,
	#testo.area02 {
		float: none;
		width: auto;
		margin: 0 0 18px;
	}

	/* ---------- barra azioni rapide (creata da mobile.js) ---------- */
	.m-band {
		position: relative;
		z-index: 4000;
		display: flex;
		background: linear-gradient(180deg, #1a1a1a, #0c0c0c);
		border-top: 1px solid #2c2c2c;
		border-bottom: 1px solid #2c2c2c;
	}
	.m-band a {
		flex: 1 1 0;
		min-height: 60px;
		display: flex;
		align-items: center;
		justify-content: center;
		font-family: London, Verdana, sans-serif;
		font-size: 15px;
		letter-spacing: .05em;
		text-transform: uppercase;
		color: #c9c5c5;
	}
	.m-band a + a { border-left: 1px solid #2c2c2c; }

	/* ---------- footer → statico, su più righe ---------- */
	#footer {
		position: relative;
		z-index: 4000;
		height: auto;
		width: auto;
		box-sizing: border-box;
		padding: 22px 22px 28px;
		background: #000;
	}
	#footer-content {
		margin: 0;
		font-size: 12px;
		line-height: 1.9;
	}
	#footer .credits {
		float: none;
		display: block;
		margin: 10px 0 0;
		font-size: 11px;
	}
}

/* telefoni: card elenchi leggermente più basse */
@media screen and (max-width: 479px) {
	.img-box { height: 180px; }
}
