/* ============================================
   BUYING WHITE ROCK — Main Stylesheet
   Coastal editorial design system
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Editorial coastal palette — warm, light, distinct */
  --navy: #1e3a3a;
  --navy-light: #2d5252;
  --ocean: #3a7d6e;
  --ocean-light: #5ea393;
  --ocean-pale: #e8f5f0;
  --sky: #b8d8cf;
  --sand: #faf7f2;
  --sand-dark: #f0ebe3;
  --driftwood: #9b8b76;
  --driftwood-light: #c4b8a8;
  --white: #ffffff;
  --off-white: #fcfbf9;
  --text: #1a1a1a;
  --text-light: #5a5a5a;
  --text-muted: #8a8a8a;
  --border: #e8e5e0;
  --border-light: #f3f1ed;
  --success: #3a7d5e;
  --error: #c45042;
  --accent: #c27d4e;
  --accent-light: #e8c9a8;

  /* Typography — editorial, different from rosemanno */
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--ocean);
  text-decoration: none;
  transition: color var(--transition);
}

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

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

/* Headings inside dark containers should be white */
.hero h1, .hero h2,
.article-hero h1,
.neighbourhood-hero h1,
.cta-banner h2,
[style*="background: var(--navy)"] h1,
[style*="background: var(--navy)"] h2,
[style*="background:#1e3a3a"] h1,
[style*="background:#1e3a3a"] h2 {
  color: var(--white);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p { margin-bottom: var(--space-md); }

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: min(var(--max-width), 90%);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

.section-sm {
  padding: var(--space-2xl) 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

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

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.nav.scrolled {
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: min(var(--max-width), 90%);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 52px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  text-decoration: none;
}

.nav-logo span {
  color: var(--ocean);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--ocean);
  transition: width var(--transition);
}

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

.nav-links a:hover {
  color: var(--ocean);
}

.nav-cta {
  background: var(--ocean) !important;
  color: var(--white) !important;
  padding: 5px 14px !important;
  border-radius: 6px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  transition: background var(--transition) !important;
}

.nav-cta::after { display: none !important; }

.nav-cta:hover {
  background: var(--navy) !important;
  color: var(--white) !important;
  transform: translateY(-1px);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  transition: var(--transition);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--navy);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.5;
  transition: opacity 1s ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26,39,68,0.4) 0%,
    rgba(26,39,68,0.7) 60%,
    rgba(26,39,68,0.9) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 720px;
  padding: var(--space-xl);
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  color: var(--sky);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
  border: 1px solid rgba(255,255,255,0.15);
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
}

.hero p {
  color: rgba(255,255,255,0.85);
  font-size: 1.15rem;
  max-width: 540px;
  margin: 0 auto var(--space-xl);
  line-height: 1.8;
}

/* Search Bar */
.search-bar {
  display: flex;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 6px;
  box-shadow: var(--shadow-xl);
  max-width: 560px;
  margin: 0 auto;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: var(--font-body);
  background: transparent;
  color: var(--text);
  min-width: 0;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar button {
  background: var(--ocean);
  color: var(--white);
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.search-bar button:hover {
  background: var(--navy);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-top: var(--space-2xl);
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header .eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ocean);
  margin-bottom: var(--space-sm);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  color: var(--text-light);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.card-img {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-img img {
  transform: scale(1.05);
}

.card-body {
  padding: var(--space-lg);
}

.card-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ocean);
  margin-bottom: var(--space-sm);
}

.card-body h3 {
  font-size: 1.15rem;
  margin-bottom: var(--space-sm);
}

.card-body p {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Listing Cards --- */
.listing-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

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

.listing-card-img {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--sand);
}

.listing-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.listing-card:hover .listing-card-img img {
  transform: scale(1.03);
}

.listing-badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  background: var(--navy);
  color: var(--white);
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.listing-badge.new {
  background: var(--success);
}

.listing-card-body {
  padding: var(--space-lg);
}

.listing-price {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-xs);
}

.listing-address {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: var(--space-md);
  line-height: 1.4;
}

.listing-specs {
  display: flex;
  gap: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.listing-spec {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.82rem;
  color: var(--text-light);
}

.listing-spec svg {
  width: 16px;
  height: 16px;
  color: var(--driftwood);
}

.listing-spec strong {
  color: var(--text);
  font-weight: 600;
}

/* --- Neighbourhood Cards --- */
.neighbourhood-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3/4;
  cursor: pointer;
}

.neighbourhood-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.neighbourhood-card:hover img {
  transform: scale(1.05);
}

.neighbourhood-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,39,68,0.85) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-xl);
}

.neighbourhood-card h3 {
  color: var(--white);
  font-size: 1.35rem;
  margin-bottom: var(--space-xs);
}

.neighbourhood-card p {
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  margin: 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
}

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

.btn-primary:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--sand);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--sand-dark);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--ocean);
  border: 2px solid var(--ocean);
}

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

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

.btn-white:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

/* --- Featured / CTA Banner --- */
.cta-banner {
  background: var(--sand);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-2xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(58,125,110,0.06);
}

.cta-banner h2 {
  color: var(--navy);
  margin-bottom: var(--space-md);
  position: relative;
}

.cta-banner p {
  color: var(--text-light);
  max-width: 480px;
  margin: 0 auto var(--space-xl);
  position: relative;
}

/* --- Blog / Article Styles --- */
.article-hero {
  position: relative;
  height: 50vh;
  min-height: 400px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.article-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,39,68,0.9) 0%, transparent 60%);
}

.article-hero-content {
  position: relative;
  z-index: 2;
  padding: var(--space-2xl);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.article-hero h1 {
  color: var(--white);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  max-width: 700px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

.article-content {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg);
}

.article-content h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  font-size: 1.6rem;
}

.article-content h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  font-size: 1.3rem;
}

.article-content p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
}

.article-content ul, .article-content ol {
  margin: var(--space-md) 0 var(--space-lg);
  padding-left: var(--space-xl);
}

.article-content li {
  margin-bottom: var(--space-sm);
  line-height: 1.7;
  font-size: 1.05rem;
}

.article-content blockquote {
  border-left: 3px solid var(--ocean);
  padding: var(--space-md) var(--space-xl);
  margin: var(--space-xl) 0;
  background: var(--ocean-pale);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--navy);
}

.article-content .info-box {
  background: var(--sand);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
}

.article-content .info-box h4 {
  margin-bottom: var(--space-sm);
  color: var(--navy);
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--ocean-pale);
  color: var(--ocean);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* --- Filters Bar (Listings Page) --- */
.filters-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
  min-width: 140px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
}

.filter-group select,
.filter-group input {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--ocean);
}

.results-count {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: var(--space-lg);
}

.results-count strong {
  color: var(--text);
}

/* Listings Grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-2xl);
}

.pagination button {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.pagination button:hover {
  border-color: var(--ocean);
  color: var(--ocean);
}

.pagination button.active {
  background: var(--ocean);
  color: var(--white);
  border-color: var(--ocean);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Market Stats --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Chart container */
.chart-container {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.chart-container h3 {
  margin-bottom: var(--space-lg);
}

/* Simple bar chart */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.bar-label {
  width: 120px;
  font-size: 0.82rem;
  color: var(--text-light);
  flex-shrink: 0;
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 32px;
  background: var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--ocean), var(--ocean-light));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  padding-left: var(--space-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--white);
  transition: width 1s ease;
  min-width: fit-content;
  padding-right: var(--space-md);
}

/* --- Mortgage Calculator --- */
.calculator {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.calc-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.calc-field input,
.calc-field select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.calc-field input:focus,
.calc-field select:focus {
  border-color: var(--ocean);
  box-shadow: 0 0 0 3px var(--ocean-pale);
}

.calc-result {
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  color: var(--white);
}

.calc-result-amount {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.calc-result-label {
  font-size: 0.85rem;
  opacity: 0.7;
}

.calc-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.calc-breakdown-item {
  text-align: center;
  padding: var(--space-md);
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
}

.calc-breakdown-value {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

.calc-breakdown-label {
  font-size: 0.72rem;
  opacity: 0.7;
  margin-top: var(--space-xs);
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: var(--space-lg) 0;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-light);
}

.breadcrumbs a:hover {
  color: var(--ocean);
}

.breadcrumbs span {
  color: var(--text-muted);
}

/* --- Footer --- */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.footer-brand {
  max-width: 300px;
}

.footer-brand .nav-logo {
  color: var(--white);
  margin-bottom: var(--space-md);
  font-size: 1.3rem;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
}

.footer h4 {
  color: var(--white);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-lg);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
  transition: color var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
}

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

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

/* --- Neighbourhood Page Specific --- */
.neighbourhood-hero {
  position: relative;
  height: 60vh;
  min-height: 450px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.neighbourhood-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.neighbourhood-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,39,68,0.9) 0%, transparent 50%);
}

.neighbourhood-hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl);
  width: 100%;
}

.neighbourhood-hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: var(--space-md);
}

.neighbourhood-hero p {
  color: rgba(255,255,255,0.8);
  font-size: 1.1rem;
  max-width: 600px;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin: calc(-1 * var(--space-xl)) auto var(--space-2xl);
  max-width: var(--max-width);
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 3;
}

.quick-fact {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.quick-fact-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}

.quick-fact-label {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: var(--space-xs);
}

/* --- Loading States --- */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--white) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius);
}

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

.skeleton-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.skeleton-img {
  aspect-ratio: 16/10;
}

.skeleton-text {
  height: 14px;
  margin: var(--space-sm) var(--space-lg);
}

.skeleton-text.short {
  width: 60%;
}

/* --- Scroll to top --- */
.scroll-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--ocean);
}

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    flex-direction: column;
    padding: var(--space-xl);
    gap: var(--space-lg);
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 99;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: block;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero {
    min-height: 75vh;
  }

  .hero-stats {
    gap: var(--space-lg);
  }

  .hero-stat-value {
    font-size: 1.35rem;
  }

  .search-bar {
    flex-direction: column;
    border-radius: var(--radius-lg);
  }

  .search-bar button {
    border-radius: var(--radius);
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .listings-grid {
    grid-template-columns: 1fr;
  }

  .calc-grid {
    grid-template-columns: 1fr;
  }

  .calc-breakdown {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .article-content {
    padding: var(--space-xl) var(--space-lg);
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .listing-specs {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger > *.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Page Header --- */
.page-header {
  padding: var(--space-2xl) 0;
  text-align: center;
}

.page-header h1 {
  margin-bottom: var(--space-sm);
}

.page-header p {
  color: var(--text-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.page-header-dark {
  background: var(--sand);
  border-bottom: 1px solid var(--border);
  padding: var(--space-3xl) 0;
}

.page-header-dark h1 {
  color: var(--navy);
}

.page-header-dark p {
  color: var(--text-light);
}

/* --- Hero Search (Homepage) --- */
.hero-search {
  display: flex;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 6px;
  box-shadow: var(--shadow-xl);
  max-width: 560px;
  margin: 0 auto;
}

.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: var(--font-body);
  background: transparent;
  color: var(--text);
  min-width: 0;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.hero-search input::placeholder {
  color: var(--text-muted);
}

.hero-search .btn {
  border-radius: var(--radius-lg);
  white-space: nowrap;
}

/* --- Section Subtitle --- */
.section-subtitle,
.eyebrow {
  display: block;
  text-align: center;
}

.section-subtitle {
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto var(--space-2xl);
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ocean);
  margin-bottom: var(--space-sm);
}

/* --- Homepage Grids --- */
.neighbourhood-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

/* --- Homepage Neighbourhood Cards (div variant) --- */
.neighbourhood-card-img {
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.neighbourhood-card-body {
  padding: var(--space-lg);
}

.neighbourhood-card-body h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-xs);
  color: var(--navy);
}

.neighbourhood-card-body p {
  color: var(--text-light);
  font-size: 0.88rem;
  margin: 0;
}

/* --- Homepage Blog Cards (variant) --- */
.card-img {
  aspect-ratio: 16/10;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ocean);
  margin-bottom: var(--space-sm);
  display: block;
}

/* --- Footer Col variant --- */
.footer-col {
  min-width: 0;
}

.footer-col:first-child {
  max-width: 300px;
}

.footer-col .logo,
.footer-col .nav-logo {
  display: inline-flex;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--white);
  text-decoration: none;
  margin-bottom: var(--space-md);
}

.footer-col .logo span,
.footer-col .nav-logo span {
  color: var(--ocean);
}

.footer-col p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
}

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

.footer-col ul li {
  margin-bottom: var(--space-sm);
}

.footer-col ul a {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
  transition: color var(--transition);
}

.footer-col ul a:hover {
  color: var(--white);
}

/* --- Logo alias --- */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  text-decoration: none;
}

.logo span {
  color: var(--ocean);
}

/* --- Mobile toggle alias --- */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  transition: var(--transition);
}

/* --- Content narrow alias --- */
.content-narrow {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* --- CTA banner as standalone section --- */
section.cta-banner {
  background: var(--sand);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
  border-radius: 0;
}

section.cta-banner h2 {
  color: var(--navy);
}

section.cta-banner p {
  color: var(--text-light);
}

/* --- Breadcrumbs container variant --- */
.breadcrumbs .container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.breadcrumbs .separator {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.breadcrumbs .current {
  color: var(--text);
  font-weight: 500;
}

/* --- Responsive additions --- */
@media (max-width: 768px) {
  .neighbourhood-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .mobile-toggle {
    display: block;
  }

  .hero-search {
    flex-direction: column;
    border-radius: var(--radius-lg);
  }

  .hero-search input {
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .hero-search .btn {
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .page-header-dark {
    padding: var(--space-xl) 0;
  }
}

/* --- Enhanced Animations --- */
.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* --- Scroll Down Indicator --- */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: bounce-down 2s infinite;
}

.scroll-indicator span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

.scroll-indicator svg {
  color: rgba(255,255,255,0.6);
}

@keyframes bounce-down {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(8px); }
  60% { transform: translateX(-50%) translateY(4px); }
}

/* --- Hero Image Parallax --- */
.hero-bg {
  will-change: transform;
}

.hero-bg img {
  width: 100%;
  height: 120%;
  object-fit: cover;
  position: absolute;
  top: -10%;
  left: 0;
}

/* --- Search Bar Enhancement --- */
.hero-search {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-search.focused {
  transform: scale(1.02);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 2px rgba(168,208,230,0.3);
}

/* --- Image Load Transition --- */
.listing-card-img img,
.card-img img {
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.listing-card-img img.loaded,
.card-img img.loaded {
  opacity: 1;
}

/* Neighbourhood card images show immediately (not dynamically loaded) */
.neighbourhood-card img {
  transition: transform 0.5s ease;
}

/* --- Neighbourhood Card 3D Tilt --- */
.neighbourhood-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.3s ease;
}

/* --- Counter Animation --- */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* --- Card hover lift --- */
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.card .card-img {
  overflow: hidden;
}

.card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card:hover .card-img img.loaded {
  transform: scale(1.05);
}

/* --- Listing card link styling --- */
.listing-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

/* --- Glassmorphism search bar --- */
.hero-search.glass {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.3);
}

/* --- CTA Banner button in hero --- */
.cta-banner .btn {
  position: relative;
  z-index: 1;
}

/* --- Stat counter on dark bg --- */
.hero-stat {
  text-align: center;
}

.hero-stat strong,
.hero-stat .counter-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
}

.hero-stat span {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Responsive: hide scroll indicator on mobile --- */
@media (max-width: 768px) {
  .scroll-indicator {
    display: none;
  }

  .hero-stat strong,
  .hero-stat .counter-value {
    font-size: 1.35rem;
  }
}

/* --- Print --- */
@media print {
  .nav, .footer, .scroll-top, .search-bar, .filters-bar {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
  }
}
