/*
 * Chr theme — base styles.
 * Original styles built around a custom 5-color palette
 * (extracted from an Adobe Color swatch file provided by the site owner).
 */

:root {
	/* Color palette — from AdobeColor My Color Theme.ase */
	--color-dark: #02402e;       /* primary dark (headers, footer, text accents) */
	--color-light: #f2f2f2;      /* page background */
	--color-tan: #f2c288;        /* soft highlight / badges */
	--color-brown: #a6530a;      /* secondary accent / hover states */
	--color-orange: #d9863d;     /* primary accent (buttons, links) */

	--color-white: #ffffff;
	--color-text: #1d2621;
	--color-muted: #5f6d66;

	/* Typography */
	--font-heading: 'Roboto', sans-serif;
	--font-body: 'Roboto', sans-serif;

	/* Layout & shape */
	--radius: 0px;
	--container-width: 1200px;
	--header-height: 70px;

	/* Transitions & overlays */
	--transition-speed: 0.35s;
	--transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
	--overlay-dark: rgba(2, 64, 46, 0.65);
	--overlay-darker: rgba(2, 64, 46, 0.82);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--font-body);
	font-weight: 300;
	color: var(--color-text);
	background: var(--color-white);
	line-height: 1.6;
	overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	font-weight: 100;
	line-height: 1.2;
}

img {
	max-width: 100%;
	display: block;
}

a {
	color: var(--color-brown);
	text-decoration: none;
	transition: color var(--transition-speed) var(--transition-ease);
}

a:hover {
	color: var(--color-orange);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--color-dark);
	color: var(--color-white);
	padding: 10px 16px;
	z-index: 10000;
}

.skip-link:focus {
	left: 10px;
}

.container {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 24px;
}

/* Buttons — Dluxe-style bordered, letter-spaced, hover-fill */
.btn {
	display: inline-block;
	padding: 15px 30px;
	border-radius: var(--radius);
	font-family: var(--font-body);
	font-weight: 500;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.25em;
	border: 1px solid currentColor;
	background: transparent;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	transition: color var(--transition-speed) var(--transition-ease),
	            border-color var(--transition-speed) var(--transition-ease);
	z-index: 1;
}

.btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 0;
	height: 100%;
	z-index: -1;
	transition: width var(--transition-speed) var(--transition-ease);
}

.btn:hover::before {
	width: 100%;
}

.btn-accent {
	border-color: var(--color-orange);
	color: var(--color-orange);
}

.btn-accent::before {
	background: var(--color-orange);
}

.btn-accent:hover {
	color: var(--color-white);
}

.btn-outline {
	border-color: var(--color-dark);
	color: var(--color-dark);
}

.btn-outline::before {
	background: var(--color-dark);
}

.btn-outline:hover {
	color: var(--color-white);
}

.btn-outline-white {
	border-color: var(--color-white);
	color: var(--color-white);
}

.btn-outline-white::before {
	background: var(--color-white);
}

.btn-outline-white:hover {
	color: var(--color-dark);
}

/* Main content sits below the fixed header; the home hero runs under it. */
.site-main {
	padding-top: var(--header-height);
}

.has-hero .site-main {
	padding-top: 0;
}

/* Hero */
.hero {
	position: relative;
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: calc(var(--header-height) + 48px) 24px 96px;
	background: linear-gradient(135deg, var(--color-dark), #063c2b 60%, var(--color-brown));
	color: var(--color-white);
	text-align: center;
}

.hero::after {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--overlay-dark);
	z-index: 1;
}

.hero-video,
.hero-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero-inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 760px;
	margin: 0 auto;
}

.hero-logo {
	margin: 0 0 24px;
	font-size: inherit;
	font-weight: inherit;
}

.hero-logo .custom-logo {
	display: inline-block;
	max-height: 96px;
	max-width: 226px;
}

.hero-logo .site-title {
	font-size: clamp(1.8rem, 4vw, 3rem);
	font-weight: 900;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.hero-subtitle {
	font-size: clamp(1.05rem, 1.6vw, 1.3rem);
	font-weight: 300;
	color: var(--color-light);
	margin: 0 auto 40px;
	max-width: 560px;
}

.hero-cta-group {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: center;
}

.hero-search {
	display: flex;
	max-width: 440px;
	margin: 32px auto 0;
	gap: 0;
}

.hero-search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	padding: 14px 16px;
	border: 1px solid var(--color-white);
	border-right: 0;
	background: rgba(255, 255, 255, 0.08);
	color: var(--color-white);
	font: inherit;
}

.hero-search input[type="search"]::placeholder {
	color: rgba(255, 255, 255, 0.75);
}

.hero-search input[type="search"]:focus {
	outline: 2px solid var(--color-tan);
	outline-offset: 2px;
}

.hero-search .btn {
	flex: 0 0 auto;
}

.hero-center-line {
	position: absolute;
	bottom: 0;
	left: 50%;
	z-index: 2;
	width: 1px;
	height: 60px;
	background: var(--color-white);
	opacity: 0.5;
}

.section-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.section-heading .section-title {
	margin-bottom: 0;
}

.featured-listings .section-title {
	font-size: clamp(2rem, 4vw, 3rem);
	line-height: 1.1;
}

.section-action {
	text-align: center;
	margin: 32px 0 48px;
}

/* Section titles */
.section-title {
	text-align: center;
	font-size: 1.8rem;
	color: var(--color-dark);
	margin: 56px 0 32px;
}

.empty-state {
	text-align: center;
	color: var(--color-muted);
}

/* Listing / post card grid */
.listing-grid,
.post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	margin-bottom: 48px;
}

.listing-grid-compact {
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 16px;
}

.listing-card,
.post-card {
	background: var(--color-white);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(2, 64, 46, 0.08);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.listing-card:hover,
.post-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 20px rgba(2, 64, 46, 0.14);
}

.listing-card-thumb,
.post-card-thumb {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	background: var(--color-tan);
	overflow: hidden;
}

.listing-card-media {
	position: absolute;
	inset: 0;
}

.listing-card-thumb img,
.post-card-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--transition-ease);
}

.listing-card:hover .listing-card-thumb img,
.listing-card-thumb:focus-visible img {
	transform: scale(1.05);
}

.listing-card-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding-bottom: 20px;
	background: linear-gradient(to top, var(--overlay-darker), transparent 60%);
	opacity: 0;
	transition: opacity var(--transition-speed) var(--transition-ease);
}

.listing-card:hover .listing-card-overlay,
.listing-card-thumb:focus-visible .listing-card-overlay {
	opacity: 1;
}

.listing-card-overlay-label {
	color: var(--color-white);
	font-size: 0.8rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.listing-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: var(--color-orange);
	color: var(--color-white);
	font-size: 0.75rem;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.15em;
}

.listing-card-body,
.post-card-body {
	padding: 16px;
}

.listing-card-price {
	color: var(--color-brown);
	font-weight: 700;
	margin: 0 0 4px;
}

.listing-card-title,
.post-card-title {
	font-size: 1.05rem;
	margin: 0 0 6px;
}

.listing-card-address,
.listing-card-excerpt,
.post-card-excerpt {
	color: var(--color-muted);
	font-size: 0.9rem;
	margin: 0 0 10px;
}

.listing-card-specs {
	list-style: none;
	display: flex;
	gap: 12px;
	padding: 0;
	margin: 0;
	font-size: 0.85rem;
	color: var(--color-dark);
}

.listing-card-specs li::before {
	content: "• ";
	color: var(--color-orange);
}

.listing-card-specs li:first-child::before {
	content: "";
}

/* Listings + map page layout: single column, filters live in the slide-out panel */
.listings-page {
	max-width: 1500px;
	margin: 0 auto;
	padding: 24px;
}

.listings-toolbar {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
}

.listings-map {
	width: 100%;
	height: 60vh;
	min-height: 420px;
	margin-bottom: 24px;
	border-radius: var(--radius);
	background: var(--color-tan);
}

.listings-count {
	color: var(--color-muted);
	margin: 0;
}

.loading-state {
	color: var(--color-muted);
}
/* Map popup card (Leaflet) */
.map-popup-card {
	min-width: 200px;
}

.map-popup-card .map-popup-price {
	font-weight: 700;
	color: var(--color-brown);
	margin: 0 0 4px;
}

.map-popup-card .map-popup-title {
	margin: 0 0 4px;
	font-size: 0.95rem;
}

/* Property single page */
.property-hero img {
	width: 100%;
	max-height: 480px;
	object-fit: cover;
}

.property-body {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 32px;
	padding: 32px 24px;
}

.property-title {
	color: var(--color-dark);
	margin-top: 0;
}

.property-address {
	color: var(--color-muted);
}

.property-specs {
	list-style: none;
	padding: 0;
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	margin: 16px 0;
}

.property-specs li {
	background: var(--color-light);
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 0.9rem;
}

.property-spec {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.property-spec .icon {
	color: var(--color-brown);
	flex-shrink: 0;
}

.property-operation {
	background: var(--color-orange) !important;
	color: var(--color-white);
}

.property-sidebar {
	background: var(--color-white);
	border-radius: var(--radius);
	padding: 24px;
	align-self: start;
	position: sticky;
	top: calc(var(--header-height) + 16px);
	text-align: center;
}

.property-price {
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--color-brown);
}

.property-contact-btn {
	width: 100%;
	font: inherit;
	cursor: pointer;
}

/* Gallery replaces the single hero when a property has several photos */
.property-hero-gallery {
	position: relative;
}

.property-gallery {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.property-gallery::-webkit-scrollbar {
	display: none;
}

.property-gallery:focus-visible {
	outline: 2px solid var(--color-brown);
	outline-offset: -2px;
}

.property-gallery-slide {
	flex: 0 0 100%;
	margin: 0;
	scroll-snap-align: start;
}

.property-hero-gallery .property-gallery-slide img {
	display: block;
	width: 100%;
	height: min(70vh, 560px);
	max-height: none;
	object-fit: cover;
}

.property-gallery-dots {
	position: absolute;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	display: flex;
	gap: 10px;
}

.property-gallery-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--color-white);
	opacity: 0.6;
	transition: opacity var(--transition-speed) var(--transition-ease);
}

.property-gallery-dot:hover,
.property-gallery-dot:focus-visible {
	opacity: 1;
}

.property-related {
	padding: 48px 0 64px;
	background: var(--color-light);
}

.property-related .section-title {
	margin-bottom: 24px;
}

/* Page / post content */
.content-area {
	padding: 48px 24px;
}

.page-title {
	color: var(--color-dark);
}

/* Footer */
.site-footer {
	background: var(--color-dark);
	color: var(--color-light);
	margin-top: 0;
}

.footer-inner {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 48px 24px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 32px;
}

.site-footer a {
	color: var(--color-tan);
}

.site-footer a:hover {
	color: var(--color-orange);
}

.widget-title,
.footer-title {
	color: var(--color-white);
	text-transform: uppercase;
	font-size: 0.95rem;
	letter-spacing: 0.04em;
}

.footer-row {
	width: 100%;
}

.footer-nav {
	border-bottom: 1px solid rgba(242, 242, 242, 0.15);
}

.footer-nav-inner {
	max-width: var(--container-width);
	margin: 0 auto;
}

.footer-nav .footer-links {
	list-style: none;
	margin: 0;
	padding: 28px 24px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px 36px;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.footer-info {
	border-bottom: 1px solid rgba(242, 242, 242, 0.15);
}

.footer-about .custom-logo {
    max-height: 88px;
    width: auto;
}

.footer-social .footer-title {
	margin-bottom: 16px;
}

.social-links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid rgba(242, 194, 136, 0.5);
	border-radius: 50%;
	color: var(--color-tan);
	transition: background 0.3s var(--transition-ease), border-color 0.3s var(--transition-ease), color 0.3s var(--transition-ease);
}

.social-link:hover {
	background: var(--color-tan);
	border-color: var(--color-tan);
	color: var(--color-dark);
}

.social-link .icon {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.footer-legal-inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 12px 24px;
	padding: 20px 24px;
	font-size: 0.85rem;
	color: rgba(242, 242, 242, 0.7);
}

.footer-legal-inner p {
	margin: 0;
}

.footer-legal-links a {
	color: rgba(242, 242, 242, 0.85);
}

.footer-legal-links a:hover {
	color: var(--color-tan);
}

/* Floating WhatsApp button */
.whatsapp-float {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 56px;
	height: 56px;
	background: #25D366;
	color: var(--color-white);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
	z-index: 999;
	transition: transform 0.3s var(--transition-ease);
}

.whatsapp-float:hover {
	transform: scale(1.1);
	color: var(--color-white);
}

.whatsapp-float:focus-visible {
	outline: 2px solid var(--color-dark);
	outline-offset: 3px;
}

.whatsapp-float .icon {
	width: 30px;
	height: 30px;
}

/* "Tu inmueble ideal" section */
.ideal-section {
	padding: 88px 0;
	background: var(--color-white);
}

.ideal-title {
	margin: 0 0 32px;
	text-align: center;
	font-size: clamp(1.9rem, 4vw, 2.75rem);
	color: var(--color-dark);
}

.ideal-tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-bottom: 40px;
}

.ideal-tab {
	padding: 12px 28px;
	border: 1px solid var(--color-dark);
	background: transparent;
	color: var(--color-dark);
	font: inherit;
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.3s var(--transition-ease), color 0.3s var(--transition-ease);
}

.ideal-tab[aria-pressed="true"] {
	background: var(--color-dark);
	color: var(--color-white);
}

.ideal-tab:focus-visible {
	outline: 2px solid var(--color-orange);
	outline-offset: 3px;
}

.ideal-panel[hidden] {
	display: none;
}

html:not(.js) .ideal-tabs {
	display: none;
}

html:not(.js) .ideal-panel[hidden] {
	display: block;
}

.ideal-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.ideal-card {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--color-dark);
}

.ideal-card--wide {
	aspect-ratio: 21 / 9;
}

.ideal-card-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.7s var(--transition-ease);
}

.ideal-card-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: flex-start;
	padding: 24px;
	background: linear-gradient(to top, var(--overlay-darker), rgba(2, 64, 46, 0) 70%);
	opacity: 0;
	transition: opacity 0.4s var(--transition-ease);
}

.ideal-card:hover .ideal-card-image,
.ideal-card:focus-within .ideal-card-image {
	transform: scale(1.05);
}

.ideal-card:hover .ideal-card-overlay,
.ideal-card:focus-within .ideal-card-overlay {
	opacity: 1;
}

.ideal-card-name {
	margin: 0 0 16px;
	font-size: 1.5rem;
	color: var(--color-white);
	transform: translateY(12px);
	transition: transform 0.4s var(--transition-ease);
}

.ideal-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	transform: translateY(12px);
	transition: transform 0.4s var(--transition-ease);
}

.ideal-card:hover .ideal-card-name,
.ideal-card:hover .ideal-card-actions,
.ideal-card:focus-within .ideal-card-name,
.ideal-card:focus-within .ideal-card-actions {
	transform: translateY(0);
}

.btn-sm {
	padding: 10px 18px;
	font-size: 0.8rem;
}

@media (min-width: 700px) {
	.ideal-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.ideal-card--wide {
		grid-column: span 2;
	}
}

/* Touch screens have no hover: keep the overlay visible */
@media (hover: none) {
	.ideal-card-overlay {
		opacity: 1;
	}

	.ideal-card-name,
	.ideal-card-actions {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ideal-card-image,
	.ideal-card-overlay,
	.ideal-card-name,
	.ideal-card-actions,
	.whatsapp-float,
	.listing-card-thumb img,
	.listing-card-overlay {
		transition: none;
	}
}

/* Responsive */
@media (max-width: 960px) {
	.property-body {
		grid-template-columns: 1fr;
	}

	.property-sidebar {
		position: static;
	}
}

/* Scroll reveal and page fade (Phase 12). Hidden state applies only once JS has run. */
html.js .animate-on-scroll {
	opacity: 0;
	transform: translateY(30px);
	transition: opacity 0.8s var(--transition-ease), transform 0.8s var(--transition-ease);
}

html.js .animate-on-scroll.in-view {
	opacity: 1;
	transform: translateY(0);
}

.stagger-children > .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.stagger-children > .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.stagger-children > .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.stagger-children > .animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.stagger-children > .animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

@keyframes chr-page-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

html.js .site-main {
	animation: chr-page-fade 0.6s var(--transition-ease) both;
}

@media (prefers-reduced-motion: reduce) {
	html.js .animate-on-scroll,
	html.js .animate-on-scroll.in-view {
		opacity: 1;
		transform: none;
		transition: none;
	}

	html.js .site-main {
		animation: none;
	}
}