/* 海灣民宿 — colours taken from the photographs: lime-washed walls, the deep
   Pacific off Hualien, the shallow water over the rocks, beach pebbles, and
   the rattan furniture. One loud thing on the page: the vertical title. */
:root {
  --wash: #F3F5F3;
  --ink: #0E3A4F;
  --sea: #1F7A86;
  --pebble: #C7CBC5;
  --rattan: #A87A48;
  --white: #FFFFFF;

  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", "PingFang TC", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --measure: 34em;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font: 400 1rem/1.75 var(--sans);
  letter-spacing: .02em;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 3px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

h2 {
  font: 700 clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem)/1.3 var(--serif);
  letter-spacing: .08em;
  margin: 0 0 1.25rem;
}
html[lang="en"] h2 { letter-spacing: 0; }

/* ---- bar ---------------------------------------------------------------- */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .75rem var(--gutter);
  background: color-mix(in srgb, var(--wash) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--pebble);
}
.bar-name {
  font: 700 1.05rem/1 var(--serif); letter-spacing: .15em; text-decoration: none;
}
.bar-nav { display: flex; gap: 1.25rem; margin-left: auto; font-size: .9rem; }
.bar-nav a { text-decoration: none; }
.bar-nav a:hover { color: var(--sea); }
.lang { display: flex; border: 1px solid var(--pebble); border-radius: 999px; }
.lang button {
  font: 500 .8rem/1 var(--sans); color: var(--ink);
  background: none; border: 0; border-radius: 999px;
  padding: .45rem .8rem; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--wash); }
@media (max-width: 720px) {
  .bar-nav { display: none; }
  .lang { margin-left: auto; }
}

/* ---- hero --------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "photo mark" "text text";
}
.hero-photo { grid-area: photo; }
.hero-photo img {
  width: 100%; height: min(78vh, 760px); object-fit: cover; object-position: 60% 50%;
}
/* In vertical-rl, blocks stack right to left: the title is the rightmost
   column and the verse hangs to its left, starting lower. */
.hero-mark {
  grid-area: mark;
  writing-mode: vertical-rl;
  padding: clamp(1.5rem, 4vw, 3.5rem) var(--gutter) 0 clamp(1rem, 3vw, 2.5rem);
}
.hero-title {
  display: block;
  font: 700 clamp(3.2rem, 2rem + 4.4vw, 6.5rem)/1 var(--serif);
  letter-spacing: .12em;
}
.hero-verse {
  display: block;
  margin-block-start: clamp(.75rem, 1.5vw, 1.5rem);
  padding-inline-start: 5.5em;
  font: 500 clamp(1rem, .8rem + .8vw, 1.45rem)/1.4 var(--serif);
  letter-spacing: .4em;
  color: var(--sea);
}
/* The verse only reads vertically in Chinese; an English line stands upright
   under the photo instead. */
html[lang="en"] .hero-verse { display: none; }
.hero-text {
  grid-area: text;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: clamp(1.5rem, 3vw, 2.5rem) var(--gutter) 0;
}
.hero-lede {
  margin: 0; max-width: var(--measure);
  font: 500 clamp(1.05rem, .95rem + .4vw, 1.3rem)/1.7 var(--serif);
}
@media (max-width: 720px) {
  .hero-photo img { height: 62vh; }
  .hero-mark { padding-top: 1rem; }
  .hero-verse { padding-inline-start: 3em; letter-spacing: .3em; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-title, .hero-verse { animation: rise 1.1s cubic-bezier(.2,.7,.2,1) both; }
  .hero-verse { animation-delay: .35s; }
  @keyframes rise {
    from { opacity: 0; clip-path: inset(0 0 100% 0); }
    to   { opacity: 1; clip-path: inset(0 0 0 0); }
  }
}

/* ---- buttons ------------------------------------------------------------ */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem;
  font: 500 1rem/1 var(--sans); letter-spacing: .08em; text-decoration: none;
  border-radius: 999px; border: 1.5px solid var(--ink);
  transition: background-color .15s, color .15s;
}
.btn-solid { background: var(--ink); color: var(--wash); }
.btn-solid:hover { background: var(--sea); border-color: var(--sea); }
.btn-line { color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--wash); }
.btn-ghost { color: var(--white); border-color: var(--white); }
.btn-ghost:hover { background: var(--white); color: var(--ink); }

/* ---- sections ----------------------------------------------------------- */
main > section:not(.hero) { padding: clamp(4rem, 9vw, 8rem) var(--gutter) 0; }

.section-head { max-width: var(--measure); }
.section-head p { margin: 0 0 2rem; color: var(--sea); }

/* rooms: a price list, so it is a table */
.rates { width: 100%; border-collapse: collapse; }
.rates thead th {
  font: 500 .85rem/1 var(--sans); letter-spacing: .1em; color: var(--sea);
  text-align: right; padding: 0 0 .9rem 1rem;
}
.rates thead th:first-child { text-align: left; padding-left: 0; }
.rates tbody tr { border-top: 1px solid var(--pebble); }
.rates tbody tr:last-child { border-bottom: 1px solid var(--pebble); }
.rates tbody th { text-align: left; font-weight: 400; padding: 1.4rem 0; }
.rates td {
  text-align: right; white-space: nowrap; padding: 1.4rem 0 1.4rem 1rem;
  font: 500 1.1rem/1.2 var(--serif); font-variant-numeric: tabular-nums;
}
.room-name {
  display: block; font: 700 1.25rem/1.4 var(--serif); letter-spacing: .08em;
}
.room-desc { display: block; font-size: .92rem; color: color-mix(in srgb, var(--ink) 78%, var(--wash)); }
@media (max-width: 640px) {
  .rates thead { display: none; }
  .rates tbody tr { display: grid; grid-template-columns: repeat(3, 1fr); padding-bottom: 1.2rem; }
  .rates tbody th { grid-column: 1 / -1; padding-bottom: .8rem; }
  .rates td { text-align: left; padding: 0; font-size: 1rem; }
  .rates td::before {
    content: attr(data-label); display: block; margin-bottom: .3rem;
    font: 400 .8rem/1 var(--sans); color: var(--sea);
  }
}

/* booking */
.booking {
  display: grid; gap: clamp(2rem, 5vw, 5rem); align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.booking-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.booking-text { max-width: var(--measure); }
.steps { list-style: none; counter-reset: step; margin: 0 0 2rem; padding: 0; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.5rem 1fr; gap: .5rem;
  padding: 1rem 0; border-top: 1px solid var(--pebble);
}
.steps li::before {
  content: counter(step);
  font: 700 1.5rem/1.1 var(--serif); color: var(--rattan);
}

/* stay */
.stay {
  display: grid; gap: clamp(2rem, 5vw, 5rem); align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
}
.stay-photo { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; }
.facts { margin: 0; }
.facts div {
  display: grid; grid-template-columns: 7.5em 1fr; gap: 1rem;
  padding: 1rem 0; border-top: 1px solid var(--pebble);
}
.facts dt { font: 700 1rem/1.75 var(--serif); letter-spacing: .08em; }
.facts dd { margin: 0; }
html[lang="en"] .facts div { grid-template-columns: 9em 1fr; }

@media (max-width: 860px) {
  .booking, .stay { grid-template-columns: 1fr; }
  .stay-photo { aspect-ratio: 4 / 3; order: -1; }
  .facts div { grid-template-columns: 1fr; gap: .1rem; }
}

/* getting here: the road runs full width, the card sits on the sea */
main > section.here { padding-left: 0; padding-right: 0; position: relative; }
.here-photo { width: 100%; height: min(80vh, 820px); object-fit: cover; }
.here-card {
  position: absolute; right: var(--gutter); bottom: clamp(1.5rem, 4vw, 3.5rem);
  max-width: 24rem; padding: 1.75rem 2rem;
  background: var(--wash); border-radius: 4px;
}
.here-card p { margin: 0 0 1rem; }
.text-link { color: var(--sea); font-weight: 500; text-underline-offset: .25em; }
@media (max-width: 640px) {
  .here-photo { height: 52vh; }
  .here-card { position: static; max-width: none; border-radius: 0; padding: 1.75rem var(--gutter) 0; }
}

/* ---- footer ------------------------------------------------------------- */
.foot { position: relative; margin-top: clamp(4rem, 9vw, 8rem); color: var(--white); }
.foot-photo { width: 100%; height: min(70vh, 640px); object-fit: cover; object-position: 50% 40%; }
.foot::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(14, 58, 79, .88) 0%, rgba(14, 58, 79, .35) 45%, rgba(14, 58, 79, 0) 70%);
}
.foot-text {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(1.5rem, 4vw, 3rem);
  z-index: 1; max-width: var(--measure);
}
.foot-text p { margin: 0 0 1.25rem; }
.foot-name { font: 700 clamp(1.8rem, 1.4rem + 1.5vw, 2.6rem)/1.2 var(--serif); letter-spacing: .15em; }
/* keep the actions clear of the chat button in the bottom-right corner */
@media (max-width: 640px) { .foot-text { bottom: 96px; } }
.foot .btn-solid { background: var(--white); color: var(--ink); border-color: var(--white); }
.foot .btn-solid:hover { background: var(--wash); }
