/* ==========================================================================
   Joe Fontanez Real Estate — Base styles, design tokens, layout primitives
   ========================================================================== */

:root {
  /* Palette: sand / soft navy-charcoal / gold, used sparingly */
  --color-white: #ffffff;
  --color-cream: #fdfaf5;
  --color-charcoal: #38424f;
  --color-charcoal-soft: #4a5563;
  --color-gray-900: #2a323c;
  --color-gray-700: #5b6472;
  --color-gray-500: #8b8577;
  --color-gray-300: #e3d7bf;
  --color-gray-100: #f6efe1;
  --color-sand: #f6efe1;
  --color-sand-deep: #ecdfc2;
  --color-gold: #b8925a;
  --color-gold-light: #d8b98a;
  --color-gold-dark: #8f6f3f;
  --color-success: #3f7d5c;
  --color-warning: #b8894a;
  --color-danger: #a94442;

  --font-display: "Playfair Display", "Georgia", serif;
  --font-body: "Inter", "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;

  --container-width: 1240px;
  --gutter: 24px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.16);

  --transition-fast: 160ms ease;
  --transition-base: 280ms ease;

  --header-height: 84px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-charcoal);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--color-charcoal);
}

h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: 88px 0;
}

.section--tight {
  padding: 56px 0;
}

.section--alt {
  background: var(--color-gray-100);
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
  font-weight: 600;
  margin-bottom: 14px;
}

.section-head {
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-head p {
  color: var(--color-gray-700);
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-charcoal);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-gold-dark);
}

.btn-outline {
  background: transparent;
  color: var(--color-charcoal);
  border-color: var(--color-charcoal);
}

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

.btn-outline-light {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.6);
}

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

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

.btn-gold:hover {
  background: var(--color-gold-dark);
}

.btn-whatsapp {
  background: #25d366;
  color: var(--color-white);
}

.btn-whatsapp:hover {
  background: #1ebd59;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

/* ---------------- Header ---------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.0);
  transition: background var(--transition-base), box-shadow var(--transition-base), height var(--transition-base);
}

.site-header.is-scrolled,
.site-header.is-solid {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(12px);
  box-shadow: var(--shadow-sm);
  height: 72px;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-charcoal);
}

.site-header.is-transparent:not(.is-scrolled) .container .brand-name,
.site-header.is-transparent:not(.is-scrolled) .container .brand-tagline {
  color: var(--color-white);
}

.brand-tagline {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-top: 4px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-charcoal);
  position: relative;
  padding: 6px 0;
}

.site-header.is-transparent:not(.is-scrolled) .container .main-nav a,
.site-header.is-transparent:not(.is-scrolled) .container .lang-switch button {
  color: var(--color-white);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--color-gold);
  transition: width var(--transition-fast);
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.lang-switch button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
  padding: 4px 2px;
  font: inherit;
}

.lang-switch button.is-active {
  opacity: 1;
  color: var(--color-gold);
}

.mobile-nav {
  display: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-charcoal);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.site-header.is-transparent:not(.is-scrolled) .container .nav-toggle span {
  background: var(--color-white);
}

/* ---------------- Footer ---------------- */

.site-footer {
  background: var(--color-charcoal);
  color: rgba(255, 255, 255, 0.75);
  padding: 72px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-grid h4 {
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.footer-grid .brand-name {
  color: var(--color-white);
}

.footer-grid p,
.footer-grid a {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-grid li {
  margin-bottom: 10px;
}

.footer-grid a:hover {
  color: var(--color-gold-light);
}

.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.6);
}

.footer-bottom a:hover {
  color: var(--color-gold-light);
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  color: var(--color-white);
  background-image: linear-gradient(180deg, rgba(56, 44, 28, 0.45), rgba(40, 32, 22, 0.72)), url("../assets/images/hero-default.svg");
  background-size: cover;
  background-position: center;
  background-color: #4a3c2c;
}

.hero-content {
  max-width: 720px;
  padding-top: var(--header-height);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  margin-bottom: 22px;
}

.hero-eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--color-gold-light);
}

.hero h1 {
  color: var(--color-white);
  margin-bottom: 20px;
}

.hero p.lead {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.86);
  max-width: 560px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 64px;
  flex-wrap: wrap;
}

.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--color-gold-light);
}

.hero-stat span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.04em;
}

/* ---------------- Cards: Property ---------------- */

.property-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.property-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  display: flex;
  flex-direction: column;
}

.property-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.property-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-gray-100);
  overflow: hidden;
}

.property-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease;
}

.property-card:hover .property-card-media img {
  transform: scale(1.06);
}

.badge {
  display: inline-block;
  padding: 5px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--color-charcoal);
  color: var(--color-white);
}

.badge-status-for_sale { background: var(--color-charcoal); }
.badge-status-pending { background: var(--color-warning); }
.badge-status-sold { background: var(--color-danger); }
.badge-status-for_rent { background: var(--color-success); }
.badge-status-rented { background: var(--color-gray-500); }

.property-card-badges {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 8px;
}

.property-card-featured {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--color-gold);
  color: var(--color-white);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.property-card-body {
  padding: 22px 22px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--color-sand);
}

.property-card-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-charcoal);
  margin-bottom: 6px;
}

.property-card-price small {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--color-gray-500);
  font-weight: 500;
}

.property-card-title {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.property-card-location {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-charcoal);
  margin-bottom: 14px;
}

.property-card-meta {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-gray-700);
  border-top: 1px solid var(--color-gray-300);
  padding-top: 14px;
  margin-top: auto;
  margin-bottom: 18px;
}

/* ---------------- Utility ---------------- */

.text-center { text-align: center; }
.text-gold { color: var(--color-gold); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.is-hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.divider {
  width: 60px;
  height: 2px;
  background: var(--color-gold);
  margin: 0 auto 20px;
}

.page-hero {
  padding: calc(var(--header-height) + 64px) 0 64px;
  background: var(--color-charcoal);
  color: var(--color-white);
  text-align: center;
}

.page-hero h1 { color: var(--color-white); }
.page-hero p { color: rgba(255, 255, 255, 0.75); max-width: 560px; margin: 0 auto; }

.breadcrumbs {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
}

.breadcrumbs a { color: rgba(255, 255, 255, 0.8); }
.breadcrumbs a:hover { color: var(--color-gold-light); }

/* WhatsApp floating button */
.whatsapp-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.whatsapp-float:hover { transform: scale(1.08); }
.whatsapp-float svg { width: 28px; height: 28px; fill: var(--color-white); }

/* Home floating button */
.home-float {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 900;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.home-float:hover { transform: scale(1.08); background: var(--color-gold-dark); }
.home-float svg { width: 26px; height: 26px; stroke: var(--color-white); }

/* Property gallery lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(20, 16, 10, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.lightbox-overlay.is-open { display: flex; }

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: var(--color-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition-fast);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255, 255, 255, 0.24); }

.lightbox-close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-close svg,
.lightbox-prev svg,
.lightbox-next svg { width: 22px; height: 22px; stroke: var(--color-white); fill: none; }

.lightbox-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

/* Loading / empty states */
.state-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-gray-500);
}

.skeleton {
  background: linear-gradient(90deg, var(--color-gray-100) 25%, #e8e5dc 37%, var(--color-gray-100) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
