/* Meagher Realty MLS site — shared stylesheet, merged from homepage + listing-detail mockups.
   Converted from the mockups' desktop/mobile JS-toggle preview into real responsive CSS. */

:root {
  --color-background-primary:   #ffffff;
  --color-background-secondary: #f7f8f6;
  --color-background-success:   #EAF3DE;
  --color-background-warning:   #FEF3C7;
  --color-background-danger:    #FEE2E2;
  --color-text-primary:   #1a1f1b;
  --color-text-secondary: #6b7570;
  --color-text-success:   #27500A;
  --color-text-warning:   #92400E;
  --color-text-danger:    #991B1B;
  --color-border-primary:   #c8d4c9;
  --color-border-secondary: #dde8de;
  --color-border-tertiary:  #eef3ee;
  --color-brand:       #155524;
  --color-brand-light: #2e6b35;
  --color-accent:      #9FE1CB;
  --border-radius-sm: 6px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); background: var(--color-background-primary); color: var(--color-text-primary); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ===== NAV ===== */
.nav {
  background: var(--color-brand);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 82px;
  position: sticky; top: 0; z-index: 100;
}
.nav-logo { display: flex; }
.nav-logo img { height: 64px; width: auto; display: block; }
.nav-logo-text { color: #fff; font-size: 15px; font-weight: 500; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: rgba(255,255,255,0.78); font-size: 15px; }
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; font-weight: 600; }
.nav-cta { background: var(--color-brand-light); color: #fff; font-size: 13px; padding: 7px 14px; border-radius: var(--border-radius-sm); border: none; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.nav-ham { display: none; width: 32px; height: 32px; background: rgba(255,255,255,0.1); border: none; border-radius: 6px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.nav-ham span { display: block; width: 15px; height: 1.5px; background: #fff; border-radius: 2px; }

@media (max-width: 767px) {
  .nav { padding: 0 16px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--color-brand);
    padding: 4px 16px 12px;
    gap: 0;
    box-shadow: 0 12px 20px rgba(0,0,0,0.2);
  }
  .nav-links.open a { padding: 13px 0; font-size: 16px; border-bottom: 0.5px solid rgba(255,255,255,0.14); }
  .nav-links.open a:last-child { border-bottom: none; }
  .nav-cta span.label { display: none; }
  .nav-ham { display: flex; position: relative; }
  .nav-ham.active span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  .nav-ham.active span:nth-child(2) { opacity: 0; }
  .nav-ham.active span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
  .nav-ham span { transition: transform 0.15s ease, opacity 0.15s ease; }
}

/* ===== BREADCRUMB ===== */
.breadcrumb { padding: 12px 28px; font-size: 12px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 6px; border-bottom: 0.5px solid var(--color-border-tertiary); }
.breadcrumb a { color: var(--color-brand-light); }
.breadcrumb a:hover { text-decoration: underline; }
@media (max-width: 767px) { .breadcrumb { padding: 10px 16px; } }

/* ===== HERO (homepage) ===== */
.hero { position: relative; height: 480px; overflow: hidden; }
.hero-img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; display: block; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10,22,12,0.45) 0%, rgba(10,22,12,0.62) 55%, rgba(10,22,12,0.82) 100%); }
.hero-content { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 28px 28px; z-index: 1; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(46,107,53,0.55); color: var(--color-accent); font-size: 11px; padding: 4px 10px; border-radius: 99px; border: 0.5px solid rgba(158,225,203,0.4); margin-bottom: 10px; width: fit-content; }
.hero h1 { color: #fff; font-size: 32px; font-weight: 500; line-height: 1.25; margin: 0 0 4px; text-shadow: 0 1px 8px rgba(0,0,0,0.4); }
.hero-sub { color: rgba(255,255,255,0.72); font-size: 13px; margin: 0 0 20px; }

.search-box { background: rgba(255,255,255,0.97); border-radius: 12px; padding: 14px 16px; max-width: 640px; }
.search-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
.search-field label { font-size: 11px; color: #555; display: block; margin-bottom: 3px; }
.search-field select, .search-field input { width: 100%; height: 36px; border: 1px solid #ddd; border-radius: 7px; padding: 0 10px; font-size: 13px; background: #f8f8f8; color: #222; }
.search-btn { height: 36px; background: var(--color-brand); color: #fff; border: none; border-radius: 7px; padding: 0 16px; font-size: 13px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }

.eula-link { display: block; width: 100%; text-align: center; font-size: 12px; color: var(--color-brand-light); text-decoration: underline; margin-top: 10px; }

.trust-pills { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.trust-pill { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,0.1); border: 0.5px solid rgba(255,255,255,0.2); border-radius: 99px; padding: 6px 12px; }
.trust-pill-icon { color: var(--color-accent); font-size: 14px; }
.trust-pill-text { color: rgba(255,255,255,0.88); font-size: 12px; }
.trust-pill-text strong { color: #fff; font-weight: 500; }

@media (max-width: 767px) {
  .hero { height: 460px; }
  .hero-content { padding: 0 16px 20px; }
  .hero h1 { font-size: 26px; }
  .search-row { grid-template-columns: 1fr; }
  .trust-pills { display: none; }
}

/* ===== SECTIONS (homepage) ===== */
.section { padding: 28px 20px; max-width: 1200px; margin: 0 auto; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 500; }
.section-link { font-size: 13px; color: var(--color-brand-light); cursor: pointer; }

.listings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 599px) { .listings-grid { grid-template-columns: 1fr; } }

.listing-card { background: var(--color-background-primary); border: 0.5px solid var(--color-border-tertiary); border-radius: 12px; overflow: hidden; display: block; }
.listing-photo { height: 220px; position: relative; background: var(--color-background-secondary); }
.listing-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-badge { position: absolute; top: 8px; left: 8px; background: var(--color-brand); color: var(--color-accent); font-size: 10px; font-weight: 500; padding: 3px 8px; border-radius: 99px; }
.listing-badge.status-comingsoon { background: #0E7490; color: #CFFAFE; }
.listing-badge.status-pending { background: #52525B; color: #E4E4E7; }
.listing-badge.status-pricereduced { background: #C2410C; color: #FFEDD5; }
.listing-badge.status-contingent { background: #A16207; color: #FEF3C7; }
.listing-badge.status-sold { background: #B91C1C; color: #FEE2E2; }
.listing-body { padding: 12px 14px 14px; }
.listing-price { font-size: 16px; font-weight: 600; }
.listing-auction-date { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }
.listing-addr { font-size: 12px; color: var(--color-text-secondary); margin: 3px 0 8px; }
.listing-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.listing-stat { font-size: 11px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 3px; }
.listing-attribution { font-size: 12px; color: var(--color-text-secondary); line-height: 1.4; margin-top: 8px; }

.notify-bar { background: var(--color-background-success); border-top: 0.5px solid #C0DD97; padding: 16px 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.notify-bar p { font-size: 13px; color: var(--color-text-success); margin: 0; }
.notify-bar input { height: 34px; border: 0.5px solid #97C459; border-radius: 7px; padding: 0 10px; font-size: 13px; width: 220px; background: #fff; color: var(--color-text-success); }
.notify-bar button { height: 34px; background: var(--color-brand); color: #fff; border: none; border-radius: 7px; padding: 0 14px; font-size: 13px; cursor: pointer; }

.idx-disclaimer { width: 100%; box-sizing: border-box; text-align: center; font-size: 12px; color: var(--color-text-secondary); line-height: 1.5; padding: 16px 20px; }

.trust-strip { background: var(--color-background-secondary); }
.trust-strip-inner { padding: 28px 20px; display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 599px) { .trust-strip-inner { grid-template-columns: 1fr; } }
.trust-item { text-align: center; }
.trust-icon { width: 40px; height: 40px; background: var(--color-background-success); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; color: var(--color-text-success); font-size: 18px; }
.trust-label { font-size: 13px; font-weight: 500; }
.trust-sub { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }

.agent-strip { padding: 24px 20px; display: flex; align-items: center; gap: 16px; border-top: 0.5px solid var(--color-border-tertiary); max-width: 1200px; margin: 0 auto; }
.agent-avatar { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; overflow: hidden; }
.agent-avatar img { width: 100%; height: 100%; object-fit: cover; }
.agent-name { font-size: 15px; font-weight: 500; }
.agent-title { font-size: 12px; color: var(--color-text-secondary); margin: 2px 0 8px; }
.agent-contact { display: flex; gap: 8px; flex-wrap: wrap; }
.agent-btn { font-size: 12px; padding: 6px 14px; border-radius: 7px; border: 0.5px solid var(--color-border-secondary); background: transparent; color: var(--color-text-primary); cursor: pointer; display: flex; align-items: center; gap: 5px; }
.agent-btn.primary { background: var(--color-brand); color: #fff; border-color: var(--color-brand); }
.agent-strip-source { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--color-text-secondary); text-align: right; }
.agent-strip-source img { height: 16px; width: auto; display: block; }

/* ===== FOOTER ===== */
.footer { background: var(--color-brand); padding: 20px 28px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-text { color: rgba(255,255,255,0.45); font-size: 11px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.45); font-size: 11px; }
.footer-links a:hover { color: rgba(255,255,255,0.8); }
@media (max-width: 767px) { .footer { flex-direction: column; text-align: center; padding: 16px; } }

/* ===== LISTING DETAIL: GALLERY ===== */
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 220px 220px; gap: 4px; background: #111; }
.gallery-main { grid-row: 1 / 3; position: relative; overflow: hidden; background: #2a4a2e; }
.gallery-thumb { position: relative; overflow: hidden; background: #1a3a35; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.2); font-size: 13px; }
.gallery-count-btn { position: absolute; bottom: 14px; right: 14px; background: rgba(0,0,0,0.65); color: #fff; font-size: 12px; padding: 6px 14px; border-radius: var(--border-radius-sm); border: 0.5px solid rgba(255,255,255,0.3); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.gallery-count-btn-mobile { display: none; }
.gallery.gallery-pending { display: block; position: relative; height: 440px; }

/* Shown on card.tpl (fills .listing-photo, 220px) and details.tpl's gallery-pending box
   (fills the full 440px/360px gallery footprint) whenever a listing's photos still
   point at MLS Grid's own S3 bucket - media_sync.php hasn't converged them yet. */
.photo-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--color-brand); color: rgba(255,255,255,0.85); text-align: center; }
/* Explicit height/object-fit/display overrides needed here - .listing-photo img and
   .gallery img (this box's parents) are equal CSS specificity to this selector and both
   set those same properties, so without restating them here they'd otherwise leak
   through and squish/crop the logo into the parent's full photo-sized box. */
.photo-placeholder img { width: 90px; height: auto; object-fit: contain; display: block; opacity: 0.9; }
.photo-placeholder span { font-size: 12px; }
.listing-status-badge { position: absolute; top: 14px; left: 14px; background: var(--color-brand); color: var(--color-accent); font-size: 11px; font-weight: 500; padding: 4px 12px; border-radius: 99px; }
.listing-status-badge.status-comingsoon { background: #0E7490; color: #CFFAFE; }
.listing-status-badge.status-pending { background: #52525B; color: #E4E4E7; }
.listing-status-badge.status-pricereduced { background: #C2410C; color: #FFEDD5; }
.listing-status-badge.status-contingent { background: #A16207; color: #FEF3C7; }
.listing-status-badge.status-sold { background: #B91C1C; color: #FEE2E2; }

@media (max-width: 767px) {
  .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 180px 180px; }
  .gallery.gallery-pending { height: 360px; }
  .gallery-main { grid-column: 1 / 3; grid-row: 1; }
  .gallery-thumb:nth-child(4), .gallery-thumb:nth-child(5) { display: none; }
  .gallery-count-btn { display: none; }
  .gallery-count-btn-mobile { display: flex; }
}

/* ===== LISTING DETAIL: LAYOUT ===== */
.page-body { display: grid; grid-template-columns: 1fr 320px; gap: 32px; padding: 28px 28px 48px; max-width: 1100px; margin: 0 auto; }
@media (max-width: 767px) {
  .page-body { grid-template-columns: 1fr; gap: 0; padding: 16px; }
  .col-sidebar { order: -1; margin-bottom: 24px; }
}

.listing-head { margin-bottom: 24px; }
.listing-price { font-size: 30px; font-weight: 600; margin-bottom: 4px; }
.listing-price-sold, .sidebar-price-sold { color: #B91C1C; }
.listing-address { font-size: 18px; margin-bottom: 6px; }
.listing-meta { font-size: 13px; color: var(--color-text-secondary); margin-bottom: 14px; }
.listing-key-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.key-stat { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.key-stat i { color: var(--color-brand-light); font-size: 16px; }
.key-stat-divider { width: 1px; height: 20px; background: var(--color-border-secondary); }
.key-stat-divider:last-child { display: none; }

.detail-section { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 0.5px solid var(--color-border-tertiary); }
.detail-section:last-child { border-bottom: none; }
.detail-section h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; }

.highlights-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 767px) { .highlights-grid { grid-template-columns: 1fr 1fr; } }
.highlight-pill { display: flex; align-items: center; gap: 8px; background: var(--color-background-secondary); border: 0.5px solid var(--color-border-tertiary); border-radius: var(--border-radius-md); padding: 9px 12px; font-size: 13px; }
.highlight-pill i { color: var(--color-brand-light); font-size: 15px; flex-shrink: 0; }

.description-text { font-size: 14px; color: var(--color-text-secondary); line-height: 1.75; }
.description-text p + p { margin-top: 12px; }

.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
@media (max-width: 767px) { .details-grid { grid-template-columns: 1fr; } }
.detail-group { padding: 14px 0; border-bottom: 0.5px solid var(--color-border-tertiary); }
.detail-group:nth-last-child(-n+2) { border-bottom: none; }
.detail-group-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-secondary); margin-bottom: 8px; }
.detail-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; padding: 3px 0; }
.detail-row-label { color: var(--color-text-secondary); }
.detail-row-val { color: var(--color-text-primary); font-weight: 500; text-align: right; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-secondary); border-bottom: 0.5px solid var(--color-border-secondary); }
.data-table td { padding: 9px 10px; border-bottom: 0.5px solid var(--color-border-tertiary); }
.data-table tr:last-child td { border-bottom: none; }

.map-placeholder { width: 100%; height: 280px; border-radius: var(--border-radius-lg); overflow: hidden; border: 0.5px solid var(--color-border-secondary); }
.map-placeholder iframe { width: 100%; height: 100%; border: 0; display: block; }

.idx-disclaimer-narrow { width: 100%; box-sizing: border-box; text-align: center; font-size: 12px; color: var(--color-text-secondary); line-height: 1.5; margin-top: 16px; }

/* ===== LISTING DETAIL: SIDEBAR ===== */
.sidebar-card { background: var(--color-background-primary); border: 0.5px solid var(--color-border-secondary); border-radius: var(--border-radius-lg); padding: 20px; position: sticky; top: 70px; }
@media (max-width: 767px) { .sidebar-card { position: static; } }
.sidebar-price { font-size: 24px; font-weight: 600; margin-bottom: 2px; }
.sidebar-auction-date { font-size: 13px; color: var(--color-text-secondary); margin-bottom: 8px; }
.sidebar-addr { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 16px; }
.sidebar-divider { height: 0.5px; background: var(--color-border-tertiary); margin: 16px 0; }
.sidebar-agent { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sidebar-agent-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; overflow: hidden; }
.sidebar-agent-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-agent-name { font-size: 13px; font-weight: 500; }
.sidebar-agent-brokerage { font-size: 11px; color: var(--color-text-secondary); margin-top: 2px; }
.cta-btn { width: 100%; padding: 12px; border-radius: var(--border-radius-md); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; font-family: var(--font-sans); }
.cta-btn.primary { background: var(--color-brand); color: #fff; border: none; }
.cta-btn.primary:hover { background: #1f4e28; }
.cta-btn.secondary { background: transparent; color: var(--color-brand); border: 1.5px solid var(--color-brand); }
.cta-btn.secondary:hover { background: var(--color-background-secondary); }
.sidebar-message-label { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 8px; }
.sidebar-input { width: 100%; border: 0.5px solid var(--color-border-secondary); border-radius: var(--border-radius-md); padding: 9px 12px; font-size: 13px; font-family: var(--font-sans); background: var(--color-background-secondary); margin-bottom: 8px; box-sizing: border-box; }
.sidebar-textarea { width: 100%; border: 0.5px solid var(--color-border-secondary); border-radius: var(--border-radius-md); padding: 9px 12px; font-size: 13px; font-family: var(--font-sans); background: var(--color-background-secondary); margin-bottom: 8px; resize: vertical; min-height: 80px; box-sizing: border-box; }
.sidebar-disclaimer { font-size: 10px; color: var(--color-text-secondary); line-height: 1.5; margin-top: 8px; }
.mls-badge { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--color-background-secondary); border-radius: var(--border-radius-md); font-size: 11px; color: var(--color-text-secondary); margin-top: 14px; }
.mls-badge i { color: var(--color-brand-light); font-size: 14px; }
.detail-attribution { font-size: 14px; color: var(--color-text-secondary); line-height: 1.5; margin-top: 8px; }

/* ===== INTERIOR CONTENT PAGES (Buy / Sell / About) ===== */
.page-hero { position: relative; height: 240px; overflow: hidden; }
.page-hero-img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; display: block; }
.page-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10,22,12,0.45) 0%, rgba(10,22,12,0.62) 55%, rgba(10,22,12,0.82) 100%); }
.page-hero-content { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 28px 20px; z-index: 1; max-width: 1200px; margin: 0 auto; }
.page-hero-title { display: block; color: #fff; font-size: 28px; font-weight: 500; line-height: 1.25; text-shadow: 0 1px 8px rgba(0,0,0,0.4); }
.page-hero-subtext { display: block; color: #fff; font-size: 15px; font-weight: 400; line-height: 1.5; margin-top: 6px; opacity: 0.92; text-shadow: 0 1px 6px rgba(0,0,0,0.35); }
@media (max-width: 767px) { .page-hero { height: 230px; } .page-hero-content { padding: 0 16px 18px; } .page-hero-title { font-size: 22px; } }

.article-content { padding: 32px 20px; max-width: 760px; margin: 0 auto; }

/* Past Auctions (template 4) uses the wider variant so the intro article text matches
   the auction-listings grid's own width, instead of the narrower 760px article-prose
   width used by Buy/Sell/About (template 2, still plain .article-content). */
.article-content.article-content-wide { max-width: 1200px; }

/* .section already has its own max-width:1200px/padding, so once the parent is also
   1200px it renders at its natural width with no breakout trick needed - just zero its
   own horizontal padding here so the grid's edges line up flush with the article text
   above it (both then share the same single 20px inset from .article-content-wide). */
.article-content-wide .section {
  padding-left: 0;
  padding-right: 0;
}

/* Breakout (template 2 / narrow article-content only): the Past Auctions listing
   grid/disclaimer used to live inside this same 760px article-prose container and
   needed to escape to viewport width - kept here, scoped away from the wide variant,
   in case a future narrow article page ever nests a listings-grid the same way. */
.article-content:not(.article-content-wide) .section {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  padding-left: 0;
  padding-right: 0;
}
.article-content:not(.article-content-wide) .section .section-header,
.article-content:not(.article-content-wide) .section .listings-grid {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}
.article-content .idx-disclaimer {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
}

.article-block { margin-bottom: 32px; }
.article-block:last-child { margin-bottom: 0; }
.article-title { font-size: 20px; font-weight: 600; color: var(--color-text-primary); margin: 0 0 14px; }
.article-body { font-size: 14px; line-height: 1.7; color: var(--color-text-primary); }
.article-body p { margin: 0 0 14px; }
.article-body p:last-child { margin-bottom: 0; }
.article-body ul { margin: 0 0 14px; padding-left: 20px; }
.article-body li { margin-bottom: 8px; }
.article-body a { color: var(--color-brand-light); }
.article-body img { max-width: 100%; height: auto; border-radius: var(--border-radius-md); }
.article-body img[align="right"], .article-body .article-img-right { float: right; margin: 0 0 14px 20px; }
@media (max-width: 599px) { .article-body img[align="right"], .article-body .article-img-right { float: none; margin: 0 0 14px; display: block; } }

.article-image-right, .article-image-left { max-width: 225px; width: 100%; height: auto; border-radius: var(--border-radius-md); }
.article-image-right { float: right; margin: 0 0 14px 20px; }
.article-image-left { float: left; margin: 0 20px 14px 0; }
.article-image-full { display: block; width: 100%; max-width: 100%; height: auto; margin: 0 0 20px; border-radius: var(--border-radius-md); }
@media (max-width: 599px) {
  .article-image-right, .article-image-left { float: none; margin: 0 0 14px; display: block; max-width: 100%; }
}

.cta-banner { background: var(--color-brand); padding: 40px 20px; text-align: center; }
.cta-banner-inner { max-width: 640px; margin: 0 auto; }
.cta-banner h2 { color: #fff; font-size: 22px; font-weight: 500; margin: 0 0 8px; }
.cta-banner p { color: rgba(255,255,255,0.8); font-size: 14px; margin: 0 0 20px; }
.cta-banner-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cta-banner-actions .cta-btn { width: auto; padding: 12px 22px; margin-bottom: 0; }
.cta-banner-actions .cta-btn.primary { background: #fff; color: var(--color-brand); }
.cta-banner-actions .cta-btn.primary:hover { background: rgba(255,255,255,0.9); }
.cta-banner-actions .cta-btn.secondary { color: #fff; border-color: rgba(255,255,255,0.55); }
.cta-banner-actions .cta-btn.secondary:hover { background: rgba(255,255,255,0.12); }

/* ===== LISTINGS SEARCH PAGE (/listings) ===== */
.listings-page-header { padding: 24px 20px 4px; max-width: 1200px; margin: 0 auto; }
.listings-page-header h1 { font-size: 22px; font-weight: 500; margin: 0 0 4px; }
.listings-page-header p { font-size: 13px; color: var(--color-text-secondary); margin: 0; }

#listings-map { height: 380px; width: 100%; background: var(--color-background-secondary); }
.map-section { max-width: 1200px; margin: 16px auto; padding: 0 20px; }
.map-section .map-frame { border-radius: var(--border-radius-lg); overflow: hidden; border: 0.5px solid var(--color-border-tertiary); }
.map-loading-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; font-size: 13px; color: var(--color-text-secondary); }
.map-loading-placeholder.map-loading-placeholder-error { color: var(--color-text-danger); background: var(--color-background-danger); }
.map-pin-info { font-family: var(--font-sans); }
.map-pin-info .mp-thumb { display: block; width: 160px; height: 60px; object-fit: cover; border-radius: var(--border-radius-sm); margin-bottom: 6px; }
.map-pin-info .mp-price { font-size: 14px; font-weight: 600; color: var(--color-brand); margin-bottom: 2px; }
.map-pin-info .mp-addr { font-size: 12px; color: #444; margin-bottom: 6px; }
.map-pin-info a { font-size: 12px; color: var(--color-brand-light); font-weight: 500; }

.results-bar { max-width: 1200px; margin: 20px auto 0; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.results-count { font-size: 13px; color: var(--color-text-secondary); }
.results-bar-controls { display: flex; align-items: center; gap: 10px; }
/* On its own full-width line below .results-bar rather than sharing that row - avoids
   competing for space with the sort/filter controls on narrow/mobile widths. */
.results-hint { max-width: 1200px; margin: 6px auto 0; padding: 0 20px; font-size: 12px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 5px; }
.sort-select { height: 36px; border: 1px solid var(--color-border-secondary); border-radius: 7px; padding: 0 10px; font-size: 13px; font-family: var(--font-sans); background: #fff; color: var(--color-text-primary); cursor: pointer; }
.filters-trigger-btn { position: relative; height: 36px; background: var(--color-brand); color: #fff; border: none; border-radius: 7px; padding: 0 16px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 7px; font-family: var(--font-sans); }
.filters-trigger-btn:hover { background: #1f4e28; }
.filter-count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; background: #fff; color: var(--color-brand); font-size: 11px; font-weight: 600; border-radius: 99px; }

/* ----- Filters modal ----- */
.filter-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(10,22,12,0.55); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.filter-modal-overlay.open { display: flex; }
.filter-modal { background: #fff; border-radius: var(--border-radius-lg); width: 100%; max-width: 720px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.filter-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 0.5px solid var(--color-border-tertiary); flex-shrink: 0; }
.filter-modal-header h2 { font-size: 16px; font-weight: 600; margin: 0; }
.filter-modal-close { width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--color-background-secondary); color: var(--color-text-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.filter-modal-close:hover { background: var(--color-border-secondary); }
.filter-bar { overflow-y: auto; flex: 1; display: flex; flex-direction: column; }
.filter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 20px; }
@media (max-width: 767px) { .filter-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .filter-grid { grid-template-columns: 1fr; } }
.filter-field label { display: block; font-size: 11px; color: var(--color-text-secondary); margin-bottom: 4px; }
.filter-field select, .filter-field input { width: 100%; height: 36px; border: 0.5px solid var(--color-border-secondary); border-radius: 7px; padding: 0 10px; font-size: 13px; background: var(--color-background-secondary); color: var(--color-text-primary); box-sizing: border-box; font-family: var(--font-sans); }
.filter-modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-top: 0.5px solid var(--color-border-tertiary); flex-shrink: 0; }
.filter-btn { height: 40px; background: var(--color-brand); color: #fff; border: none; border-radius: 7px; padding: 0 22px; font-size: 13px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; justify-content: center; font-family: var(--font-sans); }
.filter-btn:hover { background: #1f4e28; }
.filter-reset { font-size: 13px; color: var(--color-text-secondary); text-decoration: underline; }

.search-listings-grid { max-width: 1200px; margin: 0 auto; padding: 16px 20px 28px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 599px) { .search-listings-grid { grid-template-columns: 1fr; } }
.no-results { max-width: 1200px; margin: 0 auto; padding: 40px 20px; text-align: center; color: var(--color-text-secondary); font-size: 14px; }

.pagination { max-width: 1200px; margin: 0 auto; padding: 0 20px 32px; display: flex; justify-content: center; gap: 8px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 7px; font-size: 13px; border: 0.5px solid var(--color-border-secondary); color: var(--color-text-primary); }
.pagination a:hover { background: var(--color-background-secondary); }
.pagination .current { background: var(--color-brand); color: #fff; border-color: var(--color-brand); }
.pagination .disabled { color: var(--color-border-primary); border-color: var(--color-border-tertiary); }
.pagination-ellipsis { border: none !important; color: var(--color-text-secondary); min-width: auto !important; padding: 0 2px !important; }

/* ===== PHOTO LIGHTBOX (listing detail gallery) ===== */
.gallery-main img, .gallery-thumb img { cursor: pointer; }
.photo-lightbox-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 200; align-items: center; justify-content: center; }
.photo-lightbox-overlay.open { display: flex; }
.photo-lightbox-overlay img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: var(--border-radius-md); }
.lightbox-close { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.12); border: none; color: #fff; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lightbox-close:hover { background: rgba(255,255,255,0.22); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,0.12); border: none; color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lightbox-nav:hover { background: rgba(255,255,255,0.22); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ===== VIRTUAL TOUR (listing detail gallery) ===== */
.virtual-tour-btn { position: absolute; bottom: 14px; left: 14px; background: rgba(0,0,0,0.65); color: #fff; font-size: 12px; padding: 6px 14px; border-radius: var(--border-radius-sm); border: 0.5px solid rgba(255,255,255,0.3); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.virtual-tour-btn:hover { background: rgba(0,0,0,0.8); }
.virtual-tour-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
.virtual-tour-overlay.open { display: flex; }
.virtual-tour-frame { width: 100%; max-width: 1100px; aspect-ratio: 16 / 9; background: #000; border-radius: var(--border-radius-md); overflow: hidden; }
.virtual-tour-frame iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 767px) {
  .virtual-tour-frame { aspect-ratio: 4 / 3; }
}
.lightbox-counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.8); font-size: 13px; }
@media (max-width: 599px) {
  .lightbox-nav { width: 38px; height: 38px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 12px; right: 12px; }
}

/* ===== CONTACT FORMS (notify-me bars, send-message, contact page) ===== */
.contact-form-success { background: var(--color-background-success); color: var(--color-text-success); border-radius: var(--border-radius-md); padding: 16px 20px; font-size: 14px; text-align: center; }
.notify-bar .contact-form-success { width: 100%; border-radius: 0; }
.contact-page-form { max-width: 480px; }
.contact-page-form .cta-btn { width: auto; padding: 12px 24px; }
