:root {
  --ink: #213b31;
  --pine: #18392d;
  --dark: var(--ink);
  --paper: #f8f7f2;
  --surface: #fffefb;
  --wash: #edf0e8;
  --line: #ccd5c8;
  --muted: #54665b;
  --radius: .3rem;
  --edge: max(clamp(1rem, 5vw, 5rem), calc((100vw - 80rem) / 2));
  --section-space: clamp(3rem, 6vw, 6rem);
  --serif: Georgia, serif;
  --sans: "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 1rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
}

a { color: inherit; }
a, button, input, textarea, summary { touch-action: manipulation; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.skip {
  position: fixed;
  top: .5rem;
  left: .5rem;
  transform: translateY(-200%);
  z-index: 10;
  padding: .65rem 1rem;
  background: var(--surface);
}

.skip:focus { transform: none; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.035em;
}

h1 { margin: .25em 0 .5em; font-size: clamp(2.85rem, 6vw, 5.5rem); }
h2 { margin: 0 0 .5em; font-size: clamp(2.15rem, 4.5vw, 4rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.eyebrow, .kicker {
  display: block;
  margin-bottom: .9rem;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.section { padding: var(--section-space) var(--edge); }
.alternate { background: var(--wash); }

.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}

/* Header, navigation and footer */
body > header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--edge);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}

.brand svg { width: 2.65rem; height: 2.65rem; }
.brand b { display: block; font: 600 1.55rem/1 var(--serif); letter-spacing: -.04em; }

.brand small {
  display: block;
  margin-top: .3rem;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .18em;
}

.development-banner {
  margin: 0;
  padding: .7rem var(--edge);
  background: var(--wash);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

#primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(.85rem, 2vw, 2rem);
  font-size: .875rem;
  font-weight: 600;
}

#primary-nav a:not(.button) { text-decoration: none; }
#primary-nav a:not(.button):hover, #primary-nav a[aria-current]:not(.button) {
  text-decoration: underline;
  text-underline-offset: .34em;
}

.menu-toggle { display: none; }

footer {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: start;
  gap: 1rem clamp(1.5rem, 5vw, 4rem);
  padding: 2.5rem var(--edge) 4.5rem;
  background: var(--pine);
  color: var(--paper);
  font-size: .875rem;
}

footer p { margin: 0; color: #d5e0d3; }
footer a { text-underline-offset: .25em; }

/* Controls */
.button, #login button, #owner button:not(.calendar button), #logout {
  display: inline-block;
  padding: .73rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--pine);
  color: white;
  font: 600 .875rem/1.4 var(--sans);
  text-align: center;
  text-decoration: none;
}

.button:hover, #login button:hover, #owner button:hover, #logout:hover {
  filter: brightness(1.12);
}

.button:focus-visible, #login button:focus-visible, #owner button:focus-visible, #logout:focus-visible {
  outline-color: var(--ink);
}

.hero .button:focus-visible { outline-color: var(--paper); }
.button.light { background: #e8efdc; color: var(--pine); }

.button.google-sign-in {
  border-color: var(--line);
  background: var(--surface);
  color: var(--pine);
}

.menu-toggle, .viewer-head button {
  padding: .55rem .85rem;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font-size: .875rem;
}

.textlink { font-weight: 600; text-underline-offset: .3em; }
.full { width: 100%; margin-top: 1rem; }
.button:disabled { opacity: .55; filter: none; }

.panel {
  min-width: 0;
  padding: clamp(1rem, 2.75vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel > h3:first-child { margin: 0 0 1rem; }
label { display: block; font-size: .875rem; font-weight: 650; }

input:not([type="checkbox"]), textarea {
  display: block;
  width: 100%;
  min-width: 0;
  margin: .35rem 0 1rem;
  padding: .65rem .75rem;
  border: 1px solid #a8b7ad;
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}

textarea { resize: vertical; }
input[type="checkbox"] { margin-right: .35rem; }
.muted { color: var(--muted); font-size: .875rem; }

.notice, .stay-banner {
  padding: .8rem 1rem;
  border-left: 3px solid #8d7844;
  background: #f4efdf;
  font-size: .875rem;
}

.stay-banner { margin: 1rem 0; }

/* Home */
.hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  background: var(--pine);
  color: var(--paper);
}

.hero-copy { align-self: center; padding: var(--section-space) clamp(1rem, 4vw, 3rem) var(--section-space) var(--edge); }
.kicker { color: #d0ddc4; }
.hero h1 { font-size: clamp(2.85rem, 5.4vw, 6rem); }
.hero h1 em { color: #d0ddc4; }
.hero p { max-width: 40ch; color: #e0e8de; }

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem 1.4rem;
  margin-top: 1.4rem;
}

.hero-view {
  position: relative;
  min-height: 27rem;
  margin: 0;
  background: #304e3f;
}

.hero-view img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}

.hero-view figcaption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  padding: 2.75rem 1rem .85rem;
  background: linear-gradient(transparent, rgb(10 25 18 / 85%));
  color: white;
  font-size: .875rem;
}

.slide-tools { display: flex; flex-shrink: 0; align-items: center; gap: .5rem; font-variant-numeric: tabular-nums; }

.slide-tools button, .viewer-bottom button {
  flex: 0 0 2.4rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgb(255 255 255 / 65%);
  border-radius: 50%;
  background: rgb(24 55 45 / 80%);
  color: white;
  font: 1.55rem/1 var(--sans);
}

.amenity-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 1.45rem var(--edge);
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}

.amenity-highlights > div {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  column-gap: .75rem;
  padding: 0 .4rem;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
}

.amenity-highlights > div:last-child { border: 0; }

.amenity-highlights svg {
  grid-row: span 2;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--pine);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.amenity-highlights strong { color: var(--ink); font: 400 clamp(1.05rem, 2vw, 1.6rem)/1.15 var(--serif); }

.story, #contact {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(1.5rem, 7vw, 6rem);
}

.story-copy p, .contact-copy p { max-width: 43ch; }
.story img { width: 100%; aspect-ratio: 1.6; object-fit: cover; border-radius: var(--radius); }
#contact { align-items: start; }
#availability { background: var(--wash); }
#availability > p { max-width: 67ch; }
#sync-status { margin-bottom: 1.25rem; }
.booking { grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); }
#quote { padding: .85rem; border-radius: var(--radius); background: var(--wash); }

.cost {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .875rem;
}

/* Availability and owner calendars */
.calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .8rem;
}

.calendar-head h3 { margin: 0; text-align: center; }

.calendar-head button, .calendar button, #faq button {
  border: 0;
  border-radius: var(--radius);
  background: var(--wash);
  color: var(--ink);
}

.calendar-head button { min-width: 2.5rem; min-height: 2.5rem; font-size: 1.25rem; }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .25rem;
  text-align: center;
}

.weekdays { margin-bottom: .45rem; font-size: .8125rem; }
.calendar button { min-height: 2.65rem; padding: .35rem 0; font-variant-numeric: tabular-nums; }
.calendar button.low, .key.low { background: #e0ecd9; color: #26382d; }
.calendar button.mid, .key.mid { background: #f5ebcd; color: #514519; }
.calendar button.high, .key.high { background: #f3ddd7; color: #652d28; }
.calendar button.unknown { background: #eee; color: #555; }
.calendar button.blocked, .key.blocked { background: #e9e8e5; color: #625d55; text-decoration: line-through; }
.calendar button:disabled:not(.blocked) { background: transparent; color: #777; }
.calendar button.range { box-shadow: inset 0 0 0 2px var(--pine); }
.calendar button.selected { background: var(--pine); color: white; }

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .8rem 0;
  font-size: .8125rem;
}

.key { padding: .18rem .45rem; border-radius: var(--radius); }
.owner-calendar button { min-height: 3rem; font-size: .75rem; }
.owner-calendar button span { display: block; }

/* Guest guide and account */
.faq main, .account main { min-height: 65vh; }
#questions { max-width: 52rem; border-top: 1px solid var(--line); }
#questions details { border-bottom: 1px solid var(--line); }
#questions summary { padding: 1rem 0; cursor: pointer; font-weight: 650; }
#questions details p { padding-bottom: 1rem; }
.faq h2 { margin-top: 2.25rem; }
#login { max-width: 33rem; }
#owner .panel { margin: 1.25rem 0; }
#requests { display: grid; gap: 1rem; }
#requests .panel { max-width: 42rem; width: 100%; }
#booking-calendar details + details { margin-top: .75rem; }
#booking-calendar summary { cursor: pointer; }
.agreement-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.payment-ledger { margin: 1.25rem 0; }
.payment-ledger div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.payment-ledger dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 650; }

/* Photo viewer and lodge assistant */
#viewer {
  width: min(64rem, 94vw);
  max-height: 94dvh;
  padding: 1rem;
  border: 0;
  border-radius: var(--radius);
  background: #10291f;
  color: white;
}

#viewer::backdrop { background: rgb(7 23 15 / 92%); }
#viewer img { display: block; width: 100%; height: min(67dvh, 44rem); object-fit: contain; }

.viewer-head, .viewer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .35rem 0;
  font-size: .875rem;
}

.viewer-bottom span { text-align: center; }

#chat, #faq { position: fixed; right: 1rem; z-index: 4; }
#chat { bottom: 1rem; border-color: var(--line); background: var(--surface); color: var(--ink); }

#faq {
  bottom: 4.5rem;
  width: min(23rem, calc(100% - 2rem));
  max-height: calc(100dvh - 5.5rem);
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 .5rem 2rem rgb(23 55 46 / 13%);
}

#faq h3 { margin: 0 0 .75rem; }
#faq button { display: block; width: 100%; margin-bottom: .45rem; padding: .5rem .65rem; text-align: left; }
#faq label { margin-top: 1rem; }

@media (max-width: 960px) {
  .menu-toggle { display: block; }

  #primary-nav {
    display: none;
    position: absolute;
    inset: 100% 0 auto;
    align-items: stretch;
    padding: 1rem var(--edge);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 .65rem 1rem rgb(23 55 46 / 10%);
  }

  #primary-nav.open { display: grid; }
  #primary-nav a:not(.button) { padding: .45rem 0; }
  footer { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .hero, .story, #contact, .columns { grid-template-columns: 1fr; }
  .hero-copy { padding-inline: var(--edge); }
  .hero-view { min-height: 0; height: clamp(14rem, 60vw, 24rem); }
  .amenity-highlights { padding-inline: .4rem; }

  .amenity-highlights > div {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: .35rem;
    text-align: center;
    font-size: .8125rem;
    line-height: 1.3;
  }

  .amenity-highlights svg { width: 1.45rem; height: 1.45rem; }
}

@media (max-width: 420px) {
  footer { grid-template-columns: 1fr; }
  .brand b { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.photo-controls, .photo-preview-grid {
  display: grid;
  gap: .9rem;
}
.photo-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
.photo-controls select {
  width: 100%;
  margin: .35rem 0 0;
  padding: .65rem;
  border: 1px solid #a8b7ad;
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}
.photo-guide {
  margin: 1rem 0;
  padding: clamp(.8rem,2vw,1.25rem);
  border-radius: var(--radius);
  background: var(--wash);
}
.photo-guide-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem 1rem;
  margin-bottom: .9rem;
}
.photo-guide-heading h4, .photo-guide-heading p { margin: 0; }
#photo-route { margin-top: .25rem; color: var(--muted); }
.photo-preview-grid {
  max-width: 44rem;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
}
.photo-preview-grid figure { margin: 0; min-width: 0; }
.photo-preview-grid figcaption { margin-bottom: .35rem; font-size: .875rem; font-weight: 650; }
.photo-preview-arrow { color: var(--pine); font-size: 1.5rem; }
.photo-preview {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: var(--photo-ratio,4 / 3);
  overflow: hidden;
  border: 1px dashed #a8b7ad;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.photo-preview img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.photo-preview p { padding: .5rem; margin: 0; color: var(--muted); font-size: .85rem; }
#photo-status { color: var(--muted); }
#photo-status:empty { display: none; }
@media (max-width: 36rem) {
  .photo-controls { grid-template-columns: 1fr; }
  .photo-preview-grid { gap: .4rem; }
  .photo-preview p { font-size: .75rem; }
}
