/* ==========================================================================
   The Texas Homes — design system
   Built from design_handoff_the_texas_homes/ (Orchard simplicity + Redfin density)
   Palette: black / white / gray / red. One red job per view.
   ========================================================================== */

:root {
  --red: #C4161C;        /* primary actions, brand accent, price emphasis */
  --red-deep: #8F0F14;   /* hover / pressed */
  --red-light: #E8474C;  /* red on dark surfaces only */
  --ink: #131313;        /* text, dark surfaces, footer */
  --gray-800: #333333;
  --gray-700: #444444;
  --gray-600: #555555;
  --gray-500: #9A9A9A;   /* muted / meta */
  --gray-200: #E5E5E5;   /* borders / dividers */
  --gray-50: #F7F7F7;    /* section / card background */
  --white: #FFFFFF;
  --green: #1C7C3C;
  --green-bg: #E8F5EC;

  --r-btn: 6px;
  --r-card: 12px;
  --r-pill: 100px;
  --shadow-card: 0 6px 24px rgba(0,0,0,0.12);
  --maxw: 1200px;
  --nav-h: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--white);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-deep); }

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

h1, h2, h3 { margin: 0; letter-spacing: -0.5px; }

/* Layout helpers ---------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.wrap--narrow { max-width: 1100px; }
.section { padding: 72px 0; }
.section--tight { padding: 56px 0; }
.stack { display: flex; flex-direction: column; }
.dark { background: var(--ink); color: #fff; }
.gray { background: var(--gray-50); }

/* Typography -------------------------------------------------------------- */
.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--red); margin: 0;
}
.eyebrow--muted { color: var(--gray-600); }
.eyebrow--onDark { color: var(--red-light); }
.display { font-size: 58px; font-weight: 800; letter-spacing: -1.5px; line-height: 1.08; text-wrap: balance; }
.h1 { font-size: 44px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; }
.h2--sm { font-size: 28px; }
.h3 { font-size: 22px; font-weight: 700; }
.lead { font-size: 17px; color: var(--gray-800); line-height: 1.7; }
.muted { color: var(--gray-600); }
.meta { font-size: 13px; color: var(--gray-500); }
.price { font-weight: 800; }
.price--red { color: var(--red); }

/* Buttons ----------------------------------------------------------------- */
.btn {
  font-family: inherit; font-size: 16px; font-weight: 700;
  border-radius: var(--r-btn); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border: 2px solid transparent; transition: background .15s, color .15s, border-color .15s;
  text-align: center; line-height: 1.2;
}
.btn--primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn--primary:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.btn--secondary { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn--secondary:hover { background: var(--ink); color: #fff; }
.btn--ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--ink:hover { background: #333; color: #fff; }
.btn--ghost { background: var(--gray-50); color: var(--ink); border: 1px solid var(--gray-200); font-size: 15px; font-weight: 600; padding: 11px 20px; }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--sm { font-size: 14px; padding: 11px 20px; }
.btn--block { width: 100%; }
.link-arrow { font-size: 16px; font-weight: 600; color: var(--red); }
.link-arrow:hover { color: var(--red-deep); }

/* Forms ------------------------------------------------------------------- */
.field-label { font-size: 13px; font-weight: 600; color: var(--gray-600); }
.input, .select, .textarea {
  font-family: inherit; font-size: 15px; padding: 13px 14px;
  border: 2px solid var(--gray-200); border-radius: var(--r-btn);
  outline: none; background: #fff; color: var(--ink); width: 100%;
  transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); }
.textarea { resize: vertical; }
.select { cursor: pointer; font-weight: 600; }

/* Nav --------------------------------------------------------------------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: var(--nav-h); background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 1000;
}
.nav__brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.nav__brand:hover { color: var(--ink); }
.nav__brand img { height: 44px; width: auto; }
.nav__wordmark { font-size: 20px; font-weight: 900; letter-spacing: -0.5px; }
.nav__links { display: flex; gap: 26px; align-items: center; font-size: 15px; font-weight: 600; }
/* :not(.nav__cta) so the generic link styles don't override the Contact button */
.nav__links a:not(.nav__cta) { color: var(--ink); border-bottom: 2px solid transparent; padding: 4px 0; }
.nav__links a:not(.nav__cta):hover { color: var(--red); }
.nav__links a.is-active { color: var(--red); border-bottom-color: var(--red); }
.nav__cta { font-size: 14px; font-weight: 700; color: #fff; background: var(--red); border-radius: var(--r-btn); padding: 10px 20px; margin-left: 6px; white-space: nowrap; }
.nav__cta:hover { background: var(--red-deep); color: #fff; }
.nav__toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav__toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .2s; }

/* Footer ------------------------------------------------------------------ */
.footer { background: var(--ink); color: #fff; }
.footer__inner { max-width: var(--maxw); margin: 0 auto; padding: 56px 32px 32px; display: flex; flex-direction: column; gap: 40px; }
.footer__cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 48px; }
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__chip { background: #fff; border-radius: 8px; padding: 8px 12px; display: inline-flex; }
.footer__chip img { height: 34px; width: auto; }
.footer__blurb { margin: 0; font-size: 14px; color: var(--gray-500); line-height: 1.6; max-width: 320px; }
.footer__col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer__head { font-weight: 700; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gray-500); }
.footer__col a { color: #fff; }
.footer__col a:hover { color: var(--red-light); }
.footer__phone { font-weight: 700; font-size: 16px; }
.footer__legal { border-top: 1px solid #333; padding-top: 24px; display: flex; justify-content: space-between; font-size: 12px; color: #777; flex-wrap: wrap; gap: 12px; }

/* Listing card ------------------------------------------------------------ */
.card-grid { display: grid; gap: 20px; }
.card-grid--4 { grid-template-columns: repeat(4, 1fr); }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }

.listing {
  border: 1px solid var(--gray-200); border-radius: 10px; overflow: hidden;
  background: #fff; display: flex; flex-direction: column; transition: box-shadow .15s;
  color: var(--ink);
}
.listing:hover { box-shadow: var(--shadow-card); color: var(--ink); }
.listing__photo { height: 160px; position: relative; background-size: cover; background-position: center; }
.listing__photo--sm { height: 150px; }
.listing__badge {
  position: absolute; top: 10px; left: 10px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 4px; pointer-events: none;
}
.listing__badge--pending { background: var(--gray-600); }
.listing__body { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.listing__price { font-size: 21px; font-weight: 800; }
.listing__facts { font-size: 13.5px; color: var(--gray-800); }
.listing__addr { font-size: 13px; color: var(--gray-600); }
.listing__mls { font-size: 11.5px; color: var(--gray-500); }

/* Badges / chips ---------------------------------------------------------- */
.badge-active { font-size: 12px; font-weight: 700; color: var(--green); background: var(--green-bg); padding: 3px 8px; border-radius: 4px; }
.badge-pending { font-size: 12px; font-weight: 700; color: var(--gray-600); background: #EEE; padding: 3px 8px; border-radius: 4px; }
.chip {
  font-size: 13px; font-weight: 600; background: var(--gray-50);
  border: 1px solid var(--gray-200); padding: 9px 16px; border-radius: var(--r-pill); cursor: pointer;
  color: var(--ink); transition: .12s; font-family: inherit;
}
.chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Stat cards / blocks ----------------------------------------------------- */
.stat-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; padding: 24px; display: flex; flex-direction: column; gap: 4px; }
.stat-card__num { font-size: 34px; font-weight: 800; }
.stat-card__label { font-size: 14px; color: var(--gray-600); }

/* Success banner ---------------------------------------------------------- */
.success { background: var(--green-bg); color: var(--green); font-size: 14.5px; font-weight: 600; padding: 14px 18px; border-radius: 8px; line-height: 1.5; }
.error-banner { background: #FCEBEC; color: var(--red-deep); font-size: 14px; font-weight: 600; padding: 12px 16px; border-radius: 8px; }

/* Segmented control ------------------------------------------------------- */
.segment { display: flex; border: 1px solid var(--gray-200); border-radius: 8px; overflow: hidden; }
.segment button { font-family: inherit; flex: 1; font-size: 14px; font-weight: 700; padding: 13px 4px; border: none; cursor: pointer; background: #fff; color: var(--gray-600); }
.segment button.is-on { background: var(--ink); color: #fff; }

/* Day / time pickers ------------------------------------------------------ */
.day-pick { display: flex; gap: 8px; }
.day-pick button {
  font-family: inherit; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 11px 4px; border-radius: 8px; cursor: pointer; border: 2px solid var(--gray-200); background: #fff; color: var(--ink);
}
.day-pick button.is-on { border-color: var(--red); background: var(--red); color: #fff; }
.day-pick .dow { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.day-pick .num { font-size: 17px; font-weight: 800; }
.time-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.time-pick button {
  font-family: inherit; font-size: 13.5px; font-weight: 600; padding: 10px 16px; border-radius: var(--r-pill);
  cursor: pointer; border: 2px solid var(--gray-200); background: #fff; color: var(--ink);
}
.time-pick button.is-on { border-color: var(--red); background: var(--red); color: #fff; }

/* Map --------------------------------------------------------------------- */
.txh-pin {
  background: #fff; color: var(--ink); font-family: 'Libre Franklin', sans-serif; font-weight: 700;
  font-size: 12.5px; padding: 5px 10px; border-radius: var(--r-pill); border: 1px solid #bbb;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25); white-space: nowrap; cursor: pointer;
}
.txh-pin.hot { background: var(--red); color: #fff; border-color: var(--red); }
.leaflet-popup-content { font-family: 'Libre Franklin', sans-serif; margin: 10px 12px; }

/* Utilities --------------------------------------------------------------- */
.divider-red { width: 120px; height: 3px; background: var(--red); }
.center { text-align: center; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.hide { display: none !important; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 960px) {
  .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .card-grid--3 { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 32px; }
  .display { font-size: 44px; }
  .h1 { font-size: 34px; }
  .h2 { font-size: 26px; }
  .nav__links { gap: 18px; }
}

@media (max-width: 720px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .section { padding: 48px 0; }
  .card-grid--4, .card-grid--2 { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: 1fr; gap: 28px; }
  .display { font-size: 34px; letter-spacing: -1px; }
  .h1 { font-size: 28px; }

  /* Mobile nav */
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: #fff; flex-direction: column; align-items: stretch;
    gap: 0; padding: 8px 20px 20px; border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08); transform: translateY(-120%);
    transition: transform .22s ease; z-index: 999;
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a:not(.nav__cta) { padding: 14px 0; border-bottom: 1px solid var(--gray-200); border-top: none; }
  .nav__links a.is-active { border-bottom-color: var(--gray-200); }
  .nav__cta { text-align: center; padding: 14px; margin-top: 8px; margin-left: 0; }
}
