/* Shared tokens and guest-site styles. Colours drawn from the bush and stream at Driving Creek. */
:root {
  --tide: #1e3a2f;      /* deep bush shade */
  --shallows: #8db592;  /* fern */
  --pohutukawa: #b8233a;/* bromeliad red; used for the one action that matters */
  --kelp: #2f4a3a;
  --pumice: #eef1ee;    /* page background */
  --ink: #14211f;
  --muted: #55615e;
  --line: #cfd8d5;
  --white: #ffffff;
  --ok: #2f7d4f;
  --warn: #9a6a00;

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --text: 'Newsreader', Georgia, serif;

  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;
  --step-4: clamp(3rem, 9vw, 7.5rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --radius-sm: 6px;
  --radius-lg: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--pumice);
  color: var(--ink);
  font: 400 var(--step-0)/1.65 var(--text);
  font-optical-sizing: auto;
}
img { max-width: 100%; display: block; }
a { color: var(--tide); text-underline-offset: 3px; }
a:hover { color: var(--pohutukawa); }
:focus-visible { outline: 3px solid var(--pohutukawa); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 68ch; }

.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(3.5rem, 9vw, 7rem); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: 600 1rem/1 var(--display); letter-spacing: 0;
  padding: 0.95rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s, transform 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--pohutukawa); color: var(--white); }
.btn-primary:hover { background: #9c1c30; color: var(--white); }
.btn-quiet { background: transparent; color: var(--tide); border-color: var(--tide); }
.btn-quiet:hover { background: var(--tide); color: var(--white); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

label { display: block; font: 600 var(--step--1)/1.3 var(--display); margin-bottom: 0.35rem; }
input, select, textarea {
  width: 100%; font: 400 1rem/1.4 var(--text); color: var(--ink);
  padding: 0.75rem 0.85rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
}
input:focus, select:focus, textarea:focus { border-color: var(--tide); outline: none; box-shadow: 0 0 0 3px rgba(30,58,47,.18); }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font: 400 var(--step--1)/1.45 var(--text); margin: 0.75rem 0; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; flex: none; accent-color: var(--tide); }
.field { margin-bottom: 1rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.error { color: var(--pohutukawa); font: 600 var(--step--1)/1.4 var(--display); }
.hp { position: absolute; left: -9999px; }

/* ---------- Header ---------- */
.site-header {
  position: absolute; inset: 0 0 auto; z-index: 5; color: var(--white);
  display: flex; justify-content: space-between; align-items: center; padding: 1.25rem var(--gutter);
}
.site-header a { color: inherit; text-decoration: none; font: 600 1rem/1 var(--display); }
.site-header nav { display: flex; gap: 1.5rem; }
.site-header nav a:hover { color: var(--shallows); }
@media (max-width: 640px) { .site-header nav a:not(.nav-book) { display: none; } }

/* ---------- Hero: the cottage itself ---------- */
.hero {
  position: relative; min-height: min(100svh, 920px); overflow: hidden; color: var(--white);
  background: var(--tide); display: grid; align-items: end; isolation: isolate;
}
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% 55%; z-index: -2;
  animation: arrive 2.8s cubic-bezier(.2,.7,.1,1) both;
}
/* Shade the top for the nav and the bottom for the title, leaving the cottage clear. */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, rgba(14,28,22,.9) 0%, rgba(14,28,22,.55) 34%, rgba(14,28,22,0) 62%),
    linear-gradient(to bottom, rgba(14,28,22,.5) 0%, rgba(14,28,22,0) 18%);
}
@keyframes arrive { from { transform: scale(1.09); filter: saturate(.6) brightness(.85); } }

.hero-copy { position: relative; z-index: 2; padding: 0 var(--gutter) clamp(2rem, 6vw, 4.5rem); width: 100%; display: grid; gap: 1.5rem; }
.hero h1 {
  font-size: var(--step-4); font-weight: 700; font-stretch: 85%; line-height: 0.88; letter-spacing: -0.045em;
  margin: 0; max-width: 11ch; animation: settle 1.2s .5s cubic-bezier(.2,.7,.1,1) both;
}
@keyframes settle { from { opacity: 0; transform: translateY(24px); letter-spacing: -0.01em; } }
.hero-sub { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.25rem; }
.hero-sub p { font-size: var(--step-1); margin: 0; max-width: 34ch; line-height: 1.35; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 1rem 1.75rem; font: 500 1rem/1.2 var(--display); margin: 0; padding: 0; list-style: none; }
.hero-facts strong { display: block; font-size: var(--step-2); font-weight: 600; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.about .lede { font-size: var(--step-1); line-height: 1.5; }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.7rem 1.5rem; border-top: 2px solid var(--tide); padding-top: 1.25rem; }
.facts dt { font: 600 var(--step--1)/1.6 var(--display); color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 800px) { .about { grid-template-columns: 1fr; } }

/* ---------- Photos ---------- */
.photos { display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 520px); gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
.photos figure { margin: 0; scroll-snap-align: start; }
.photos img, .photos .ph { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border-radius: var(--radius-lg); }
.photos .ph { display: grid; place-items: end start; padding: 1.25rem; color: var(--white); font: 500 1rem/1.3 var(--display); }
.photos figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.5rem; }

/* ---------- Booking: calendar + summary ---------- */
.book { background: var(--white); border-radius: var(--radius-lg); padding: clamp(1.25rem, 3vw, 2.5rem); display: grid; grid-template-columns: 1fr 360px; gap: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 940px) { .book { grid-template-columns: 1fr; } }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.cal-nav { display: flex; gap: 0.5rem; }
.cal-nav button { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1.5px solid var(--line); background: var(--white); cursor: pointer; font-size: 1.1rem; color: var(--tide); }
.cal-nav button:hover:not([disabled]) { border-color: var(--tide); }
.cal-nav button[disabled] { opacity: .35; cursor: default; }
.months { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 640px) { .months { grid-template-columns: 1fr; } .months .month + .month { display: none; } }
.month h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dow { font: 600 0.75rem/2 var(--display); color: var(--muted); text-align: center; }
.day {
  aspect-ratio: 1 / 1.05; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer;
  display: grid; place-items: center; align-content: center; gap: 1px; font: 600 0.95rem/1 var(--display); color: var(--ink); padding: 0;
}
.day small { font: 400 0.68rem/1 var(--text); color: var(--muted); }
.day:hover:not([disabled]) { background: #e4ede5; }
.day[disabled] { cursor: not-allowed; color: #a6b1ae; text-decoration: line-through; text-decoration-thickness: 1px; }
.day[disabled] small { visibility: hidden; }
.day.in-range { background: #d7e8da; border-radius: 0; }
.day.start, .day.end { background: var(--tide); color: var(--white); }
.day.start small, .day.end small { color: #cfe2d4; }
.day.start { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.day.end { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.day.start.end { border-radius: var(--radius-sm); }
.day.checkout-only { color: var(--ink); text-decoration: none; cursor: pointer; }
.cal-hint { font-size: var(--step--1); color: var(--muted); margin-top: 1rem; }

.summary { border-left: 1.5px solid var(--line); padding-left: clamp(1.25rem, 3vw, 2.5rem); }
@media (max-width: 940px) { .summary { border-left: 0; padding-left: 0; border-top: 1.5px solid var(--line); padding-top: 1.5rem; } }
.summary .dates { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 1rem; }
.summary .dates div { padding: 0.7rem 0.85rem; }
.summary .dates div + div { border-left: 1.5px solid var(--line); }
.summary .dates span { display: block; font: 600 0.75rem/1.4 var(--display); color: var(--muted); }
.summary .dates strong { font: 600 1.05rem/1.3 var(--display); }
.lines { list-style: none; padding: 0; margin: 1rem 0; }
.lines li { display: flex; justify-content: space-between; padding: 0.35rem 0; font-size: 1rem; }
.lines li.total { border-top: 1.5px solid var(--ink); margin-top: 0.4rem; padding-top: 0.7rem; font: 600 1.15rem/1.3 var(--display); }
.note { font-size: var(--step--1); color: var(--muted); }
.card-soon { display: flex; justify-content: space-between; align-items: center; font: 500 0.85rem/1.3 var(--display); color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; margin: 0.75rem 0; }

/* Request form slides open under the summary once dates are chosen. */
.request { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s ease; }
.request.open { grid-template-rows: 1fr; }
.request > div { overflow: hidden; }
.request form { padding-top: 1rem; }

/* ---------- Amenities / rules ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.ticks { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2rem; }
.ticks li { padding: 0.45rem 0 0.45rem 1.6rem; position: relative; break-inside: avoid; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 0.95rem; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--shallows); }
.rules li::before { background: var(--pohutukawa); border-radius: 2px; transform: rotate(45deg); width: 0.55rem; height: 0.55rem; }
@media (max-width: 520px) { .ticks { columns: 1; } }

/* ---------- Location ---------- */
.map { width: 100%; aspect-ratio: 16 / 7; border: 0; border-radius: var(--radius-lg); filter: saturate(.7); min-height: 280px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--tide); color: #dbe7de; padding-block: 3.5rem 2.5rem; font-size: 1rem; }
.site-footer a { color: var(--white); }
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer h2 { color: var(--white); font-size: var(--step-2); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.site-footer .fine { grid-column: 1 / -1; font-size: 0.85rem; color: #a9c2b0; border-top: 1px solid #36584a; padding-top: 1.25rem; margin-top: 1rem; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ---------- Simple pages (booking status, legal, 404) ---------- */
.page-top { background: var(--tide); color: var(--white); padding: 6.5rem 0 3rem; }
.page-top h1 { font-size: clamp(2.25rem, 6vw, 4rem); margin: 0; }
.page-top p { color: #cfe2d4; margin: 0.75rem 0 0; }
.prose { max-width: 72ch; }
.prose h2 { font-size: var(--step-2); margin-top: 2.5rem; }
.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0 1.5rem; font-size: 1rem; }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font: 600 0.9rem/1.3 var(--display); }
.prose li { margin-bottom: 0.4rem; }
mark { background: #fde7a9; padding: 0 2px; border-radius: 2px; }
.draft { background: #fff5d6; border: 1.5px solid #ecd27e; border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.day.past { text-decoration: none; opacity: .5; }

/* ---------- Guest picker (adults, children, infants, pets) ---------- */
.guests-field { position: relative; }
.guests-field .label { display: block; font: 600 var(--step--1)/1.3 var(--display); margin-bottom: 0.35rem; }
.guest-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  font: 400 1rem/1.4 var(--text); color: var(--ink); text-align: left;
  padding: 0.75rem 0.85rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white); cursor: pointer;
}
.guest-toggle:hover, .guest-toggle[aria-expanded="true"] { border-color: var(--tide); }
.guest-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.guest-toggle svg { transition: transform .2s; flex: none; color: var(--muted); }
.guest-pop {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--white); border-radius: var(--radius-lg); padding: .5rem 1.1rem 1rem;
  box-shadow: 0 14px 40px rgba(20, 33, 31, .18), 0 0 0 1px rgba(20, 33, 31, .06);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }
.guest-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.guest-row:last-child { border-bottom: 0; }
.guest-row b { display: block; font: 600 1rem/1.3 var(--display); }
.guest-row small { display: block; font-size: .85rem; color: var(--muted); }
.guest-row .stepper { display: flex; align-items: center; gap: .6rem; }
.guest-row .stepper button {
  width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1.5px solid #b9c4c1; background: var(--white);
  font: 400 1.25rem/1 var(--display); color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.guest-row .stepper button:hover:not([disabled]) { border-color: var(--ink); }
.guest-row .stepper button[disabled] { opacity: .3; cursor: not-allowed; }
.guest-row output { min-width: 1.5rem; text-align: center; font: 500 1rem/1 var(--display); font-variant-numeric: tabular-nums; }
.guest-pop .note { margin: .5rem 0 .75rem; font-size: .85rem; }
.guest-pop .btn { width: 100%; padding: .7rem 1rem; }
.lines li.gst { font-size: .9rem; color: var(--muted); padding-top: 0; }

/* Other listings on the same site */
.stays { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.stay { display: grid; gap: .6rem; color: inherit; text-decoration: none; }
.stay img, .stay .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg, 16px); background: #dfe5e2; }
.stay-t { display: grid; gap: .15rem; }
.stay-t b { font: 600 1.15rem/1.2 var(--display); }
.stay-t span { color: var(--muted); font-size: .95rem; }
.stay:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* Messages: ask a question, and conversations */
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--tide); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; }
.site-footer .linkish { color: inherit; }
.ask-line { font-size: .95rem; color: var(--muted); margin-top: 1rem; text-align: center; }
dialog#ask { border: 0; border-radius: var(--radius-lg); padding: clamp(1.25rem, 4vw, 2rem); width: min(520px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); color: var(--ink); }
dialog#ask::backdrop { background: rgba(12, 22, 19, .5); }
dialog#ask input, dialog#ask textarea { font-size: 16px; }
.ask-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.ask-head h2 { margin: 0; font-size: 1.5rem; }
.ask-x { border: 0; background: var(--pumice); border-radius: 50%; width: 36px; height: 36px; cursor: pointer; flex: none; }
.chat { display: grid; gap: .75rem; margin: 1rem 0; }
.bubble { max-width: 85%; padding: .75rem 1rem; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.bubble small { display: block; font: 500 .75rem/1.3 var(--display); opacity: .75; margin-top: .35rem; }
.bubble.guest { justify-self: end; background: var(--tide); color: var(--white); border-bottom-right-radius: 4px; }
.bubble.owner { justify-self: start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.compose textarea { width: 100%; font-size: 16px; }
