/* ==========================================================
   GLOBE BUILDERS — extensions for the live listings, forms,
   empty states, loaders, toasts, dark-mode safety and the
   premium polish layer. Uses the site's own tokens
   (paper, ink, gold, DM Sans, Playfair Display).
========================================================== */

:root { color-scheme: only light; }
html, body { background-color: var(--paper, #f5f1e9); color: var(--ink, #171715); }

/* Site header carries its own tokens so it renders identically on every page
   (including the legal pages, which have their own palette). */
.site-header {
  --paper: #f5f1e9; --ink: #171715; --gold: #a77a32; --line: rgba(32, 29, 24, .18);
  --pad: clamp(24px, 5vw, 78px);
  font-family: "DM Sans", Arial, sans-serif;
  background-color: #f5f1e9;
  color: #171715;
}
.gb-legal-site-header img { max-width: 100%; }
.gb-legal-site-header .brand-logo { width: auto; height: 54px; }
@media (max-width: 1150px) { .gb-legal-site-header .brand-logo { height: 49px; } }
@media (max-width: 480px) { .gb-legal-site-header .brand-logo { height: 42px; } }

/* Explicit colours on form controls: forced dark modes cannot produce
   white-on-white or invisible text. */
input, select, textarea {
  color-scheme: only light;
  color: #171715;
  -webkit-text-fill-color: #171715;
}
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { background-color: #fffdf8; }
input::placeholder, textarea::placeholder { color: #8b867d; -webkit-text-fill-color: #8b867d; opacity: 1; }
select option, select optgroup { background-color: #fffdf8; color: #171715; }

/* ---------- honeypot ---------- */
.gb-hp { position: absolute !important; left: 0 !important; top: 0 !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap; opacity: 0; pointer-events: none; }

/* ---------- invalid field + form status ---------- */
.gb-invalid { border-color: #b4442f !important; box-shadow: 0 0 0 3px rgba(180, 68, 47, .12) !important; }
.gb-form-status { margin: 14px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted, #716c63); }
.gb-form-status:empty { display: none; }
.gb-form-status.is-success { padding: 12px 14px; border-left: 3px solid var(--gold, #a77a32); background: #fbf7ee; color: #3d3523; }
.gb-form-status.is-error { padding: 12px 14px; border-left: 3px solid #b4442f; background: #fbefec; color: #7c2c1e; }
button.is-loading { cursor: progress; opacity: .85; }
.gb-spinner { display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gb-spin .8s linear infinite; }
@keyframes gb-spin { to { transform: rotate(360deg); } }

/* ---------- area + unit compound field (sell form) ---------- */
.gb-area-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
.gb-area-row select { min-width: 0; }

/* ---------- toasts ---------- */
.gb-toasts { position: fixed; z-index: 100001; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 10px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.gb-toast { padding: 14px 18px; border-left: 3px solid var(--gold, #a77a32); background: #171715; color: #fff; font: 500 13px/1.55 "DM Sans", Arial, sans-serif; box-shadow: 0 14px 40px rgba(0, 0, 0, .22); opacity: 0; transform: translateY(12px); transition: opacity .35s ease, transform .35s ease; }
.gb-toast.is-in { opacity: 1; transform: none; }
.gb-toast--success { border-left-color: #d3ae63; }
.gb-toast--error { border-left-color: #e0715b; }

/* ---------- skeleton loaders (polished shimmer) ---------- */
.gb-skeleton { min-width: 0; background: #fbfaf6 !important; border: 1px solid rgba(32, 29, 24, .07); padding-bottom: 22px; overflow: hidden; pointer-events: none; }
.gb-skeleton__img { aspect-ratio: 4 / 3; margin-bottom: 18px; }
.gb-skeleton__line { height: 10px; margin: 0 20px 12px; }
.gb-skeleton__line.tall { height: 20px; }
.gb-skeleton__line.w30 { width: 30%; } .gb-skeleton__line.w40 { width: 40%; } .gb-skeleton__line.w60 { width: 60%; } .gb-skeleton__line.w80 { width: 75%; }
.gb-skeleton__img, .gb-skeleton__line, .gb-skel-text, .gb-loading-block {
  background: linear-gradient(100deg, #ece6da 20%, #f7f2e8 40%, #ece6da 60%) 0 0 / 300% 100%;
  animation: gb-shimmer 1.4s ease-in-out infinite;
}
.gb-skel-text { display: inline-block; height: .8em; border-radius: 2px; vertical-align: middle; }
.gb-skel-text.w60 { width: min(520px, 70%); } .gb-skel-text.w30 { width: min(240px, 50%); height: 14px; }
@keyframes gb-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.gb-img-missing { background: #ece6da; min-height: 100%; }

/* ---------- empty state: "No property found" ---------- */
.gb-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: clamp(40px, 6vw, 72px) 22px; border: 1px solid rgba(167, 122, 50, .28); background: linear-gradient(180deg, #fbf8f1, #f6f1e6); }
.gb-empty__mark { width: 44px; height: 44px; border: 1px solid var(--gold, #a77a32); transform: rotate(45deg); position: relative; margin-bottom: 8px; }
.gb-empty__mark::after { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(167, 122, 50, .5); }
.gb-empty__title { margin: 0; font: 400 clamp(26px, 3.2vw, 38px)/1.15 "Playfair Display", Georgia, serif; letter-spacing: -.02em; color: var(--ink, #171715); }
.gb-empty__note { max-width: 520px; margin: 0; color: var(--muted, #716c63); font-size: 13px; line-height: 1.8; }
.gb-empty__btn { margin-top: 10px; }
.gb-empty .gb-btn:not([class*="page"]) { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 26px; border: 1px solid var(--gold, #a77a32); background: var(--gold, #a77a32); color: #211d17; font: 700 10px/1.5 "DM Sans", Arial, sans-serif; letter-spacing: .09em; text-decoration: none; transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s ease; }
.gb-empty .gb-btn:hover { transform: translateY(-2px); background: var(--ink, #171715); border-color: var(--ink, #171715); color: #fff; }
.rent-listing-grid.is-empty, .buy-property-grid.is-empty { display: block; }

/* ---------- featured badge (existing gold language) ---------- */
.gb-featured-badge { position: absolute; top: 14px; right: 14px; z-index: 2; padding: 6px 10px; background: #171715; color: #e5c78e; border: 1px solid rgba(214, 178, 112, .7); font: 700 9px/1.2 "DM Sans", Arial, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.gb-featured-inline { position: static; display: inline-block; margin-left: 8px; vertical-align: middle; }
.rent-property-photo, .buy-property-image, .sle-card-image { position: relative; }
.gb-ppsf { font-size: .82em; color: var(--muted, #716c63); font-weight: 400; white-space: nowrap; }

/* ---------- Buy page: published sale listings ---------- */
.buy-available { margin-top: clamp(56px, 7vw, 92px); padding-top: clamp(40px, 5vw, 64px); border-top: 1px solid rgba(32, 29, 24, .12); }
.buy-sale-filter-bar { align-items: center; flex-wrap: wrap; }
.gb-results-count { margin-left: auto; color: var(--muted, #716c63); font-size: 12px; }
.buy-dynamic-grid { margin-top: 26px; }
.buy-dynamic-card .buy-property-image img { aspect-ratio: auto; }

/* ---------- request forms (same look as the Sell page form) ---------- */
.gb-enq { padding: clamp(64px, 8vw, 100px) var(--pad, clamp(24px, 5vw, 78px)); background: #eeece5; }
.gb-enq__layout { width: min(1240px, 100%); margin: 0 auto; display: grid; grid-template-columns: .8fr 1.2fr; align-items: start; gap: clamp(36px, 6vw, 80px); }
.gb-enq__copy { min-width: 0; }
.gb-enq__copy h2 { margin: 0 0 21px; font-size: clamp(38px, 5vw, 65px); line-height: 1.06; }
.gb-enq__copy h2 em { display: block; }
.gb-enq__copy > p:not(.section-kicker) { margin: 0 0 25px; color: var(--muted, #716c63); font-size: 13px; line-height: 1.95; }
.gb-enq__contact { display: grid; justify-items: start; gap: 14px; margin-top: 30px; }
.gb-enq__contact a { color: var(--ink, #171715); font-size: 12px; text-decoration: none; overflow-wrap: anywhere; transition: color .2s ease; }
.gb-enq__contact a:hover { color: var(--gold, #a77a32); }
.gb-enq__form { min-width: 0; padding: clamp(22px, 4vw, 42px); background: var(--paper, #f5f1e9); position: relative; }
.gb-enq__heading { margin-bottom: 28px; }
.gb-enq__heading > span { display: block; margin-bottom: 8px; color: var(--ink, #171715); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.gb-enq__heading p { margin: 0; color: var(--muted, #716c63); font-size: 11px; }
.gb-enq__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 21px 18px; }
.gb-enq__field { display: grid; align-content: start; gap: 9px; min-width: 0; }
.gb-enq__field--full { grid-column: 1 / -1; }
.gb-enq__field > span { color: var(--ink, #171715); font-size: 11px; font-weight: 600; }
.gb-enq__field input, .gb-enq__field select, .gb-enq__field textarea {
  display: block; width: 100%; min-width: 0; min-height: 45px; padding: 12px 13px; border: 1px solid #dcd6ca; border-radius: 0; outline: none;
  background-color: #fffdf8; color: var(--ink, #171715); font: 400 12px/1.6 "DM Sans", sans-serif; transition: border-color .2s ease, box-shadow .2s ease; appearance: auto;
}
.gb-enq__field input:focus, .gb-enq__field select:focus, .gb-enq__field textarea:focus { border-color: var(--gold, #a77a32); box-shadow: 0 0 0 3px rgba(167, 122, 50, .1); }
.gb-enq__field textarea { min-height: 115px; resize: vertical; }
.gb-enq__consent { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start; margin: 25px 0; color: var(--muted, #716c63); font-size: 11px; line-height: 1.85; }
.gb-enq__consent input { width: 14px; height: 14px; margin-top: 4px; accent-color: var(--gold, #a77a32); }
.gb-enq__consent a { color: var(--ink, #171715); text-decoration: underline; text-decoration-color: var(--gold, #a77a32); text-underline-offset: 3px; }
.gb-enq .gb-btn.gb-enq__submit { width: 100%; min-height: 49px; font-family: "DM Sans", sans-serif; cursor: pointer; }
@media (max-width: 900px) {
  .gb-enq__layout { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 600px) {
  .gb-enq__form { padding: 24px 18px; }
  .gb-enq__grid { grid-template-columns: 1fr; gap: 16px; }
  .gb-enq__field--full { grid-column: auto; }
  .gb-enq__copy h2 { font-size: clamp(34px, 9vw, 48px); }
}

/* ---------- property detail additions ---------- */
.gb-prewrap { white-space: pre-line; }
.rental-detail-price small { font: 400 14px "DM Sans", Arial, sans-serif; color: var(--rd-muted, #74746d); }
.gb-map { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--rd-line, #e7e3db); background: #ece6da; }
.gb-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; filter: saturate(.85) sepia(.06); }
.gb-map-link { display: inline-block; margin-top: 12px; color: var(--rd-ink, #242720); font-size: 12px; text-decoration: underline; text-decoration-color: var(--rd-gold, #b69252); text-underline-offset: 3px; }
.gb-detail-missing { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 10px; }
.gb-detail-missing .rental-enquiry-button { width: auto; padding-left: 24px; padding-right: 24px; }
.rental-enquiry-button.gb-outline { background: transparent; color: var(--rd-ink, #242720); border: 1px solid var(--rd-ink, #242720); }
.gb-detail-form { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--rd-line, #e7e3db); display: grid; gap: 12px; }
.gb-detail-form__title { margin: 0; font: 400 22px/1.2 "Playfair Display", Georgia, serif; color: var(--rd-ink, #242720); }
.gb-detail-form__property { margin: -4px 0 4px; color: var(--rd-gold, #b69252); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.gb-detail-field { display: grid; gap: 6px; min-width: 0; }
.gb-detail-field > span { font-size: 11px; font-weight: 600; color: var(--rd-ink, #242720); }
.gb-detail-field input, .gb-detail-field textarea { width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px; border: 1px solid #dcd6ca; border-radius: 0; outline: none; background-color: #fffdf8; color: #242720; font: 400 13px/1.5 "DM Sans", Arial, sans-serif; }
.gb-detail-field input:focus, .gb-detail-field textarea:focus { border-color: var(--rd-gold, #b69252); box-shadow: 0 0 0 3px rgba(182, 146, 82, .12); }
.gb-detail-field textarea { resize: vertical; min-height: 84px; }
.gb-detail-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gb-detail-row2:has(> :only-child) { grid-template-columns: 1fr; }
.gb-detail-submit { width: 100%; border: 0; cursor: pointer; font-family: "DM Sans", Arial, sans-serif; }
.rental-gallery-thumbnails { scrollbar-width: thin; }
@media (max-width: 700px) {
  .rental-gallery-thumbnails { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; }
  .rental-gallery-thumb { flex: 0 0 82px; height: 64px !important; scroll-snap-align: start; }
}
@media (max-width: 380px) { .gb-detail-row2 { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .gb-map { aspect-ratio: 4 / 3; } }

/* ---------- contact page: secondary WhatsApp button ---------- */
.contact-page .contact-form .gb-contact-wa { margin-top: 10px; border: 1px solid rgba(32, 29, 24, .18); }

/* ==========================================================
   PREMIUM POLISH (transforms + opacity only; all of it is
   switched off for people who prefer reduced motion)
========================================================== */
.gb-scroll-progress { position: fixed; z-index: 100000; left: 0; top: 0; width: 100%; height: 2px; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #8a6324, #d6b270, #a77a32); pointer-events: none; }

/* header: hairline gold accent */
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(167, 122, 50, .55) 30%, rgba(214, 178, 112, .9) 50%, rgba(167, 122, 50, .55) 70%, transparent); pointer-events: none; }
.site-footer { position: relative; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(214, 178, 112, .8), transparent); pointer-events: none; }

/* gold shimmer sweep on gold buttons */
.gb-btn, .header-enquire, .rental-enquiry-button, .sle-button:not(.sle-button-light) { position: relative; overflow: hidden; isolation: isolate; }
.gb-btn::after, .header-enquire::after, .rental-enquiry-button::after, .sle-button:not(.sle-button-light)::after {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: -60%; width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .42), transparent);
  transform: translateX(0) skewX(-18deg); opacity: 0; pointer-events: none;
}
@media (hover: hover) {
  .gb-btn:hover::after, .header-enquire:hover::after, .rental-enquiry-button:hover::after, .sle-button:not(.sle-button-light):hover::after { animation: gb-sweep .9s ease forwards; }
}
@keyframes gb-sweep { 0% { opacity: 0; transform: translateX(0) skewX(-18deg); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateX(420%) skewX(-18deg); } }

/* cards: refined lift and soft depth. The photo zoom inside each card is the
   site's ORIGINAL hover/tap zoom (buy-property.css, rent-property.css,
   sell-property.css); nothing here overrides it. */
.buy-property-card, .rent-property-card, .sle-card, .rental-related-card {
  transition: transform .5s cubic-bezier(.2, .72, .2, 1), box-shadow .5s cubic-bezier(.2, .72, .2, 1), border-color .3s ease;
}
.rental-related-card { overflow: hidden; }
.rental-related-card img { transition: transform 1s cubic-bezier(.2, .65, .3, 1); }
.rental-related-card:hover img { transform: scale(1.035); }
@media (hover: hover) {
  .buy-property-card:hover, .rent-property-card:hover, .sle-card:hover, .rental-related-card:hover { transform: translateY(-6px); box-shadow: 0 22px 46px -22px rgba(60, 44, 18, .38); }
}

/* listings rendered by JS (rent / buy / sell / related): the same scroll reveal
   as the page's own *-reveal sections. Uses the separate `translate` property so
   it never fights the card's hover lift or the photo zoom (both use transform). */
.gb-card-in.gb-card-in {
  opacity: 0; translate: 0 24px;
  transition: opacity .75s ease var(--gb-reveal-delay, 0ms), translate .8s cubic-bezier(.2, .65, .3, 1) var(--gb-reveal-delay, 0ms),
    transform .5s cubic-bezier(.2, .72, .2, 1), box-shadow .5s cubic-bezier(.2, .72, .2, 1), border-color .3s ease;
}
.gb-card-in.gb-card-in.is-visible { opacity: 1; translate: 0 0; }

/* property detail gallery: each photo eases in, and the photo zooms on hover / tap
   like the site's other photo frames */
.rental-gallery-main { overflow: hidden; }
.rental-gallery-main > img { transition: transform 1s cubic-bezier(.2, .65, .3, 1); }
.rental-gallery-main:hover > img { transform: scale(1.035); }
.rental-gallery-main > img.gb-photo-in { animation: gb-photo-in .9s cubic-bezier(.2, .65, .3, 1) backwards; }
@keyframes gb-photo-in { from { opacity: .35; scale: 1.05; } to { opacity: 1; scale: 1; } }

/* hero imagery: soft parallax depth (JS sets --gb-par). Uses the separate
   `translate` property so the hero keeps its ORIGINAL entrance animation and
   its original hover / tap zoom (those use transform). */
.gb-parallax { translate: 0 var(--gb-par, 0px); }

/* reveal: smoother easing + stagger (uses motion.js's --gb-reveal-delay) */
.motion-ready .reveal, .motion-ready [class$="-reveal"], .motion-ready [class*="-reveal "], .gb-reveal {
  transition-delay: var(--gb-reveal-delay, 0ms);
}
.gb-reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s cubic-bezier(.2, .72, .2, 1), transform 1s cubic-bezier(.2, .72, .2, 1); transition-delay: var(--gb-reveal-delay, 0ms); }
.gb-reveal.is-visible { opacity: 1; transform: none; }

/* elegant kicker accent: a short gold rule that draws in */
.gb-enq .section-kicker::before, .buy-available .section-kicker::before {
  content: ""; display: inline-block; width: 26px; height: 1px; margin-right: 12px; vertical-align: middle; background: currentColor; transform-origin: 0 50%;
}

/* TV / very large screens: keep content from stretching */
@media (min-width: 2200px) {
  body { font-size: 16px; }
  .gb-enq__layout { width: min(1480px, 100%); }
}

/* Reduced motion (phone battery saver / "Remove animations" / iOS Reduce Motion).
   The client wants motion on phones, so js/motion.js switches off the old
   "kill all motion" rules and THIS block is the gentle version: fades, slow
   zooms and scroll reveals keep running; only parallax and big movement go. */
@media (prefers-reduced-motion: reduce) {
  .gb-parallax { translate: none !important; }
  .buy-property-card:hover, .rent-property-card:hover, .sle-card:hover, .rental-related-card:hover { transform: none; }
  .gb-reveal { transform: translateY(12px); }
  .gb-reveal.is-visible { transform: none; }
}

/* Touch phones: frame that clips a photo's slow Ken Burns zoom (js/gb-premium.js
   adds it only around photos that sit inside a bigger card). */
.gb-kb-frame { display: block; overflow: hidden; }
.gb-kb-frame > img { display: block; }
