/* =========================================================
   HOUSOMLY — SHARED PREMIUM DESIGN SYSTEM
   Palette: forest green, warm ivory, soft sage, subtle gold
   Typography: Manrope, mostly regular / medium weights
   This stylesheet is presentation-only. Keep page logic in JS.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --house-forest: #173f35;
  --house-forest-deep: #102f28;
  --house-forest-soft: #e8efe9;
  --house-cream: #f7f5ef;
  --house-paper: #fffefa;
  --house-sage: #dce8de;
  --house-gold: #c6a15b;
  --house-gold-soft: #f3ead5;
  --house-ink: #24332d;
  --house-muted: #6d7972;
  --house-line: #e7e6dc;
  --house-danger: #a94a42;
  --house-radius-sm: 0.65rem;
  --house-radius-md: 1rem;
  --house-radius-lg: 1.35rem;
  --house-radius-xl: 1.75rem;
  --house-shadow-sm: 0 4px 16px rgba(23, 43, 37, 0.05);
  --house-shadow-md: 0 12px 32px rgba(23, 43, 37, 0.08);
  --house-shadow-lg: 0 22px 60px rgba(23, 43, 37, 0.12);
  --house-transition: 180ms ease;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--house-cream);
  color: var(--house-ink);
  font-family: "Manrope", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

img {
  height: auto;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

::selection {
  color: var(--house-forest-deep);
  background: var(--house-sage);
}

:focus-visible {
  outline: 2px solid var(--house-gold);
  outline-offset: 3px;
}

/* ---------- Typography: understated, not oversized ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--house-ink);
  font-family: "Manrope", Inter, system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

h1 { font-size: clamp(1.65rem, 3vw, 2.35rem); }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); }
h3 { font-size: clamp(1.05rem, 1.6vw, 1.25rem); }
h4 { font-size: 1rem; }

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 600;
}

/* ---------- Shared header / navigation ---------- */
header {
  border-color: rgba(23, 63, 53, 0.12);
}

header,
.site-header {
  color: var(--house-ink);
}

header nav a,
.site-nav a {
  color: var(--house-muted);
  font-size: 0.875rem;
  font-weight: 400;
  transition: color var(--house-transition), background var(--house-transition);
}

header nav a:hover,
.site-nav a:hover {
  color: var(--house-forest);
}

#mobileMenu,
#userDropdown {
  background: var(--house-paper);
  border-color: var(--house-line);
  box-shadow: var(--house-shadow-lg);
}

/* ---------- Buttons ---------- */
button,
.button,
.btn {
  transition:
    color var(--house-transition),
    background-color var(--house-transition),
    border-color var(--house-transition),
    box-shadow var(--house-transition),
    transform var(--house-transition);
}

#openPostModal,
button.btn-primary,
.btn-primary,
.button-primary,
a.btn-primary {
  background: var(--house-forest);
  border-color: var(--house-forest);
  color: #fff;
  box-shadow: 0 6px 18px rgba(23, 63, 53, 0.12);
  font-size: 0.875rem;
  font-weight: 500;
}

#openPostModal:hover,
button.btn-primary:hover,
.btn-primary:hover,
.button-primary:hover,
a.btn-primary:hover {
  background: var(--house-forest-deep);
  border-color: var(--house-forest-deep);
}

.btn-secondary,
.button-secondary,
button.btn-secondary {
  color: var(--house-forest);
  background: var(--house-paper);
  border: 1px solid var(--house-line);
  font-weight: 500;
}

.btn-secondary:hover,
.button-secondary:hover,
button.btn-secondary:hover {
  background: var(--house-forest-soft);
  border-color: rgba(23, 63, 53, 0.25);
}

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

/* ---------- Forms and search ---------- */
input,
select,
textarea {
  color: var(--house-ink);
  background-color: var(--house-paper);
  border-color: var(--house-line);
  border-radius: var(--house-radius-sm);
  font-size: 0.875rem;
  font-weight: 400;
}

input::placeholder,
textarea::placeholder {
  color: #929b95;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(23, 63, 53, 0.6);
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 63, 53, 0.08);
}

label {
  color: var(--house-ink);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ---------- Shared cards / panels ---------- */
.house-tile,
.property-card,
.listing-card,
.blog-card,
.panel-card,
.surface-card {
  background: var(--house-paper);
  border: 1px solid var(--house-line);
  border-radius: var(--house-radius-lg);
  box-shadow: var(--house-shadow-sm);
}

.house-tile {
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.house-tile:hover,
.property-card:hover,
.listing-card:hover,
.blog-card:hover {
  border-color: rgba(198, 161, 91, 0.65);
  box-shadow: var(--house-shadow-md);
}

.house-tile:hover {
  transform: translateY(-3px);
}

.house-section {
  padding-block: clamp(3rem, 6vw, 5.25rem);
}

.house-eyebrow {
  color: #947438;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  line-height: 1.5;
  text-transform: uppercase;
}

.house-heading {
  color: var(--house-ink);
  font-size: clamp(1.55rem, 2.8vw, 2.2rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.house-copy {
  color: var(--house-muted);
  line-height: 1.75;
}

.house-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: var(--house-gold-soft);
  color: var(--house-forest);
  font-size: 1.1rem;
}

.house-city {
  display: block;
  padding: 0.9rem 1rem;
  border: 1px solid var(--house-line);
  border-radius: var(--house-radius-md);
  background: var(--house-paper);
  color: var(--house-ink);
  transition: transform var(--house-transition), border-color var(--house-transition), background var(--house-transition);
}

.house-city:hover {
  transform: translateY(-2px);
  border-color: var(--house-gold);
  background: #fffdf7;
}

.house-tile-art {
  position: relative;
  display: flex;
  min-height: 165px;
  align-items: flex-end;
  padding: 1.25rem;
  background-position: center;
  background-size: cover;
}

.house-tile-art::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 8%, rgba(16, 47, 40, 0.76));
  content: "";
}

.house-tile-art > * {
  position: relative;
  z-index: 1;
}

.house-cta {
  position: relative;
  overflow: hidden;
  border-radius: var(--house-radius-xl);
  background: var(--house-forest);
  color: #fff;
}

/* Keep the property-owner CTA heading readable on its dark background. */
.house-cta h2 {
  color: var(--house-paper);
}

/* Preserve the intended cream-and-forest homepage hero palette. */
.house-hero {
  background-color: var(--house-cream);
}

.house-hero h1 {
  color: var(--house-forest);
}

.house-cta::after {
  position: absolute;
  top: -9rem;
  right: -6rem;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(198, 161, 91, 0.24);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(198, 161, 91, 0.04), 0 0 0 68px rgba(198, 161, 91, 0.025);
  content: "";
  pointer-events: none;
}

.house-cta-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  background: #e2c27c;
  color: var(--house-forest-deep);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.house-cta-link:hover {
  background: #f0d99f;
}

/* ---------- Listing grids and generated cards ---------- */
#recentListings,
#featuredListings,
#publicBlogGrid {
  align-items: stretch;
}

#recentListings > *,
#featuredListings > *,
#publicBlogGrid > * {
  min-width: 0;
  border-radius: var(--house-radius-lg);
}

#recentListings img,
#featuredListings img,
#publicBlogGrid img {
  border-radius: inherit;
}

#recentListings a,
#featuredListings a,
#publicBlogGrid a {
  transition: color var(--house-transition), background var(--house-transition);
}

/* ---------- Filters, chips, badges and pagination ---------- */
.filter-chip,
.badge,
.tag {
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 400;
}

.filter-chip,
.tag {
  border: 1px solid var(--house-line);
  background: var(--house-paper);
  color: var(--house-muted);
}

.filter-chip:hover,
.tag:hover {
  border-color: var(--house-gold);
  color: var(--house-forest);
}

.pagination a,
.pagination button {
  border-radius: var(--house-radius-sm);
}

.pagination .active,
.pagination [aria-current="page"] {
  background: var(--house-forest);
  border-color: var(--house-forest);
  color: #fff;
}

/* ---------- Modals and cookie banner ---------- */
#loginModal,
#postModal {
  color: var(--house-ink);
}

#loginModal > div:last-child,
#postModal > div {
  border-radius: var(--house-radius-xl);
}

#cookie-banner > div {
  border-color: var(--house-line);
  border-radius: var(--house-radius-lg);
  box-shadow: var(--house-shadow-lg);
  background: var(--house-paper);
}

#cookie-accept {
  background: var(--house-forest);
  color: #fff;
}

#cookie-accept:hover {
  background: var(--house-forest-deep);
}

#cookie-reject {
  border-color: var(--house-line);
  color: var(--house-ink);
  background: var(--house-paper);
}

/* ---------- Utility color harmonization ---------- */
/* These target common legacy Tailwind classes without changing layout. */
.text-primary,
.text-blue-600,
.text-blue-700,
.text-indigo-600 {
  color: var(--house-forest);
}

.bg-primary,
.bg-blue-600,
.bg-blue-700,
.bg-indigo-600 {
  background-color: var(--house-forest);
}

.border-primary,
.border-blue-600,
.border-blue-700,
.border-indigo-600 {
  border-color: var(--house-forest);
}

.hover\:text-primary:hover,
.hover\:text-blue-700:hover,
.hover\:text-indigo-600:hover {
  color: var(--house-forest-deep);
}

.hover\:bg-primary:hover,
.hover\:bg-blue-700:hover,
.hover\:bg-indigo-700:hover {
  background-color: var(--house-forest-deep);
}

/* ---------- Tables ---------- */
table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  color: var(--house-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

td,
th {
  border-color: var(--house-line);
}

/* ---------- Responsive behavior ---------- */
@media (max-width: 767px) {
  body {
    font-size: 14px;
  }

  .house-section {
    padding-block: 3rem;
  }

  .house-tile-art {
    min-height: 140px;
  }

  .house-cta {
    border-radius: var(--house-radius-lg);
  }

  #recentListings > *,
  #featuredListings > *,
  #publicBlogGrid > * {
    border-radius: var(--house-radius-md);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
