/* ==========================================================================
   pisoenterrassa.com — layout modernizado (responsive, mismo diseño visual)
   ========================================================================== */

:root {
	--rojo: #C12D1F;
	--rojo-osc: #a3251a;
	--texto: #6b6b6b;
	--texto-fuerte: #4a4a4a;
	--enlace: #9a9a9a;
	--bg: #efefef;
	--linea: #cccccc;
	--ancho: 1100px;
}

/* @group Reset mínimo */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
ul, ol { list-style: none; padding: 0; }
img { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--enlace); text-decoration: none; }
a:hover { color: var(--rojo); }
:focus-visible { outline: 2px solid var(--rojo); outline-offset: 2px; }
/* @end */

body {
	font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--texto);
	background: var(--bg);
	-webkit-text-size-adjust: 100%;
}

h2 {
	color: var(--rojo);
	font-size: clamp(1.25rem, 2vw, 1.5rem);
	margin: .9rem 0 .45rem;
}

/* Contenedor con anchura máxima moderna y gutters fluidos */
.page {
	max-width: var(--ancho);
	margin: 0 auto;
	padding: 0 clamp(18px, 4vw, 40px);
}

.visually-hidden {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* @group Héroe (home) — banner ancho; conserva la composición de producción */
.hero {
	min-height: clamp(280px, 26vw, 340px);
	margin-top: clamp(10px, 1.4vw, 14px);
	padding: clamp(18px, 3%, 34px) clamp(22px, 4%, 52px) clamp(6px, 1%, 10px);
	display: flex;
	flex-direction: column;
	color: #fff;
	text-align: right;
	border-radius: 6px;
	overflow: hidden;
	/* foto anclada abajo + degradado suave SOLO al pie: completa la franja
	   oscura en todo el ancho (la foto solo es oscura a la izquierda) para
	   que el precio se lea sobre cualquier zona. WebP con fallback PNG. */
	background-color: #ccc;
	background-image:
		linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,.28) 12%, rgba(0,0,0,0) 30%),
		url(../img/piso-terrassa-bg.png);
	background-image:
		linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,.28) 12%, rgba(0,0,0,0) 30%),
		image-set(url(../img/piso-terrassa-bg.webp) type("image/webp"), url(../img/piso-terrassa-bg.png) type("image/png"));
	background-repeat: no-repeat;
	background-position: center bottom;
	background-size: cover;
}
.hero-intro h2 {
	color: var(--rojo);
	font-size: clamp(1.6rem, 3vw, 2.3rem);
	margin: 0 0 .4em;
	text-shadow: 0 1px 4px rgba(0,0,0,.5), 0 0 2px rgba(0,0,0,.4);
}
.hero-intro p {
	margin: 0 0 .3em;
	padding-left: 38%;
	line-height: 1.4;
	font-size: clamp(1.05rem, 1.8vw, 1.4rem);
	text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
.hero .precio {
	margin-top: auto;
	text-align: center;
	font-size: clamp(1.05rem, 1.7vw, 1.35rem);
	text-shadow: 0 1px 4px rgba(0,0,0,.75);
}
.hero .precio em {
	color: #ff6f5e;
	font-style: normal;
	font-weight: bold;
}
@media (max-width: 640px) {
	.hero {
		min-height: 300px;
		padding: 32px 18px 24px;
	}
	.hero-intro p { padding-left: 18%; }
}

/* @group Cabecera + navegación (páginas internas) */
.site-nav {
	margin-top: clamp(16px, 3vw, 26px);
}
.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 28px;
}
.site-nav a {
	display: inline-block;
	font-weight: bold;
	font-size: 1.05rem;
	padding-bottom: 5px;
	border-bottom: 2px solid transparent;
}
.site-nav a[aria-current="page"] {
	color: var(--texto-fuerte);
	border-bottom-color: var(--rojo);
}

.page-header {
	min-height: clamp(140px, 18vw, 220px);
	margin: clamp(14px, 2.5vw, 22px) 0 clamp(18px, 2.5vw, 28px);
	display: flex;
	align-items: flex-end;
	border-radius: 6px;
	overflow: hidden;
	background-color: #ccc;
	background-image:
		linear-gradient(to bottom, rgba(0,0,0,.05), rgba(0,0,0,.45)),
		url(../img/piso-terrassa-bg2.png);
	background-image:
		linear-gradient(to bottom, rgba(0,0,0,.05), rgba(0,0,0,.45)),
		image-set(url(../img/piso-terrassa-bg2.webp) type("image/webp"), url(../img/piso-terrassa-bg2.png) type("image/png"));
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
}
.page-header h1 {
	color: #fff;
	font-size: clamp(1.5rem, 3vw, 2.1rem);
	padding: 0 0 clamp(14px, 2vw, 24px) clamp(18px, 3vw, 32px);
	text-shadow: 0 1px 3px rgba(0,0,0,.55);
}

/* @group Contenido */
/* solo el texto corrido (hijo directo); NO los párrafos anidados del héroe */
.content > p { margin: .5rem 0; max-width: 68ch; }
.content ul { list-style: disc; padding-left: 1.3rem; }
.content ul ul { margin: .15rem 0; }
.content li { margin: .15rem 0; }

/* Las listas de fotos no llevan viñeta (gana en especificidad a .content ul) */
.content .thumbs,
.content .gallery {
	list-style: none;
	padding-left: 0;
}
.content .thumbs li,
.content .gallery li { margin: 0; }

/* Home: dos columnas (info + fotos) */
.cols {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(28px, 4vw, 60px);
	margin-top: clamp(10px, 1.4vw, 16px);
}
.cols > * > h2:first-child { margin-top: 0; }
.cols .info { flex: 2 1 420px; }
.cols .fotos-preview { flex: 1 1 300px; }

.features {
	display: flex;
	flex-wrap: wrap;
	gap: 0 clamp(28px, 4vw, 56px);
}
.features ul { flex: 1 1 180px; }

/* Miniaturas del home */
.thumbs {
	list-style: none;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	margin-top: .6rem;
}
.thumbs a {
	display: block;
	text-align: center;
	color: var(--texto);
	font-size: .85rem;
}
.thumbs a:hover { color: var(--rojo); }
.thumbs img {
	display: block;
	width: 100%;
	padding: 2px;
	background: #fff;
	border: 1px solid var(--linea);
	margin-bottom: 5px;
}

/* @group Galería (página de fotos) */
.gallery {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: clamp(18px, 2vw, 28px);
	margin-top: clamp(18px, 2.5vw, 28px);
}
.gallery a {
	display: block;
	text-align: center;
	color: var(--texto);
	font-size: .85rem;
}
.gallery a:hover { color: var(--rojo); }
.gallery img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	padding: 4px;
	background: #fff;
	border: 2px solid var(--linea);
	margin-bottom: 6px;
	transition: border-color .15s ease;
}
.gallery a:hover img { border-color: var(--rojo); }

/* @group Lightbox */
.lightbox {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0,0,0,.85);
	z-index: 1000;
}
.lightbox.open { display: flex; }
.lightbox img {
	max-width: 100%;
	max-height: 84vh;
	padding: 4px;
	background: #fff;
	box-shadow: 0 6px 40px rgba(0,0,0,.5);
}
.lightbox button {
	position: absolute;
	background: none;
	border: 0;
	color: #fff;
	font-size: 2.2rem;
	line-height: 1;
	padding: 10px 16px;
	cursor: pointer;
}
.lightbox button:hover { color: var(--rojo); }
.lb-close { top: 6px; right: 10px; }
.lb-prev { left: 6px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 6px; top: 50%; transform: translateY(-50%); }
.lb-caption {
	position: absolute;
	bottom: 14px; left: 0; right: 0;
	text-align: center;
	color: #fff;
	font-size: .9rem;
}

/* @group Embeds responsive (vídeo y mapa) */
.embed {
	position: relative;
	margin: 18px 0;
	aspect-ratio: 16 / 9;
}
.embed.map { aspect-ratio: 2 / 1; }
.embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* @group Pie */
.site-footer {
	margin-top: 24px;
	padding: 12px 0;
	font-size: .8rem;
	text-align: center;
	color: var(--texto);
	border-top: 1px solid var(--rojo);
}
.site-footer a { color: var(--enlace); }
.site-footer a:hover { color: var(--rojo); }
