/* ============================
   Fusion Townhouse — styles
   ============================ */

:root {
  --ink:        #1a1a1a;
  --ink-soft:   #3a3a3a;
  --paper:      #faf7f2;
  --cream:      #f3ede2;
  --line:       #d9d2c5;
  --teak:       #6b4423;
  --teak-warm:  #8a5a32;
  --sea:        #2d5f6e;
  --sea-deep:   #1a3a45;
  --accent:     #b87a4a;
  --shadow:     0 10px 40px -10px rgba(0,0,0,.18);
  --serif:      "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:       "Inter", "Sarabun", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --thai:       "Sarabun", "Inter", -apple-system, sans-serif;
}

html[lang="th"] body { font-family: var(--thai); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: 760px; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
}
.brand {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.nav { display: flex; gap: 28px; }
.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
}
.nav a:hover { color: var(--ink); }
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width .2s ease;
}
.nav a:hover::after { width: 100%; }

.lang-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.lang-btn {
  background: transparent;
  border: 0;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}
.lang-btn.active {
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 760px) {
  .nav { display: none; }
  .header-inner { padding: 14px 18px; }
  .brand { font-size: 18px; }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: -2;
  transform: scale(1.02);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.25) 50%, rgba(0,0,0,.65) 100%);
  z-index: -1;
}
.hero-content {
  max-width: 900px;
  padding: 48px 32px 120px;
  color: #fff;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 18px;
  opacity: 0.92;
  font-weight: 500;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5.5vw, 64px);
  line-height: 1.08;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.hero-sub {
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 300;
  margin: 0 0 32px;
  max-width: 620px;
  opacity: 0.94;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-price {
  position: absolute;
  right: 32px;
  bottom: 32px;
  background: rgba(255,255,255,0.96);
  color: var(--ink);
  padding: 18px 24px;
  border-radius: 4px;
  text-align: right;
  box-shadow: var(--shadow);
  z-index: 1;
}
.price-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.price-value {
  display: block;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
}
.price-tag {
  display: block;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

@media (max-width: 600px) {
  .hero { min-height: 88vh; }
  .hero-content { padding: 40px 22px 180px; }
  .hero-price {
    right: 22px; bottom: 22px;
    padding: 14px 18px;
  }
  .price-value { font-size: 24px; }
}

/* ===== VIEW STRIP (under hero) ===== */
.viewstrip {
  position: relative;
  height: 38vh;
  min-height: 280px;
  max-height: 420px;
  overflow: hidden;
  background: var(--ink);
}
.viewstrip-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 60%;
}
.viewstrip-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.55) 100%);
}
.viewstrip-caption {
  position: absolute;
  left: 32px;
  bottom: 24px;
  right: 32px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}
.viewstrip-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.viewstrip-text {
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.25;
  max-width: 760px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 14px 26px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 2px;
  transition: all .2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #a16937; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

/* ===== SECTIONS ===== */
.section {
  padding: 96px 0;
}
.section-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  font-weight: 600;
}
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  margin: 0 0 36px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.prose p {
  font-size: 18px;
  line-height: 1.7;
  margin: 0 0 22px;
  color: var(--ink-soft);
}
html[lang="th"] .prose p { font-size: 17px; }

@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .prose p { font-size: 16px; }
}

/* ===== STORY ===== */
.story { background: var(--paper); }

/* ===== SPECS ===== */
.specs { background: var(--cream); }
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 56px;
}
.spec {
  background: var(--paper);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.spec-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.spec-value {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
}
.spec-value small {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-soft);
  margin-left: 2px;
}

.features-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 16px;
}
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px 28px;
}
.feature-list li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 10px; height: 1px;
  background: var(--accent);
}

/* ===== GALLERY ===== */
.gallery-section { background: var(--paper); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 6px;
  margin-top: 12px;
}
.gal-item {
  margin: 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--cream);
}
.gal-item.gal-tall { grid-row: span 2; aspect-ratio: 4 / 6; }
.gal-item.gal-wide { grid-column: span 2; aspect-ratio: 8 / 3; }
.gal-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.gal-item:hover img { transform: scale(1.04); }

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gal-item.gal-wide { grid-column: span 2; aspect-ratio: 8 / 3; }
  .gal-item.gal-tall { grid-row: auto; aspect-ratio: 4 / 3; }
}
@media (max-width: 520px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gal-item.gal-wide,
  .gal-item.gal-tall { grid-column: auto; grid-row: auto; aspect-ratio: 4 / 3; }
}

/* ===== BEFORE & AFTER ===== */
.beforeafter { background: var(--paper); }
.ba-intro {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 48px;
}
.ba-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
.ba-item {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: var(--cream);
}
.ba-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.ba-item figcaption {
  padding: 14px 18px;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ba-tag {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}
.ba-tag-after { color: var(--accent); }
.ba-cap {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
  line-height: 1.3;
}
@media (max-width: 700px) {
  .ba-pair { grid-template-columns: 1fr; gap: 12px; margin-bottom: 24px; }
}

/* ===== HOW IT LIVES INTRO ===== */
.livedin .section-title { margin-bottom: 18px; }
.livedin-intro {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 28px;
  max-width: 760px;
}

/* ===== NEIGHBORHOOD ===== */
.neighborhood { background: var(--cream); }
.neighborhood-intro {
  font-size: 18px;
  line-height: 1.7;
  margin: 0 0 40px;
  color: var(--ink-soft);
  max-width: 820px;
}
.walk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}
.walk-item {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.walk-time {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
}
.walk-name {
  font-size: 14px;
  color: var(--ink-soft);
}
.map-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--paper);
}
.map-wrap iframe { width: 100%; height: 100%; border: 0; }

/* ===== CONTACT ===== */
.contact { background: var(--ink); color: var(--paper); }
.contact .section-title { color: var(--paper); }
.contact .section-eyebrow { color: var(--accent); }
.contact-intro {
  font-size: 17px;
  line-height: 1.7;
  margin: 0 0 18px;
  color: rgba(250, 247, 242, 0.85);
}
.contact-agents {
  margin: 0 0 36px;
  padding: 14px 18px;
  background: rgba(184, 122, 74, 0.12);
  border-left: 2px solid var(--accent);
  font-size: 15px;
  color: rgba(250, 247, 242, 0.85);
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.contact-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all .2s ease;
}
.contact-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.contact-icon {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.contact-value {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--paper);
  word-break: break-word;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--sea-deep);
  color: rgba(250, 247, 242, 0.7);
  padding: 32px 0;
  text-align: center;
}
.foot-line {
  font-size: 14px;
  margin: 0 0 6px;
  color: rgba(250, 247, 242, 0.85);
}
.foot-fine {
  font-size: 12px;
  margin: 0;
  opacity: 0.7;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lb-img {
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
}
.lb-caption {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  margin: 0;
  text-align: center;
  max-width: 90%;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  cursor: pointer;
  font-size: 28px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: all .15s ease;
}
.lb-close { top: 24px; right: 24px; }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.6);
}

@media (max-width: 600px) {
  .lightbox { padding: 16px; }
  .lb-close { top: 12px; right: 12px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
