:root {
  --bg: #faf8f5;
  --ink: #2a2723;
  --muted: #6b6459;
  --accent: #1f4e5f;
  --card: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.hero {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 48px 16px 40px;
}
.eyebrow { text-transform: uppercase; letter-spacing: .15em; font-size: .8rem; margin: 0; opacity: .8; }
.hero h1 { margin: 8px 0 0; font-size: clamp(1.6rem, 5vw, 2.4rem); }
.city { margin: 0; opacity: .85; }
.price { font-size: 1.8rem; font-weight: 700; margin: 16px 0; }

.facts {
  list-style: none; padding: 0; margin: 0 0 24px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px;
}
.facts strong { font-size: 1.2rem; }

button, .viewer-actions a {
  font: inherit; cursor: pointer;
  border: 0; border-radius: 999px;
  padding: 10px 20px;
  background: var(--card); color: var(--accent);
  text-decoration: none; font-weight: 600;
}

main { max-width: 900px; margin: 0 auto; padding: 0 16px 48px; }
section { margin-top: 40px; }
h2 { color: var(--accent); border-bottom: 2px solid #e4ded5; padding-bottom: 6px; }
.hint { color: var(--muted); font-size: .9rem; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.gallery figure { margin: 0; cursor: pointer; }
.gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 8px; display: block;
}
.gallery figcaption { font-size: .85rem; color: var(--muted); padding-top: 4px; }

.contact a { color: var(--accent); font-weight: 600; }

dialog {
  border: 0; padding: 0; background: #000;
  max-width: 100vw; max-height: 100vh; width: 100%; height: 100%;
}
dialog::backdrop { background: #000; }
dialog img { width: 100%; height: calc(100% - 72px); object-fit: contain; display: block; }
.viewer-actions {
  display: flex; justify-content: center; gap: 12px;
  padding: 14px 16px;
}

.hero {
  background:
    linear-gradient(rgba(10, 30, 40, .55), rgba(10, 30, 40, .75)),
    url("img/full/extra-3.jpg") center / cover;
  padding: 96px 16px 56px;
}

/* Viewer: image fills the space above the counter + buttons */
dialog[open] { display: flex; flex-direction: column; }
.viewer-stage { position: relative; flex: 1; min-height: 0; }
dialog .viewer-stage img { width: 100%; height: 100%; object-fit: contain; touch-action: none; user-select: none; }
.viewer-count { color: #ddd; text-align: center; margin: 8px 0 0; font-size: .9rem; }
.nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .8); font-size: 1.8rem; line-height: 1;
}
.nav.prev { left: 12px; }
.nav.next { right: 12px; }

/* Category filter chips: scroll sideways on narrow phones */
.filters {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px;
  scrollbar-width: none;
}
.filters button {
  flex: none; padding: 8px 14px; font-size: .9rem;
  border: 1px solid #d6cfc4; background: var(--card); color: var(--ink); font-weight: 500;
}
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Always-visible close button, top right of the photo viewer */
.viewer-x {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 2;
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .85); font-size: 1.3rem; line-height: 1;
}
.viewer-actions { gap: 8px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.viewer-actions > * { white-space: nowrap; padding: 10px 16px; }

[hidden] { display: none !important; }

/* Room highlights: two columns on phones, three on wider screens */
.rooms {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
}
.rooms li {
  background: var(--card); border: 1px solid #e4ded5; border-radius: 8px;
  padding: 12px 14px;
}
.rooms strong { color: var(--accent); font-size: 1.1rem; }

/* Stop phones treating quick repeated taps (arrows, swipes, thumbnails) as
   double-tap-to-zoom. Pinch-zoom still works on the page itself. */
html { touch-action: manipulation; }
/* Inside the viewer our own swipe handling owns every gesture, so the page
   can never get zoomed and stuck off-centre behind it. */
dialog, dialog * { touch-action: none; }

.description { margin-bottom: 20px; }
.description .lede { font-size: 1.15rem; font-weight: 600; color: var(--accent); }

.map-link { margin: 6px 0 0; }
.map-link a { color: #fff; opacity: .9; font-size: .95rem; text-underline-offset: 3px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
a.share-btn {
  font-weight: 600; text-decoration: none; border-radius: 999px; padding: 10px 20px;
  background: var(--card); color: var(--accent); display: inline-block;
}

.golf-links { display: flex; flex-wrap: wrap; gap: 10px; }
.link-btn {
  display: inline-block; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent); font-weight: 600; text-decoration: none;
}

#golf-gallery { margin: 16px 0 8px; }
.credit { font-size: .85rem; color: var(--muted); }
.credit a { color: var(--muted); }

/* Nearby golf list */
.course-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.course-list li {
  background: var(--card); border: 1px solid #e4ded5; border-radius: 8px; padding: 10px 14px;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline;
}
.course-list a { color: var(--accent); font-weight: 600; text-decoration: none; }
.course-list .tag { font-size: .75rem; color: var(--muted); border: 1px solid #d6cfc4; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.course-list .dist { grid-column: 1 / -1; font-size: .88rem; color: var(--muted); }

/* Golf shortcut in the header: stands out from the white buttons */
a.share-btn.golf-btn { background: #2f7d3b; color: #fff; }
html { scroll-behavior: smooth; }
#golf-nearby { scroll-margin-top: 16px; }

.price .offered { display: block; font-size: .9rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.feature-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 32px; }
.features h3 { color: var(--accent); margin: 8px 0 4px; font-size: 1.05rem; }
.features ul { margin: 0; padding-left: 20px; }
.features li { margin: 4px 0; }

/* Schools */
.school-stats { margin: 12px 0 18px; }
.school-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.school-card { background: var(--card); border: 1px solid #e4ded5; border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 16px; }
.school-card .level { margin: 0; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.school-card h3 { margin: 2px 0 6px; color: var(--accent); font-size: 1.05rem; }
.school-card ul { margin: 0; padding-left: 18px; }
.school-card li { margin: 4px 0; }
.schools .lede { font-size: 1.05rem; }
a.share-btn.school-btn { background: #7a2e2e; color: #fff; }
#schools { scroll-margin-top: 16px; }

/* Language switch (top-right of header) and Chinese-device banner */
.hero { position: relative; }
/* Fixed so it's reachable from anywhere on the page */
.lang-switch {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 50;
  color: var(--accent); background: rgba(255,255,255,.95); text-decoration: none; font-weight: 700;
  border: 1px solid #d6cfc4; border-radius: 999px; padding: 8px 14px; font-size: .95rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.lang-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
  background: #fff7e0; color: var(--ink); padding: 10px 16px; border-bottom: 1px solid #e8d9a8; font-size: 1rem;
}
.lang-banner a, .lang-banner button {
  font: inherit; font-weight: 600; border-radius: 999px; padding: 6px 14px; cursor: pointer; text-decoration: none;
}
.lang-banner .lang-yes { background: var(--accent); color: #fff; }
.lang-banner .lang-no { background: transparent; border: 1px solid #c9bb8d; color: var(--ink); }
:lang(zh) body, html[lang^="zh"] body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
/* While the Chinese-offer banner is showing, it *is* the language switch */
body:has(.lang-banner) .lang-switch { display: none; }
