/* Tema Immobili — frontend */

.tema-immo {
	--tema-accent: #0066cc;
	--tema-text: #1a1a1a;
	--tema-muted: #666;
	--tema-border: #e8e8e8;
	--tema-radius: 12px;
	margin: 2rem 0;
}

/* Filtri — una riga, chip squadrati, scroll orizzontale su mobile */
.tema-immo__filters-wrap {
	margin-bottom: 1.5rem;
}

.tema-immo__filters {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.5rem;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding: 0.25rem 0 0.5rem;
}

.tema-immo__filters::-webkit-scrollbar {
	display: none;
}

.tema-immo__filter-sep {
	flex: 0 0 auto;
	color: #c8c8c8;
	font-size: 0.875rem;
	font-weight: 300;
	padding: 0 0.15rem;
	user-select: none;
}

.tema-immo__filter {
	flex: 0 0 auto;
	white-space: nowrap;
	padding: 0.5rem 1rem;
	border: 1px solid var(--tema-accent);
	border-radius: 0;
	background: #fff;
	color: var(--tema-accent);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.3;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tema-immo__filter:hover {
	background: #f0f6fc;
}

.tema-immo__filter.is-active {
	background: var(--tema-accent);
	color: #fff;
	border-color: var(--tema-accent);
}

.tema-immo__filter--secondary {
	border-color: #d0d0d0;
	color: var(--tema-text);
	background: #fff;
}

.tema-immo__filter--secondary:hover {
	background: #f8f8f8;
	border-color: #bbb;
	color: var(--tema-text);
}

.tema-immo__filter--secondary.is-active {
	background: #eef4fb;
	color: var(--tema-accent);
	border-color: var(--tema-accent);
}

/* Griglia */
.tema-immo__grid {
	display: grid;
	gap: 1.5rem;
}

.tema-immo__grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.tema-immo__grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.tema-immo__grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

.tema-immo__grid.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

.tema-immo__empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 2rem;
	color: var(--tema-muted);
}

.tema-immo__empty-guide {
	grid-column: 1 / -1;
	text-align: left;
	padding: 1.5rem 2rem;
	background: #f6f7f7;
	border: 1px solid var(--tema-border);
	border-radius: 0;
	max-width: 640px;
	margin: 0 auto;
}

.tema-immo__empty-guide h3 {
	margin: 0 0 0.75rem;
	font-size: 1.1rem;
}

.tema-immo__empty-guide p {
	margin: 0 0 0.75rem;
	line-height: 1.55;
}

.tema-immo__empty-guide code {
	display: inline-block;
	background: #fff;
	border: 1px solid #dcdcde;
	padding: 6px 10px;
	font-size: 0.95rem;
	margin-top: 0.25rem;
}

.tema-immo__empty-guide ol {
	margin: 0.5rem 0 0 1.25rem;
	padding: 0;
}

.tema-immo__empty-guide li {
	margin-bottom: 0.35rem;
}

/* Card */
.tema-immo-card {
	background: #fff;
	border: 1px solid var(--tema-border);
	border-radius: var(--tema-radius);
	overflow: hidden;
	transition: box-shadow 0.2s, transform 0.2s;
}

.tema-immo-card--readonly .tema-immo-card__link--static {
	cursor: default;
}

.tema-immo-card__link--static {
	display: block;
	color: inherit;
	text-decoration: none;
}

.tema-immo-card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.tema-immo-card__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.tema-immo-card__media {
	position: relative;
	aspect-ratio: 4/3;
	background: #f4f4f4;
}

.tema-immo-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tema-immo-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #bbb;
}

.tema-immo-card__price {
	position: absolute;
	bottom: 12px;
	left: 12px;
	background: var(--tema-accent);
	color: #fff;
	padding: 6px 12px;
	border-radius: 6px;
	font-weight: 700;
	font-size: 1rem;
}

.tema-immo-card__body {
	padding: 1rem 1.25rem 1.25rem;
}

.tema-immo-card__title {
	margin: 0 0 0.35rem;
	font-size: 1.05rem;
	line-height: 1.35;
	font-weight: 600;
}

.tema-immo-card__location {
	margin: 0 0 0.5rem;
	font-size: 0.85rem;
	color: var(--tema-muted);
}

.tema-immo-card__excerpt {
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	color: #444;
	line-height: 1.45;
}

.tema-immo-card__features {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.5rem 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.8rem;
	color: var(--tema-muted);
}

.tema-immo-card__features li {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

/* Icone feature (CSS puro) */
.tema-immo-icon {
	display: inline-block;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	background: currentColor;
	opacity: 0.7;
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
}

.tema-immo-icon--rooms {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='8' height='8' rx='1'/%3E%3Crect x='13' y='3' width='8' height='8' rx='1'/%3E%3Crect x='3' y='13' width='8' height='8' rx='1'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='8' height='8' rx='1'/%3E%3Crect x='13' y='3' width='8' height='8' rx='1'/%3E%3Crect x='3' y='13' width='8' height='8' rx='1'/%3E%3C/svg%3E");
}

.tema-immo-icon--size {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 8V4h4M20 8V4h-4M4 16v4h4M20 16v4h-4'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 8V4h4M20 8V4h-4M4 16v4h4M20 16v4h-4'/%3E%3C/svg%3E");
}

.tema-immo-icon--bathrooms {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 12h16v4a2 2 0 01-2 2H6a2 2 0 01-2-2v-4zM6 12V7a2 2 0 012-2h2'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 12h16v4a2 2 0 01-2 2H6a2 2 0 01-2-2v-4zM6 12V7a2 2 0 012-2h2'/%3E%3C/svg%3E");
}

.tema-immo-icon--floor {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 20h16M4 16l4-4 4 4 4-4 4 4'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 20h16M4 16l4-4 4 4 4-4 4 4'/%3E%3C/svg%3E");
}

.tema-immo-icon--elevator {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='6' y='3' width='12' height='18' rx='1'/%3E%3Cpath d='M12 8v8M9 11l3-3 3 3M9 13l3 3 3-3'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='6' y='3' width='12' height='18' rx='1'/%3E%3Cpath d='M12 8v8M9 11l3-3 3 3M9 13l3 3 3-3'/%3E%3C/svg%3E");
}

.tema-immo-icon--balcony,
.tema-immo-icon--terrace {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 14h18M5 14v4M19 14v4M3 10h18'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 14h18M5 14v4M19 14v4M3 10h18'/%3E%3C/svg%3E");
}

.tema-immo-icon--garage {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 10l9-7 9 7v10H3V10z'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 10l9-7 9 7v10H3V10z'/%3E%3C/svg%3E");
}

/* Singolo */
.tema-immo-single__header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.tema-immo-single__title {
	margin: 0;
	font-size: 1.5rem;
}

.tema-immo-single__location {
	margin: 0.25rem 0 0;
	color: var(--tema-muted);
}

.tema-immo-single__price {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--tema-accent);
}

.tema-immo-single__hero {
	margin-bottom: 1.5rem;
	border-radius: var(--tema-radius);
	overflow: hidden;
}

.tema-immo-single__hero img {
	width: 100%;
	height: auto;
	display: block;
}

.tema-immo-single__features {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 1rem;
	margin: 0 0 1.5rem;
	padding: 1.25rem;
	list-style: none;
	background: #f8f9fa;
	border-radius: var(--tema-radius);
}

.tema-immo-single__features li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
}

.tema-immo-single__short {
	margin-bottom: 1.5rem;
	font-size: 1.05rem;
	line-height: 1.6;
}

.tema-immo-single__ref {
	margin-top: 2rem;
	font-size: 0.85rem;
	color: var(--tema-muted);
}

.tema-immo-page {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

.tema-immo-page__header {
	margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 992px) {
	.tema-immo__grid--cols-3,
	.tema-immo__grid--cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.tema-immo__grid {
		grid-template-columns: 1fr !important;
	}

	.tema-immo-card__features {
		grid-template-columns: repeat(2, 1fr);
	}
}

