/* =========================================================
   BUCKEYE HOME EXCHANGE — Global Stylesheet
   Aesthetic: Editorial Real Estate · Warm Ohio Heritage
   ========================================================= */

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

/* ── CSS Variables ── */
:root {
  --cream:       #FAF7F2;
  --cream-dark:  #F0EBE1;
  --navy:        #1A2744;
  --navy-light:  #253566;
  --terracotta:  #C2613A;
  --terra-light: #E8856A;
  --gold:        #C9A96E;
  --sage:        #6B8F71;
  --text:        #2C2A27;
  --muted:       #7A7068;
  --border:      #DDD8CF;
  --white:       #FFFFFF;
  --error:       #C0392B;
  --success:     #27AE60;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius:    8px;
  --radius-lg: 16px;
  --shadow:    0 2px 12px rgba(26,39,68,0.08);
  --shadow-lg: 0 8px 40px rgba(26,39,68,0.14);

  --max-w: 1180px;
  --nav-h: 68px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Grain texture overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(250,247,242,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-logo-mark {
  width: 34px;
  height: 34px;
  background: var(--navy);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-logo-mark svg { width: 20px; height: 20px; fill: var(--gold); }
.nav-logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
}
.nav-logo-text span { display: block; font-size: 0.65rem; font-weight: 400; color: var(--muted); font-family: var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--navy); }
.nav-cta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-user { font-size: 0.85rem; color: var(--muted); }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--navy); border-radius: 2px; transition: 0.2s; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--terracotta);
  color: var(--white);
  border-color: var(--terracotta);
}
.btn-primary:hover { background: #A84D2A; border-color: #A84D2A; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(194,97,58,0.35); }
.btn-navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-navy:hover { background: var(--navy-light); border-color: var(--navy-light); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-outline-terra {
  background: transparent;
  color: var(--terracotta);
  border-color: var(--terracotta);
}
.btn-outline-terra:hover { background: var(--terracotta); color: var(--white); }
.btn-lg { padding: 15px 32px; font-size: 1rem; }
.btn-sm { padding: 7px 16px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Container ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

/* ── Typography ── */
.display-xl { font-family: var(--font-display); font-size: clamp(2.8rem, 5vw, 4.5rem); line-height: 1.1; font-weight: 700; color: var(--navy); }
.display-lg { font-family: var(--font-display); font-size: clamp(2rem, 3.5vw, 3rem); line-height: 1.15; font-weight: 700; color: var(--navy); }
.display-md { font-family: var(--font-display); font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.25; font-weight: 600; color: var(--navy); }
.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--terracotta); }
.lead { font-size: 1.15rem; color: var(--muted); line-height: 1.7; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-body { padding: 24px; }

/* ── Listing Cards ── */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.listing-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transition: all 0.25s; }
.listing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.listing-card-img { position: relative; height: 210px; overflow: hidden; background: var(--cream-dark); }
.listing-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.listing-card:hover .listing-card-img img { transform: scale(1.04); }
.listing-card-badge { position: absolute; top: 12px; left: 12px; background: var(--navy); color: var(--white); font-size: 0.7rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; letter-spacing: 0.05em; text-transform: uppercase; }
.listing-card-badge.active { background: var(--sage); }
.listing-card-badge.under_contract { background: var(--gold); color: var(--navy); }
.listing-card-badge.sold { background: var(--muted); }
.listing-card-body { padding: 18px 20px; }
.listing-price { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--navy); }
.listing-address { font-size: 0.875rem; color: var(--muted); margin-top: 2px; }
.listing-meta { display: flex; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.listing-meta-item { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.listing-meta-item strong { color: var(--text); font-weight: 600; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.form-label span.req { color: var(--terracotta); }
.form-input, .form-select, .form-textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,39,68,0.1);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: 0.78rem; color: var(--muted); }
.form-error { font-size: 0.78rem; color: var(--error); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input[type=checkbox] { margin-top: 3px; accent-color: var(--terracotta); flex-shrink: 0; }

/* ── Alerts ── */
.alert { padding: 14px 18px; border-radius: var(--radius); font-size: 0.9rem; border: 1px solid transparent; }
.alert-success { background: #EDFAF2; border-color: #A8DDB7; color: #1E6B3C; }
.alert-error { background: #FEF0EE; border-color: #F5B7B0; color: #922B1F; }
.alert-warning { background: #FEF9EE; border-color: #F5E08A; color: #7A5C00; }
.alert-info { background: #EEF4FF; border-color: #B3CEFF; color: #1A3A7A; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.divider-section { border: none; border-top: 1px solid var(--border); }

/* ── Badge/Tag ── */
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.tag-navy { background: rgba(26,39,68,0.1); color: var(--navy); }
.tag-terra { background: rgba(194,97,58,0.12); color: var(--terracotta); }
.tag-sage { background: rgba(107,143,113,0.12); color: var(--sage); }

/* ── Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
.stat-card { text-align: center; padding: 32px 24px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.stat-number { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }

/* ── Steps ── */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 20px; padding-bottom: 32px; position: relative; }
.step:not(:last-child)::before { content: ''; position: absolute; left: 19px; top: 42px; bottom: 0; width: 2px; background: var(--border); }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: var(--white); font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-content { padding-top: 8px; }
.step-title { font-weight: 600; font-size: 1rem; color: var(--navy); margin-bottom: 4px; }
.step-desc { font-size: 0.875rem; color: var(--muted); }

/* ── Footer ── */
.footer { background: var(--navy); color: rgba(255,255,255,0.75); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
.footer-brand .nav-logo-text { color: var(--white); }
.footer-brand p { font-size: 0.875rem; margin-top: 12px; line-height: 1.7; color: rgba(255,255,255,0.6); }
.footer-col h4 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.footer-col a { display: block; font-size: 0.875rem; color: rgba(255,255,255,0.65); margin-bottom: 10px; transition: color 0.2s; }
.footer-col a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 48px; padding-top: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; color: rgba(255,255,255,0.4); }
.footer-disclaimer { margin-top: 24px; padding: 16px 20px; background: rgba(255,255,255,0.06); border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.1); font-size: 0.78rem; color: rgba(255,255,255,0.5); line-height: 1.6; }

/* ── Loading ── */
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--terracotta); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; background: rgba(250,247,242,0.85); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(26,39,68,0.55); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--white); border-radius: var(--radius-lg); padding: 36px; max-width: 540px; width: 100%; box-shadow: var(--shadow-lg); transform: translateY(20px); transition: transform 0.25s; }
.modal-overlay.open .modal { transform: none; }
.modal-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--navy); margin-bottom: 16px; }

/* ── Page header ── */
.page-header { background: var(--navy); padding: 64px 0 56px; position: relative; overflow: hidden; }
.page-header::after { content: ''; position: absolute; right: -80px; top: -80px; width: 400px; height: 400px; border-radius: 50%; background: rgba(201,169,110,0.08); }
.page-header .eyebrow { color: var(--gold); }
.page-header .display-lg { color: var(--white); margin-top: 10px; }
.page-header p { color: rgba(255,255,255,0.65); margin-top: 14px; max-width: 560px; }

/* ── Map placeholder ── */
.map-placeholder { background: var(--cream-dark); border-radius: var(--radius); height: 300px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.9rem; border: 1px solid var(--border); }

/* ── Photo gallery ── */
.photo-gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; border-radius: var(--radius-lg); overflow: hidden; max-height: 520px; }
.photo-gallery .main-photo { grid-row: 1 / -1; }
.photo-gallery img { width: 100%; height: 100%; object-fit: cover; }

/* ── Progress tracker ── */
.progress-track { display: flex; align-items: center; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.progress-step { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 80px; }
.progress-step-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); background: var(--white); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; flex-shrink: 0; color: var(--muted); }
.progress-step.done .progress-step-dot { background: var(--sage); border-color: var(--sage); color: var(--white); }
.progress-step.active .progress-step-dot { background: var(--terracotta); border-color: var(--terracotta); color: var(--white); }
.progress-step-label { font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.progress-step.done .progress-step-label, .progress-step.active .progress-step-label { color: var(--text); }
.progress-line { flex: 1; height: 2px; background: var(--border); min-width: 20px; }
.progress-line.done { background: var(--sage); }

/* ── Table ── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.table th { font-weight: 600; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; background: var(--cream); }
.table tr:hover td { background: rgba(250,247,242,0.6); }

/* ── Dropdown ── */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 160px; z-index: 200; opacity: 0; pointer-events: none; transform: translateY(-8px); transition: all 0.2s; }
.dropdown.open .dropdown-menu { opacity: 1; pointer-events: all; transform: none; }
.dropdown-item { display: block; padding: 10px 16px; font-size: 0.875rem; color: var(--text); transition: background 0.15s; }
.dropdown-item:hover { background: var(--cream); }
.dropdown-item.danger { color: var(--error); }

/* ── Mobile nav ── */
.mobile-nav { display: none; position: fixed; inset: 0; top: var(--nav-h); background: var(--white); z-index: 99; padding: 24px; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); }
.mobile-nav.open { display: flex; }
.mobile-nav a { display: block; padding: 12px 16px; font-size: 1rem; font-weight: 500; color: var(--text); border-radius: var(--radius); }
.mobile-nav a:hover { background: var(--cream); }

/* ── Utilities ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-48 { gap: 48px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sticky-top { position: sticky; top: calc(var(--nav-h) + 16px); }

/* ── Scroll animations ── */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.55s ease, transform 0.55s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .photo-gallery { grid-template-columns: 1fr; grid-template-rows: auto; max-height: none; }
  .photo-gallery .main-photo { grid-row: auto; }
  .photo-gallery img { height: 200px; }
  .section { padding: 56px 0; }
  .page-header { padding: 48px 0 40px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .listing-grid { grid-template-columns: 1fr; }
}
