/* ============================================
   Aqeel Ali | Royal LePage Arteam Realty
   Shared stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Jost:wght@300;400;500;600&display=swap');

:root{
  --charcoal:#17181a;
  --charcoal-soft:#242527;
  --cream:#f7f4ee;
  --cream-dark:#efe9df;
  --gold:#a9863f;
  --gold-light:#c9a765;
  --maroon:#6e1423;
  --gray:#6b6b6b;
  --white:#ffffff;
  --border:#e3ddd0;
  --shadow: 0 20px 50px rgba(23,24,26,0.10);
  --max: 1240px;
}

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

html{ scroll-behavior:smooth; }

section[id]{ scroll-margin-top:88px; }

body{
  margin:0;
  font-family:'Jost', sans-serif;
  color:var(--charcoal);
  background:var(--cream);
  font-weight:400;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3,h4{
  font-family:'Playfair Display', serif;
  font-weight:600;
  line-height:1.15;
  margin:0 0 .5em;
  color:var(--charcoal);
}

p{ margin:0 0 1em; color:var(--gray); }

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

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

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

.eyebrow{
  display:block;
  font-family:'Jost', sans-serif;
  letter-spacing:.28em;
  text-transform:uppercase;
  font-size:.72rem;
  color:var(--gold);
  font-weight:600;
  margin-bottom:14px;
}

.section{ padding:96px 0; }
.section--tight{ padding:64px 0; }
.section--dark{ background:var(--charcoal); color:var(--cream); }
.section--dark p{ color:#b9b6ae; }
.section--dark h2, .section--dark h3{ color:var(--cream); }
.section--cream-dark{ background:var(--cream-dark); }

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

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:15px 32px;
  font-family:'Jost', sans-serif;
  font-size:.82rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  font-weight:600;
  border-radius:2px;
  border:1px solid transparent;
  cursor:pointer;
  transition:all .25s ease;
  white-space:nowrap;
}
.btn-gold{ background:var(--gold); color:var(--white); }
.btn-gold:hover{ background:var(--gold-light); }
.btn-outline{ background:transparent; border-color:currentColor; color:var(--cream); }
.btn-outline:hover{ background:rgba(255,255,255,.1); }
.btn-outline-dark{ background:transparent; border-color:var(--charcoal); color:var(--charcoal); }
.btn-outline-dark:hover{ background:var(--charcoal); color:var(--cream); }
.btn-block{ width:100%; justify-content:center; }

/* ============ HEADER ============ */
.site-header{
  position:absolute;
  top:0; left:0; right:0;
  z-index:100;
  padding:26px 0;
}
.site-header.is-solid{
  position:fixed;
  background:rgba(23,24,26,0.96);
  padding:16px 0;
  box-shadow:0 4px 24px rgba(0,0,0,.18);
  transition:padding .25s ease;
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}
/* The hero is light, so the header defaults to dark type and
   flips to cream once it goes solid on scroll. */
.brand{
  color:var(--charcoal);
  line-height:1.1;
}
.brand .brand-name{
  font-family:'Playfair Display', serif;
  font-size:1.5rem;
  letter-spacing:.03em;
  font-weight:600;
  display:block;
}
.brand .brand-sub{
  display:block;
  font-size:.66rem;
  letter-spacing:.22em;
  text-transform:uppercase;
  color:var(--gold);
  margin-top:4px;
}

.main-nav{
  display:flex;
  align-items:center;
  gap:36px;
}
.main-nav a{
  color:var(--charcoal);
  font-size:.82rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-weight:500;
  position:relative;
  padding:6px 0;
}
.main-nav a::after{
  content:"";
  position:absolute;
  left:0; bottom:0;
  width:0; height:1px;
  background:var(--gold);
  transition:width .25s ease;
}
.main-nav a:hover::after, .main-nav a.active::after{ width:100%; }
.main-nav a.active{ color:var(--gold); }

.header-cta{ display:flex; align-items:center; gap:22px; }
.header-phone{
  color:var(--charcoal);
  font-size:.85rem;
  letter-spacing:.05em;
  font-weight:500;
}
.header-phone span{ color:var(--gold); }

.nav-toggle{
  display:none;
  flex-direction:column;
  gap:5px;
  background:none;
  border:none;
  cursor:pointer;
  padding:6px;
}
.nav-toggle span{
  width:26px; height:2px; background:var(--charcoal);
}

/* ---- Once the header goes solid (dark), flip type back to cream ---- */
.site-header.is-solid .brand,
.site-header.is-solid .main-nav a,
.site-header.is-solid .header-phone{ color:var(--cream); }

.site-header.is-solid .brand .brand-sub,
.site-header.is-solid .main-nav a.active{ color:var(--gold-light); }

.site-header.is-solid .main-nav a::after{ background:var(--gold-light); }
.site-header.is-solid .nav-toggle span{ background:var(--cream); }

/* ============ HERO ============ */
/* ============ HERO — split layout ============
   Text left, photograph right. The portrait is a full-length
   studio shot on a light background; cropping it into a wide
   full-bleed band severed the composition and a dark scrim over
   a white wall turned it muddy. A split keeps the photo whole
   and gives the headline clean space. */
.hero{
  position:relative;
  min-height:100vh;
  display:grid;
  grid-template-columns:1fr 1fr;
  background:var(--cream);
  color:var(--charcoal);
}

.hero-text{
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:120px clamp(32px,4vw,72px) 120px clamp(32px,6vw,96px);
}
.hero-text-inner{ max-width:520px; }

.hero .eyebrow{ color:var(--gold); }
.hero h1{
  color:var(--charcoal);
  font-size:clamp(2.1rem, 3.4vw, 3.4rem);
  margin-bottom:22px;
}
.hero p.lead{
  color:var(--gray);
  font-size:1.05rem;
  margin-bottom:36px;
}
.hero-actions{ display:flex; gap:16px; flex-wrap:wrap; }

.hero-media{
  position:relative;
  overflow:hidden;
  background:#eceae5;
}
.hero-media img{
  width:100%;
  height:100%;
  object-fit:cover;
  /* Slightly below centre keeps the chair grounded and leaves
     breathing room above his head. */
  object-position:center 54%;
}

.hero-scroll{
  position:absolute;
  bottom:40px;
  left:clamp(32px,6vw,96px);
  font-size:.7rem;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--gray);
}
.hero-scroll:hover{ color:var(--gold); }

/* Stack on narrower screens: photo first, then the text. */
@media (max-width: 900px){
  .hero{
    grid-template-columns:1fr;
    grid-template-rows:48vh auto;
    min-height:auto;
  }
  .hero-media{ order:1; }
  .hero-text{ order:2; padding:48px 32px 72px; }
  .hero-text-inner{ max-width:none; }
  .hero h1{ font-size:clamp(1.9rem,7vw,2.6rem); }
  .hero-scroll{ display:none; }
}

/* ============ CARDS: LISTINGS ============ */
.listing-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:32px;
}
.listing-card{
  background:var(--white);
  box-shadow:var(--shadow);
  overflow:hidden;
  transition:transform .3s ease, box-shadow .3s ease;
}
.listing-card:hover{ transform:translateY(-6px); }
.listing-media{ position:relative; aspect-ratio:4/3; overflow:hidden; }
.listing-media img{ width:100%; height:100%; object-fit:cover; transition:transform .5s ease; }
.listing-card:hover .listing-media img{ transform:scale(1.06); }
.listing-tag{
  position:absolute; top:16px; left:16px;
  background:var(--maroon); color:var(--white);
  font-size:.68rem; letter-spacing:.12em; text-transform:uppercase;
  padding:6px 12px;
}
.listing-tag.sold{ background:var(--charcoal); }

/* ---- Buyer-side sales ----
   Quieter by design. The listing photo and marketing on these
   weren't Aqeel's work, so the card doesn't borrow them. A
   typographic panel keeps the grid even without implying credit. */
.listing-media--plain{
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(160deg,#202123,#141517);
  padding:20px;
}
.listing-plain-label{
  font-family:'Playfair Display', serif;
  font-size:1.5rem;
  color:#8e8a80;
  text-align:center;
  line-height:1.25;
}
.listing-card--buyer{ box-shadow:0 10px 30px rgba(23,24,26,.07); }
.listing-card--buyer:hover{ transform:translateY(-4px); }
.listing-card--buyer .listing-price{ font-size:1.2rem; }
.listing-body{ padding:24px; }
.listing-price{ font-family:'Playfair Display', serif; font-size:1.35rem; margin-bottom:6px; color:var(--charcoal); }
.listing-address{ font-size:.9rem; color:var(--gray); margin-bottom:14px; }
/* Names the role on sold properties. Advertising a sale without
   saying which side you acted for can read as misleading. */
.listing-role{
  font-size:.68rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--gold);
  font-weight:600;
  margin:-6px 0 14px;
}
.listing-meta{
  display:flex; gap:16px;
  font-size:.78rem; letter-spacing:.03em;
  color:var(--gray);
  border-top:1px solid var(--border);
  padding-top:14px;
  text-transform:uppercase;
}
.listing-meta strong{ color:var(--charcoal); }

.listing-filters{
  display:flex; gap:12px; justify-content:center; margin-bottom:48px; flex-wrap:wrap;
}
.filter-btn{
  padding:10px 24px;
  border:1px solid var(--charcoal);
  background:transparent;
  font-size:.78rem; letter-spacing:.12em; text-transform:uppercase;
  cursor:pointer;
}
.filter-btn.active, .filter-btn:hover{ background:var(--charcoal); color:var(--cream); }

/* Shown in the main grid when the feed has nothing to display. */
.listings-empty{
  grid-column:1 / -1;
  background:var(--white);
  padding:40px;
  border-left:3px solid var(--gold);
  box-shadow:var(--shadow);
  margin:0;
}
.listings-empty a{ color:var(--gold); border-bottom:1px solid var(--gold); }

/* ============ NEIGHBOURHOODS ============ */
/* Nine communities make three clean rows of three. */
.hood-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:28px;
}
.hood-card{ position:relative; aspect-ratio:3/4; overflow:hidden; }
.hood-card img{ width:100%; height:100%; object-fit:cover; transition:transform .5s ease; }
.hood-card:hover img{ transform:scale(1.08); }
.hood-overlay{
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(23,24,26,0) 40%, rgba(23,24,26,.85) 100%);
  display:flex; align-items:flex-end; padding:26px;
}
.hood-overlay h3{ color:var(--cream); font-size:1.3rem; margin-bottom:4px; }
.hood-overlay span{ color:var(--gold-light); font-size:.75rem; letter-spacing:.1em; text-transform:uppercase; }

/* ============ COMMUNITY DETAIL PANEL ============ */
.hood-card{
  border:none; padding:0; margin:0; cursor:pointer;
  font-family:inherit; text-align:left; width:100%;
  display:block; background:none;
}
.hood-card.is-active{ outline:3px solid var(--gold); outline-offset:3px; }

.community-detail{
  display:none;
  margin-top:40px;
  background:var(--white);
  box-shadow:var(--shadow);
  position:relative;
}
.community-detail.open{ display:block; animation:panelIn .35s ease; }

@keyframes panelIn{
  from{ opacity:0; transform:translateY(-10px); }
  to{ opacity:1; transform:translateY(0); }
}

.community-detail-inner{ padding:48px; }

.community-close{
  position:absolute; top:18px; right:20px;
  background:none; border:none; cursor:pointer;
  font-size:1.9rem; line-height:1; color:var(--gray);
}
.community-close:hover{ color:var(--charcoal); }

.community-detail-head{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:48px;
  align-items:start;
  padding-bottom:40px;
  border-bottom:1px solid var(--border);
}
.community-detail-head h3{ font-size:2rem; margin-bottom:14px; }
.community-detail-img{ width:100%; aspect-ratio:4/3; object-fit:cover; }

.community-stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:20px;
  margin-top:28px;
}
/* Stats only render when there's real data behind them, so the
   column count varies. Keep the row balanced either way. */
.community-stats--2{ grid-template-columns:repeat(2,1fr); }
.community-stats--3{ grid-template-columns:repeat(3,1fr); }
.community-stats--5{ grid-template-columns:repeat(5,1fr); }
.community-stats > div{ border-top:2px solid var(--gold); padding-top:12px; }
.community-stats span{
  display:block;
  font-size:.68rem; letter-spacing:.14em; text-transform:uppercase;
  color:var(--gold); margin-bottom:6px;
}
.community-stats strong{
  font-family:'Jost', sans-serif;
  font-size:.9rem; font-weight:400; color:var(--charcoal);
  line-height:1.4;
}

.community-listings{ padding-top:40px; }
.community-listings h4{
  font-size:1.15rem;
  letter-spacing:.02em;
  margin-bottom:26px;
}
/* Second heading in a panel, when sales follow active listings. */
.community-listings h4.community-subhead{
  margin-top:44px;
  padding-top:32px;
  border-top:1px solid var(--border);
}
.listing-grid--compact{ grid-template-columns:repeat(3,1fr); gap:24px; }
.listing-grid--compact .listing-body{ padding:20px; }
.listing-grid--compact .listing-price{ font-size:1.15rem; }

.community-empty{
  background:var(--cream);
  padding:28px;
  border-left:3px solid var(--gold);
  margin:0;
}

@media (max-width: 980px){
  .community-detail-inner{ padding:32px 24px; }
  .community-detail-head{ grid-template-columns:1fr; gap:28px; }
  .community-stats,
  .community-stats--2,
  .community-stats--3{ grid-template-columns:repeat(2,1fr); gap:18px; }
  .listing-grid--compact{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 640px){
  .listing-grid--compact{ grid-template-columns:1fr; }
}

/* ============ ADVANTAGE LIST ============ */
.advantage-list{ list-style:none; padding:0; margin:24px 0 0; }
.advantage-list li{
  padding:14px 0 14px 30px;
  border-bottom:1px solid var(--border);
  position:relative;
  color:var(--gray);
}
.advantage-list li:last-child{ border-bottom:none; }
.advantage-list li::before{
  content:"—";
  position:absolute; left:0; top:14px;
  color:var(--gold);
}

/* ============ FOOTER ============ */
.site-footer{
  background:var(--charcoal);
  color:#bdb9ae;
  padding:80px 0 28px;
}
.footer-grid{
  display:grid;
  grid-template-columns:1.6fr 1fr 1fr 1fr;
  gap:40px;
  padding-bottom:56px;
  border-bottom:1px solid rgba(255,255,255,.1);
}
.footer-grid h5{
  color:var(--cream);
  font-size:.78rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  margin-bottom:20px;
}
.footer-grid ul{ list-style:none; padding:0; margin:0; }
.footer-grid li{ margin-bottom:12px; }
.footer-grid a:hover{ color:var(--gold-light); }
.footer-brand .brand-name{ color:var(--cream); font-family:'Playfair Display', serif; font-size:1.4rem; }
.footer-brand p{ margin-top:14px; max-width:320px; font-size:.9rem; }
.footer-social{ display:flex; gap:14px; margin-top:20px; }
.footer-social a{
  width:36px; height:36px; border:1px solid rgba(255,255,255,.25);
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:.75rem;
}
.footer-social a:hover{ border-color:var(--gold-light); color:var(--gold-light); }
.footer-bottom{
  padding-top:26px;
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px;
  font-size:.76rem; color:#8b8880;
}

/* ============ FORMS ============ */
.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
}
.form-grid .full{ grid-column:1 / -1; }
.field label{
  display:block; font-size:.72rem; letter-spacing:.1em; text-transform:uppercase;
  color:var(--gray); margin-bottom:8px;
}
.field input, .field select, .field textarea{
  width:100%;
  padding:14px 16px;
  border:1px solid var(--border);
  background:var(--white);
  font-family:'Jost', sans-serif;
  font-size:.95rem;
  color:var(--charcoal);
}
.field textarea{ resize:vertical; min-height:130px; }
.field input:focus, .field select:focus, .field textarea:focus{
  outline:none; border-color:var(--gold);
}
.consent{ display:flex; gap:10px; align-items:flex-start; font-size:.8rem; color:var(--gray); }
.consent input{ width:auto; margin-top:4px; }

/* ============ ABOUT PAGE ============ */
.about-grid{
  display:grid;
  grid-template-columns:.9fr 1.1fr;
  gap:64px;
  align-items:start;
}
.credential-list{ list-style:none; padding:0; margin:24px 0; }
.credential-list li{
  padding:12px 0; border-bottom:1px solid var(--border);
  display:flex; justify-content:space-between; font-size:.9rem;
}
.credential-list span:last-child{ color:var(--gray); }

/* ============ CONTACT PAGE ============ */
.contact-wrap{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:56px;
}
.contact-info-card{
  background:var(--charcoal); color:var(--cream);
  padding:44px 36px;
}
.contact-info-card h3{ color:var(--cream); }
.contact-info-row{ display:flex; gap:14px; margin-bottom:22px; align-items:flex-start; }
.contact-info-row .icon{ color:var(--gold-light); font-size:1.1rem; }
/* Replaces the old map placeholder. A map of "Greater Edmonton"
   communicated nothing; the nine communities reinforce the
   specialism at the exact moment someone decides to get in touch. */
.contact-communities{
  margin-top:32px;
  padding-top:28px;
  border-top:1px solid rgba(255,255,255,.14);
}
.contact-communities h4{
  color:var(--gold-light);
  font-family:'Jost', sans-serif;
  font-size:.7rem;
  letter-spacing:.16em;
  text-transform:uppercase;
  font-weight:600;
  margin-bottom:18px;
}
.contact-communities ul{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px 20px;
}
.contact-communities a{
  color:#cfcabe;
  font-size:.88rem;
  border-bottom:1px solid transparent;
  transition:color .2s ease, border-color .2s ease;
}
.contact-communities a:hover{
  color:var(--cream);
  border-bottom-color:var(--gold);
}

@media (max-width: 420px){
  .contact-communities ul{ grid-template-columns:1fr; }
}

/* ============ UTILITIES ============ */
.text-center{ text-align:center; }
.mt-0{ margin-top:0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px){
  .main-nav{ display:none; }
  .header-phone{ display:none; }
  .nav-toggle{ display:flex; }
  .listing-grid, .hood-grid{ grid-template-columns:repeat(2,1fr); }
  .about-grid{ grid-template-columns:1fr; }
  .footer-grid{ grid-template-columns:1fr 1fr; }
  .contact-wrap{ grid-template-columns:1fr; }
  .form-grid{ grid-template-columns:1fr; }
}
@media (max-width: 640px){
  .listing-grid, .hood-grid{ grid-template-columns:1fr; }
  .footer-grid{ grid-template-columns:1fr; }
  .section{ padding:64px 0; }
}

/* Mobile nav drawer */
.mobile-nav{
  position:fixed; inset:0; z-index:200;
  background:var(--charcoal);
  display:flex; flex-direction:column;
  padding:32px;
  transform:translateX(100%);
  transition:transform .3s ease;
}
.mobile-nav.open{ transform:translateX(0); }
.mobile-nav a{
  color:var(--cream); font-size:1.1rem; padding:16px 0;
  border-bottom:1px solid rgba(255,255,255,.1);
  text-transform:uppercase; letter-spacing:.08em;
}
.mobile-nav-close{
  align-self:flex-end; background:none; border:none; color:var(--cream);
  font-size:1.6rem; cursor:pointer; margin-bottom:20px;
}

/* =============================================================
   HOME VALUATION POPUP
   =============================================================
   Shown after ~4 screen-heights of scrolling. See
   js/valuation-popup.js for the trigger and the 30-day memory.
   ============================================================= */

.valuation-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.valuation-modal[hidden] { display: none; }

.valuation-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 27, 29, 0.62);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 240ms ease;
}

.valuation-modal__panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--cream, #faf8f5);
  border-top: 3px solid var(--gold, #b8954f);
  padding: 40px 40px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  transform: translateY(14px);
  opacity: 0;
  transition: transform 260ms ease, opacity 260ms ease;
}

/* Added by the script one frame after unhiding, so the transition
   actually runs rather than being skipped. */
.valuation-modal.is-open .valuation-modal__backdrop { opacity: 1; }
.valuation-modal.is-open .valuation-modal__panel {
  transform: translateY(0);
  opacity: 1;
}

.valuation-modal__panel h2 {
  margin: 10px 0 14px;
  font-size: 1.75rem;
  line-height: 1.2;
}

.valuation-modal__intro {
  margin: 0 0 24px;
  color: var(--charcoal, #2a2b2d);
  opacity: 0.85;
  line-height: 1.55;
}

.valuation-modal__close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--charcoal, #2a2b2d);
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 160ms ease;
}
.valuation-modal__close:hover { opacity: 1; }

.valuation-field { margin-bottom: 16px; }

.valuation-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.valuation-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(42, 43, 45, 0.2);
  background: #fff;
  font: inherit;
  font-size: 1rem;      /* 16px minimum, or iOS zooms on focus */
}

.valuation-field input:focus {
  outline: 2px solid var(--gold, #b8954f);
  outline-offset: 1px;
  border-color: transparent;
}

.valuation-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.valuation-modal .consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0 22px;
  font-size: 0.82rem;
  line-height: 1.45;
  opacity: 0.8;
}

.valuation-modal .consent input { margin-top: 3px; flex-shrink: 0; }

.valuation-modal__note {
  margin: 18px 0 0;
  padding: 13px 16px;
  border-left: 3px solid var(--gold, #b8954f);
  background: var(--cream-dark, #f0ece5);
  font-weight: 500;
}

.valuation-modal__note--error { border-left-color: var(--maroon, #7a2e31); }
.valuation-modal__note[hidden] { display: none; }

.valuation-modal__dismiss {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 6px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.85rem;
  color: var(--charcoal, #2a2b2d);
  opacity: 0.5;
  text-decoration: underline;
  cursor: pointer;
}
.valuation-modal__dismiss:hover { opacity: 0.85; }

@media (max-width: 560px) {
  .valuation-modal { padding: 14px; }
  .valuation-modal__panel { padding: 32px 22px 24px; }
  .valuation-modal__panel h2 { font-size: 1.45rem; }
  .valuation-row { grid-template-columns: 1fr; gap: 0; }
}

/* Respect a visitor who has asked for less motion. */
@media (prefers-reduced-motion: reduce) {
  .valuation-modal__backdrop,
  .valuation-modal__panel { transition: none; }
}

/* ---- Popup: the choose-your-side step ---------------------- */

.valuation-step[hidden] { display: none; }

.valuation-choice {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.valuation-choice__btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  border: 1px solid rgba(42, 43, 45, 0.18);
  background: #fff;
  font: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.valuation-choice__btn:hover,
.valuation-choice__btn:focus-visible {
  border-color: var(--gold, #b8954f);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
  outline: none;
}

.valuation-choice__btn strong {
  display: block;
  font-size: 1.02rem;
  margin-bottom: 3px;
}

.valuation-choice__btn span {
  display: block;
  font-size: 0.85rem;
  opacity: 0.68;
  line-height: 1.4;
}

.valuation-back {
  display: inline-block;
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--charcoal, #2a2b2d);
  opacity: 0.55;
  cursor: pointer;
}
.valuation-back:hover { opacity: 0.9; }
.valuation-back[hidden] { display: none; }

/* =============================================================
   LISTING DETAIL MODAL
   ============================================================= */

.listing-card--openable { cursor: pointer; }

.listing-card--openable:hover,
.listing-card--openable:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.listing-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;          /* above the lead popup */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 20px;
  overflow-y: auto;
}

.listing-modal[hidden] { display: none; }

.listing-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 27, 29, 0.68);
  opacity: 0;
  transition: opacity 220ms ease;
}

.listing-modal__panel {
  position: relative;
  width: 100%;
  max-width: 840px;
  background: var(--cream, #faf8f5);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.32);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.listing-modal.is-open .listing-modal__backdrop { opacity: 1; }
.listing-modal.is-open .listing-modal__panel { opacity: 1; transform: translateY(0); }

.listing-modal__close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--charcoal, #2a2b2d);
}
.listing-modal__close:hover { background: #fff; }

.listing-hero { width: 100%; aspect-ratio: 3 / 2; background: var(--cream-dark, #f0ece5); }
.listing-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.listing-gallery {
  display: flex;
  gap: 6px;
  padding: 6px;
  overflow-x: auto;
  background: var(--charcoal, #2a2b2d);
}

.listing-gallery__thumb {
  flex: 0 0 84px;
  height: 60px;
  padding: 0;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
}
.listing-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-gallery__thumb.is-active { border-color: var(--gold, #b8954f); }

.listing-detail__body { padding: 32px 40px 36px; }

.listing-detail__price {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--maroon, #7a2e31);
  line-height: 1.1;
}

.listing-detail__body h2 { margin: 8px 0 4px; font-size: 1.4rem; }
.listing-detail__place { margin: 0 0 22px; opacity: 0.7; }

.listing-detail__keyfacts {
  display: flex;
  gap: 28px;
  padding: 16px 0;
  border-top: 1px solid rgba(42, 43, 45, 0.12);
  border-bottom: 1px solid rgba(42, 43, 45, 0.12);
  font-size: 0.9rem;
}
.listing-detail__keyfacts strong { font-size: 1.05rem; }

.listing-detail__description {
  margin: 24px 0;
  line-height: 1.65;
  white-space: pre-line;   /* the feed uses newlines for paragraphs */
}

.listing-detail__body h3 {
  margin: 28px 0 12px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold, #b8954f);
}

.listing-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 28px;
  margin: 0;
}

.listing-spec { display: flex; justify-content: space-between; gap: 14px;
                padding-bottom: 8px; border-bottom: 1px solid rgba(42,43,45,0.08); }
.listing-spec dt { font-size: 0.82rem; opacity: 0.6; flex-shrink: 0; }
.listing-spec dd { margin: 0; font-size: 0.86rem; text-align: right; font-weight: 500; }

.listing-rooms { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.listing-rooms td { padding: 7px 0; border-bottom: 1px solid rgba(42, 43, 45, 0.08); }
.listing-rooms td:nth-child(2) { opacity: 0.62; }
.listing-rooms td:last-child { text-align: right; opacity: 0.62; }

.listing-detail__cta { margin: 30px 0 18px; }
.listing-detail__video {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--maroon, #7a2e31);
}

/* Attribution is a DDF requirement — keep it legible, not hidden. */
.listing-detail__attribution {
  margin: 0 0 6px;
  padding-top: 16px;
  border-top: 1px solid rgba(42, 43, 45, 0.12);
  font-size: 0.84rem;
  font-weight: 600;
  opacity: 0.8;
}

.listing-detail__disclaimer { margin: 0; font-size: 0.72rem; line-height: 1.5; opacity: 0.5; }

.listing-detail__loading { padding: 70px 40px; text-align: center; opacity: 0.7; }

@media (max-width: 640px) {
  .listing-modal { padding: 0; }
  .listing-modal__panel { max-width: none; min-height: 100vh; }
  .listing-detail__body { padding: 24px 20px 32px; }
  .listing-detail__price { font-size: 1.55rem; }
  .listing-specs { grid-template-columns: 1fr; }
  .listing-detail__keyfacts { gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .listing-modal__backdrop,
  .listing-modal__panel,
  .listing-card--openable { transition: none; }
}

/* ---- Listing card attribution ------------------------------
   Required by CREA's DDF terms: the listing brokerage must be
   identified wherever a listing appears. Quiet, but legible —
   do not hide it. */
.listing-attribution {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(42, 43, 45, 0.1);
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--gray, #6f7175);
  opacity: 0.78;
}

.listing-grid--compact .listing-attribution {
  margin-top: 11px;
  padding-top: 10px;
  font-size: 0.68rem;
}

/* ---- Listing gallery navigation ---------------------------- */

.listing-hero { position: relative; }

.listing-hero__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: var(--charcoal, #2a2b2d);
  font-size: 1.9rem;
  line-height: 1;
  padding: 0 0 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms ease, background 180ms ease;
}

/* Hidden until the pointer is over the photo, so the image isn't
   cluttered — but always visible on touch, where there's no hover. */
.listing-hero:hover .listing-hero__nav,
.listing-hero__nav:focus-visible { opacity: 1; }
.listing-hero__nav:hover { background: #fff; }

.listing-hero__nav--prev { left: 12px; }
.listing-hero__nav--next { right: 12px; }

.listing-hero__counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 11px;
  border-radius: 2px;
  background: rgba(26, 27, 29, 0.7);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

@media (hover: none) {
  .listing-hero__nav { opacity: 1; }
}

@media (max-width: 640px) {
  .listing-hero__nav { width: 40px; height: 40px; font-size: 1.6rem; }
  .listing-hero__nav--prev { left: 8px; }
  .listing-hero__nav--next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .listing-hero__nav { transition: none; }
}
