/* The Hayloft. Colours are taken from the barn itself. */
:root {
  --slate: #353A3F;       /* roof tiles and the house sign */
  --slate-2: #4A5056;
  --mortar: #EDEFEA;      /* page background: pale lime mortar */
  --paper: #FAFBF8;       /* booking card */
  --olive: #6E7B5B;       /* the olive tree: selection */
  --olive-pale: #DDE3D3;
  --door: #8C979A;        /* the front door: quiet lines */
  --brick: #8E3B2A;       /* used only for small accents */
  --ink: #23272B;
  --ink-soft: #565D63;
  --line: #CDD2CB;
  --radius-s: 4px;
  --radius-l: 10px;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sign: "Cinzel", "Trajan Pro", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--mortar);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--serif);
  font-variant-numeric: lining-nums;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-weight: 500; line-height: 1.2; margin: 0; }
h2 { font-size: 1.5rem; margin-bottom: .75rem; }
h3 { font-size: 1.2rem; margin-bottom: .75rem; }
p { margin: 0 0 1rem; }
a { color: var(--slate); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--olive); outline-offset: 2px; }
.small { font-size: .9rem; color: var(--ink-soft); }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -999px; top: 0; background: var(--slate); color: #fff; padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }

/* Preview banner */
.draft { background: var(--brick); color: #fff; text-align: center; font-size: .95rem; padding: .55rem 16px; }

/* Hero: the photo with the slate house sign */
.hero { position: relative; height: min(88vh, 820px); min-height: 460px; overflow: hidden; background: var(--slate); }
.hero picture, .hero-img { width: 100%; height: 100%; }
.hero-img { object-fit: cover; object-position: 50% 42%; }
.plaque {
  position: absolute; left: 16px; bottom: 24px;
  background: linear-gradient(160deg, #3d4348 0%, #2c3135 100%);
  color: #F2F1EC;
  padding: 1.1rem 1.6rem 1rem;
  border-radius: var(--radius-s);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 18px 40px rgba(20,22,24,.35);
  border: 1px solid #23272a;
  max-width: calc(100% - 32px);
}
.plaque::before, .plaque::after { /* the two fixing screws on the real sign */
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9aa0a4, #5d6367);
}
.plaque::before { left: 8px; } .plaque::after { right: 8px; }
.plaque-name {
  font-family: var(--sign); font-weight: 600; text-transform: uppercase;
  font-size: clamp(2rem, 7vw, 4.2rem); letter-spacing: .06em; line-height: 1;
  text-shadow: 0 -1px 0 rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.12); /* engraved */
}
.plaque-place { margin: .55rem 0 0; font-size: 1rem; font-style: italic; color: #C9CDC6; }
@media (min-width: 900px) { .plaque { left: 48px; bottom: 48px; padding: 1.5rem 2.4rem 1.3rem; } }

/* Intro and key facts */
.intro { padding-top: 3rem; padding-bottom: 2rem; }
.lede { font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.45; max-width: 34em; color: var(--ink); }
.facts { display: flex; flex-wrap: wrap; gap: 0; margin: 2rem 0 0; border-top: 1px solid var(--line); }
.facts div { padding: .9rem 1.6rem .9rem 0; margin-right: 1.6rem; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts dt { font-size: .85rem; color: var(--ink-soft); }
.facts dd { margin: 0; font-size: 1.05rem; }
@media (max-width: 600px) {
  .facts { display: grid; grid-template-columns: 1fr 1fr; }
  .facts div { border-right: 0; margin: 0; padding: .75rem 0; border-bottom: 1px solid var(--line); }
}

/* Gallery: one tall photo, then a mixed grid */
.gallery { padding-bottom: 3rem; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 46vw; }
.grid li { position: relative; overflow: hidden; border-radius: var(--radius-s); min-height: 0; background: #d9ddd6; }
.grid li:first-child { grid-column: span 2; grid-row: span 2; }
.grid button { all: unset; position: absolute; inset: 0; cursor: zoom-in; }
.grid button:focus-visible { outline: 3px solid var(--olive); outline-offset: -3px; }
.grid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) {
  /* Big photo on the left, two stacked on the right, then a row of three */
  .grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 250px; }
  .grid li:first-child { grid-column: span 2; grid-row: span 2; }
}

/* Two columns: details and booking */
.columns { display: grid; gap: 2.5rem; padding-bottom: 5rem; }
@media (min-width: 960px) { .columns { grid-template-columns: minmax(0, 1fr) 400px; gap: 4rem; } }
.block, #sections > section { padding: 1.75rem 0; border-top: 1px solid var(--line); }
.details > :first-child > section:first-child { border-top: 0; padding-top: 0; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { padding-left: 1.4rem; position: relative; margin-bottom: .4rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .7em; width: .55rem; height: 1px; background: var(--olive); }
.pairs { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; margin: 0; }
.pairs dt { color: var(--ink-soft); }
.pairs dd { margin: 0; }
.steps { margin: 0 0 1rem; padding-left: 1.4rem; }
.steps li { margin-bottom: .5rem; padding-left: .3rem; }
.steps li::marker { color: var(--olive); font-weight: 600; }

/* Booking card */
.book { position: relative; }
@media (min-width: 960px) { .book-card { position: sticky; top: 24px; } }
.book-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.4rem; box-shadow: 0 1px 2px rgba(35,39,43,.06), 0 12px 32px rgba(35,39,43,.07); }
.book-title { font-size: 1.35rem; margin-bottom: .2rem; }
.from { color: var(--ink-soft); margin-bottom: 1rem; }
.from strong { color: var(--ink); font-weight: 600; font-size: 1.15rem; }

.cal { position: relative; }
.cal-nav { position: absolute; top: -.1rem; left: 0; right: 0; display: flex; justify-content: space-between; pointer-events: none; }
.nav-btn { pointer-events: auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--slate); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.nav-btn:disabled { opacity: .35; cursor: default; }
.months { display: grid; gap: 1.5rem; }
.month-name { text-align: center; font-weight: 500; margin: .2rem 0 .7rem; font-size: 1.05rem; }
.dow, .days { display: grid; grid-template-columns: repeat(7, 1fr); }
.dow span { text-align: center; font-size: .75rem; color: var(--ink-soft); padding-bottom: .3rem; }
.day {
  appearance: none; border: 0; background: none; font: inherit; color: var(--ink);
  height: 48px; padding: 4px 0 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.1;
  position: relative;
}
.day .n { font-size: .95rem; }
.day .p { font-size: .68rem; color: var(--ink-soft); margin-top: 3px; }
.day:hover:not(:disabled) .n { text-decoration: underline; text-underline-offset: 3px; }
.day:disabled { cursor: default; color: #A9AEAA; }
.day:disabled .p { visibility: hidden; }
.day.booked .n { text-decoration: line-through; color: #9AA09C; }
.day.booked .p { visibility: hidden; }
.day.booked.out-ok { cursor: pointer; }
.day.in-range { background: var(--olive-pale); }
.day.start, .day.end { background: var(--olive); color: #fff; }
.day.start .p, .day.end .p { color: #E8ECE1; }
.day.start { border-radius: 24px 0 0 24px; }
.day.end { border-radius: 0 24px 24px 0; }
.day.start.end { border-radius: 24px; }
.day.today .n::after { content: ""; display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--brick); margin: 2px auto 0; }
.cal-key { font-size: .8rem; color: var(--ink-soft); margin: .6rem 0 1rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: .4rem; }
.key:first-child { margin-left: 0; }
.key-booked { background: repeating-linear-gradient(135deg, #C9CEC8 0 2px, transparent 2px 5px); border: 1px solid #C9CEC8; }
.key-sel { background: var(--olive); }

.when { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: .9rem; }
.when > div { padding: .55rem .8rem; }
.when > div + div { border-left: 1px solid var(--line); }
.when-label { display: block; font-size: .78rem; color: var(--ink-soft); }
.when-val { font-size: .98rem; }

.field { display: block; margin-bottom: .85rem; }
.field span { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: .25rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1px solid #B9BFB8; border-radius: var(--radius-s); padding: .6rem .7rem;
}
.field textarea { resize: vertical; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; margin: .4rem 0 1rem; }
.check input { margin-top: .3rem; width: 18px; height: 18px; accent-color: var(--olive); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.msg { min-height: 0; margin: 0 0 .8rem; color: var(--brick); font-size: .95rem; }
.msg:empty { display: none; }
.quote { border-top: 1px solid var(--line); padding-top: .9rem; margin-bottom: 1rem; }
.qrow { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; }
.qrow.total { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .6rem; font-weight: 600; font-size: 1.1rem; }
.qrow.save span:last-child { color: var(--olive); }
.quote .small { margin: .6rem 0 0; }

.btn {
  display: inline-block; width: 100%; text-align: center; text-decoration: none;
  font: 500 1.05rem/1 var(--serif); color: #fff; background: var(--slate);
  border: 0; border-radius: var(--radius-s); padding: 1rem 1.2rem; cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--slate-2); }
.btn:disabled { background: #A5ABA6; cursor: not-allowed; }
.btn-small { width: auto; padding: .7rem 1rem; font-size: .98rem; }
.btn-link { background: none; border: 0; font: inherit; color: var(--ink-soft); text-decoration: underline; cursor: pointer; margin-top: .6rem; padding: .2rem; }
.actions { text-align: center; }
.req { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.req .small { margin: .7rem 0 0; text-align: center; }
.done { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.done h3 { color: var(--olive); }

/* Footer */
.foot { background: var(--slate); color: #DADDD8; padding: 2.5rem 0 6rem; }
.foot a { color: #fff; }
.foot-name { font-family: var(--sign); color: #fff; letter-spacing: .05em; font-size: 1.1rem; }
.foot .small { color: #AEB4B0; }
@media (min-width: 960px) { .foot { padding-bottom: 2.5rem; } }

/* Mobile bar */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--paper); border-top: 1px solid var(--line); padding: .65rem 16px calc(.65rem + env(safe-area-inset-bottom)); }
.bar strong { font-weight: 600; }
@media (min-width: 960px) { .bar { display: none; } }

/* Photo viewer */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(23,26,28,.92); }
.lightbox img { max-width: 92vw; max-height: 82vh; margin: 6vh auto 0; object-fit: contain; border-radius: var(--radius-s); }
.lb-cap { color: #D7DAD5; text-align: center; padding: .8rem 16px; font-size: .95rem; }
.lb-btn { position: fixed; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; }
.lb-next { right: 14px; top: 50%; }
