/* deya liao photography */
:root {
  --paper: #f6f3ee;
  --ink: #1e1b17;
  --muted: #7d756c;
  --rose: #751723;          /* deep red from the bouquet photo */
  --serif: "Playfair Display", "Noto Serif SC", Georgia, "Songti SC", serif;
  --display: "IM Fell English", "Noto Serif SC", Georgia, "Songti SC", serif;
  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 48px;
  --page-pad: clamp(20px, 9vw, 150px);   /* left & right padding on every page */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  background: transparent;
}
.brand { font-family: var(--display); font-weight: 400; font-style: normal; font-size: 27px; text-decoration: none; white-space: nowrap; }
.nav-center { display: flex; gap: 36px; }
.nav-right { justify-self: end; }
.nav a.link { font-family: var(--serif); font-size: 15px; font-style: normal; text-decoration: none; }
.nav a.link[aria-current="page"], .bottom-nav a[aria-current="page"] { color: var(--rose); }

.bottom-nav { display: none; }
@media (max-width: 760px) {
  .nav { grid-template-columns: 1fr; justify-items: center; }
  .nav-center, .nav-right { display: none; }
  .bottom-nav {
    display: flex; justify-content: space-around; align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 12px 8px calc(12px + env(safe-area-inset-bottom));
    background: var(--paper);
  }
  .bottom-nav a { font-family: var(--serif); font-style: normal; font-size: 15px; text-decoration: none; }
  body { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
}

/* ---------- shared ---------- */
main { padding: 24px var(--page-pad) 0; }
h2 { font-family: var(--display); font-weight: 400; font-style: normal; font-size: 24px; line-height: 1.3; margin: 0 0 4px; }

.reveal { opacity: 0; transition: opacity .9s ease; }
.reveal.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transition: none; } }

/* ---------- home ---------- */
.hero { text-align: center; padding: 16px 0 32px; }
.hero h1 { font-family: var(--display); font-weight: 400; font-style: normal; font-size: 19px; margin: 0; color: var(--rose); line-height: 1.2; text-wrap: balance; }
.hero .booking { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--muted); margin: 0; line-height: 1.3; }

/* scattered layout: rows built in JS with % widths/offsets */
.scatter { max-width: 1400px; margin: 0 auto; }
.scatter .row { display: flex; align-items: flex-start; margin-bottom: clamp(16px, 3vw, 40px); }
.scatter .item { flex: none; }
.scatter .item img { width: 100%; }
.scatter a.item { text-decoration: none; }
.cap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 6px; font-size: 13px; line-height: 20px; height: 20px; }
.cap span:first-child { font-family: var(--display); font-weight: 400; font-style: normal; font-size: 16px; }
.cap span + span { color: var(--muted); font-style: italic; }
.zoomable { cursor: zoom-in; }

/* ---------- galleries index (mobile: organized list) ---------- */
.gallery-list { display: none; }
@media (max-width: 760px) {
  .scatter.galleries { display: none; }
  .gallery-list { display: grid; gap: 36px; }
  .gallery-list a { text-decoration: none; }
  .gallery-list img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
}

/* ---------- single gallery ---------- */
.gallery-title { text-align: center; font-size: 14px; margin: 0 0 32px; }
#gallery-title { font-family: var(--display); font-weight: 400; font-style: normal; font-size: 26px; }
.gallery-title .location { color: var(--muted); font-style: italic; font-size: 14px; }
.masonry { display: flex; align-items: flex-start; gap: 12px; max-width: 1000px; margin: 0 auto; }
.masonry .mcol { flex: 1; min-width: 0; }
.masonry img { width: 100%; margin-bottom: 12px; }
.gallery-nav { display: flex; justify-content: space-between; max-width: 1000px; margin: 48px auto 0; font-size: 14px; }
.gallery-nav a { text-decoration: none; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90; background: rgba(20, 18, 15, .96);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 92vw; max-height: 88vh; width: auto; height: auto; object-fit: contain; }
.lightbox button {
  position: absolute; background: none; border: 0; color: #f6f3ee; cursor: pointer;
  font-family: var(--serif); font-size: 13px; padding: 16px;
}
.lightbox .lb-close { top: 8px; right: 12px; }
.lightbox .lb-prev { left: 6px; top: 50%; transform: translateY(-50%); font-size: 28px; }
.lightbox .lb-next { right: 6px; top: 50%; transform: translateY(-50%); font-size: 28px; }
.lightbox .lb-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #aaa196; font-size: 12px; }

/* ---------- packages: three loosely scattered columns ---------- */
.packages { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; }
.package { width: 28%; }
.package:nth-child(1) { width: 27%; margin-top: 56px; }
.package:nth-child(2) { width: 30%; margin-top: 180px; }
.package:nth-child(3) { width: 29%; margin-top: 0; }
.package img { width: 100%; margin-bottom: 6px; }
.package ul { list-style: none; margin: 0 0 1.35em; padding: 0; }
.package li { margin: 0; }
.package li::before { content: "- "; }
.package p { margin: 0; }
.package .price, .discount { font-style: italic; }
@media (max-width: 760px) {
  .packages { flex-direction: column; gap: 48px; }
  .package, .package:nth-child(n) { width: 100%; margin-top: 0; }
}

/* ---------- contact ---------- */
.contact { max-width: 560px; margin: 0 auto; }
.contact > p { margin: 0 0 24px; }
form.inquiry { display: grid; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .field legend { font-size: 13px; }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #d9d3ca;
  border-radius: 2px; padding: 8px 10px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 1px solid var(--ink); }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { padding: 0; margin-bottom: 4px; }
.radios { display: flex; flex-direction: column; gap: 2px; }
.radios label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.hp { position: absolute; left: -9999px; }
.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn {
  font: inherit; font-size: 15px; background: var(--ink); color: var(--paper);
  border: 0; border-radius: 2px; padding: 10px 22px; cursor: pointer;
}
.btn:disabled { opacity: .6; }
.form-status { font-size: 14px; color: var(--muted); }
.form-status.error { color: #9b2d20; }
.thanks { display: none; }
.sent form.inquiry { display: none; }
.sent .thanks { display: block; }

/* ---------- about ---------- */
.about { max-width: 900px; margin: 0 auto; }
.about-row { display: grid; grid-template-columns: 380px 1fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
.about-row.flip { grid-template-columns: 1fr 260px; align-items: start; }
.about-row.flip img { margin-top: 5px; }
.about-row + .about-row { margin-top: 56px; }
.about-row img { width: 100%; }
.about-row p { margin: 0 0 1em; }
.about-row > div { max-width: 400px; }
.about-row .hello { font-family: var(--display); font-weight: 400; font-style: normal; font-size: 28px; margin-bottom: 1em; }
.justified { max-width: 1000px; margin: 14px auto 0; display: flex; flex-direction: column; gap: 8px; }
.jrow { display: flex; gap: 8px; }
.jrow img { width: 100%; height: auto; }
.divider { border: 0; border-top: 1px solid #d9d3ca; max-width: 900px; margin: 64px auto 0; }
.travel-note { text-align: center; font-size: 14px; margin: 40px 0 0; }
@media (max-width: 700px) {
  .about-row, .about-row.flip { grid-template-columns: 1fr; }
  .about-row img { max-width: 100%; }
}

/* ---------- language toggle ---------- */
.lang-toggle {
  position: fixed; right: var(--gutter); bottom: 18px; z-index: 60;
  font-family: var(--serif); font-size: 13px; color: var(--muted);
  background: none; border: 0; border-radius: 2px; padding: 4px 8px; cursor: pointer;
}
.lang-toggle .on { color: var(--ink); }
@media (max-width: 760px) {
  .lang-toggle { right: 10px; top: calc(12px + env(safe-area-inset-top)); bottom: auto; padding: 4px 6px; }
}
/* chinese text: no fake italics, slightly roomier lines */
html:lang(zh) :not(.location):not(.lang-toggle *) { font-style: normal !important; }
html:lang(zh) body { line-height: 1.6; }

/* ---------- footer ---------- */
footer { padding: 48px var(--gutter) 32px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; }

/* desktop: nudge the brand down so its baseline lines up with the nav links */
@media (min-width: 761px) {
  .brand { position: relative; top: 3px; }
  .hero { padding-top: 0; }          /* tagline sits closer to the nav on laptops */
}

/* phone: tighter space around the home tagline (kept last so it wins) */
@media (max-width: 760px) {
  .brand { font-size: 29px; }
  .hero h1 { display: none; }         /* phones show only "now booking" */
  .hero { margin: 0 -14px; }         /* a little extra width so it stays on one line */
  .lang-toggle { font-size: 12px; right: 6px; padding: 4px; }
  main { padding-top: 4px; }
  .hero { padding: 4px 0 16px; }
}
