/* ============================================================
   Shared stylesheet - editorial agent template
   Palette: ivory / gold / navy. Every colour is a token.
   ============================================================ */

:root {
  --ink: #1F2A44;
  --paper: #F7F4EE;
  --accent: #886B40;
  --accent-dark: #6F562F;
  --line: #D8CEBB;
  --muted: #5E6478;

  --ink-rgb: 31, 42, 68;
  --paper-rgb: 247, 244, 238;
  --accent-rgb: 136, 107, 64;

  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: "Jost", system-ui, -apple-system, Segoe UI, sans-serif;

  --maxw: 1200px;
  --sec-y: 120px;
  --unit: 8px;
}

@media (max-width: 720px) {
  :root { --sec-y: 72px; }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 720px) { body { font-size: 16px; } }

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.4em;
  line-height: 1.12;
  letter-spacing: 0.005em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 600; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.75rem); }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: var(--sec-y) 0; }
.section--tight { padding: calc(var(--sec-y) * 0.6) 0; }
.measure { max-width: 62ch; }
.center { text-align: center; }
.center.measure { margin-left: auto; margin-right: auto; }

.divider { border: 0; border-top: 1px solid var(--line); margin: 0; }
.rule-accent { border: 0; border-top: 1px solid var(--accent); width: 56px; margin: 0 0 1.5rem; }
.center .rule-accent { margin-left: auto; margin-right: auto; }

/* ---------- labels / eyebrow ---------- */
.eyebrow {
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 30px;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1;
}
.btn-filled { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.btn-filled:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--paper); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { color: var(--accent-dark); border-color: var(--accent-dark); }
.btn + .btn { margin-left: 14px; }
@media (max-width: 480px) {
  .btn { display: block; width: 100%; text-align: center; }
  .btn + .btn { margin-left: 0; margin-top: 12px; }
}

/* ---------- header / nav ---------- */
.site-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  gap: 24px;
}
.nav-brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.nav-brand:hover { color: var(--ink); }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-menu a {
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav-menu a:hover { color: var(--accent); }
.nav-menu a.nav-cta { color: var(--paper); }
.nav-menu a.nav-cta:hover { color: var(--paper); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  width: 46px;
  height: 46px;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle__bar { display: block; width: 20px; height: 1.5px; background: var(--ink); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 24px;
  }
  .site-nav.nav-open .nav-menu { display: flex; }
  .nav-menu a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-menu a.nav-cta { margin-top: 16px; border-bottom: 0; text-align: center; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 82vh;
  display: flex;
  align-items: flex-end;
  color: var(--paper);
}
.hero--page { min-height: 46vh; align-items: center; }
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(var(--ink-rgb), 0.15), rgba(var(--ink-rgb), 0.72));
}
.hero__inner { padding-top: 90px; padding-bottom: 90px; width: 100%; }
.hero h1, .hero h2 { color: var(--paper); }
.hero .eyebrow { color: var(--paper); }
.hero__lede { max-width: 48ch; color: var(--paper); font-size: 1.15rem; margin-bottom: 2rem; }
.hero__actions { margin-top: 1.5rem; }
.hero--page .hero__inner { padding-top: 70px; padding-bottom: 70px; }

/* ---------- generic media cards & grids ---------- */
.grid { display: grid; gap: 40px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.media-card { background: transparent; }
.media-card__img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
}
.media-card__body { padding-top: 18px; }
.media-card__title { font-family: var(--display); font-size: 1.4rem; margin: 0 0 0.3rem; }
.media-card__text { color: var(--muted); margin: 0; }

/* sale card (wider photo) */
.sale-card .media-card__img { aspect-ratio: 3 / 2; }
.sale-card__price { font-family: var(--display); color: var(--accent); font-size: 1.25rem; margin: 0.3rem 0 0; }

/* split block: image beside prose */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.split--reverse .split__media { order: 2; }
.split__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 36px; }
  .split--reverse .split__media { order: 0; }
}

/* steps (unnumbered) */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px; }
.step__title { font-family: var(--display); font-size: 1.3rem; margin: 0 0 0.4rem; }
.step__text { color: var(--muted); margin: 0; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ---------- testimonial quote ---------- */
.quote {
  max-width: 44ch;
  margin: 0 auto;
  text-align: center;
}
.quote blockquote {
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 1.2rem;
  position: relative;
}
.quote blockquote::before { content: "\201C"; color: var(--accent); }
.quote blockquote::after { content: "\201D"; color: var(--accent); }
.quote__name { font-family: var(--body); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; color: var(--muted); }
.quote-list { display: grid; gap: 64px; }
.quote-list .quote { margin: 0 auto; }

/* ---------- forms ---------- */
.form { max-width: 560px; }
.form .field { margin-bottom: 20px; }
.form label {
  display: block;
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}
.form input,
.form textarea,
.form select {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 13px 14px;
}
.form textarea { min-height: 140px; resize: vertical; }
.form input:focus,
.form textarea:focus,
.form select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
[data-lead-message] { margin-top: 14px; font-weight: 500; }
[data-lead-message="failed"] { color: var(--accent-dark); }

/* ---------- dark contact band (the one dark band per page) ---------- */
.contact-band {
  position: relative;
  isolation: isolate;
  color: var(--paper);
  padding: var(--sec-y) 0;
}
.contact-band__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.contact-band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(var(--ink-rgb), 0.85);
}
.contact-band h2, .contact-band h3 { color: var(--paper); }
.contact-band p { color: var(--paper); }
.contact-band .eyebrow { color: var(--paper); }
.contact-band .rule-accent { border-top-color: var(--paper); }
.contact-band a { color: var(--paper); }
.contact-band a:hover { color: var(--paper); }
.contact-band .btn-outline { color: var(--paper); border-color: var(--paper); }
.contact-band .btn-outline:hover { color: var(--paper); border-color: var(--paper); }
.contact-band .btn-filled { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.contact-band .btn-filled:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.contact-band__links { display: flex; flex-wrap: wrap; gap: 28px; font-size: 1.2rem; margin: 1.2rem 0 1.8rem; }

/* ---------- footer ---------- */
.site-foot {
  background: var(--paper);
  border-top: 1px solid var(--accent);
  padding: 72px 0 40px;
  color: var(--ink);
}
.foot-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
}
.foot-logo { width: auto; height: 46px; margin-bottom: 18px; }
.foot-name { font-family: var(--display); font-size: 1.35rem; margin: 0; }
.foot-col a { display: block; color: var(--accent); margin-bottom: 8px; }
.foot-col address { font-style: normal; color: var(--muted); margin: 0 0 8px; }
.foot-col p { color: var(--muted); margin: 0; }
.foot-base {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: baseline;
}
.foot-fair { color: var(--muted); font-size: 0.85rem; margin: 0; flex: 1 1 300px; }
.foot-copy { color: var(--muted); font-size: 0.85rem; margin: 0; }
.foot-brandname { color: var(--muted); font-size: 0.85rem; margin: 0; }
@media (max-width: 760px) {
  .foot-inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- listing detail ---------- */
.listing-head { display: grid; gap: 10px; margin-bottom: 28px; }
.listing-price { font-family: var(--display); font-size: clamp(2rem, 4vw, 3rem); color: var(--ink); }
.listing-status {
  display: inline-block;
  font-family: var(--body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  padding: 6px 12px;
  border-radius: 2px;
}
.listing-cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 2px; }
.listing-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.listing-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; }
.listing-facts { display: flex; flex-wrap: wrap; gap: 28px; margin: 24px 0; }
.listing-facts > div { font-family: var(--body); }
.listing-facts span { font-family: var(--display); font-size: 1.5rem; color: var(--ink); margin-right: 6px; }
.listing-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 56px; align-items: start; }
.listing-aside { position: sticky; top: 104px; border: 1px solid var(--line); border-radius: 2px; padding: 28px; }
@media (max-width: 860px) {
  .listing-layout { grid-template-columns: 1fr; gap: 36px; }
  .listing-aside { position: static; }
  .listing-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Rechat SDK theming + structural overrides
   ============================================================ */
[data-theme="rechat"],
rechat-root {
  --rechat-theme-background-color: var(--paper);

  --rechat-theme-accent-9: var(--accent);
  --rechat-theme-accent-10: var(--accent-dark);
  --rechat-theme-accent-11: #5C4728;

  --rechat-theme-secondary-9: var(--ink);
  --rechat-theme-secondary-10: #18233A;
  --rechat-theme-secondary-11: #121B2E;

  --rechat-theme-gray-1: #F7F4EE;
  --rechat-theme-gray-2: #F1EDE4;
  --rechat-theme-gray-3: #E8E2D5;
  --rechat-theme-gray-4: #DED7C7;
  --rechat-theme-gray-5: #D0C8B6;
  --rechat-theme-gray-6: #BCB3A0;
  --rechat-theme-gray-7: #9E9686;
  --rechat-theme-gray-8: #7D7768;
  --rechat-theme-gray-9: #5E6478;
  --rechat-theme-gray-10: #474C5E;
  --rechat-theme-gray-11: #333748;
  --rechat-theme-gray-12: #1F2A44;

  --rechat-theme-pin-color: var(--accent);
  --rechat-theme-pin-cluster-color: var(--ink);

  --rechat-theme-status-active: var(--accent);
  --rechat-theme-status-pending: #8A7A4E;
  --rechat-theme-status-sold: var(--ink);
  --rechat-theme-status-coming-soon: #6F562F;

  --rechat-theme-text-font-family: var(--body);
  --rechat-theme-heading-font-family: var(--display);

  --rechat-theme-radius-factor: 0.25;
}

/* Match the SDK listing card to the site's static media cards */
[data-theme="rechat"] .listing-card,
rechat-root .listing-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: none;
}
[data-theme="rechat"] .listing-card__image,
rechat-root .listing-card__image { border-radius: 2px 2px 0 0; }
[data-theme="rechat"] .listing-card__price,
rechat-root .listing-card__price {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 600;
}
[data-theme="rechat"] .listing-card__address,
rechat-root .listing-card__address { font-family: var(--body); color: var(--muted); }
[data-theme="rechat"] .listing-card__attributes,
rechat-root .listing-card__attributes { font-family: var(--body); color: var(--ink); }
[data-theme="rechat"] .listing-card__badge,
rechat-root .listing-card__badge {
  background: var(--accent);
  color: var(--paper);
  border-radius: 2px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Lock the map row height so the empty state cannot collapse it (Section 2.5.1) */
[data-theme="rechat"] .rechat-shell rechat-map,
rechat-root .rechat-shell rechat-map {
  min-height: 600px;
  height: 100%;
}
[data-theme="rechat"] .rechat-shell rechat-map-listings-grid,
rechat-root .rechat-shell rechat-map-listings-grid {
  min-height: 600px;
  max-height: 100%;
  overflow-y: auto;
}
@media (max-width: 900px) {
  [data-theme="rechat"] .rechat-shell rechat-map,
  rechat-root .rechat-shell rechat-map { min-height: 360px; }
  [data-theme="rechat"] .rechat-shell rechat-map-listings-grid,
  rechat-root .rechat-shell rechat-map-listings-grid {
    min-height: 0;
    max-height: none;
    overflow-y: visible;
  }
}

/* SDK alignment patches (TODO: remove when SDK ships fixes) */
/* TODO (Rechat SDK): the address input inside <rechat-map-filter> ships at a
   different default height than the sibling filter chips. Remove once the SDK
   ships consistent filter-row sizing. */
[data-theme="rechat"] .search_address_input__field_wrapper,
rechat-root .search_address_input__field_wrapper {
  height: 44px;
  display: flex;
  align-items: center;
}
[data-theme="rechat"] .map-listings-filters__dropdown_trigger,
rechat-root .map-listings-filters__dropdown_trigger {
  height: 44px;
  display: inline-flex;
  align-items: center;
}
[data-theme="rechat"] .listings-sort__option,
rechat-root .listings-sort__option { font-family: var(--body); }
[data-theme="rechat"] .list-pagination__root,
rechat-root .list-pagination__root { font-family: var(--body); padding: 24px 0; }

/* search frame sizing for the listings page */
.search-frame {
  height: calc(100vh - 80px - 96px);
  min-height: 600px;
  margin-bottom: 96px;
}

/* ---------- accessibility helpers ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  z-index: 100;
}
.skip-link:focus { left: 0; color: var(--paper); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* The site's body font, restated so it wins over the Rechat SDK stylesheet, which pages load after this file */
html body{font-family:var(--body)}

/* fabrik:animate — the editor's animations: an element's own --fx-anim, played as it scrolls into view (server/src/edits/style.ts) */
@keyframes fx-fade{from{opacity:0}}@keyframes fx-rise{from{opacity:0;transform:translateY(2rem)}}@keyframes fx-pan-left{from{opacity:0;transform:translateX(6%) scale(0.88)}}@keyframes fx-pan-right{from{opacity:0;transform:translateX(-6%) scale(0.88)}}@keyframes fx-zoom{from{opacity:0;transform:scale(0.8)}}@media screen and (prefers-reduced-motion:no-preference){@supports (animation-timeline:view()){[style*="--fx-anim:"]{animation:var(--fx-anim) linear both!important;animation-timeline:view()!important;animation-range:var(--fx-anim-range)!important}}}

/* fabrik:animate-play — when the editor's animations play: --fx-anim-time as the page opens, --fx-anim-replay again as it comes back into view (server/src/edits/style.ts) */
@media screen and (prefers-reduced-motion:no-preference){[style*="--fx-anim:"][style*="--fx-anim-time:"]{animation:var(--fx-anim) var(--fx-anim-time) cubic-bezier(0.2,0.7,0.2,1) both!important;animation-timeline:auto!important;animation-range:normal!important}@supports (animation-timeline:view()){[style*="--fx-anim:"][style*="--fx-anim-replay:"]{animation:var(--fx-anim) linear both,var(--fx-anim) linear reverse forwards!important;animation-timeline:view(),view()!important;animation-range:var(--fx-anim-range),var(--fx-anim-replay)!important}[style*="--fx-anim:"][style*="--fx-anim-time:"][style*="--fx-anim-replay:"]{animation:var(--fx-anim) linear reverse forwards,var(--fx-anim) var(--fx-anim-time) cubic-bezier(0.2,0.7,0.2,1) backwards!important;animation-timeline:view(),auto!important;animation-range:var(--fx-anim-replay),normal!important}}}
