/* A home's page. Measurements are the reference pages'; every colour, type
   size and spacing value is a design token (tokens standard, T3). The
   breakpoints are the tokens breakpoint.lg and breakpoint.md, written as
   numbers because a container condition cannot read a custom property (T5). */

/* ---------------------------------------------------------------- hero */

.ui-hero__text--home {
  gap: var(--lcr-space-12);
  padding: var(--lcr-space-fluid-20-64) 0;
}
.ui-hero__name {
  margin: 0;
  font-weight: var(--lcr-font-weight-light);
  font-size: var(--lcr-font-size-h1-property);
  line-height: 1.05;
  color: var(--lcr-color-green);
}
.ui-hero__address {
  margin: 0;
  font-size: var(--lcr-font-size-fluid-18-20);
  font-weight: var(--lcr-font-weight-medium);
}
.ui-hero__location {
  margin: 0;
  max-width: 44ch;
  color: var(--lcr-color-ink-muted);
}
.ui-hero__actions--home { margin-top: var(--lcr-space-12); }
.ui-hero__photo {
  flex: 1.25 1 460px;
  min-width: 0;
  min-height: clamp(220px, 40cqw, 580px);
}

/* The unit switcher: one button for each unit, the pressed one green. */
.ui-units {
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-10);
  margin-top: var(--lcr-space-6);
}
.ui-units__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lcr-space-8);
}
.ui-unit {
  min-height: 44px;
  padding: 0 var(--lcr-space-18);
  font-family: var(--lcr-font-family);
  font-size: var(--lcr-font-size-15);
  font-weight: var(--lcr-font-weight-semibold);
  border-radius: var(--lcr-radius-control);
  cursor: pointer;
  background: var(--lcr-color-ground);
  color: var(--lcr-color-ink);
  border: 1px solid var(--lcr-color-control-border);
}
.ui-unit:hover { background: var(--lcr-color-surface-alt); }
.ui-unit[aria-pressed="true"] {
  background: var(--lcr-color-green);
  color: var(--lcr-color-ground);
  border-color: var(--lcr-color-green);
}
.ui-units__note {
  margin: 0;
  font-size: var(--lcr-font-size-14);
  color: var(--lcr-color-ink-muted);
}
.ui-showing {
  margin: var(--lcr-space-6) 0 0;
  font-size: var(--lcr-font-size-15);
  font-weight: var(--lcr-font-weight-semibold);
}

/* The three spec tiles. */
.ui-specs {
  list-style: none;
  margin: var(--lcr-space-6) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--lcr-space-10);
  max-width: 440px;
}
.ui-spec {
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-4);
  padding: var(--lcr-space-14) var(--lcr-space-16);
  background: var(--lcr-color-ground);
  border: 1px solid var(--lcr-color-line);
}
.ui-spec__icon {
  display: inline-flex;
  color: var(--lcr-color-green);
}
.ui-spec__value {
  font-size: var(--lcr-font-size-22);
  font-weight: var(--lcr-font-weight-medium);
  line-height: 1.2;
}
.ui-spec__label {
  font-size: var(--lcr-font-size-13);
  color: var(--lcr-color-ink-muted);
}

/* ---------------------------------------------------------------- in-page links */

/* They stick under the header, which is 72 px tall, and scroll sideways when
   they do not fit. */
.ui-inpage {
  position: sticky;
  top: 72px;
  z-index: 20;
  background: var(--lcr-color-ground);
  border-bottom: 1px solid var(--lcr-color-line);
}
.ui-inpage__links {
  display: flex;
  gap: var(--lcr-space-6) var(--lcr-space-32);
  overflow-x: auto;
}
.ui-inpage__link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-size: var(--lcr-font-size-14);
  font-weight: var(--lcr-font-weight-semibold);
  color: var(--lcr-color-ink);
  text-decoration: none;
  white-space: nowrap;
}
/* The strip scrolls, so it clips what is drawn outside a link's box. The ring
   is drawn just inside the box, where it can be seen whole. */
.ui-inpage__link:focus-visible { outline-offset: calc(-1 * var(--lcr-focus-ring-width)); }

/* ---------------------------------------------------------------- the two columns */

/* The booking column comes first in the page and sits on the right; when the
   two no longer fit side by side it wraps to the top, above Highlights. */
.ui-columns {
  padding-bottom: var(--lcr-space-fluid-28-48);
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0 var(--lcr-space-72);
}
/* 136 px is the header and the in-page links together. */
.ui-booking {
  flex: 1 1 340px;
  min-width: 0;
  padding-top: var(--lcr-space-fluid-24-36);
  scroll-margin-top: 100px;
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-16);
  position: sticky;
  top: 136px;
}
@container lcr (max-width: 1060px) {
  .ui-booking { position: static; }
}
.ui-columns__main {
  flex: 999 1 560px;
  min-width: 0;
}

/* The host card under the booking panel. */
.ui-host {
  display: flex;
  align-items: center;
  gap: var(--lcr-space-16);
  padding: var(--lcr-space-16) var(--lcr-space-20);
  background: var(--lcr-color-surface-alt);
}
.ui-host__photo {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: var(--lcr-color-photo-ground);
  background-image: repeating-linear-gradient(135deg, var(--lcr-color-hatch-on-photo) 0px, var(--lcr-color-hatch-on-photo) 1px, transparent 1px, transparent 9px);
}
/* With a photo from the photo list the block is drawn by the rules under
   "a photo in its place", at the foot of this file: no hatch, and the photo
   cropped to the circle. */
.ui-host__text {
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-2);
  min-width: 0;
}
.ui-host__name {
  font-size: var(--lcr-font-size-19);
  font-weight: var(--lcr-font-weight-medium);
  line-height: 1.2;
}
.ui-host__mail {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--lcr-font-size-15);
  font-weight: var(--lcr-font-weight-semibold);
  color: var(--lcr-color-green);
  text-underline-offset: 4px;
}

/* ---------------------------------------------------------------- sections */

/* A section's heading must clear both sticky bars when a link brings it into
   view: 72 px of header and 48 px of in-page links, and 16 px of air. */
.ui-section {
  padding: var(--lcr-space-fluid-28-48) 0;
  border-bottom: 1px solid var(--lcr-color-line);
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-22);
  scroll-margin-top: 136px;
}
.ui-section--last { border-bottom: 0; }
.ui-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--lcr-space-6) var(--lcr-space-24);
}
.ui-section__heading {
  margin: 0;
  font-family: var(--lcr-font-family);
  font-weight: var(--lcr-font-weight-light);
  font-size: var(--lcr-font-size-fluid-26-32);
  line-height: 1.2;
  color: var(--lcr-color-green);
}

.ui-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: var(--lcr-space-12);
}
.ui-highlight {
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-8);
  padding: var(--lcr-space-14) var(--lcr-space-16);
  background: var(--lcr-color-surface-alt);
  font-size: var(--lcr-font-size-15);
  font-weight: var(--lcr-font-weight-medium);
  line-height: 1.4;
}
.ui-highlight__icon {
  display: inline-flex;
  color: var(--lcr-color-orange-text);
}

.ui-about {
  margin: 0;
  max-width: 66ch;
}

.ui-amenities {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--lcr-space-10);
}
.ui-amenity {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--lcr-space-16);
  border: 1px solid var(--lcr-color-line);
  border-radius: 20px;
  font-size: var(--lcr-font-size-15);
}

/* ---------------------------------------------------------------- full width, below the columns */

.ui-below { padding-bottom: var(--lcr-space-fluid-56-96); }
.ui-below__inner { border-top: 1px solid var(--lcr-color-line); }

.ui-location {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--lcr-space-24) var(--lcr-space-48);
}
.ui-location__map {
  flex: 3 1 520px;
  min-width: 0;
}
.ui-walking {
  flex: 1 1 240px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-10);
}
.ui-walking__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: var(--lcr-space-12);
}
.ui-walking__item {
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-2);
  padding: var(--lcr-space-14) var(--lcr-space-16);
  border-top: 3px solid var(--lcr-color-orange);
  background: var(--lcr-color-surface-alt);
}
.ui-walking__time {
  font-weight: var(--lcr-font-weight-light);
  font-size: var(--lcr-font-size-30);
  line-height: 1.1;
  color: var(--lcr-color-orange-text);
}
.ui-walking__place {
  font-size: var(--lcr-font-size-14);
  font-weight: var(--lcr-font-weight-medium);
}
.ui-walking__note {
  margin: 0;
  font-size: var(--lcr-font-size-13);
  color: var(--lcr-color-ink-muted);
}

.ui-rules {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--lcr-space-12);
}
.ui-rule {
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-6);
  padding: var(--lcr-space-18) var(--lcr-space-20);
  border: 1px solid var(--lcr-color-line);
}
.ui-rule dd { margin: 0; }

/* ---------------------------------------------------------------- the other two homes */

.ui-others { background: var(--lcr-color-surface-alt); }
.ui-others__inner {
  padding-top: var(--lcr-space-fluid-48-80);
  padding-bottom: var(--lcr-space-fluid-48-80);
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-32);
}
.ui-others__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
  gap: var(--lcr-space-24);
}
.ui-card {
  display: flex;
  flex-wrap: wrap;
  background: var(--lcr-color-ground);
  border: 1px solid var(--lcr-color-line);
  min-width: 0;
}
.ui-card__photo {
  flex: 1 1 220px;
  min-width: 0;
  display: block;
  text-decoration: none;
}
.ui-card__image {
  height: 100%;
  min-height: 150px;
}
.ui-card__text {
  flex: 1.2 1 240px;
  min-width: 0;
  box-sizing: border-box;
  padding: var(--lcr-space-22) var(--lcr-space-24);
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-6);
}
.ui-card__title {
  display: flex;
  align-items: center;
  gap: var(--lcr-space-12);
}
.ui-card__name {
  margin: 0;
  font-weight: var(--lcr-font-weight-light);
  font-size: var(--lcr-font-size-28);
  line-height: 1.15;
  color: var(--lcr-color-green);
}
.ui-card__address {
  margin: 0;
  font-weight: var(--lcr-font-weight-medium);
}
.ui-card__specs {
  margin: 0;
  font-size: var(--lcr-font-size-14);
  color: var(--lcr-color-ink-muted);
}
.ui-card__link {
  align-self: flex-start;
  margin-top: auto;
}

/* ---------------------------------------------------------------- the bottom bar's contents */

.ui-bar__home {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.ui-bar__name {
  font-size: var(--lcr-font-size-18);
  font-weight: var(--lcr-font-weight-medium);
  color: var(--lcr-color-green);
}
.ui-bar__address {
  font-size: var(--lcr-font-size-13);
  color: var(--lcr-color-ink-muted);
}

/* ---------------------------------------------------------------- the photo gallery */

/* Over the whole screen, above the header (z-index 30) and the bottom bar. */
.ui-gallery {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--lcr-color-gallery-ground);
  color: var(--lcr-color-ground);
}
.ui-gallery__inner {
  max-width: var(--lcr-space-container-max);
  margin: 0 auto;
  box-sizing: border-box;
  padding: var(--lcr-space-20) var(--lcr-space-24) var(--lcr-space-64);
  display: flex;
  flex-direction: column;
  gap: var(--lcr-space-24);
}
.ui-gallery__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lcr-space-16);
}
.ui-gallery__heading {
  margin: 0;
  font-weight: var(--lcr-font-weight-light);
  font-size: var(--lcr-font-size-26);
}
.ui-gallery__close {
  display: inline-flex;
  align-items: center;
  gap: var(--lcr-space-8);
  min-height: 48px;
  padding: 0 var(--lcr-space-16);
  background: transparent;
  color: var(--lcr-color-ground);
  border: 1px solid var(--lcr-color-ground);
  border-radius: var(--lcr-radius-control);
  font-family: var(--lcr-font-family);
  font-size: var(--lcr-font-size-15);
  font-weight: var(--lcr-font-weight-semibold);
  cursor: pointer;
}
/* auto-fill, not auto-fit: a gallery with fewer photos than the grid has
   columns keeps the columns, so a photo's tile is the size a hatched tile is
   in the same window, however few photos there are. With as many tiles as
   columns or more, which is every gallery of twenty, the two are the same. */
.ui-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--lcr-space-12);
}
/* A hatched block stands where each photo will go (register entry D-08). */
.ui-gallery__tile {
  aspect-ratio: 4 / 3;
  box-sizing: border-box;
  background-color: var(--lcr-color-gallery-tile);
  background-image: repeating-linear-gradient(135deg, var(--lcr-color-hatch-on-gallery) 0px, var(--lcr-color-hatch-on-gallery) 1px, transparent 1px, transparent 14px);
  display: flex;
  align-items: flex-end;
  padding: var(--lcr-space-12);
}
.ui-gallery__label {
  font-size: var(--lcr-font-size-12);
  font-weight: var(--lcr-font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lcr-color-gallery-label);
}

/* ---------------------------------------------------------------- a photo in its place */

/* A gallery tile or the host's block that holds a photo from the photo list
   (src/ui/photos.mjs; the page marks it data-ui-photo-block="photo"). One set
   of rules draws both. The place keeps its own box and its plain ground and
   loses its hatch. The photo is laid over the whole of the place, its padding
   too, so it takes no part in sizing it, and fills it by cropping.
   It is never drawn larger than its own size: the build writes the file's own
   width and height on the <img> as its two limits, so a photo smaller than
   its place stands at its own size in the middle, on the place's ground. */
.ui-gallery__tile[data-ui-photo-block="photo"],
.ui-host__photo[data-ui-photo-block="photo"] {
  position: relative;
  overflow: hidden;
  background-image: none;
}
.ui-gallery__tile[data-ui-photo-block="photo"] > img,
.ui-host__photo[data-ui-photo-block="photo"] > img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
