/* Connect Hong Kong — static rebuild.
   Layout values (sizes, colours, spacing) are taken from the original WordPress theme. */

:root {
  --blue: #1b4380;
  --grey: #929397;
  --text: #59595b;
  --muted: #939598;
  --rule: #4b6999;
  --blue-dark: #143564;
  --bar-h: 84px;
  --header-gap: 13px; /* keeps the first banner where the original put it (its header was 97px tall) */
  --container: 1320px;
  color-scheme: light;
  accent-color: var(--blue); /* checkboxes, radios, etc. pick up the brand blue */
}

::selection { background: rgba(27, 67, 128, .2); }

*,
*::before,
*::after { box-sizing: border-box; }

/* scrollbar-gutter keeps the page the same width whether or not it scrolls, so short pages don't shift sideways */
html {
  -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable;
  scroll-padding-top: calc(var(--bar-h) + 16px); /* anchors and focus don't land under the sticky header */
}

body {
  display: flex; flex-direction: column; min-height: 100vh;
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 400 18px/26px 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue); }
strong { font-weight: 600; }
p { margin: 0 0 1.5em; }
ul { margin: 0; padding: 0; list-style: none; }

/* Avoid one-word last lines and ragged short headings. Browsers that don't support these just ignore them. */
h1, .banner_txt, .footer-quote, .contact-intro { text-wrap: balance; }
.entry-content p, .sidebar_top_text p, .name_txt p { text-wrap: pretty; }

/* Soft cross-fade between pages. The header keeps its own layer so it stays put while the content fades. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: .18s; }
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: #fff; color: var(--blue); padding: 10px 16px; border-radius: 0 0 4px 4px;
  font-size: 16px; transition: top .15s;
}
.skip-link:focus { top: 0; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.site-header :focus-visible { outline-color: #fff; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 15px; }

/* ---------------------------------------------------------------- Header */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--grey);
  transition: box-shadow .25s;
}
.site-header.is-stuck { box-shadow: 0 3px 8px rgba(0, 0, 0, .22); }

.header-inner { display: flex; align-items: stretch; height: var(--bar-h); }

/* The logo sits in a white block that fills the full height of the grey bar. */
.logo {
  flex: none; width: 214px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.logo img { width: 182px; height: auto; }

.nav { flex: 1 1 auto; display: flex; align-items: center; margin-left: 32px; }
.nav ul { flex: 1 1 auto; display: flex; align-items: center; }
.nav li { padding: 0 20px; }
.nav li:first-child { padding-left: 0; }
.nav a {
  position: relative; display: block; line-height: var(--bar-h);
  color: #fff; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
/* Current page and hover: white underline under the text that draws in from the left
   (blue-on-grey was only ~3:1 contrast). */
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; top: calc(50% + 17px); height: 2px;
  background: #fff;
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .2s ease;
}
.nav a:hover::after,
.nav a:focus-visible::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Contact Us is the one action that matters: a solid button at the right-hand end of the bar. */
.nav li:last-child { margin-left: auto; padding-right: 0; }
.nav a.nav-cta {
  padding: 0 24px; line-height: 44px;
  font-weight: 600;
  color: var(--blue); background: #fff; border-radius: 4px;
  transition: background .15s, color .15s;
}
.nav a.nav-cta::after { display: none; }
.nav a.nav-cta:hover,
.nav a.nav-cta:focus-visible,
.nav a.nav-cta[aria-current="page"] { color: #fff; background: var(--blue); }

.nav-toggle { display: none; }

/* ---------------------------------------------------------------- Banners */

.banner_txt {
  max-width: 500px; margin: 0 auto;
  padding: 39px 15px 30px;
  text-align: center; text-transform: uppercase; letter-spacing: .04em;
  font-size: 32px; line-height: 45px; color: #919395;
}

/* The compass is capped by window height so the top of the diamond row always shows beneath it, hinting there is more
   to scroll to. 470px = header + gap + title (256) + diamond-row padding (60) + the ~150px we want visible.
   The image background is white, so a narrower centred compass blends into the page. */
.banner_home img {
  display: block; width: auto; max-width: 100%; margin: 0 auto;
  max-height: clamp(260px, calc(100vh - 470px), 720px);
}
@supports (height: 100svh) {
  .banner_home img { max-height: clamp(260px, calc(100svh - 470px), 720px); }
}

.banner_all_page { padding: 60px 0 100px; text-align: center; }
.banner_all_page img { display: inline-block; }
.home-page .banner_all_page { padding-bottom: 100px; }

/* ---------------------------------------------------------------- Content */

main { flex: 1 0 auto; padding-top: var(--header-gap); }

.main-contain { padding-bottom: 50px; }

.site-content { display: block; }

.cols { display: flex; margin: 0 -15px; }
.col-main { flex: 0 0 58.3333%; max-width: 58.3333%; padding: 0 15px; }
.col-full { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }
.col-side {
  flex: 0 0 41.6667%; max-width: 41.6667%; padding: 0 15px;
  border-left: 1px solid var(--rule);
}

article { margin-top: -32px; }
.home-page article { margin-top: 0; }

.entry-content { font-size: 24px; line-height: 34px; font-weight: 300; }
.entry-content::before { content: ""; display: table; }
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content strong { font-weight: 600; }

/* Single-column pages: keep line length readable instead of stretching text across the whole container. */
.col-full .entry-content { max-width: 1000px; }

.entry-title {
  margin: -26px 0 6px;
  color: var(--muted); text-transform: uppercase; letter-spacing: .03em;
  font-size: 34px; line-height: 48px; font-weight: 500;
}
.home-page .entry-title { display: none; }

.alignright { float: right; margin: 0 0 1.5em 1.5em; }

/* Testimonials */
.testimonials { padding: 0 90px 0 30px; }
.testimonials li { margin-bottom: 0; }

.sidebar_top_text {
  position: relative;
  font-style: italic; font-weight: 300;
  font-size: 25px; line-height: 30px;
}
.sidebar_top_text::after {
  content: ""; position: absolute; left: 0; top: 0;
  width: 30px; height: 25px;
  background: url('../img/quote-open.svg') no-repeat;
}
.sidebar_top_text p:first-child { text-indent: 35px; }
.sidebar_top_text p { margin-bottom: 37.5px; }
.last_block { white-space: nowrap; }
.sidebar_top_text p:last-child .last_block::after {
  content: ""; display: inline-block;
  width: 36px; height: 25px; margin-left: 9px; vertical-align: -4px;
  background: url('../img/quote-close.svg') no-repeat;
}

.name_txt { display: inline-block; padding-bottom: 10px; font-size: 16px; line-height: 25px; letter-spacing: .03em; }
.name_txt p { margin: 0 0 24px; font-size: 16px; }

/* Services page map strip */
.footer_top { padding-top: 30px; }
.footer_top img { display: block; margin: 0 auto; }

/* Property / For Sale */
.lease-btn { font-weight: 600; }
.lease-btn a { color: #004181; font-weight: 600; }
.lease-btn a:hover { color: #000; text-decoration: underline; text-underline-offset: 4px; }

/* ---------------------------------------------------------------- Contact form */

.contact-intro em { font-style: italic; }

.contact-form { max-width: 860px; margin-top: 34px; }
.contact-form .field { margin-bottom: 20px; }
.contact-form .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

.contact-form label {
  display: block; margin-bottom: 6px;
  font-size: 15px; line-height: 22px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text);
}
.contact-form .opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  display: block; width: 100%;
  padding: 11px 14px;
  font: 400 17px/26px 'Open Sans', system-ui, Arial, sans-serif;
  color: var(--text); background: #fff;
  border: 1px solid #c8cad0; border-radius: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.contact-form input:hover:not(:focus),
.contact-form textarea:hover:not(:focus) { border-color: #a9acb3; }
.contact-form textarea { min-height: 170px; resize: vertical; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27, 67, 128, .18);
}
.contact-form [aria-invalid="true"] { border-color: #b3261e; }

.contact-form button[type="submit"] {
  display: inline-block; min-width: 180px;
  padding: 12px 32px;
  font: 600 16px/26px 'Open Sans', system-ui, Arial, sans-serif;
  text-transform: uppercase; letter-spacing: .06em;
  color: #fff; background: var(--blue);
  border: 0; border-radius: 4px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(20, 53, 100, .25);
  transition: background .15s, box-shadow .15s, transform .1s;
}
.contact-form button[type="submit"]:hover { background: var(--blue-dark); box-shadow: 0 3px 8px rgba(20, 53, 100, .28); }
.contact-form button[type="submit"]:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(20, 53, 100, .25); }
.contact-form button[disabled] { opacity: .65; cursor: progress; }

/* honeypot — kept off-screen rather than display:none so bots still fill it */
.hp { position: absolute !important; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin-top: 20px; padding: 0; font-size: 17px; line-height: 26px; }
.form-status:not(:empty) { padding: 14px 18px; border: 1px solid; border-radius: 4px; }
.form-status.ok { color: #1d5e2f; background: #eaf5ee; border-color: #2e8b4a; }
.form-status.err { color: #8c1d18; background: #fbeceb; border-color: #b3261e; }

.office { margin-top: 44px; font-weight: 300; }
.office strong { font-weight: 600; }

/* ---------------------------------------------------------------- Footer */

.site-footer { background: #fff; }
.footer-top {
  padding: 40px 0 5px;
  background: #f5f6f8;
  border-top: 1px solid var(--rule);
  border-bottom: 16px solid #919395;
}
.footer-grid { display: flex; align-items: flex-start; margin: 0 -15px; }
.footer-grid > div { flex: 0 0 33.3333%; max-width: 33.3333%; padding: 0 15px; }

.footer-menu li { padding: 3px 0; font-size: 14px; line-height: 20px; }
.footer-menu a { font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--text); transition: color .15s; }
.footer-menu a:hover,
.footer-menu a[aria-current="page"] { color: var(--blue); }

.footer-quote { margin: 0; font-size: 22px; line-height: 26px; font-style: italic; font-weight: 300; }
.footer-logo img { width: 218px; height: auto; }

.footer-top .col-quote { margin-top: 20px; }

.footer-legal {
  margin: 28px 0 0; padding: 16px 0 14px;
  border-top: 1px solid rgba(0, 0, 0, .08);
  font-size: 13px; line-height: 20px; color: #66676a;
}

/* ---------------------------------------------------------------- Large tablets / small laptops */

@media (max-width: 1199px) {
  .nav li { padding: 0 14px; }
  .nav a { font-size: 17px; }
  .testimonials { padding: 0 45px 0 30px; }
  .banner_txt { font-size: 28px; line-height: 40px; }
}

/* ---------------------------------------------------------------- Tablets and below: stacked layout, hamburger menu */

@media (max-width: 991px) {
  :root { --bar-h: 64px; --header-gap: 0px; }

  .logo { width: 160px; padding: 0 12px; }
  .logo img { width: 134px; }

  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    align-self: center; margin-left: auto; margin-right: -6px;
    width: 52px; height: 52px;
    background: transparent; border: 0; cursor: pointer;
  }
  .nav-toggle .bar {
    display: block; width: 26px; height: 3px; border-radius: 2px; background: #fff;
    transition: transform .2s, opacity .2s;
  }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(2) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(3) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(4) { transform: translateY(-8px) rotate(-45deg); }

  .nav {
    display: block;
    position: absolute; left: 0; right: 0; top: var(--bar-h);
    margin: 0;
    background: var(--grey);
    box-shadow: 0 8px 14px rgba(0, 0, 0, .18);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  }
  .nav.is-open {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .2s ease, transform .2s ease;
  }

  .nav ul { flex-direction: column; align-items: stretch; padding: 4px 15px 12px; }
  .nav li { padding: 0; border-top: 1px solid rgba(255, 255, 255, .35); }
  .nav li:first-child { border-top: 0; }
  .nav a { line-height: 52px; font-size: 18px; }
  .nav a::after { display: none; }
  .nav a[aria-current="page"] { font-weight: 700; }

  /* in the stacked menu the Contact Us button spans the full width, set apart from the links above it */
  .nav li:last-child { margin-left: 0; border-top: 0; padding-top: 8px; }
  .nav a.nav-cta { padding: 0; line-height: 48px; text-align: center; }

  .banner_txt { padding: 20px 15px 24px; font-size: 26px; line-height: 36px; }
  .banner_all_page,
  .home-page .banner_all_page { padding: 30px 15px 51px; }

  article,
  .home-page article { margin-top: 0; }
  .entry-title { margin: 0 0 12px; font-size: 28px; line-height: 38px; }

  .cols { display: block; }
  .col-main, .col-full, .col-side { max-width: none; }
  .col-side { border-left: 0; margin-top: 20px; padding-top: 30px; border-top: 1px solid var(--rule); }
  .col-side:empty { display: none; }

  .entry-content,
  .sidebar_top_text { font-size: 18px; line-height: 28px; }
  .testimonials { padding: 0; }
  .sidebar_top_text p { margin-bottom: 24px; }
  .name_txt, .name_txt p { font-size: 13px; line-height: 18px; }

  .main-contain { padding-bottom: 20px; }

  .footer-grid { flex-direction: column; }
  .footer-grid > div { flex-basis: auto; max-width: none; width: 100%; }
  .footer-top .col-quote { display: none; }
  .footer-top .col-quote-mobile { display: block; margin: 0 0 20px; }
  .footer-quote { font-size: 18px; line-height: 28px; }
  .footer-logo { margin-top: 20px; }
}

@media (min-width: 992px) {
  .col-quote-mobile { display: none; }
}

/* ---------------------------------------------------------------- Phones */

@media (max-width: 767px) {
  .alignright { float: none; display: block; margin: 0 0 15px; }
  .contact-form .row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 590px) {
  .banner_txt { font-size: 22px; line-height: 32px; }
  .banner_home img { width: 100%; max-height: none; min-height: 160px; object-fit: cover; object-position: 50% 100%; }
  .entry-title { font-size: 26px; }
  .contact-form button[type="submit"] { width: 100%; }
}

/* Gentle fade-up as the testimonials, diamond row and map scroll into view. main.js adds .reveal only to elements that
   start below the fold (and not for reduced-motion visitors), then .in-view once they appear. Without JS nothing is hidden. */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in-view { opacity: 1; transform: none; }
@media print { .reveal { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0s !important; }
}
