/* ============================================
   myhouses.site — shared stylesheet
   Editorial-utilitarian aesthetic
   ============================================ */

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

:root {
  /* Light mode — warm off-whites, deep navy, military olive, one accent */
  --bg: #F4F1EA;
  --bg-alt: #EAE6DC;
  --surface: #FFFFFF;
  --ink: #1A1F2B;
  --ink-soft: #4A5061;
  --ink-muted: #8A8F9C;
  --line: #D8D3C6;
  --line-strong: #B8B2A1;

  /* Accents */
  --accent: #C8502E;           /* signal orange — used sparingly */
  --accent-dark: #9E3E21;
  --olive: #5A5D3E;            /* military olive */
  --olive-soft: #E5E4D4;
  --navy: #1E2A44;
  --forest: #2F4A3A;

  /* Semantic */
  --oha-ok: #2F4A3A;
  --oha-ok-bg: #E0E8DE;
  --verified: #8A6D1F;
  --verified-bg: #F1E8CE;
  --fresh: #9E3E21;
  --fresh-bg: #F5E1D5;
  --pending: #8A6D1F;
  --pending-bg: #F5EAC9;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;

  color-scheme: light;
}

/* Dark mode — deep navy surfaces, warm cream type */
[data-theme="dark"] {
  --bg: #13151A;
  --bg-alt: #1C1F26;
  --surface: #1F232C;
  --ink: #F0EAD9;
  --ink-soft: #B8BAC4;
  --ink-muted: #7B7E8A;
  --line: #2D323D;
  --line-strong: #424856;

  --accent: #E56B44;
  --accent-dark: #C8502E;
  --olive: #8C9060;
  --olive-soft: #2A2E23;
  --navy: #3A4A6E;
  --forest: #588669;

  --oha-ok: #7AB38E;
  --oha-ok-bg: #1F2E26;
  --verified: #D4B766;
  --verified-bg: #2F2A1C;
  --fresh: #E56B44;
  --fresh-bg: #2E1F1A;
  --pending: #D4B766;
  --pending-bg: #2F2A1C;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ============================================
   Top Bar
   ============================================ */
.topbar {
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  padding: 0 16px;
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  min-height: 30px;
}
.topbar-msg { text-align: center; }
.topbar .dot-accent { color: var(--accent); margin: 0 6px; }

.theme-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  padding: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,0.1); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}
[data-theme="light"] .header,
:root:not([data-theme="dark"]) .header { background: rgba(244, 241, 234, 0.92); }
[data-theme="dark"] .header { background: rgba(19, 21, 26, 0.92); }
.logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.logo .dot { color: var(--accent); }
.logo .tld {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-muted);
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: 32px;
  align-items: center;
  font-size: 14px;
}
.nav a {
  color: var(--ink-soft);
  position: relative;
  padding: 6px 0;
  transition: color 0.15s;
}
.nav a:hover { color: var(--ink); }
.nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

.btn {
  font-size: 13px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-alt); }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-dark); }

/* ============================================
   Typography
   ============================================ */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}
.meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ============================================
   Tags / Pills
   ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.tag-oha { background: var(--oha-ok-bg); color: var(--oha-ok); }
.tag-verified { background: var(--verified-bg); color: var(--verified); }
.tag-fresh { background: var(--fresh-bg); color: var(--fresh); }
.tag-pending { background: #F0E8D9; color: #7A5A20; border: 1px dashed #C9B67E; }
.tag-pets { background: var(--olive-soft); color: var(--olive); }

/* ============================================
   Cards (listing cards)
   ============================================ */
.listing-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.listing-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px rgba(26, 31, 43, 0.15);
}
.listing-photo {
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  position: relative;
  overflow: hidden;
}
.listing-photo svg { width: 100%; height: 100%; display: block; }
.photo-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(26, 31, 43, 0.8);
  color: var(--bg);
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.fav {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.fav:hover { background: #fff; transform: scale(1.1); }
.fav.active svg { fill: var(--accent); stroke: var(--accent); }

.listing-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.listing-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.listing-price .per { font-family: var(--font-body); font-size: 12px; color: var(--ink-muted); font-weight: 400; }
.listing-specs { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.listing-loc { font-size: 12px; color: var(--ink-muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.listing-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }

/* ============================================
   Generic house illustrations (SVG backgrounds)
   ============================================ */
.house-illus {
  width: 100%;
  height: 100%;
}

/* ============================================
   MOBILE-FIRST RESPONSIVE PRIMITIVES
   All devices ≤ 768px — phone-first experience
   ============================================ */

/* Prevent iOS text-size auto-inflate on rotate */
html { -webkit-text-size-adjust: 100%; }

/* Kill horizontal scroll on any page */
body { overflow-x: hidden; max-width: 100vw; }

/* Tap targets — Apple/Google both recommend 44px min */
button, .btn, .chip, .nav a, .dd-opt, input, select {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Hide desktop-only elements on mobile */
.desktop-only { display: initial; }
.mobile-only { display: none; }

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: initial; }

  /* Topbar — tighter on mobile */
  .topbar {
    font-size: 10px;
    padding: 6px 12px;
    letter-spacing: 0.05em;
  }

  /* Header — squeeze down, hide nav links, show hamburger */
  .header {
    padding: 12px 16px;
  }
  .logo { font-size: 20px; }
  .logo .tld { font-size: 11px; }

  .nav { display: none; }

  .header > div:last-child .btn-ghost { display: none; }
  .header > div:last-child .btn-primary {
    padding: 8px 14px;
    font-size: 12px;
  }

  /* Hamburger mobile menu button */
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    background: var(--surface);
  }

  /* Mobile slide-over drawer */
  .mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 82%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg);
    z-index: 10000;
    padding: 24px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    box-shadow: -20px 0 40px -20px rgba(26,31,43,0.25);
  }
  .mobile-drawer.open { transform: translateX(0); }
  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26,31,43,0.4);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .mobile-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-drawer .close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    margin-left: auto;
  }
  .mobile-drawer nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mobile-drawer nav a {
    padding: 16px 12px;
    font-family: var(--font-display);
    font-size: 22px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
  }
  .mobile-drawer nav a:active { background: var(--bg-alt); }
  .mobile-drawer .drawer-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .mobile-drawer .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 18px;
    font-size: 14px;
  }
}

/* Hide mobile-only bits above 768px */
@media (min-width: 769px) {
  .menu-toggle, .mobile-drawer, .mobile-drawer-backdrop { display: none !important; }
}
