/*
Theme Name: MLS Listings GTA
Theme URI: https://themlslistings.ca
Author: Team Sapphire — Sapphire Real Estate Inc., Brokerage
Author URI: https://searchbrick.ca
Description: A GTA deal-finder theme for themlslistings.ca. City hubs, price-band archives, curated deal cards and a Zolo-style editorial blog. Built to run standalone, and compatible with Elementor Pro Theme Builder and ACF.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mlsgta
Tags: real-estate, custom-post-type, elementor, blog, grid-layout, custom-colors
*/

/* ==========================================================================
   Design tokens
   Palette derives from the khaki-gold city rail in the brand reference.
   Section fills stay a cool neutral so the gold reads as brand, not wallpaper.
   ========================================================================== */

:root {
  --gold:        #8C7A4F;
  --gold-deep:   #5F5232;
  --gold-tint:   #EFEADC;
  --ink:         #16181C;
  --slate:       #5C6673;
  --line:        #E3E5E9;
  --paper:       #FFFFFF;
  --soft:        #F4F5F6;
  --signal:      #1D5FD1;  /* just listed */
  --value:       #A8761B;  /* below median */

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body:    "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --wrap: 1240px;
  --gap: 24px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(22,24,28,.10);
  --shadow-lift: 0 10px 28px rgba(22,24,28,.16);
  --ease: cubic-bezier(.2,.7,.3,1);
}

/* ==========================================================================
   Reset + base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--gold-deep); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(34px, 5vw, 54px); }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: 20px; letter-spacing: -0.01em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section--soft { background: var(--soft); }

.eyebrow {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 10px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.section-head h2 { margin: 0; }
.section-head .view-all {
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-deep);
  white-space: nowrap;
}
.section-head .view-all::after { content: " →"; }

.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  padding: 13px 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.btn--gold { background: var(--gold); color: #fff; }
.btn--gold:hover { background: var(--gold-deep); color: #fff; transform: translateY(-1px); }
.btn--ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-deep); }
.btn--block { display: block; width: 100%; text-align: center; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 28px;
  min-height: 72px;
}
.site-brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}
.site-brand span { color: var(--gold); }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.site-nav a { font-size: 15px; font-weight: 500; }
.site-nav .current-menu-item > a { color: var(--gold-deep); }

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 12px;
  font-family: var(--display); font-weight: 600; cursor: pointer;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  background: linear-gradient(180deg, var(--gold-tint) 0%, #fff 100%);
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
}
.hero h1 { max-width: 16ch; }
.hero p.lede {
  font-size: 19px; color: var(--slate);
  max-width: 56ch; margin: 0 0 28px;
}
.hero-search {
  display: flex; gap: 10px; flex-wrap: wrap;
  max-width: 620px;
}
.hero-search input[type="search"] {
  flex: 1 1 280px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--body); font-size: 16px;
  background: #fff;
}
.hero-search input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.quick-chips a {
  font-size: 14px; font-weight: 500;
  padding: 7px 14px;
  border: 1px solid var(--gold);
  color: var(--gold-deep);
  border-radius: 100px;
  background: #fff;
}
.quick-chips a:hover { background: var(--gold); color: #fff; }

/* ==========================================================================
   Featured communities
   ========================================================================== */

.community-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.community-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  display: block;
}
.community-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.community-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.community-card .placeholder {
  width: 100%; aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
}
.community-pill {
  position: absolute; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  width: 85%;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  border-radius: 6px;
  padding: 10px 20px;
  color: #fff; text-align: center;
}
.community-pill .name {
  font-family: var(--display);
  font-size: 20px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.community-pill .count {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,.75);
  margin-top: 2px;
}

/* Vertical rail — mobile default and interior-page sidebar */
.city-rail { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); overflow: hidden; }
.city-rail li { border-bottom: 1px solid rgba(255,255,255,.35); }
.city-rail li:last-child { border-bottom: 0; }
.city-rail a {
  display: block;
  background: var(--gold);
  color: #fff;
  font-family: var(--display);
  font-size: 18px;
  padding: 14px 20px;
  transition: background .2s var(--ease);
}
.city-rail a:hover { background: var(--gold-deep); color: #fff; }

/* ==========================================================================
   Price-band ladder  — the signature element.
   Rung width encodes band order, so the row reads as a climb, not a menu.
   ========================================================================== */

.band-ladder { list-style: none; margin: 0; padding: 0; }
.band-ladder li { border-bottom: 1px solid var(--line); }
.band-ladder li:first-child { border-top: 1px solid var(--line); }
.band-ladder a {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 16px 0;
  overflow: hidden;
}
.band-ladder a::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--rung, 10%);
  background: var(--gold-tint);
  transition: width .3s var(--ease), background .3s var(--ease);
  z-index: 0;
}
.band-ladder a:hover::before { background: var(--gold); }
.band-ladder a:hover .band-label { color: #fff; }
.band-ladder .band-label {
  position: relative; z-index: 1;
  font-family: var(--display);
  font-size: 19px; font-weight: 600;
  padding-left: 20px;
  font-variant-numeric: tabular-nums;
  transition: color .3s var(--ease);
}
.band-ladder .band-count {
  position: relative; z-index: 1;
  font-size: 14px; color: var(--slate);
  font-variant-numeric: tabular-nums;
}

/* Type row */
.type-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.type-row a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  background: #fff;
  font-family: var(--display);
  font-weight: 600; font-size: 18px;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.type-row a:hover { border-color: var(--gold); transform: translateY(-2px); }
.type-row .type-count { display: block; font-family: var(--body); font-size: 14px; font-weight: 400; color: var(--slate); margin-top: 4px; }

/* ==========================================================================
   Listing cards
   ========================================================================== */

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

.listing-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  display: flex; flex-direction: column;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.listing-card .thumb { position: relative; }
.listing-card .thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.listing-card .thumb .placeholder {
  width: 100%; aspect-ratio: 4/3;
  background: var(--soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--slate); font-size: 14px;
}
.listing-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing-card .price {
  font-family: var(--display);
  font-size: 25px; font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.listing-card .specs {
  font-size: 14px; color: var(--slate);
  display: flex; gap: 10px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.listing-card .specs span + span::before { content: "· "; color: var(--line); }
.listing-card .address { font-size: 16px; font-weight: 600; }
.listing-card .locale { font-size: 14px; color: var(--slate); }
.listing-card .note {
  font-size: 14px; color: var(--gold-deep);
  border-left: 2px solid var(--gold);
  padding-left: 10px; margin-top: 6px;
}

.badge-strip {
  position: absolute; top: 12px; left: 12px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.badge {
  font-family: var(--display);
  font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 4px;
  color: #fff;
}
.badge--new   { background: var(--signal); }
.badge--value { background: var(--value); }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--slate);
  background: var(--soft);
}
.empty-state h3 { margin-bottom: 6px; color: var(--ink); }

/* ==========================================================================
   Single listing
   ========================================================================== */

.listing-single { padding: 40px 0 72px; }
.listing-hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; align-items: start; }
.listing-hero img { border-radius: var(--radius); width: 100%; }
.listing-facts { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: sticky; top: 96px; }
.listing-facts .price {
  font-family: var(--display); font-size: 38px; font-weight: 700;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-bottom: 4px;
}
.listing-facts dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; margin: 20px 0; font-size: 15px; }
.listing-facts dt { color: var(--slate); }
.listing-facts dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.listing-facts .btn { margin-bottom: 10px; }
.disclosure { font-size: 12px; color: var(--slate); line-height: 1.5; margin-top: 18px; }

/* ==========================================================================
   Blog — editorial layout. Title, excerpt, then image.
   ========================================================================== */

.blog-nav { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 72px; z-index: 40; }
.blog-nav ul {
  display: flex; gap: 22px; list-style: none; margin: 0; padding: 14px 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.blog-nav ul::-webkit-scrollbar { display: none; }
.blog-nav a { font-size: 15px; font-weight: 500; white-space: nowrap; }
.blog-nav .is-current a { color: var(--gold-deep); font-weight: 600; }

.blog-masthead { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.blog-masthead p.lede { font-size: 19px; color: var(--slate); max-width: 62ch; margin: 0 0 24px; }

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

.post-card h3 { margin: 0 0 8px; }
.post-card h3 a:hover { color: var(--gold-deep); }
.post-card .excerpt { font-size: 15px; color: var(--slate); margin: 0 0 14px; }
.post-card img { border-radius: 6px; aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.post-card.is-tall img { aspect-ratio: 3/2; }

.blog-block { padding: 44px 0; border-bottom: 1px solid var(--line); }
.blog-block:last-of-type { border-bottom: 0; }

.find-homes { background: var(--soft); padding: 44px 0; margin: 0; }
.find-homes ul { columns: 3; list-style: none; margin: 0; padding: 0; font-size: 15px; }
.find-homes li { margin-bottom: 8px; break-inside: avoid; }

/* Single post */
.entry { max-width: 720px; margin: 0 auto; padding: 48px 0 72px; }
.entry-meta { font-size: 14px; color: var(--slate); margin-bottom: 24px; }
.entry-content { font-size: 18px; line-height: 1.75; }
.entry-content p { margin: 0 0 1.3em; }
.entry-content h2 { margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.6em; font-size: 22px; }
.entry-content img { border-radius: 6px; margin: 1.6em 0; }
.entry-content blockquote {
  border-left: 3px solid var(--gold);
  margin: 1.6em 0; padding: 4px 0 4px 20px;
  color: var(--slate); font-style: italic;
}
.entry-content a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; }

.inline-cta {
  background: var(--gold-tint);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 2em 0;
}
.inline-cta h3 { margin: 0 0 6px; }
.inline-cta p { margin: 0 0 14px; font-size: 16px; color: var(--slate); }

/* ==========================================================================
   Lead form + footer
   ========================================================================== */

.lead-band { background: var(--gold); color: #fff; padding: 56px 0; }
.lead-band h2 { color: #fff; }
.lead-band p { color: rgba(255,255,255,.85); max-width: 52ch; }
.lead-band .btn--ghost { background: #fff; border-color: #fff; }

.site-footer { background: var(--ink); color: rgba(255,255,255,.72); padding: 56px 0 32px; font-size: 15px; }
.site-footer a { color: rgba(255,255,255,.72); }
.site-footer a:hover { color: #fff; }
.site-footer h4 { color: #fff; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin-bottom: 7px; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.14);
  margin-top: 40px; padding-top: 24px;
  font-size: 12.5px; line-height: 1.6; color: rgba(255,255,255,.5);
}

/* ==========================================================================
   Pagination, accessibility, responsive
   ========================================================================== */

.pagination { margin-top: 40px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers {
  padding: 9px 15px; border: 1px solid var(--line); border-radius: 6px;
  font-weight: 600; font-size: 15px;
}
.pagination .current { background: var(--gold); color: #fff; border-color: var(--gold); }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--ink); color: #fff; padding: 12px 18px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; color: #fff; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1024px) {
  .listing-grid { grid-template-columns: repeat(3, 1fr); }
  .post-grid--4 { grid-template-columns: repeat(3, 1fr); }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .listing-hero { grid-template-columns: 1fr; }
  .listing-facts { position: static; }
}

@media (max-width: 860px) {
  .community-grid { grid-template-columns: repeat(2, 1fr); }
  .listing-grid, .listing-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .post-grid, .post-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .type-row { grid-template-columns: repeat(2, 1fr); }
  .find-homes ul { columns: 2; }
  .site-nav { display: none; }
  .site-nav.is-open {
    display: block; position: absolute; top: 72px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 16px 24px;
  }
  .site-nav.is-open ul { flex-direction: column; gap: 14px; }
  .nav-toggle { display: block; }
  .blog-nav { top: 0; }
}

@media (max-width: 560px) {
  .section { padding: 44px 0; }
  /* Communities collapse to the vertical gold rail from the brand reference */
  .community-grid { grid-template-columns: 1fr; gap: 0; border-radius: var(--radius); overflow: hidden; }
  .community-grid .community-card { border-radius: 0; box-shadow: none; }
  .community-grid .community-card img,
  .community-grid .community-card .placeholder { aspect-ratio: 5/2; }
  .listing-grid, .listing-grid--3 { grid-template-columns: 1fr; }
  .post-grid, .post-grid--4 { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr; }
  .find-homes ul { columns: 1; }
  .footer-cols { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  position: static !important;
  width: auto; height: auto; clip: auto;
  padding: 12px 18px; background: var(--ink); color: #fff;
}

/* Badge strip inside the single-listing fact panel, out of the photo overlay */
.badge-strip--static { position: static; margin: 0 0 16px; }

.widget { margin-bottom: 32px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { margin-bottom: 8px; }

.wp-caption { max-width: 100%; }
.alignwide { width: 100%; }
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { margin-left: auto; margin-right: auto; }
