/* ============================================================
   Dawiburi — Beachfront Villas, Jao-Sam-Ran Beach, Petchburi
   Restored static site · modern design system
   ============================================================ */

:root {
  --c-sea-900: #0b4a58;
  --c-sea-700: #0e7490;
  --c-sea-600: #128aa6;
  --c-sea-100: #e2f2f5;
  --c-sand: #f8f3e9;
  --c-sand-2: #fdfaf3;
  --c-sand-dark: #ece2cf;
  --c-ink: #24323c;
  --c-muted: #5d6d77;
  --c-accent: #b0513f;
  --c-accent-dark: #8e3f31;
  --c-line: #e4dccc;
  --c-card: #ffffff;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: Georgia, "Times New Roman", "Noto Serif", serif;
  --shadow-soft: 0 1px 2px rgba(20, 40, 50, .06), 0 8px 24px rgba(20, 40, 50, .07);
  --radius: 14px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--c-ink);
  background:
    linear-gradient(180deg, rgba(14, 116, 144, .06), rgba(14, 116, 144, 0) 320px),
    var(--c-sand);
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }

a { color: var(--c-sea-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--c-sea-900); }

/* ---------- layout ---------- */
.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

main { display: block; }

.section {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
  padding-block: 2.4rem;
}
.section + .section { border-top: 1px solid var(--c-line); }

.section-head { margin-bottom: 1.4rem; }
.section-head h2,
.section-head h1 {
  font-family: var(--font-display);
  color: var(--c-sea-900);
  line-height: 1.25;
  margin: 0 0 .4rem;
}
.section-head p.lede { margin: 0; color: var(--c-muted); max-width: 62ch; }

h1, h2, h3 { font-family: var(--font-display); color: var(--c-sea-900); }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); }
h3 { font-size: 1.15rem; }

/* ---------- header ---------- */
.site-header {
  background: var(--c-sand-2);
  border-bottom: 1px solid var(--c-line);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 1.5rem;
  padding-block: .9rem;
}
.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; }
.brand img { display: block; }

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .4rem;
  margin: 0; padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: .42rem .72rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--c-ink);
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--c-sea-100); color: var(--c-sea-900); }
.site-nav a[aria-current="page"] {
  background: var(--c-sea-700);
  color: #fff;
}

/* ---------- breadcrumb ---------- */
.breadcrumb { padding-block: .8rem; font-size: .88rem; }
.breadcrumb ol {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: .35rem; margin: 0; padding: 0; color: var(--c-muted);
}
.breadcrumb li + li::before { content: "›"; margin-inline: .45rem; color: var(--c-line); }
.breadcrumb a { color: var(--c-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-sea-700); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--c-ink); font-weight: 600; }

/* ---------- hero ---------- */
.hero { padding-block: 2.2rem 2.6rem; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 2.2rem;
  align-items: center;
}
.hero h1 { margin: 0 0 .8rem; }
.hero .lede { font-size: 1.08rem; color: var(--c-muted); margin: 0 0 1.4rem; max-width: 55ch; }
.hero-media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--c-line);
  background: #fff;
}
.hero-media img { display: block; }

.kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--c-accent);
  margin-bottom: .6rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: .68rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .98rem;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-sea-700); color: #fff; }
.btn-primary:hover { background: var(--c-sea-900); color: #fff; }
.btn-ghost { border: 1.5px solid var(--c-sea-700); color: var(--c-sea-700); }
.btn-ghost:hover { background: var(--c-sea-100); }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

/* ---------- cards & grids ---------- */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-soft);
}
.card h3 { margin: 0 0 .45rem; }
.card p { margin: 0; color: var(--c-muted); font-size: .97rem; }
.card .more { display: inline-block; margin-top: .7rem; font-weight: 700; font-size: .92rem; }

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem; height: 2.6rem;
  border-radius: 50%;
  background: var(--c-sea-100);
  color: var(--c-sea-700);
  font-size: 1.25rem;
  margin-bottom: .8rem;
}

.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: center; }
.split .media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); border: 1px solid var(--c-line); background:#fff; }
.split .media img { display: block; }

/* ---------- gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.tile {
  margin: 0;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.tile a { display: block; text-decoration: none; }
.tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tile figcaption {
  padding: .55rem .7rem;
  font-size: .88rem;
  color: var(--c-muted);
  text-align: center;
}

.tile-ph {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, var(--c-sea-100), var(--c-sand-dark));
  color: var(--c-sea-900);
  font-weight: 700; font-size: 2rem;
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  font-size: .98rem;
}
table.data th, table.data td {
  text-align: left;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--c-line);
}
table.data th { background: var(--c-sea-100); color: var(--c-sea-900); font-family: var(--font-display); }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; white-space: nowrap; }
.status-sold { color: var(--c-accent); font-weight: 700; }

/* ---------- callout / note ---------- */
.callout {
  background: var(--c-sea-100);
  border: 1px solid #c8e4ea;
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
}
.note {
  font-size: .85rem;
  color: var(--c-muted);
  background: var(--c-sand-dark);
  border-radius: 10px;
  padding: .6rem .9rem;
}

.cta-panel {
  background: linear-gradient(135deg, var(--c-sea-900), var(--c-sea-700));
  color: #eaf6f9;
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  box-shadow: var(--shadow-soft);
}
.cta-panel h2, .cta-panel h3 { color: #fff; margin-top: 0; }
.cta-panel a { color: #ffe9c9; }
.cta-panel .btn { background: #fff; color: var(--c-sea-900); }
.cta-panel .btn:hover { background: var(--c-sea-100); color: var(--c-sea-900); }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 1rem; }
details.faq {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  padding: .9rem 1.2rem;
  box-shadow: var(--shadow-soft);
}
details.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--c-sea-900);
  font-size: 1.05rem;
}
details.faq[open] summary { margin-bottom: .5rem; }
details.faq p { margin: .3rem 0 0; color: var(--c-muted); }

/* ---------- photo viewer (popup pages) ---------- */
.viewer-main {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.2rem;
  text-align: center;
}
.viewer-main img { max-height: 70vh; width: auto; height: auto; border-radius: 8px; }
.viewer-caption { color: var(--c-muted); margin-top: .8rem; font-size: .95rem; }
.viewer-nav {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 1.2rem;
}
.viewer-nav a {
  text-decoration: none; font-weight: 700; font-size: .95rem;
  padding: .5rem .9rem; border: 1.5px solid var(--c-sea-700);
  border-radius: 999px;
}
.viewer-nav a:hover { background: var(--c-sea-100); }
.ph-frame {
  display: flex; align-items: center; justify-content: center;
  min-height: 260px;
  background: linear-gradient(160deg, var(--c-sea-100), var(--c-sand-dark));
  border-radius: 8px;
  color: var(--c-sea-900);
  font-family: var(--font-display);
  font-size: 1.05rem;
  padding: 1rem;
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(10, 25, 32, .86);
  display: none;
  align-items: center; justify-content: center;
  padding: 2rem;
  z-index: 50;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.5); }
.lightbox figcaption {
  position: fixed; bottom: 1.2rem; left: 0; right: 0;
  text-align: center; color: #d8e6ea; font-size: .9rem;
}
.lightbox-close {
  position: fixed; top: 1rem; right: 1.4rem;
  color: #fff; font-size: 2rem; line-height: 1;
  background: none; border: 0; cursor: pointer;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 3rem;
  background: var(--c-sea-900);
  color: #cfe3e9;
  font-size: .92rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-block: 2.4rem 1.6rem;
}
.site-footer h2, .site-footer h3 { color: #fff; font-size: 1rem; margin: 0 0 .7rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: #bfe0e9; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, .16);
  padding-block: 1rem;
  font-size: .82rem;
  color: #9dbcc6;
}

/* skip link */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--c-sea-900); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 60;
}
.skip-link:focus { left: 0; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .btn-row .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn:active { transition: none; }
}