@import url("https://fonts.googleapis.com/css2?family=Anuphan:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap");
/* ชุดสีและฟอนต์หลัก */
:root {
  --night: #151d1b;
  --ink: #222b27;
  --muted: #5e655e;
  --gold: #e0be77;
  --green: #243731;
  --paper: #f6f3eb;
  --white: #fffdf6;
  --line: #dad5c8;
  --sans: Anuphan, "Leelawadee UI", Tahoma, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --pad: clamp(24px, 6.25vw, 100px);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #ad7924;
  outline-offset: 4px;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
button:disabled {
  cursor: default;
}
img {
  display: block;
  max-width: 100%;
}
svg {
  width: 23px;
  height: 23px;
  flex: none;
}
.skip {
  position: fixed;
  left: 20px;
  top: 10px;
  z-index: 9;
  transform: translateY(-150%);
  background: white;
  padding: 8px;
}
.skip:focus {
  transform: none;
}
/* ส่วนหัวและเมนู */
.header {
  min-height: 89px;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--night);
  color: var(--white);
  position: relative;
  z-index: 2;
  border-bottom: 1px solid #fff2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  line-height: 1;
}
.brand img {
  width: 37px;
  height: 43px;
  object-fit: contain;
}
.brand strong {
  font: 600 23px/0.9 var(--serif);
  display: block;
  letter-spacing: 0.09em;
}
.brand small {
  display: block;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.24em;
  margin-top: 7px;
}
.top-nav,
.head-actions,
.locale {
  display: flex;
  align-items: center;
  gap: 24px;
}
.top-nav {
  gap: clamp(20px, 3vw, 48px);
}
.top-nav a {
  color: #ebe9e2;
  font-size: 15px;
  white-space: nowrap;
  position: relative;
}
.top-nav a:after {
  content: "";
  position: absolute;
  height: 1px;
  left: 0;
  right: 100%;
  bottom: -5px;
  background: var(--gold);
  transition: right 0.2s;
}
.top-nav a:hover:after,
.top-nav a[aria-current="page"]:after {
  right: 0;
}
.locale {
  gap: 7px;
  color: #e7ddc7;
}
.locale button,
.menu-toggle {
  border: 0;
  color: inherit;
  background: none;
  padding: 8px 3px;
  font-size: 13px;
}
.locale button[aria-pressed="true"] {
  color: var(--gold);
  font-weight: 600;
}
.locale span {
  opacity: 0.4;
}
.menu-toggle {
  display: none;
}
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: 3px;
  background: var(--gold);
  border: 1px solid var(--gold);
  color: #222722;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  transition:
    background 0.2s,
    border-color 0.2s;
  white-space: normal;
}
.button:hover {
  background: #efd39b;
  border-color: #efd39b;
}
.button.outline {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}
.button.outline:hover {
  background: #8882;
}
.button svg {
  width: 19px;
  height: 19px;
}
/* หน้าแรกและภาพ Hero */
.home {
  background: var(--night);
  color: var(--white);
}
.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(530px, calc(100svh - 274px), 850px);
  display: flex;
  align-items: center;
  padding: 62px var(--pad) 98px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 74% 22%, #6b6651, transparent 62%),
    linear-gradient(120deg, #14211e, #3f5043);
}
.hero-image,
.hero:after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero-image {
  object-fit: cover;
  object-position: center 52%;
}
.hero:after {
  content: "";
  background:
    linear-gradient(
      90deg,
      rgba(13, 22, 20, 0.91),
      rgba(15, 24, 21, 0.74) 27%,
      rgba(14, 20, 18, 0.29) 58%,
      rgba(14, 20, 18, 0.03) 100%
    ),
    linear-gradient(0deg, #151d1bcc, transparent 32%);
}
.hero-copy {
  position: relative;
  max-width: 660px;
}
.eyebrow {
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0.23em;
  text-transform: uppercase;
  font-weight: 600;
  color: #78561f;
}
.hero .eyebrow,
.home .eyebrow {
  color: var(--gold);
}
.hero .eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
}
.hero .eyebrow:before {
  content: "";
  width: 31px;
  height: 1px;
  background: currentColor;
}
.hero h1 {
  font: 500 clamp(68px, 8.35vw, 132px)/0.78 var(--serif);
  letter-spacing: -0.048em;
  margin: 33px 0 28px;
}
.hero h1 em {
  display: block;
  color: #f3dfb2;
  font-weight: 400;
  margin-top: 14px;
}
.hero .intro {
  font-size: clamp(17px, 1.7vw, 23px);
  font-weight: 500;
  color: #fff9ec;
}
.hero .facts {
  font-size: 15px;
  color: #eee7db;
  margin: 8px 0 29px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.photo-credit {
  position: absolute;
  right: var(--pad);
  bottom: 36px;
  font-size: 12px;
  letter-spacing: 0.09em;
  color: #fff;
  background: #131b18b5;
  padding: 5px 11px;
  border-radius: 2px;
}
.photo-credit:hover {
  text-decoration: underline;
}
.quick {
  margin: 0 var(--pad);
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid #eee6cc33;
  border-radius: 5px;
  background: #202d28;
}
.quick a {
  min-height: 109px;
  padding: 16px 7px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 8px;
  border-inline-end: 1px solid #eee6cc22;
  font-size: 14px;
  transition: background 0.2s;
}
.quick a:last-child {
  border: 0;
}
.quick a:hover,
.quick a.plan-link {
  background: #35443b;
}
.quick a.plan-link:hover {
  background: #435348;
}
.quick svg {
  color: var(--gold);
  width: 25px;
  height: 25px;
}
.home-note {
  margin: 0 var(--pad);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #ddd5c4;
  font-size: 13px;
}
.home-note a:hover {
  text-decoration: underline;
}
.concierge {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  box-shadow: 0 8px 28px #1117;
  border-radius: 99px;
  padding: 12px 18px;
}
.home-note .prototype {
  padding-right: 170px;
}
/* หน้ารวมบ้านและหน้ารายละเอียด */
.page {
  max-width: 1440px;
  margin: auto;
  padding: 56px var(--pad) 80px;
  min-height: calc(100svh - 213px);
}
.page h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 500;
  line-height: 1.15;
  margin: 10px 0 13px;
}
.page h1.latin {
  font: 500 clamp(43px, 7vw, 90px)/0.9 var(--serif);
  margin: 12px 0 20px;
  letter-spacing: -0.02em;
}
.page h2 {
  font-weight: 500;
  font-size: 25px;
  margin: 0 0 12px;
}
.lead {
  color: var(--muted);
  max-width: 72ch;
}
.back {
  display: inline-block;
  margin-bottom: 18px;
  color: #55675d;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.note {
  background: #ece7d9;
  color: #51401d;
  border-left: 3px solid #ad7931;
  padding: 10px 14px;
  font-size: 14px;
  margin: 16px 0;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  margin: 27px 0 24px;
}
.filters label,
.field {
  display: grid;
  gap: 6px;
  font-size: 14px;
}
.field input,
.filters input,
.filters select,
select {
  min-height: 45px;
  border: 1px solid #b1ac9f;
  background: #fffcf6;
  border-radius: 3px;
  padding: 8px 12px;
  color: var(--ink);
  max-width: 100%;
}
.filters input[type="search"] {
  width: min(300px, 74vw);
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.card {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-body {
  display: grid;
  gap: 9px;
  padding: 17px 20px 20px;
}
.card h2,
.card h3 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
}
.card .meta {
  color: var(--muted);
  font-size: 14px;
}
.card .button {
  justify-self: start;
  margin-top: 3px;
  min-height: 39px;
  padding: 7px 12px;
  font-size: 14px;
}
.photo {
  position: relative;
  background: linear-gradient(130deg, #31463d, #1b2723);
  display: grid;
  place-items: center;
  color: #e9d5a6;
  overflow: hidden;
  aspect-ratio: 16/10;
}
.photo img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo span {
  padding: 18px;
  text-align: center;
  font-size: 14px;
}
.photo span svg {
  display: block;
  margin: 0 auto 8px;
}
.photo img.is-missing {
  display: none;
}
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 28px;
  margin: 26px 0 34px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px;
  background: #fffdf7;
}
.panel .button {
  margin-top: 14px;
}
.detail .photo {
  height: 100%;
  min-height: 300px;
}
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
.metrics div {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.metrics strong {
  display: block;
  font-size: 22px;
  font-weight: 500;
}
.section {
  margin-top: 33px;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 2px;
  background: #fffdf7;
  font-size: 14px;
}
.rooms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.rooms div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.gallery-grid button {
  padding: 0;
  border: 0;
  background: none;
  text-align: inherit;
}
.gallery-grid .photo {
  width: 100%;
}
.foot {
  background: var(--night);
  color: #e7dfd1;
  padding: 25px var(--pad) 33px;
  display: flex;
  gap: 13px 22px;
  flex-wrap: wrap;
  font-size: 14px;
}
.foot a:hover {
  text-decoration: underline;
}
/* ผังโครงการและสถานะแปลง */
.plot-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  background: #e7e3d5;
  border: 1px solid #cfcabd;
  padding: 16px;
  cursor: grab;
}
.plot-scroll:active {
  cursor: grabbing;
}
.plot {
  position: relative;
  min-width: 985px;
  aspect-ratio: 4.5;
  background: #d4ccba;
}
.lot {
  position: absolute;
  border: 1px solid #f9f3e8;
  background: #38574a;
  color: #fffdf4;
  padding: 4px 3px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  line-height: 1.12;
  text-align: center;
  user-select: none;
}
.lot small {
  font-size: 11px;
  margin-top: 4px;
}
.lot.reno {
  background: repeating-linear-gradient(135deg, #7a7569 0 6px, #686459 6px 9px);
  font-size: 11px;
}
.lot.office {
  background: #e3c184;
  color: #2d3028;
}
.lot[aria-pressed="true"] {
  background: #dcb972;
  color: #1c2922;
  box-shadow: inset 0 0 0 3px #25362d;
}
.lot.filtered {
  opacity: 0.29;
}
.road-label {
  position: absolute;
  top: 46%;
  left: 42%;
  font-size: 13px;
}
.entrance {
  position: absolute;
  right: 0;
  top: 65%;
  height: 30%;
  writing-mode: vertical-rl;
  font-size: 11px;
  text-align: center;
}
.plot-preview {
  margin-top: 16px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.plot-preview .photo {
  width: 150px;
}
.plot-preview .button {
  margin: 8px 6px 0 0;
}
.legend {
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
}
table {
  border-collapse: collapse;
  min-width: 460px;
  width: 100%;
  background: #fffdf7;
}
th,
td {
  text-align: start;
  border-bottom: 1px solid var(--line);
  padding: 12px 15px;
  vertical-align: top;
}
.table-scroll {
  overflow: auto;
}
.reading {
  max-width: 77ch;
}
.reading p,
.reading li {
  margin-bottom: 8px;
}
.reading a,
.gallery-source {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.reading details {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.reading summary {
  cursor: pointer;
  font-weight: 600;
}
.reading details p {
  margin: 10px 0 0;
}
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 15px;
  margin-top: 21px;
}
/* หน้าต่างผู้ช่วยและภาพขยาย */
dialog {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  width: min(580px, calc(100% - 26px));
  max-height: 90svh;
  overflow: auto;
  box-shadow: 0 18px 80px #101a17aa;
}
dialog::backdrop {
  background: #111b19ae;
}
dialog.media-dialog {
  width: min(900px, calc(100% - 26px));
}
.modal-in {
  padding: 22px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.modal-head h2 {
  font-size: 24px;
  font-weight: 500;
}
.icon-btn {
  border: 1px solid #cbc3b2;
  background: #fffaf1;
  border-radius: 3px;
  min-width: 41px;
  min-height: 40px;
  color: var(--ink);
}
.media-dialog img {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  background: #17221d;
}
.media-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 8px;
}
.results {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}
.result {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fffdf7;
  padding: 8px;
}
.result .photo {
  width: 85px;
  flex: none;
}
.result a {
  text-decoration: underline;
}
.result small {
  display: block;
}
/* ปรับเลย์เอาต์สำหรับแท็บเล็ตและมือถือ */
@media (max-width: 970px) {
  .top-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--night);
    padding: 18px var(--pad);
    border-bottom: 1px solid #fff3;
    flex-wrap: wrap;
  }
  .top-nav.open {
    display: flex;
  }
  .menu-toggle {
    display: grid;
    place-items: center;
  }
  .head-actions {
    gap: 14px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick a {
    font-size: 13px;
  }
  .detail {
    gap: 16px;
  }
}
@media (max-width: 640px) {
  :root {
    --pad: 20px;
  }
  .header {
    min-height: 69px;
    gap: 8px;
  }
  .brand {
    gap: 7px;
  }
  .brand img {
    width: 28px;
    height: 34px;
  }
  .brand strong {
    font-size: 17px;
  }
  .brand small {
    font-size: 8px;
    letter-spacing: 0.13em;
  }
  .header .button {
    display: none;
  }
  .head-actions {
    gap: 10px;
  }
  .hero {
    padding: 60px var(--pad) 72px;
    min-height: 465px;
    align-items: center;
  }
  .hero-image {
    object-position: 59% center;
  }
  .hero:after {
    background:
      linear-gradient(90deg, #0e1916df, #101a175e),
      linear-gradient(0deg, #111a18a0, transparent 60%);
  }
  .hero h1 {
    font-size: clamp(48px, 13vw, 76px);
    margin: 26px 0 21px;
  }
  .hero h1 em {
    margin-top: 10px;
  }
  .hero .facts {
    font-size: 14px;
    margin-bottom: 23px;
  }
  .hero .intro {
    font-size: 16px;
  }
  .button {
    padding-inline: 14px;
    min-height: 45px;
    font-size: 14px;
  }
  .photo-credit {
    bottom: 15px;
    font-size: 11px;
  }
  .quick {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .quick a {
    min-height: 64px;
    padding: 8px 3px;
    gap: 5px;
    font-size: 11px;
    border-block-end: 1px solid #eee6cc22;
    line-height: 1.25;
  }
  .quick a:nth-child(4) {
    border-inline-end: 0;
  }
  .quick a:nth-child(n + 5) {
    border-block-end: 0;
  }
  .quick a:last-child {
    grid-column: span 2;
  }
  .quick svg {
    width: 20px;
    height: 20px;
  }
  .home-note {
    align-items: start;
    flex-direction: column;
    min-height: 0;
    padding: 14px 0 28px;
    gap: 3px;
  }
  .home-note .prototype {
    padding-right: 63px;
  }
  .concierge {
    right: 13px;
    bottom: 14px;
    padding: 10px;
    min-height: 45px;
    min-width: 45px;
  }
  .concierge span {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
  }
  .page {
    padding-top: 34px;
  }
  .detail,
  .grid {
    grid-template-columns: 1fr;
  }
  .detail .photo {
    min-height: 0;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .plot-preview .photo {
    width: 120px;
  }
  .foot {
    padding-bottom: 65px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

.hero-image.is-missing,
.brand img.is-missing {
  display: none;
}
@media (min-width: 641px) and (max-height: 820px) {
  .header {
    min-height: 76px;
  }
  .hero {
    min-height: clamp(438px, calc(100svh - 215px), 610px);
    padding-top: 39px;
    padding-bottom: 61px;
  }
  .hero h1 {
    font-size: clamp(64px, min(8.2vw, 14vh), 112px);
    margin: 26px 0 23px;
  }
  .hero .facts {
    margin-bottom: 23px;
  }
  .quick a {
    min-height: 86px;
    padding-block: 10px;
  }
  .home-note {
    min-height: 48px;
  }
  .photo-credit {
    bottom: 23px;
  }
}
@media (max-width: 640px) {
  .quick a {
    font-size: 12px;
  }
}

.photo:has(img:not(.is-missing)) > span {
  visibility: hidden;
}
@media (max-width: 640px) {
  .hero .eyebrow {
    font-size: 11px;
    letter-spacing: 0.15em;
    gap: 9px;
    white-space: nowrap;
  }
  .hero .eyebrow:before {
    width: 19px;
    flex: none;
  }
  .hero .intro {
    max-width: 29ch;
    text-wrap: balance;
  }
}

/* หน้าทัวร์ — วางตัวเลือกบ้านข้างชื่อหน้าเพื่อให้เห็นโมเดลตั้งแต่เปิด */
.page:has(#tour-villa) {
  padding-top: 24px;
}
.page:has(#tour-villa) .field {
  max-width: 420px;
}
.page:has(#tour-villa) .section {
  margin-top: 16px;
}
.tour-stage {
  display: block;
  width: 100%;
  height: clamp(330px, 54vh, 650px);
  background: #e2e5dc;
  border: 1px solid #c9cec2;
  border-radius: 9px;
  overflow: hidden;
}
.tour-stage + .filters {
  margin: 12px 0 8px;
  gap: 8px;
}
@media (min-width: 800px) {
  .page:has(#tour-villa) {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 380px);
    align-content: start;
    align-items: center;
  }
  .page:has(#tour-villa) .eyebrow {
    grid-column: 1;
  }
  .page:has(#tour-villa) h1 {
    grid-column: 1;
    font-size: 42px;
    margin: 5px 0;
  }
  .page:has(#tour-villa) .field {
    grid-column: 2;
    grid-row: 1 / 3;
  }
  .page:has(#tour-villa) .section {
    grid-column: 1 / -1;
  }
  .page:has(#tour-villa) .section h2 {
    font-size: 20px;
    margin-bottom: 8px;
  }
}
/* ปุ่มเลือกดูบ้านและเปิดโมเดล — ขนาดสัมผัสขั้นต่ำ 44 พิกเซล */
.villa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.villa-actions .button,
.villa-cover .button {
  min-height: 44px;
  margin: 0;
  padding: 9px 14px;
}
.villa-cover {
  position: relative;
}
.villa-cover > .button {
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.villa-cover > .button:hover {
  background: white;
}
/* ปุ่มย้อนกลับอยู่เหนือหัวข้อทุกหน้าด้านใน */
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  justify-self: start;
  padding: 6px 12px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}
.page-back:hover {
  background: #ede8db;
}
@media (min-width: 800px) {
  .page:has(#tour-villa) .page-back {
    grid-column: 1/-1;
  }
  .page:has(#tour-villa) .field {
    grid-row: 2/4;
  }
}
.location-map {
  display: block;
  width: 100%;
  min-height: 360px;
  height: 100%;
  border: 0;
  border-radius: 6px;
}

/* Responsive layout — shared controls and overflow boundaries */
.page > *,
.detail > *,
.card-body,
.filters label,
.field {
  min-width: 0;
}
.page :is(input, select),
dialog :is(input, select) {
  min-width: 0;
  width: 100%;
}
.page :is(h1, h2, h3),
.card-body h2 {
  overflow-wrap: break-word;
}
.locale button,
.menu-toggle,
.icon-btn {
  min-width: 44px;
  min-height: 44px;
}
.tour-stage {
  height: clamp(300px, 50svh, 640px);
}
.table-scroll,
.plot-scroll {
  max-width: 100%;
}
.quick a,
.button {
  text-wrap: balance;
}

/* Phone — readable shortcuts, one villa per row, full-width form fields */
@media (max-width: 640px) {
  :root {
    --pad: clamp(14px, 4.5vw, 24px);
  }
  .header {
    gap: 6px;
  }
  .head-actions,
  .locale {
    gap: 0;
  }
  .brand strong {
    font-size: clamp(15px, 4.3vw, 19px);
  }
  .brand img {
    width: 25px;
  }
  .top-nav.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    padding-block: 10px;
  }
  .top-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  .hero {
    min-height: 365px;
    padding-block: 42px 56px;
  }
  .hero .eyebrow {
    white-space: normal;
  }
  .quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick a,
  .quick a:last-child {
    flex-direction: row;
    justify-content: flex-start;
    text-align: start;
    min-height: 50px;
    padding: 8px 10px;
    gap: 9px;
    font-size: 14px;
    line-height: 1.35;
    border: 0;
    border-bottom: 1px solid #eee6cc22;
  }
  .quick a:nth-child(odd) {
    border-inline-end: 1px solid #eee6cc22;
  }
  .quick a:last-child {
    grid-column: 1 / -1;
    border: 0;
  }
  .page {
    padding-top: 20px;
    padding-bottom: 72px;
  }
  .page h1 {
    font-size: clamp(29px, 7.6vw, 44px);
  }
  .page h1.latin {
    font-size: clamp(38px, 10vw, 58px);
  }
  .page .filters:not(:has([data-camera])) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
  }
  .filters input[type="search"],
  .filters select {
    width: 100%;
  }
  #villa-filter label:first-child,
  #availability label:has(select),
  #availability button,
  .filters label:only-child {
    grid-column: 1 / -1;
  }
  .field input,
  .filters input,
  .filters select,
  .field select {
    font-size: 16px;
  }
  .card-body {
    padding: 14px;
  }
  .villa-actions .button {
    flex: 1 1 auto;
  }
  .panel {
    padding: 16px;
  }
  .detail .villa-cover .photo {
    min-height: 190px;
  }
  .page:has(#tour-villa) {
    padding-top: 14px;
  }
  .page:has(#tour-villa) .field {
    max-width: none;
  }
  .tour-stage {
    height: clamp(275px, 45svh, 440px);
  }
  .tour-stage + .filters {
    gap: 6px;
  }
  .tour-stage + .filters .button {
    flex: 1 1 124px;
  }
  .location-map {
    min-height: 275px;
    height: 38svh;
  }
  .concierge {
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Tablet — two villa cards, larger navigation tiles, compact header */
@media (min-width: 641px) and (max-width: 1100px) {
  :root {
    --pad: clamp(24px, 4vw, 44px);
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .header {
    gap: 12px;
  }
  .top-nav {
    gap: 14px;
  }
  .head-actions {
    gap: 8px;
  }
  .quick {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .quick a {
    min-height: 66px;
    flex-direction: row;
    gap: 8px;
    padding: 9px;
    font-size: 14px;
  }
  .quick a:last-child {
    grid-column: span 2;
  }
  .detail {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
}
@media (min-width: 641px) and (max-width: 800px) {
  .detail {
    grid-template-columns: 1fr;
  }
}
/* Laptop and desktop — preserve space for the model on shorter screens */
@media (min-width: 1101px) and (max-height: 820px) {
  .page {
    padding-top: 26px;
  }
  .tour-stage {
    height: clamp(300px, 48svh, 440px);
  }
}
/* Keep photographs and embedded media inside their column at every width. */
.detail > figure,
.detail .photo,
.detail iframe,
.gallery-grid button {
  min-width: 0;
  max-width: 100%;
}
.detail .photo {
  width: 100%;
}
@media (max-width: 360px) {
  .header {
    padding-inline: 8px;
    gap: 2px;
  }
  .brand {
    gap: 4px;
  }
  .brand strong {
    font-size: 14px;
  }
  .brand small {
    letter-spacing: 0.06em;
  }
  .locale span {
    display: none;
  }
  .header .brand img {
    width: 21px;
  }
  .detail {
    grid-template-columns: minmax(0, 1fr);
  }
}
dialog .filters label,
.result > div,
.media-controls {
  min-width: 0;
}
@media (max-width: 640px) {
  dialog .filters label {
    flex: 1 1 120px;
  }
  dialog .filters input,
  dialog .filters select {
    width: 100%;
    font-size: 16px;
  }
  .media-controls {
    flex-wrap: wrap;
  }
  .foot a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
