/* John's Bunkhouse's website wears the booking pages' look: their palette,
   masthead, type, buttons and footer all come from the app's own
   stylesheets, linked before this one. This file adds only what a website
   has and the booking pages do not — a wider page, the navigation, and
   photographs that run edge to edge — and it is not layered, so it wins
   over the app's rules without fighting their specificity. */

body.site {
  --site-column: 64rem;
  --content: var(--site-column);
  /* The masthead's glass: the page's own ground, most of the way opaque,
     so at rest the band is the page and only what scrolls under it tells
     them apart. */
  --mh-glass: color-mix(in oklab, var(--jb-canvas) 75%, transparent);
}

/* The masthead: the booking pages' band, on the website's column. The
   links sit between the name and Book while they fit there; when they do
   not, they take a row of their own below, and Book stays on the first row
   beside the name. The band is its own container, so that is decided by the
   room there is rather than by a guess at the width of the screen.

   It stays at the top of the page as the page scrolls, and it is glass:
   the page's ground, most of the way opaque, over a blur of whatever is
   passing underneath, with no rule of its own. Its inks and its buttons'
   paper are custom properties, so the home page's sky can hand them over
   by changing values, not rules. */
body.site site-header {
  --mh-ink: var(--jb-text);
  --mh-ink-quiet: var(--jb-text-muted);
  --mh-chip: var(--jb-surface);
  /* How much of the ink a link shows at rest. Pointing at one, or being
     on its page, brings it up to the whole. */
  --mh-rest: 75%;
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  padding-inline: 0;
  background: var(--mh-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border-block-end: 0;
  /* The column plus its own padding, so the name lines up with the text
     of the page below it. */
  & brand-bar {
    container: masthead / inline-size;
    max-inline-size: calc(var(--site-column) + 2.5rem);
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    padding: 0.875rem 1.25rem;
  }
  /* The mark is drawn larger than the booking pages' so it stands beside
     two lines, the name and where the bunkhouse is. */
  & .brand {
    flex: 0 0 auto;
    color: var(--mh-ink);
    & img { inline-size: 3rem; block-size: 3rem; }
    & span { display: grid; gap: 0.125rem; }
    & small {
      font-family: inherit;
      font-size: 0.8125rem;
      font-weight: 400;
      color: var(--mh-ink-quiet);
      vertical-align: baseline;
    }
  }
  /* The links are buttons: white, round-ended, a step smaller than Book,
     their words at three quarters of the ink. Pointing at one shades its
     paper and brings its words up to the whole ink. The page you are on
     is the bunkhouse's colour, faintly, with a ring of it. Book stands
     apart from them by the band's gap alone. */
  & nav {
    flex: 1 1 auto;
    & ul { list-style: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.25rem; margin: 0; padding: 0; }
    & a {
      display: flex;
      align-items: center;
      block-size: 2.25rem;
      padding-inline: 0.75rem;
      font-family: inherit;
      font-size: 0.875rem;
      line-height: 1;
      text-transform: none;
      letter-spacing: normal;
      white-space: nowrap;
      text-decoration: none;
      color: color-mix(in oklab, var(--mh-ink) var(--mh-rest), transparent);
      background: var(--mh-chip);
      border: 0;
      border-radius: 999px;
      box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--mh-ink) 9%, transparent);
      transition: color 180ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
      &:hover { color: var(--mh-ink); background: color-mix(in oklab, var(--mh-chip), var(--mh-ink) 7%); }
      &:focus-visible { color: var(--mh-ink); outline: 2px solid var(--mh-ink); outline-offset: 2px; }
    }
    & a[aria-current="page"] {
      color: var(--mh-ink);
      background: color-mix(in oklab, var(--mh-chip), var(--jb-accent) 12%);
      box-shadow: inset 0 0 0 1.5px var(--jb-accent);
      &:hover { background: color-mix(in oklab, var(--mh-chip), var(--jb-accent) 20%); }
    }
  }
  /* Book is the one solid thing on the glass. Larger than the links and a
     full thumb high, so it reads as the band's purpose rather than as one
     more place to go; round-ended like them, so they are one family. */
  & .cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-block-size: 2.75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.01em;
    text-decoration: none;
    background: var(--jb-accent);
    color: var(--jb-accent-text);
    border: 0;
    border-radius: 999px;
    padding: 0 1.5rem;
    transition: background-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
    &:hover { background: var(--jb-accent-hover); color: var(--jb-accent-text); }
    &:active { background: var(--jb-accent-hover); translate: 0 1px; }
    &:focus-visible { outline: 2px solid var(--mh-ink); outline-offset: 3px; }
  }
}

/* A signed-in staff member's menu, at the top right: their initials on a
   chip like the links', so Book stays the one solid thing, and under it
   the panel on the page's own paper. The band is already full at the
   column's width, so the menu is not one more thing in its row. Where the
   page has a margin wide enough it stands there, just past the column;
   narrower, the band keeps room for it at its end, which leaves the links
   less and so moves them to their own row sooner, by the band's own
   container query. Nobody but staff sees any of this. */
body.site site-header brand-bar:has(> user-menu:not([hidden])) {
  position: relative;
  padding-inline-end: 5.25rem;
  @media (width >= 74rem) { padding-inline-end: 1.25rem; }
}
@media (65.5rem <= width < 74rem) {
  :root:has(site-header user-menu:not([hidden])) { --mh-block: 7.25rem; }
}
body.site site-header user-menu {
  position: absolute;
  inset-block-start: 0.875rem;
  inset-inline-end: 1.25rem;
  /* One row there, so the middle of the band is the middle of Book. */
  @media (width >= 74rem) { inset-block-start: 50%; translate: 0 -50%; inset-inline-end: auto; inset-inline-start: 100%; }
  & user-mark {
    inline-size: 2.75rem;
    block-size: 2.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mh-ink);
    background: var(--mh-chip);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--mh-ink) 16%, transparent);
  }
  & summary:hover user-mark { color: var(--mh-ink); background: color-mix(in oklab, var(--mh-chip), var(--mh-ink) 7%); }
  & summary:focus-visible user-mark { outline: 2px solid var(--mh-ink); outline-offset: 3px; }
  & user-panel { background: var(--jb-surface); border-color: var(--jb-border); }
  & p.who, & a, & button.link { font-family: inherit; font-size: 0.875rem; color: var(--jb-text); }
  & p.who { border-color: var(--jb-border); & small { color: var(--jb-text-muted); } }
  & a:hover, & button.link:hover { background: color-mix(in oklab, var(--jb-surface), var(--jb-text) 7%); color: var(--jb-text); }
}

/* Where glass cannot be drawn, or the reader has asked for less of it,
   the band is the plain page. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.site { --mh-glass: var(--jb-canvas); }
}
@media (prefers-reduced-transparency: reduce) {
  body.site { --mh-glass: var(--jb-canvas); }
  body.site site-header, body.site nav.contents::before {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  body.site nav.contents::before { background: var(--jb-canvas); }
}

/* Too narrow for one row: Book moves up beside the name, and the links
   take the whole of the row below, starting from the left. */
@container masthead (max-width: 63rem) {
  body.site site-header {
    /* The name gives way before Book does: on a phone too narrow for
       both, where the bunkhouse is gets cut short, and Book keeps its
       place beside the name rather than dropping to a row of its own. */
    & .brand {
      flex: 1 1 0;
      min-inline-size: 0;
      padding-block: 0;
      & img { inline-size: 2.5rem; block-size: 2.5rem; }
      & span { min-inline-size: 0; white-space: nowrap; }
      & small { overflow: hidden; text-overflow: ellipsis; }
    }
    & .cta { margin-inline-start: auto; }
    & nav {
      order: 1;
      flex-basis: 100%;
      min-inline-size: 0;
      & ul { flex-wrap: nowrap; justify-content: flex-start; }
    }
  }
}
/* A phone: seven buttons do not go in a line, so they wrap onto two rows,
   four above and three below, each row's buttons shared out across the
   width. Always two rows, never a line that scrolls, so every place is in
   sight and the band is the same height on every phone, which is how the
   Berneray contents know where to stand beneath it. */
@container masthead (max-width: 44rem) {
  body.site site-header nav {
    & ul {
      flex: 1 1 auto;
      flex-wrap: wrap;
      /* The break between the rows: a line of no height after the fourth
         button. */
      &::before { content: ""; order: 2; flex-basis: 100%; block-size: 0; }
    }
    & li { flex: 1 1 auto; order: 1; }
    & li:nth-child(n + 5) { order: 3; }
    & a { justify-content: center; padding-inline: 0.5rem; font-size: 0.8125rem; }
  }
}
/* The narrowest phones, 320px across, fit the name and Book side by side
   only with the band drawn closer to the edges, as the page's own text
   already is at that width. */
@media (width < 24rem) {
  body.site site-header {
    & brand-bar { column-gap: 0.75rem; padding-inline: 1rem; }
    & .brand { gap: 0.625rem; & img { inline-size: 2.25rem; block-size: 2.25rem; } & small { font-size: 0.75rem; } }
    & .cta { padding-inline: 1rem; }
  }
}

/* How tall the band is. Every size in it is set in rems, so it is the
   same at any text size: one row on a wide screen, two where the links
   take a row of their own, and three on a phone, where they wrap. An anchored jump lands clear of it. These are
   the first guess: the layout measures the band once it is drawn and
   sets --mh-block to what it really is, so what sticks under it meets it
   whatever wraps or is added; the guesses stand where there is no script. */
:root { --mh-block: 5.39rem; }
@media (width < 65.5rem) { :root { --mh-block: 7.25rem; } }
@media (width < 46.5rem) { :root { --mh-block: 10rem; } }
html:has(body.site) { scroll-padding-block-start: var(--mh-block); }
/* Bars that run the width of the window, under the masthead, never make
   the page scroll sideways where a scrollbar takes some of it. */
body.site { overflow-x: clip; }

/* The page: the website's grid rather than the booking pages' one narrow
   column, so photographs can run full width and text can sit beside them. */
body.site main {
  display: grid;
  max-inline-size: none;
  margin: 0;
  padding: 2rem 0 3rem;
  row-gap: 2.5rem;
}
body.site main.home { padding-block-start: 0; }
body.site main :is(h1, h2, h3) { color: var(--jb-text); }
body.site figure img { border-radius: 3px; }
/* The home page opens on the bunkhouse itself, cut out of its photograph:
   the sky is gone, so the building stands on the masthead's own ground,
   and the band runs from the top of the page down to the gravel. The
   masthead's rule moves to the foot of the band, where the page begins. */
body.site hero-banner {
  background: var(--jb-raised);
  border-block-end: 1px solid var(--jb-border);
  & img { inline-size: 100%; block-size: auto; object-fit: contain; border-radius: 0; }
}

/* The home page's sky. The bunkhouse is cut out of its photograph, so what
   stands behind it is the page's own weather: a gradient that starts in the
   masthead, comes down through the hero and goes pale at the horizon, where
   the building meets the gravel. The masthead and the hero are two boxes,
   not one, so the gradient is written in two halves that meet on the same
   colour at the seam — they join without either having to know the other's
   height, which changes as the navigation wraps. Only the home page: every
   other page keeps the flat band, and so do the booking pages, which wear
   this masthead too.

   The same sky after dark. The weather over Berneray does not know what a
   reader has set, and a dusk version made the home page a different place
   at night. That means the masthead cannot take its colours from the page
   around it: in dark mode those are near-white, which on this band would be
   an almost invisible name over a bright sky. So the masthead's ink is the
   sky's own, set here for both schemes. The links are the exception: after
   dark they are the buttons every other page wears, white words on black,
   standing on the sky, so the navigation does not change from page to
   page. */
body.site:has(main.home) {
  --sky-high: #7ba4d0;
  --sky-seam: #a9c6e2;
  --sky-horizon: #dde9f4;
  /* Dark enough to clear 4.5:1 against the deepest part of the sky, which
     is the top of the band where the links sit. The links are 15px. */
  --sky-ink: #243646;
  --sky-ink-strong: #16242f;

  /* The gradient finishes near the top of the hero rather than at its foot:
     below the moor line the photograph is opaque, so a gradient run to the
     bottom would spend most of its range behind the building and show only
     a sliver of sky. */
  & hero-banner { background: linear-gradient(to bottom, var(--sky-seam), var(--sky-horizon) 34%); }
}

/* The band stays at the top, but the sky belongs to the hero, and only
   while the page is at rest. The home page carries a few lines of script
   that mark the page as scrolled the moment it moves, and the sky fades
   out from behind the band's words, leaving the glass every other page
   wears, while the ink runs from the sky's to the page's; back at the top
   the sky returns. CSS alone cannot tell the top of a page from the rest
   of it in every browser, and a sky band pinned over the whole page is
   worse than none, so without script the band is the glass from the
   start. The ink is registered so it can be eased, and the sky is a layer
   faded out rather than colours run into the glass's, because
   interpolating a colour into a mixed one sends Chromium through yellow. */
@property --mh-ink { syntax: "<color>"; inherits: true; initial-value: black; }
@property --mh-ink-quiet { syntax: "<color>"; inherits: true; initial-value: black; }
@property --mh-rest { syntax: "<percentage>"; inherits: true; initial-value: 75%; }
@property --mh-chip { syntax: "<color>"; inherits: true; initial-value: white; }
body.site:has(main.home) site-header {
  --mh-ease: 320ms cubic-bezier(0.22, 1, 0.36, 1);
  transition: --mh-ink var(--mh-ease), --mh-ink-quiet var(--mh-ease), --mh-rest var(--mh-ease), --mh-chip var(--mh-ease);
  &::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to bottom, var(--sky-high), var(--sky-seam));
    opacity: 0;
    transition: opacity var(--mh-ease);
  }
}
@media (scripting: enabled) {
  html:not(.scrolled) body.site:has(main.home) site-header {
    /* 86% of the sky's ink still clears 4.5:1 against the deepest part
       of the sky, which is the top of the band where the links sit. */
    --mh-ink: var(--sky-ink-strong);
    --mh-ink-quiet: var(--sky-ink);
    --mh-rest: 86%;
    --mh-chip: #ffffff;
    &::before { opacity: 1; }
  }
}
/* After dark the links take the page's inks and paper whether or not the
   sky is behind them: white words on black, as on every other page. */
@media (prefers-color-scheme: dark) {
  body.site:has(main.home) site-header :is(nav a, user-mark) {
    --mh-ink: var(--jb-text);
    --mh-chip: var(--jb-surface);
    --mh-rest: 75%;
  }
}
body.site figcaption { color: var(--jb-text-muted); }
/* A photographer's credit: a line of its own under the caption, smaller. */
body.site figcaption small { display: block; font-size: 0.8125rem; }
body.site .prices {
  inline-size: 100%;
  max-inline-size: 32rem;
  background: var(--jb-surface);
  border: 1px solid var(--jb-border);
  border-radius: 3px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  & th, & td { padding: 0.625rem 1rem; text-align: start; border-block-end: 1px solid var(--jb-border-inner); }
  & tr:last-child td { border-block-end: 0; }
  & th { color: var(--jb-text-muted); font-weight: 500; font-size: 0.875rem; }
  & td:last-child, & th:last-child { text-align: end; white-space: nowrap; }
}

/* The location page: the directions beside the map, under it on a phone,
   and the ways of getting there across the whole column rather than held
   to a measure. */
body.site figure.map {
  display: grid;
  gap: 1rem 2rem;
  align-items: start;
  max-inline-size: none;
  & figcaption { margin: 0; font-size: inherit; color: inherit; }
  & p { max-inline-size: none; }
  /* One link to a line, each with room around it to tap. The flow's gap
     above the list is taken back by the first link's own padding. */
  & ul.map-links {
    flex-direction: column;
    align-items: start;
    gap: 0;
    margin-block-start: 0.25rem;
    & a { display: inline-block; padding: 0.375rem 0.25rem; }
  }
}
@container page (min-width: 46rem) {
  body.site figure.map { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
body.site .getting-there p { max-inline-size: none; }
/* The introduction sits above the heading, so the page's own row gap is
   all the space it needs below it. */
body.site page-intro p.lede { margin-block-end: 0; }

/* The footer: the booking pages' own, with its rule run the full width of
   the page and its text kept to the website's column by the padding. */
body.site site-footer {
  max-inline-size: none;
  padding: 1.5rem max(1.25rem, (100% - var(--site-column)) / 2);
  border-block-start: 1px solid var(--jb-border);
  font-size: 1rem;
  text-align: center;
  & > p { border: 0; padding-block-start: 0; }
  & ul { justify-content: center; flex-wrap: wrap; gap: 0 0.5rem; }
  & li + li::before { content: "•"; content: "•" / ""; margin-inline-end: 0.5rem; color: var(--jb-text-muted); }
}

/* The funding acknowledgement the website owes, at the foot of the home
   page: one small line in the muted ink, centred above the footer. The
   footer's rule is the only one; the app's own rule under the line goes. */
body.site funding-note {
  display: block;
  margin-block-start: 3rem;
  padding: 0;
  border: 0;
  color: var(--jb-text-muted);
  font-size: 0.875rem;
  text-align: center;
  text-wrap: balance;
}

/* The invitation to book, in the middle of the welcome. */
body.site main.home call-to-action { text-align: center; }

/* The essentials, under the welcome: the facts a guest wants before
   pressing Book, each under a label, across the column in as many columns
   as fit and down it on a phone. Opened by a hairline, as the second half
   of the contact page is. */
body.site section.essentials {
  padding-block-start: 2rem;
  border-block-start: 1px solid var(--jb-border);
  & h2 { font-size: 1.25rem; }
  /* The flow's small step after a heading is for a paragraph, which has
     its own leading; a row of labels needs the whole step. */
  & h2 + dl { margin-block-start: 1.25rem; }
  & dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 1.5rem 2.5rem;
    margin: 0;
  }
  & div { display: grid; gap: 0.25rem; align-content: start; }
  & dt {
    font-size: clamp(0.9rem, 0.87rem + 0.15vw, 1rem);
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--jb-text-secondary);
  }
  & dd { margin: 0; max-inline-size: none; }
}

/* Photographs with their words underneath, each pair on a card: one to a
   row on a phone, two across once the column has room for them. The photo
   runs to the card's edges, so it takes the card's corners rather than
   its own. */
body.site card-grid {
  display: grid;
  gap: 1.5rem;
  & > article {
    display: grid;
    align-content: start;
    background: var(--jb-surface);
    border: 1px solid var(--jb-border);
    border-radius: 3px;
    overflow: hidden;
  }
  & img { inline-size: 100%; block-size: auto; aspect-ratio: 4 / 3; object-fit: cover; }
  & section { padding: 1rem 1.25rem 1.25rem; }
}
@container page (min-width: 46rem) {
  body.site card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The Hebridean Way map: the whole chain of islands, tall and narrow, so
   it is held narrower than the location map and the whole of the page's
   text sits beside it, rather than the facts alone with a column of empty
   paper under them. On a phone the text follows the map.
   The cycling route is drawn as the location map draws the road there, and
   the walking route as a dashed line in Ink over it, so neither is
   mistaken for the green of the bunkhouse's marker. */
body.site route-guide {
  display: grid;
  gap: 2.5rem 2.5rem;
  align-items: start;
  & p, & li { max-inline-size: none; }
}
body.site figure.route-map {
  display: block;
  max-inline-size: 420px;
  & .route path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
  & .route.cycle path { stroke: var(--map-main-road); stroke-width: 3.5; }
  & .route.cycle .casing path, & .route.cycle path.casing { stroke: color-mix(in oklab, var(--map-main-road) 75%, var(--ink)); stroke-width: 5.5; }
  & .route.walk path { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 4; }
  & .end circle { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
  & .end text { font-weight: 600; }
  /* Labels that cross land or a route keep a halo of sea round their letters. */
  & :is(.end, .place) { paint-order: stroke; stroke: var(--map-sea); stroke-width: 4px; stroke-linejoin: round; }
  & .key text { font-size: 14px; }
}
@container page (min-width: 46rem) {
  body.site route-guide { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
}

/* The Hebridean Way from end to end: the ten islands in order, south to
   north, as evenly spaced stops on a plain ink line, the two ferries dotted.
   The ends are filled stops and Berneray is the map's green marker. Across
   the page when there is room, names taking turns above and below the line,
   and down it when there is not. */
body.site dl.routes {
  --map-main-road: #f1ac40;
  --route-casing: color-mix(in oklab, var(--map-main-road) 75%, var(--ink));
  @media (prefers-color-scheme: dark) {
    --map-main-road: #c9902f;
  }
}
body.site island-chain {
  display: block;
  --line-at: 1.25rem;
  & ol {
    list-style: none;
    position: relative;
    margin: 0;
    padding: 0;
    block-size: 30rem;
  }
  & li {
    --at: calc(var(--i) / 9 * 100);
    --from: calc((var(--i) - 1) / 9 * 100);
  }
  & b { font-weight: 600; }
  & small { font-size: 0.8125rem; line-height: 1.2; color: var(--jb-text-muted); }
  & .here small { color: var(--jb-text); font-weight: 600; }
  /* Down the page: the line on the left, each name beside its stop. */
  /* Above every stretch of line: the stops hang off the names, and a
     translated name is a layer of its own. */
  & li > span {
    position: absolute;
    z-index: 1;
    inset-block-start: calc(var(--at) * 1%);
    inset-inline-start: calc(var(--line-at) + 1.25rem);
    translate: 0 -50%;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    white-space: nowrap;
  }
  & li:first-child > span { translate: 0 -0.75rem; }
  & li:last-child > span { translate: 0 calc(-100% + 0.75rem); }
  /* The island's stop, hung off its name so the two always travel together. */
  & li > span::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset-block-start: 50%;
    inset-inline-start: -1.25rem;
    translate: -50% -50%;
    inline-size: 0.8125rem;
    block-size: 0.8125rem;
    border-radius: 50%;
    background: var(--jb-surface);
    border: 2px solid var(--ink);
  }
  & li:first-child > span::before { inset-block-start: 0.75rem; }
  & li:last-child > span::before { inset-block-start: calc(100% - 0.75rem); }
  & li:is(:first-child, :last-child) > span::before { background: var(--ink); border-color: var(--jb-surface); inline-size: 0.875rem; block-size: 0.875rem; }
  & li.here > span::before {
    inline-size: 1.25rem;
    block-size: 1.25rem;
    border: 0;
    background: radial-gradient(circle, var(--green) 0 3.5px, var(--jb-surface) 3.5px 5px, color-mix(in oklab, var(--green) 50%, transparent) 5px);
  }
  /* The stretch from the island before: solid by road, dotted by ferry. */
  & li::before {
    content: "";
    position: absolute;
    inset-inline-start: var(--line-at);
    inset-block-start: calc(var(--from) * 1%);
    block-size: calc((var(--at) - var(--from)) * 1%);
    translate: -50% 0;
    inline-size: 3px;
    background: var(--ink);
  }
  & li:first-child::before { content: none; }
  & li.ferry::before {
    inline-size: 6px;
    background: radial-gradient(circle, var(--ink) 1.5px, transparent 1.75px) 50% 0 / 6px 7px repeat-y;
  }
}
/* Across the page: the line through the middle, names taking turns above
   and below it. */
@container page (min-width: 60rem) {
  body.site island-chain {
    --line-at: 0;
    & ol { block-size: 8.5rem; }
    & li > span {
      inset-inline-start: calc(var(--at) * 1%);
      translate: -50% 0;
      flex-direction: column;
      align-items: center;
      gap: 0.125rem;
      text-align: center;
    }
    & li.below > span { inset-block: calc(50% + 0.875rem) auto; }
    & li.above > span { inset-block: auto calc(50% + 0.875rem); flex-direction: column-reverse; }
    & li:first-child > span { translate: -0.75rem 0; align-items: start; }
    & li:last-child > span { translate: calc(-100% + 0.75rem) 0; align-items: end; }
    & li > span::before { inset-inline-start: 50%; }
    & li.below > span::before { inset-block-start: -0.875rem; }
    & li.above > span::before { inset-block-start: calc(100% + 0.875rem); }
    & li:first-child > span::before { inset-inline-start: 0.75rem; }
    & li:last-child > span::before { inset-inline-start: calc(100% - 0.75rem); }
    & li:first-child > span::before { inset-block-start: -0.875rem; }
    & li:last-child > span::before { inset-block-start: calc(100% + 0.875rem); }
    & li::before {
      inset-block-start: 50%;
      inset-inline-start: calc(var(--from) * 1%);
      inline-size: calc((var(--at) - var(--from)) * 1%);
      block-size: 3px;
      translate: 0 -50%;
    }
    & li.ferry::before {
      inline-size: calc((var(--at) - var(--from)) * 1%);
      block-size: 6px;
      background: radial-gradient(circle, var(--ink) 1.5px, transparent 1.75px) 0 50% / 7px 6px repeat-x;
    }
  }
}

/* The routes as the map's key has them: the line each is drawn in, then how
   far it goes, then where from and to. */
body.site dl.routes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1.25rem 2rem;
  margin: 0;
  & div { display: grid; gap: 0.25rem; align-content: start; }
  & dt {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 600;
    &::before { content: ""; inline-size: 2.5rem; flex: none; }
  }
  & .cycle dt::before {
    block-size: 3px;
    background: var(--map-main-road);
    border-block: 1px solid var(--route-casing);
  }
  & .walk dt::before { border-block-start: 2px dashed var(--ink); }
  & dd { margin: 0; }
  & dd.distance {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    color: var(--jb-text);
    & small { font-size: 1rem; font-weight: 400; letter-spacing: normal; color: var(--jb-text-muted); }
  }
}

/* The Berneray page: three chapters in one, and long enough that the reader
   needs to know where in it they are. The page opens straight onto them,
   and the contents stay with the reader at every width: a rail beside the
   chapters on a wide screen, a bar across the top of a narrow one, marking
   the chapter being read either way. No script: the contents are a list of
   links that works the moment the HTML arrives, and the mark is a
   scroll-driven animation that browsers without it simply do not draw. */
/* A heading under a section's own: the booking pages set h2 at 1.25rem
   and 600, and the shared stylesheet's h3 is larger and lighter than
   that, so it comes down a step and up to the same weight. */
body.site main h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }

body.site page-parts {
  display: block;
  /* The chapters are the largest step on the page: they are the thing the
     contents are for, and the gap has to read as a chapter ending. */
  & > section.part + section.part { margin-block-start: clamp(3.5rem, 2.5rem + 4vw, 6rem); }
}

/* An anchored jump lands with the chapter's opening clear of the top, and
   on a narrow screen clear of the contents bar stuck there too. */
body.site section.part { scroll-margin-block-start: 4.5rem; }

/* Inside a chapter, after its opening, every item — an activity, a place,
   an event — is divided from the next by a hairline sitting midway in the
   gap. The opening and its photograph are not items and take no line. */
body.site section.part > * + * { margin-block-start: 2.75rem; }
body.site section.part > :is(text-photo, section, article) + :is(text-photo, section, article) {
  margin-block-start: 2.25rem;
  border-block-start: 1px solid var(--jb-border-inner);
  padding-block-start: 2.25rem;
}
/* The distance or the date belongs to the name above it, not to the
   paragraph below: bind it close and let the prose fall away. */
body.site article.entry > :is(.where, .when) { margin-block-start: 0.35rem; }

/* A chapter opens on a heavier rule than the hairlines between its items,
   so the two can be told apart at a glance down a long page; then the name
   at a size nothing inside the chapter reaches, and a photograph of what
   it covers. */
body.site .part-open {
  border-block-start: 2px solid var(--jb-text);
  padding-block-start: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
  & h2 {
    font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.6rem);
    font-weight: 600;
    line-height: 1.1;
    text-wrap: balance;
  }
  & p { color: var(--jb-text-secondary); }
}
/* The rule goes between chapters, not above the first: the page opens
   straight onto it, just under the masthead's own. */
body.site page-parts > section.part:first-child > .part-open {
  border-block-start: 0;
  padding-block-start: 0;
}

/* On a narrow screen a photograph comes after the words it belongs to. The
   site's own order puts it first, which here set each chapter's opening
   photograph straight on top of the first entry's, two pictures with no
   words between them; heading first also lets a reader scan down the
   names, and matches the order the page is read aloud in. */
@container page (width < 46rem) {
  body.site section.part text-photo { grid-template-areas: "text" "photo"; }
}

/* The contents. Below the width for a rail they are a bar across the top
   that stays under the masthead as the page scrolls: the three names on
   one line, separated the way the footer's links are, on the same glass
   as the masthead so the chapters pass underneath rather than through,
   and closed by a hairline. The chapter being read is underlined on that hairline, the
   way the masthead marks the current page. */
body.site nav.contents {
  position: sticky;
  inset-block-start: var(--mh-block);
  z-index: 1;
  margin-block-end: clamp(2rem, 1.5rem + 2vw, 3rem);
}
/* Its glass and its hairline run the width of the window, as the
   masthead's do, though the links keep to the column. */
body.site nav.contents::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline: calc(50% - 50vw);
  z-index: -1;
  background: color-mix(in oklab, var(--jb-canvas) 75%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border-block-end: 1px solid var(--jb-border);
}
body.site ul.jump-links {
  list-style: none;
  display: flex;
  /* One line on any phone; a reader with enlarged text gets a second line
     rather than a link cut off at the edge. */
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  & li { display: flex; align-items: center; }
  & li + li::before { content: "•"; content: "•" / ""; margin-inline: 0.625rem; color: var(--jb-text-muted); }
  & a {
    display: block;
    font-size: 0.875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    color: var(--jb-text-secondary);
    /* A thumb, not a pointer: 44px to press, the underline included. */
    padding-block: 0.75rem calc(0.75rem - 2px);
    border-block-end: 2px solid transparent;
    &:hover { color: var(--sea); }
  }
}
/* On a phone "Local amenities" is "Amenities", so the three fit one line.
   The narrowest phones, 320px across, are still 31px short of that, so
   there the letters and the bullets close up a little. */
@container page (width < 46rem) {
  body.site ul.jump-links .long { display: none; }
}
@container page (width < 22rem) {
  body.site ul.jump-links {
    & a { letter-spacing: 0; }
    & li + li::before { margin-inline: 0.375rem; }
  }
}

/* From the width where a rail and a full measure both fit, the contents
   leave the top and stand beside the chapters. 11rem holds the longest
   of the three names on one line. */
@media (min-width: 62rem) {
  body.site berneray-body {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    column-gap: 3rem;
    align-items: start;
  }
  body.site section.part { scroll-margin-block-start: 1.5rem; }
  body.site nav.contents {
    inset-block-start: calc(var(--mh-block) + 2rem);
    z-index: auto;
    margin-block-end: 0;
  }
  body.site nav.contents::before { display: none; }
  body.site ul.jump-links {
    display: grid;
    & li { display: block; }
    & li + li::before { content: none; }
    & a {
      /* The rail itself: a hairline the whole list stands on, with the
         chapter being read marked on it — the bar's underline, turned on
         its side. */
      border-block-end: 0;
      border-inline-start: 2px solid var(--jb-border);
      padding: 0.5rem 0 0.5rem 0.875rem;
    }
  }
}

/* Which chapter is being read, without a line of script. Each chapter
   drives a timeline, and each link runs an animation on its own chapter's
   over the stretch where that chapter crosses a reading line 40% of the
   way down the screen. The chapters are stacked, so only one can cross it
   at a time, and outside its stretch an animation fills nothing in, so
   exactly one link is marked, the first chapter included from the moment
   the page opens. A range asking for a chapter to fill the screen would
   leave the contents blank at the top, where the first chapter starts
   below the masthead. Browsers without scroll-driven animations get the
   plain links, which were always the thing that had to work. */
@supports (animation-timeline: view()) {
  body.site berneray-body { timeline-scope: --ch-things, --ch-amenities, --ch-events; }
  body.site #things-to-do { view-timeline-name: --ch-things; }
  body.site #local-amenities { view-timeline-name: --ch-amenities; }
  body.site #events { view-timeline-name: --ch-events; }
  body.site nav.contents a {
    animation-name: chapter-here-bar;
    animation-duration: 1ms;
    animation-range: cover 60vh cover calc(100% - 40vh);
  }
  body.site nav.contents a[href="#things-to-do"] { animation-timeline: --ch-things; }
  body.site nav.contents a[href="#local-amenities"] { animation-timeline: --ch-amenities; }
  body.site nav.contents a[href="#events"] { animation-timeline: --ch-events; }
  @media (min-width: 62rem) {
    body.site nav.contents a { animation-name: chapter-here; }
  }
}
@keyframes chapter-here-bar {
  from, to { color: var(--jb-text); border-block-end-color: var(--jb-accent); }
}
@keyframes chapter-here {
  from, to { color: var(--jb-text); border-inline-start-color: var(--jb-accent); }
}

body.site text-photo.contact {
  & p.lede { margin: 0; font-size: 1.1875rem; color: var(--jb-text); }
  & call-to-action a { font-size: 1.125rem; font-weight: 500; padding: 0.875rem 2rem; }
  & small { color: var(--jb-text-muted); }
}
@container page (min-width: 46rem) {
  /* The words stand in the middle of the photograph's height. */
  body.site text-photo.contact {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: center;
  }
}
body.site contact-ways {
  display: block;
  & dl { display: grid; gap: 1rem; margin: 0; }
  & div { display: grid; gap: 0.125rem; }
  & dt {
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--jb-text-muted);
  }
  & dd { margin: 0; max-inline-size: none; }
  & a { font-size: 1.1875rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
}
/* Opened by a hairline, as the parts of the Berneray page are. */
body.site contact-more {
  display: grid;
  gap: 2.5rem;
  align-items: start;
  padding-block-start: 2rem;
  border-block-start: 1px solid var(--jb-border);
  & h2 { font-size: 1.25rem; }
  & address p { max-inline-size: none; }
}
@container page (min-width: 46rem) {
  body.site contact-more { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
