/* ========================================================================
   Charleston Coastal Realty — Lead Generation Site
   Design system: Charleston-coastal palette
   ======================================================================== */

:root {
  /* Palette */
  --navy: #0F2A3F;
  --navy-dark: #081A28;
  --navy-light: #1E4566;
  --sand: #F5EFE6;
  --sand-dark: #E8DFD0;
  --palmetto: #2F5D3F;
  --palmetto-light: #4A7A5C;
  --gold: #C9A961;
  --gold-dark: #A8893E;
  --cream: #FAFAF7;
  --charcoal: #1F2937;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --white: #FFFFFF;
  --error: #B91C1C;
  --success: #166534;

  /* Type */
  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', 'Helvetica Neue', system-ui, -apple-system, sans-serif;

  /* Layout */
  --container: 1200px;
  --container-narrow: 960px;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 42, 63, 0.08);
  --shadow: 0 4px 16px rgba(15, 42, 63, 0.10);
  --shadow-lg: 0 12px 40px rgba(15, 42, 63, 0.18);
  --transition: 200ms ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--navy);
  margin: 0 0 0.6em;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1em; }

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

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.6em;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-dark); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-dark); color: var(--white); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-outline-light { border-color: var(--white); color: var(--white); background: transparent; }
.btn-outline-light:hover { background: var(--white); color: var(--navy); }
.btn-text { background: none; border: none; color: var(--navy); font-weight: 600; padding: 8px 0; cursor: pointer; }
.btn-text:hover { color: var(--gold-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.78rem; }

/* ========== Header / Nav ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-200);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  /* Full viewport width — logos hug the left edge, actions hug the right,
     menu items get the full middle to breathe. */
}
/* Brand row holds the CHS brand, a thin vertical divider, and the brokerage logo
   side-by-side. CHS comes first (HTML order = visual order = tab order). */
.brand-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-width: 0; /* allow text truncation on very small screens */
}
.broker-mark {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.broker-mark img {
  max-height: 36px;
  width: auto;
  display: block;
  transition: opacity var(--transition);
}
.broker-mark:hover img,
.broker-mark:focus-visible img { opacity: 0.85; }
.broker-mark:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}
.brand-divider {
  width: 1px;
  height: 38px;
  background: var(--gray-300);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--gold);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-serif); font-size: 1.15rem; color: var(--navy); font-weight: 600; }
.brand-tag { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gray-500); }

.main-nav { display: flex; align-items: center; gap: 26px; flex-wrap: nowrap; }
.main-nav a {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  position: relative;
  white-space: nowrap; /* prevents "Home Valuation" from breaking onto two lines */
}
.main-nav a:hover { color: var(--gold-dark); }
.main-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 2px;
  background: var(--gold);
}

.nav-actions { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
.nav-actions .btn-text {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  white-space: nowrap;
}
.nav-actions .btn-text:hover { color: var(--gold-dark); }
.nav-actions .btn-gold,
.nav-actions .btn.btn-sm {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.user-status {
  display: none; /* Redundant with the "My Account" button — saves header width */
  font-size: 0.82rem;
  color: var(--gray-500);
  white-space: nowrap;
}
.user-status strong { color: var(--navy); font-weight: 600; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--navy);
  cursor: pointer;
}

@media (max-width: 1100px) {
  .main-nav, .nav-actions .btn-text-desktop { display: none; }
  .mobile-toggle { display: block; }
  .main-nav.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    background: var(--white);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    gap: 18px;
  }
  .main-nav.open a { font-size: 0.86rem; letter-spacing: 0.1em; }
  .brand-row { gap: 12px; }
  .broker-mark img { max-height: 38px; }
  .brand-divider { height: 32px; }
}

@media (max-width: 600px) {
  .nav-wrap { padding: 14px 16px; }
  .brand-row { gap: 10px; }
  .broker-mark img { max-height: 32px; }
  .brand-divider { height: 28px; }
  /* Tighten CHS brand text on smaller phones to make room for the broker logo */
  .brand-tag { display: none; }
  .brand-name { font-size: 1rem; }
}

@media (max-width: 420px) {
  .brand-row { gap: 8px; }
  .broker-mark img { max-height: 28px; }
  .brand-divider { height: 24px; }
  .brand-name { font-size: 0.95rem; }
}

@media (max-width: 360px) {
  /* On the tiniest screens, hide broker logo + divider so CHS brand + hamburger fit */
  .broker-mark, .brand-divider { display: none; }
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  overflow: hidden;
  background: linear-gradient(135deg, #0F2A3F 0%, #1E4566 100%);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,42,63,0.3) 0%, rgba(15,42,63,0.7) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 80px 24px;
}
.hero h1 { color: var(--white); margin-bottom: 0.4em; }
.hero p.lead {
  font-size: 1.15rem;
  margin-bottom: 2em;
  color: rgba(255,255,255,0.92);
}
.hero .eyebrow { color: var(--gold); }

/* ========== Search bar in hero ========== */
.search-bar {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  margin: 0 auto;
}
.search-bar input, .search-bar select {
  border: none;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: var(--cream);
  border-radius: var(--radius);
  color: var(--charcoal);
  flex: 1;
  min-width: 0;
}
.search-bar input:focus, .search-bar select:focus {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
}
.search-bar .btn { flex-shrink: 0; }

@media (max-width: 700px) {
  .search-bar { flex-direction: column; }
}

/* ========== Sections ========== */
section { padding: 80px 0; }
.section-light { background: var(--white); }
.section-sand { background: var(--sand); }
.section-navy { background: var(--navy); color: var(--white); }
.section-navy h2 { color: var(--white); }
.section-navy .eyebrow { color: var(--gold); }

.section-header {
  text-align: center;
  margin-bottom: 60px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.section-header p { color: var(--gray-500); font-size: 1.08rem; }
.section-navy .section-header p { color: rgba(255,255,255,0.75); }

/* ========== Listing card ========== */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.listing-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: inherit;
}
.listing-img {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--sand);
  position: relative;
}
.listing-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: var(--radius);
}
.listing-fav {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.94);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  transition: all var(--transition);
}
.listing-fav:hover, .listing-fav.saved { background: var(--gold); color: var(--white); }
.listing-body { padding: 22px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.listing-price {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--navy);
  font-weight: 600;
  margin-bottom: 4px;
}
.listing-address {
  font-size: 0.95rem;
  color: var(--gray-700);
  margin-bottom: 14px;
}
.listing-meta {
  display: flex;
  gap: 18px;
  font-size: 0.85rem;
  color: var(--gray-500);
  padding-top: 14px;
  border-top: 1px solid var(--gray-200);
  margin-top: auto;
}
.listing-meta strong { color: var(--charcoal); font-weight: 600; }

/* ========== City tile ========== */
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.city-tile {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 32px;
  text-decoration: none;
  background: var(--navy);
}
.city-tile-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 600ms ease;
}
.city-tile:hover .city-tile-bg { transform: scale(1.06); }
.city-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(15,42,63,0.85) 100%);
}
.city-tile-content {
  position: relative;
  z-index: 2;
  color: var(--white);
}
.city-tile h3 {
  color: var(--white);
  margin-bottom: 4px;
  font-size: 1.7rem;
}
.city-tile p {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  margin: 0;
}
.city-tile-arrow {
  display: inline-block;
  margin-top: 12px;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ========== Neighborhood tile ========== */
.neighborhood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.neighborhood-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.neighborhood-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: inherit;
}
.neighborhood-img {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--sand-dark);
}
.neighborhood-body { padding: 24px; }
.neighborhood-body h3 { font-size: 1.4rem; margin-bottom: 8px; }
.neighborhood-stats {
  display: flex;
  gap: 18px;
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-200);
}
.neighborhood-stats span strong { color: var(--navy); }

/* ========== Forms ========== */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-700);
  margin-bottom: 8px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--charcoal);
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 6px;
  display: none;
}
.form-group.error input,
.form-group.error select,
.form-group.error textarea { border-color: var(--error); }
.form-group.error .form-error { display: block; }
.form-success {
  background: #ECFDF5;
  border: 1px solid var(--success);
  color: var(--success);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

/* TCPA / opt-out disclosure beneath lead forms */
.form-disclosure {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--gray-500);
  margin: 16px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--gray-200);
}
.form-disclosure a {
  color: var(--gray-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.form-disclosure a:hover { color: var(--navy); }
.form-disclosure strong { color: var(--gray-700); font-weight: 600; }

/* In dark-background modals, lighten the disclosure */
.modal .form-disclosure {
  color: rgba(31, 41, 55, 0.7);
  border-top-color: var(--gray-200);
}

/* ========== Modal ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 42, 63, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 200ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--white);
  max-width: 500px;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 280ms ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 36px 36px 28px;
  text-align: center;
  position: relative;
}
.modal-hero h2 { color: var(--white); margin-bottom: 8px; }
.modal-hero p { color: rgba(255,255,255,0.85); margin: 0; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.18);
  color: var(--white);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}
.modal-close:hover { background: rgba(255,255,255,0.3); }
.modal-body { padding: 30px 36px 36px; }
.modal-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-500);
  padding-top: 12px;
}
.modal-footer a { color: var(--navy); text-decoration: underline; }

.modal-no-close .modal-close { display: none; }

/* ========== Footer ========== */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.75);
  padding: 70px 0 30px;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}
.footer-brand .brand-name { color: var(--white); }
.footer-brand .brand-tag { color: var(--gold); }
.footer-brand p { color: rgba(255,255,255,0.6); margin-top: 16px; max-width: 320px; }
.site-footer h5,
.site-footer .footer-heading {
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 18px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 10px; }
.site-footer ul a { color: rgba(255,255,255,0.85); }
.site-footer ul a:hover { color: var(--gold); }
.site-footer ul a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

/* Brokerage logo in footer (Carolina One, etc.) */
.footer-broker-logo {
  margin-top: 24px;
  max-width: 220px;
}
.footer-broker-logo img {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0) invert(1); /* Force any color logo to render white on the dark footer */
  opacity: 0.92;
  transition: opacity var(--transition);
}
.footer-broker-logo a:hover img,
.footer-broker-logo a:focus-visible img { opacity: 1; }
.footer-broker-logo a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 4px; }
/* If the logo image is already white on transparent, the agent can opt out of the filter
   by adding a custom CSS rule, e.g. .footer-broker-logo img { filter: none; } */

/* Compliance block (Equal Housing + ADA statement) */
.footer-compliance {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 30px;
  padding-top: 30px;
}
.footer-compliance-statement {
  color: rgba(255,255,255,0.82);
  font-size: 0.85rem;
  line-height: 1.65;
  margin: 0 0 14px;
  max-width: 920px;
}
.footer-compliance-statement strong { color: var(--white); }
.footer-compliance-statement a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-compliance-statement a:hover,
.footer-compliance-statement a:focus-visible {
  color: var(--white);
  background: rgba(201, 169, 97, 0.18);
}
.footer-compliance-statement a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.footer-compliance-statement abbr { text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,0.5); cursor: help; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 30px;
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
}
.footer-bottom .legal a {
  color: rgba(255,255,255,0.85);
  margin-left: 18px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-bottom .legal a:hover { color: var(--gold); }
.footer-bottom .legal a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom .legal a { margin-left: 0; margin-right: 18px; }
}

/* ========== Accessibility helpers (WCAG 2.1 AA) ========== */

/* Visually hidden but available to screen readers */
.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;
}

/* Skip-to-content link — invisible until focused, then jumps to top-left */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 9999;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: top var(--transition);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 8px;
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  color: var(--white);
}

/* Global focus-visible defaults — visible 3:1 contrast indicator on all interactives */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Remove the default ugly outline only when focus-visible is supported */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) { outline: none; }

/* Main content target — no visible focus ring on programmatic focus */
#main-content:focus { outline: none; }

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}

/* ========== Page header (sub-pages) ========== */
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 80px 0 70px;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
}
.page-header.has-bg::before { background-image: var(--bg-img); }
.page-header > .container { position: relative; z-index: 2; }
.page-header h1 { color: var(--white); margin-bottom: 10px; }
.page-header p { color: rgba(255,255,255,0.85); font-size: 1.1rem; max-width: 640px; }
.breadcrumbs { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 18px; }
.breadcrumbs a { color: var(--gold); }
.breadcrumbs span { margin: 0 8px; opacity: 0.5; }

/* ========== Filter bar ========== */
.filter-bar {
  background: var(--white);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  margin-bottom: 40px;
  align-items: end;
}
.filter-bar .form-group { flex: 1; min-width: 140px; margin: 0; }
.filter-bar label { font-size: 0.7rem; }
.filter-bar input, .filter-bar select { padding: 10px 12px; font-size: 0.9rem; }

/* ========== Listing detail ========== */
.listing-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
  margin-bottom: 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 480px;
}
.listing-hero-main {
  background-size: cover;
  background-position: center;
  background-color: var(--sand);
}
.listing-hero-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}
.listing-hero-side > div {
  background-size: cover;
  background-position: center;
  background-color: var(--sand);
}
@media (max-width: 700px) {
  .listing-hero { grid-template-columns: 1fr; height: 320px; }
  .listing-hero-side { display: none; }
}
.listing-detail-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 50px;
}
@media (max-width: 900px) { .listing-detail-grid { grid-template-columns: 1fr; } }

.listing-detail-price {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  color: var(--navy);
}
.listing-detail-address { color: var(--gray-700); font-size: 1.05rem; margin-bottom: 24px; }
.listing-detail-stats {
  display: flex;
  gap: 36px;
  padding: 24px 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 30px;
}
.listing-detail-stats div strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--navy);
  font-weight: 600;
}
.listing-detail-stats div span {
  font-size: 0.85rem;
  color: var(--gray-500);
}
.feature-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 20px 0 0;
}
.feature-list li::before {
  content: '✦';
  color: var(--gold);
  margin-right: 10px;
}

.contact-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 100px;
}
.agent-mini {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}
.agent-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  flex-shrink: 0;
}
.agent-mini-name { font-weight: 600; color: var(--navy); }
.agent-mini-title { font-size: 0.85rem; color: var(--gray-500); }

/* ========== Neighborhood detail page ========== */
.amenity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.amenity-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.amenity-card h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--navy);
  font-size: 1.1rem;
}
.amenity-card .amenity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--palmetto);
  font-size: 1rem;
}
.amenity-card ul { list-style: none; padding: 0; margin: 0; }
.amenity-card li {
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  font-size: 0.92rem;
}
.amenity-card li:last-child { border-bottom: none; }
.amenity-card .amenity-meta { color: var(--gray-500); font-size: 0.82rem; }
.rating-pill {
  background: var(--palmetto);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}
.rating-pill.gold { background: var(--gold); color: var(--navy); }
.rating-pill.gray { background: var(--gray-300); color: var(--charcoal); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 30px 0 50px;
}
.stat-tile {
  background: var(--white);
  padding: 22px;
  border-radius: var(--radius-lg);
  text-align: center;
  border-top: 3px solid var(--gold);
}
.stat-tile strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--navy);
  font-weight: 600;
}
.stat-tile span { font-size: 0.82rem; color: var(--gray-500); }
@media (max-width: 700px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

/* ========== About page ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; gap: 40px; } }
.about-img {
  aspect-ratio: 4/5;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--navy), var(--palmetto));
  position: relative;
  overflow: hidden;
}
.about-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 4rem;
  color: var(--gold);
}

/* ========== Contact ========== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 50px;
}
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info p { margin: 0 0 14px; }
.contact-info strong { color: var(--navy); }

/* ========== Account dashboard ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
}
@media (max-width: 800px) { .dashboard-grid { grid-template-columns: 1fr; } }
.dashboard-nav {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  height: fit-content;
  box-shadow: var(--shadow-sm);
}
.dashboard-nav ul { list-style: none; padding: 0; margin: 0; }
.dashboard-nav li a {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--charcoal);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 4px;
}
.dashboard-nav li a:hover { background: var(--sand); }
.dashboard-nav li a.active { background: var(--navy); color: var(--white); }

.empty-state {
  background: var(--white);
  padding: 60px 30px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--gray-300);
}
.empty-state h3 { color: var(--gray-700); }
.empty-state p { color: var(--gray-500); margin-bottom: 24px; }

/* ========== Testimonials ========== */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
}
.testimonial-card {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--gold);
}
.testimonial-card blockquote {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--charcoal);
  line-height: 1.5;
}
.testimonial-author { font-weight: 600; color: var(--navy); font-size: 0.92rem; }
.testimonial-meta { font-size: 0.82rem; color: var(--gray-500); }

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: var(--white);
  padding: 14px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  font-size: 0.92rem;
  animation: slideIn 280ms ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ========== Utilities ========== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.hidden { display: none !important; }
