/* Saltbox Inn — one stylesheet for the whole site.
   The system comes from the house and the harbour (DESIGN.md):
   harbour white ground, harbour navy deepened to ink, and the red
   off the front door — used the way the door is used: rarely, and
   only where it means something. The saltbox's long rear pitch is
   the recurring geometry: photo crops and rules sit on the slope. */

:root {
  --ground: #f2f3f1;
  --ink: #16283a;
  --ink-deep: #0f1d2c;
  --soft: #5a6b78;
  --line: #d8ddd9;
  --band: #e9ece8;
  --paper: #ffffff;
  --door: #b3402e;
  --door-dark: #97351f;
  --free: #2e6b34;
  --amber: #9a6a12;

  /* legacy names, kept pointing at the new tokens so rules written
     for the old palette land in the new world */
  --navy: var(--ink);
  --navy-dark: var(--ink-deep);
  --door-red: var(--door);
  --gray: var(--soft);
  --wash: var(--band);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--ground);
  line-height: 1.6;
  font-size: 16.5px;
}

h1, h2, h3, .serif {
  font-family: "Bitter", Georgia, serif;
  color: var(--ink);
  line-height: 1.12;
  font-weight: 700;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: -0.02em; margin: 0 0 .5rem; }
h2 { font-size: clamp(2.3rem, 5vw, 3.9rem); letter-spacing: -0.015em; margin: 0 0 .7rem; }
h3 { font-size: 1.18rem; margin: 1.4rem 0 .4rem; }

p { margin: 0 0 1rem; }
a { color: var(--ink); text-decoration-color: #a9b6bd; text-underline-offset: 3px; }
a:hover { color: var(--door); }

img { max-width: 100%; display: block; }

::selection { background: #cfd8d2; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.vh { /* visually hidden, read aloud */
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* the roofline: a wedge cut on the saltbox pitch, in door red.
   It sits under page heads the way the long roof sits on the house. */
.roofrule {
  width: 84px; height: 11px; background: var(--door);
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
  margin: 16px 0 20px;
}

/* ---------- header ---------- */

.topbar {
  background: var(--ink-deep);
  color: #c8d3da;
  font-size: .86rem;
}
.topbar .wrap { display: flex; justify-content: space-between; gap: 1rem; padding-top: 7px; padding-bottom: 7px; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

.sitehead { border-bottom: 1px solid var(--line); background: var(--ground); }
.sitehead .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-top: 18px; padding-bottom: 14px;
}
.wordmark { font-family: "Bitter", Georgia, serif; font-size: 1.6rem; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: .2px; }
.wordmark span { color: var(--door); }
.wordmark small { display: block; font-family: "Public Sans", sans-serif; font-weight: 400; font-size: .78rem; color: var(--soft); letter-spacing: 1.6px; text-transform: uppercase; margin-top: 1px; }

nav.main { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: baseline; }
nav.main a { text-decoration: none; font-size: .98rem; padding: 4px 0; }
nav.main a.booklink {
  background: var(--door); color: #fff; padding: 8px 18px; border-radius: 2px;
}
nav.main a.booklink:hover { background: var(--door-dark); color: #fff; }

/* ---------- general bits ---------- */

.lede { font-size: 1.14rem; max-width: 40rem; }
.small { font-size: .9rem; }
.muted { color: var(--soft); }

.btn {
  display: inline-block; background: var(--ink); color: #fff; border: 0;
  padding: 11px 22px; font: inherit; font-size: .98rem; border-radius: 2px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--ink-deep); color: #fff; }
.btn.red { background: var(--door); }
.btn.red:hover { background: var(--door-dark); }
.btn.ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }

input, select, textarea {
  font: inherit; font-size: .98rem; padding: 9px 11px;
  border: 1px solid #b4bcb6; border-radius: 2px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; }
label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 4px; color: var(--ink); }

.note-box { background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--ink); padding: 16px 20px; margin: 1.2rem 0; }
.note-box p:last-child { margin-bottom: 0; }

.cap { font-size: .88rem; color: var(--soft); padding-top: 8px; max-width: 44rem; }

/* ---------- chapters (home) ---------- */

.chapter { margin: clamp(4.2rem, 9vw, 7.5rem) 0; }
.chapter-head { margin-bottom: 1.6rem; }

/* the street: one photograph, one word */
.street { position: relative; }
.street-photo {
  position: relative;
  height: min(86vh, 740px); overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 2.6vw));
}
.street-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.place-word {
  position: absolute; left: max(24px, calc(50vw - 590px)); bottom: 4.5vw;
  font-family: "Bitter", Georgia, serif; font-weight: 800;
  font-size: clamp(3.4rem, 10.5vw, 9.5rem); line-height: .95; letter-spacing: -0.02em;
  color: #fff; text-shadow: 0 1px 26px rgba(15, 29, 44, .45);
  margin: 0;
}
.street-cap {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .9rem; color: var(--soft); padding-top: 10px;
}

/* the porch: one quiet text chapter, notes in the margin */
.porch-grid { display: grid; grid-template-columns: minmax(0, 40rem) minmax(0, 1fr); gap: 3.5rem; align-items: start; }
.margin-notes { border-left: 1px solid var(--line); padding-left: 1.6rem; font-size: .96rem; }
.margin-notes h3 { margin-top: .2rem; }
.margin-notes ul { margin: 0; padding-left: 1.1rem; }
.margin-notes li { margin-bottom: .45rem; }

/* story chapters open the way the guest book does */
.dropcap::first-letter {
  font-family: "Bitter", Georgia, serif; font-weight: 800;
  float: left; font-size: 3.3em; line-height: .82;
  padding: .04em .14em 0 0; color: var(--ink);
}

/* the diary strip on the home page: the next fortnight, from the book */
.diary-strip { background: var(--paper); border: 1px solid var(--line); }
.diary-strip-head {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  align-items: baseline; padding: 16px 22px 0;
}
.diary-strip-head h3 { margin: 0; font-size: 1.3rem; }
.fortnight {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
  padding: 14px 22px 6px;
}
.fday { border-left: 1px solid var(--line); padding: 6px 8px 10px; }
.fday .dow { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--soft); }
.fday .d { font-family: "Bitter", Georgia, serif; font-weight: 700; font-size: 1.25rem; line-height: 1.2; }
.fday .n { font-size: .8rem; color: var(--soft); }
.fday.today { background: var(--band); }
.fday.full .n { color: var(--door); font-weight: 600; }
.diary-strip .checkbar { border: 0; border-top: 1px solid var(--line); margin: 10px 0 0; }

/* the date form (home strip, room pages) */
.checkbar {
  border: 1px solid var(--line); padding: 18px 22px;
  display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; background: var(--paper);
}
.checkbar h3 { margin: 0 0 .2rem; }
.checkbar .field { min-width: 150px; }

/* breakfast, and other two-part chapters */
.split { display: flex; gap: 2.8rem; flex-wrap: wrap; margin: 0; align-items: flex-start; }
.split .grow { flex: 1 1 24rem; }
.split .pic { flex: 0 1 25rem; }
.split .pic img { width: 100%; height: auto; }
.split.reverse .pic { order: -1; }

.band { margin: 0; }
.band img { width: 100%; height: 300px; object-fit: cover; }

/* the bay: one photograph, drifting — the only parallax on the site */
.bay-photo { height: min(70vh, 600px); overflow: hidden; position: relative; }
.bay-photo img {
  width: 100%; height: calc(100% + 28px); object-fit: cover;
  position: absolute; left: 0; top: -14px; will-change: transform;
}

/* the rooms, as an index you read */
.rooms-index { border-top: 2px solid var(--ink); }
.room-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem 2.5rem;
  padding: 1.7rem 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.room-line .room-name {
  font-family: "Bitter", Georgia, serif; font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.05; letter-spacing: -0.015em;
  color: var(--ink); text-decoration: none;
}
.room-line .room-name:hover { color: var(--door); }
.room-line .one-line { grid-column: 1; max-width: 42rem; margin: 0; }
.room-line .rate { font-family: "Bitter", Georgia, serif; font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.room-line .rate small { font-family: "Public Sans", sans-serif; font-weight: 400; font-size: .82rem; color: var(--soft); }
.room-line .go { grid-column: 1; font-size: .95rem; }

/* the house's story */
.beats { margin-top: 1.6rem; }
.beat { border-top: 1px solid var(--line); padding: 1.4rem 0 1.6rem; display: grid; grid-template-columns: 11rem minmax(0, 44rem); gap: .4rem 2.5rem; }
.beat-year { font-family: "Bitter", Georgia, serif; font-weight: 800; color: var(--ink); font-size: 1.7rem; line-height: 1.1; }
.beat h3 { margin: 0 0 .3rem; font-size: 1.3rem; }
.beat p { margin-bottom: 0; }

/* who it suits */
.fit-cols { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1.2rem; }
.fit-col { flex: 1 1 21rem; background: var(--paper); border: 1px solid var(--line); padding: 8px 24px 16px; }
.fit-col ul { margin: 0; padding-left: 1.1rem; }
.fit-col li { margin-bottom: .5rem; }

/* guest book */
.guestbook { margin-top: 2.6rem; }
.guestbook blockquote {
  margin: 0 0 1.6rem; padding: 0; font-family: "Bitter", Georgia, serif;
  font-style: italic; font-size: 1.22rem; line-height: 1.5; color: var(--ink); max-width: 44rem;
}
.guestbook blockquote footer { font-family: "Public Sans", sans-serif; font-style: normal; font-size: .86rem; color: var(--soft); margin-top: .35rem; }

.gb-stats { display: flex; gap: 2.5rem; flex-wrap: wrap; margin: .4rem 0 2rem; }
.gb-stat { flex: 0 1 12rem; border-top: 2px solid var(--ink); padding-top: .55rem; }
.gb-stat b { display: block; font-family: "Bitter", Georgia, serif; font-size: 1.9rem; color: var(--ink); line-height: 1.15; }
.gb-stat span { font-size: .88rem; color: var(--soft); }

/* questions people ask */
.faq { margin-top: 1rem; }
.faq-item { border-top: 1px solid var(--line); padding: .95rem 0; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary {
  font-family: "Bitter", Georgia, serif; font-weight: 700; font-size: 1.08rem;
  color: var(--ink); cursor: pointer;
}
.faq-item summary::marker { color: var(--ink); }
.faq-item p { margin: .55rem 0 .1rem; max-width: 44rem; }

/* ---------- rooms pages ---------- */

.room-entry {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 2.6rem; padding: 2.4rem 0; border-bottom: 1px solid var(--line);
  align-items: start;
}
.room-entry .pic img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.room-entry.flip .pic { order: 2; }
.room-entry h3 { margin-top: 0; font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.015em; }
.room-entry h3 a { text-decoration: none; }
.room-entry .rate { font-weight: 700; color: var(--ink); font-family: "Bitter", Georgia, serif; font-size: 1.08rem; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 .8rem; }
.chip {
  font-size: .78rem; line-height: 1.3; color: var(--ink);
  background: transparent; border: 1px solid var(--line);
  border-radius: 2px; padding: 3px 10px; white-space: nowrap;
}

.facts { font-size: .97rem; }
.facts dl { margin: 0; }
.facts dt { font-weight: 600; color: var(--soft); float: left; clear: left; width: 7.5rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.facts dd { margin: 0 0 0 7.5rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }

.taken { color: var(--door); font-weight: 600; }
.free { color: var(--free); font-weight: 600; }

/* ---------- the house diary (booking) ---------- */

.diary {
  background: var(--paper); border: 1px solid var(--line);
  padding: 20px 22px; margin: 0 0 1.8rem;
}
.diary-head {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  align-items: baseline; border-bottom: 2px solid var(--ink);
  padding-bottom: .55rem; margin-bottom: 1rem;
}
.diary-head h3 { margin: 0; font-size: 1.35rem; }
.diary-months { display: grid; grid-template-columns: 1fr 1fr; gap: 2.2rem; }
.dmonth h4 { font-family: "Bitter", Georgia, serif; font-size: 1.05rem; margin: 0 0 .45rem; color: var(--ink); }
.dgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dow { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); text-align: center; padding: 2px 0; }
.dcell {
  position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  font: inherit; font-size: .87rem; color: var(--ink);
  background: transparent; border: 0; padding: 0; border-radius: 0;
}
button.dcell.free { cursor: pointer; }
button.dcell.free:hover { background: var(--band); }
.dcell.past { color: #b7beb9; }
.dcell.other { visibility: hidden; }
.dcell .x { position: absolute; inset: 10% 8%; width: 84%; height: 80%; pointer-events: none; }
.dcell.taken { color: #9aa5a0; }
.dcell.inrange { background: #e3e9e5; }
.dcell.inrange::after, .dcell.endpoint::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 16%;
  height: 2px; background: var(--ink); opacity: .5;
}
.dcell.endpoint { background: var(--ink); color: #fff; font-weight: 700; }
.dcell.endpoint::after { background: #fff; }
.dcell.leaving { box-shadow: inset 0 0 0 1.5px var(--ink); border-radius: 50%; }
.dcell.today .num { text-decoration: underline; text-underline-offset: 3px; }
.diary-legend { font-size: .84rem; color: var(--soft); margin-top: .8rem; display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: center; }
.diary-legend .swatch { display: inline-flex; align-items: center; gap: .4rem; }
.diary-legend svg { display: inline-block; }

/* ---------- booking ---------- */

.booklayout { display: flex; gap: 2.8rem; flex-wrap: wrap; align-items: flex-start; margin-top: 1.4rem; }
.bookmain { flex: 1 1 32rem; }
/* the bill is written in the diary's margin — the red line down its
   left edge is the margin rule of the book itself */
.bookside {
  flex: 0 1 19.5rem; background: var(--paper);
  border: 1px solid var(--line); border-left: 2px solid rgba(179, 64, 46, .5);
  padding: 18px 20px; position: sticky; top: 16px;
}
.bookside h3 { margin-top: 0; }
.bookside table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.bookside td { padding: 4px 0; vertical-align: top; }
.bookside td.r { text-align: right; white-space: nowrap; padding-left: 12px; font-variant-numeric: tabular-nums; }
.bookside tr.total td {
  border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink);
  padding-top: 8px; padding-bottom: 8px; font-weight: 700; color: var(--ink);
}

.pickroom { background: var(--paper); border: 1px solid var(--line); padding: 14px 16px; margin-bottom: 12px; display: flex; gap: 1rem; align-items: flex-start; cursor: pointer; }
.pickroom:hover { border-color: var(--ink); }
.pickroom.chosen { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pickroom img { width: 130px; height: 92px; object-fit: cover; flex: none; }
.pickroom h4 { margin: 0 0 .2rem; font-family: "Bitter", Georgia, serif; color: var(--ink); font-size: 1.05rem; }
.pickroom .stay { margin-left: auto; text-align: right; flex: none; }
.pickroom.unavailable { opacity: .55; cursor: default; }

.formgrid { display: flex; gap: 1rem; flex-wrap: wrap; }
.formgrid .field { flex: 1 1 13rem; margin-bottom: 1rem; }
.field.full { flex-basis: 100%; }
.err { color: var(--door); font-size: .9rem; min-height: 1.2em; }

.confirmref {
  font-family: "Bitter", Georgia, serif; font-size: 2.1rem; color: var(--ink);
  border: 1.5px solid var(--ink); display: inline-block; padding: 10px 24px; margin: .6rem 0 1rem;
  letter-spacing: .02em;
}

/* ---------- manage ---------- */

table.bookings { width: 100%; border-collapse: collapse; font-size: .93rem; margin: 1rem 0 2rem; }
table.bookings th { text-align: left; border-bottom: 2px solid var(--ink); padding: 7px 8px; color: var(--ink); }
table.bookings td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
.status { font-size: .8rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.status.pending { color: var(--amber); }
.status.confirmed { color: var(--free); }
.status.cancelled { color: var(--door); }
.mini { font-size: .84rem; padding: 5px 11px; }

.weekstrip { display: flex; gap: 8px; margin: 1rem 0 1.6rem; flex-wrap: wrap; }
.daycol { flex: 1 1 6.2rem; background: var(--paper); border: 1px solid var(--line); padding: 9px 10px; }
.daycol h4 { margin: 0 0 .35rem; font-size: .88rem; color: var(--ink); }
.daycol .roomline { font-size: .8rem; color: var(--soft); }
.daycol .roomline b { color: var(--ink); font-weight: 600; }

/* ---------- chat ---------- */

.chatbtn {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  background: var(--door); color: #fff; border: 0; border-radius: 24px;
  padding: 12px 20px; font: inherit; font-size: .95rem; cursor: pointer;
  box-shadow: 0 3px 12px rgba(15, 29, 44, .28);
}
.chatbtn:hover { background: var(--door-dark); }

.chatpanel {
  position: fixed; right: 20px; bottom: 76px; z-index: 40; width: 348px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid #c3c9c2; border-radius: 4px;
  box-shadow: 0 10px 34px rgba(15, 29, 44, .25); display: none; flex-direction: column;
  max-height: min(560px, calc(100vh - 110px));
}
.chatpanel.open { display: flex; }
.chathead { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 4px 4px 0 0; }
.chathead b { font-family: "Bitter", Georgia, serif; font-size: 1.02rem; }
.chathead p { margin: 2px 0 0; font-size: .8rem; color: #c2ced6; }
.chatlog { padding: 14px; overflow-y: auto; flex: 1; }
.msg { margin-bottom: 10px; max-width: 88%; padding: 8px 12px; border-radius: 10px; font-size: .93rem; line-height: 1.45; white-space: pre-line; }
.msg.bot { background: var(--band); border-bottom-left-radius: 2px; }
.msg.me { background: var(--ink); color: #fff; margin-left: auto; border-bottom-right-radius: 2px; }
.msg a { color: var(--door); font-weight: 600; }
.msg.me a { color: #ffd9d2; }
.chatchips { padding: 0 14px 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.chatchips button {
  font-size: .8rem; background: #fff; border: 1px solid var(--ink); color: var(--ink);
  border-radius: 14px; padding: 4px 11px; cursor: pointer;
}
.chatchips button:hover { background: var(--band); }
.chatform { display: flex; border-top: 1px solid var(--line); }
.chatform input { flex: 1; border: 0; padding: 12px; }
.chatform input:focus { outline: none; }
.chatform button { background: var(--ink); color: #fff; border: 0; padding: 0 18px; font: inherit; cursor: pointer; border-radius: 0 0 4px 0; }

/* ---------- footer ---------- */

.sitefoot { background: var(--ink-deep); color: #ccd6dd; margin-top: 4rem; }
.sitefoot .wrap { padding-top: 30px; padding-bottom: 26px; display: flex; gap: 2.6rem; flex-wrap: wrap; }
.sitefoot h3 { color: #fff; margin-top: 0; font-size: 1.05rem; }
.sitefoot a { color: #ccd6dd; text-decoration-color: #54687c; }
.sitefoot a:hover { color: #fff; }
.sitefoot .col { flex: 1 1 13rem; }
.footbottom { border-top: 1px solid #2a3e52; }
.footbottom .wrap { padding-top: 12px; padding-bottom: 14px; font-size: .84rem; color: #8b9dab; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .porch-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .margin-notes { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 1rem; }
  .diary-months { grid-template-columns: 1fr; }
  .room-entry { grid-template-columns: 1fr; gap: 1.2rem; }
  .room-entry.flip .pic { order: 0; }
  .beat { grid-template-columns: 1fr; gap: .1rem; }
}

@media (max-width: 640px) {
  h1 { font-size: 2.3rem; }
  h2 { font-size: 2rem; }
  .place-word { font-size: clamp(3rem, 17vw, 4.5rem); bottom: 7vw; }
  .street-photo { height: 62vh; }
  .bookside { position: static; }
  .room-line .rate { grid-column: 1; }
}
