/*
 * Residency Atlas: site stylesheet
 *
 * The look borrows from nautical charts: deep water is white, shallows are pale blue,
 * land is buff, and notes are printed in magenta. Charts frame everything with a thin
 * "neatline", so photographs and maps here get one too.
 *
 * Contents
 *   1. Fonts              6. Home: the chart      11. Property listings
 *   2. Tokens             7. Home: other sections 12. Forms and results
 *   3. Base               8. Place pages          13. Story
 *   4. Header and menu    9. Text components      14. Enquiry dialog
 *   5. Footer            10. Tables and maps      15. Print
 */

/* 1. Fonts ------------------------------------------------------------------------------- */

@font-face {
  font-family: "Besley";
  src: url("/assets/fonts/besley-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Besley";
  src: url("/assets/fonts/besley-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Fira Sans";
  src: url("/assets/fonts/fira-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fira Sans";
  src: url("/assets/fonts/fira-sans-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Fira Sans";
  src: url("/assets/fonts/fira-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fira Sans";
  src: url("/assets/fonts/fira-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* 2. Tokens ------------------------------------------------------------------------------ */

:root {
  /* Colour */
  --deep: #ffffff; /* page: deep water */
  --shoal: #ddebf4; /* tinted bands and table heads: shallow water */
  --shoal-light: #eef5f9;
  --buff: #f3e8bf; /* land on the maps, highlights */
  --buff-light: #faf6e3;
  --ink: #0f2a4a; /* all text */
  --ink-soft: #46597a; /* secondary text; 7:1 on white */
  --magenta: #b4127a; /* chart notes: markers, underlines, focus */
  --rule: #b7cadb; /* hairlines */
  --abyss: #0b2545; /* footer */

  /* Type */
  --serif: "Besley", Rockwell, "Roboto Slab", Georgia, serif;
  --sans: "Fira Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  /* Space */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --page: 76rem;
  --measure: 41rem;
  --band: clamp(3rem, 7vw, 5.5rem);
  --header: 4.5rem;
}

/* 3. Base -------------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 1.25rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--deep);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.12;
}
h3 {
  font-size: 1.5rem;
  line-height: 1.2;
}
h4 {
  font-size: 1.1875rem;
  line-height: 1.3;
}

p,
ul,
ol {
  margin: 0 0 1em;
}
p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--magenta);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}
a:hover {
  color: var(--magenta);
}

img {
  max-width: 100%;
  height: auto;
}

strong {
  font-weight: 600;
}

:focus-visible {
  outline: 3px solid var(--magenta);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--buff);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}
.narrow-only,
.chart-break {
  display: none;
}
@media (max-width: 61.99rem) {
  .wide-only {
    display: none;
  }
  .narrow-only {
    display: inline;
  }
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 40;
  padding: 0.625rem 1rem;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  border-radius: 0 0 3px 3px;
}
.skip-link:focus {
  top: 0;
  color: #fff;
}

/* A band is a full-width strip whose content lines up with the page column. */
.band {
  padding-block: var(--band);
  padding-inline: max(var(--gutter), calc((100% - var(--page)) / 2));
}
.band--shoal {
  background: var(--shoal-light);
}
.band--tight {
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
}
.band > h2 {
  margin-bottom: 1.5rem;
}
.band > h2 + p {
  max-width: var(--measure);
  font-size: 1.125rem;
}

/* Photographs and maps sit inside a chart-style neatline. */
.frame {
  display: block;
  padding: 5px;
  border: 1px solid var(--ink);
  background: var(--deep);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
  font: 500 1rem/1.2 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button:hover {
  border-color: var(--magenta);
  background: var(--magenta);
  color: #fff;
}
.button--quiet {
  background: transparent;
  color: var(--ink);
}
.button--quiet:hover {
  border-color: var(--ink);
  background: var(--shoal);
  color: var(--ink);
}

/* 4. Header and menu --------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 2rem;
  min-height: var(--header);
  padding-block: 0.75rem;
  padding-inline: max(var(--gutter), calc((100% - var(--page)) / 2));
  border-bottom: 1px solid var(--rule);
  background: var(--deep);
}

.wordmark {
  margin-right: auto;
  padding-block: 0.6875rem; /* a comfortable target for a finger */
  font: 600 1.375rem/1 var(--serif);
  letter-spacing: -0.015em;
  text-decoration: none;
}
.wordmark:hover {
  color: var(--ink);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}
.site-nav a {
  padding: 0.5rem 0 0.375rem;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover {
  border-bottom-color: var(--rule);
  color: var(--ink);
}
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--magenta);
}

.menu-toggle {
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font: 500 1rem/1.2 var(--sans);
  cursor: pointer;
}
.menu-toggle[aria-expanded="true"] {
  background: var(--shoal);
}

@media (max-width: 61.99rem) {
  :root {
    --header: 4rem;
  }
  .site-header {
    gap: 0.5rem 0.625rem;
  }
  .wordmark {
    font-size: 1.1875rem;
  }
  .site-header .button {
    padding-inline: 0.875rem;
  }
  .site-nav {
    order: 5;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding-bottom: 0.5rem;
  }
  .site-nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 1.125rem;
  }
  .site-nav a:last-child {
    border-bottom: 0;
  }
  .site-nav a[aria-current="page"] {
    border-bottom-color: var(--rule);
    box-shadow: inset 3px 0 0 var(--magenta);
    padding-left: 0.875rem;
  }
  .site-nav[data-collapsed="true"] {
    display: none;
  }
}

/* 5. Footer ------------------------------------------------------------------------------ */

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 5fr) repeat(2, minmax(0, 2fr));
  gap: 2.5rem clamp(2rem, 5vw, 5rem);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  padding-inline: max(var(--gutter), calc((100% - var(--page)) / 2));
  background: var(--abyss);
  color: #fff;
}
.site-footer a {
  text-decoration-color: rgb(255 255 255 / 0.45);
  text-decoration-thickness: 1px;
}
.site-footer a:hover {
  color: #fff;
  text-decoration-color: #fff;
}
.footer-about p {
  max-width: 34rem;
  color: #d5e2ee;
  font-size: 1rem;
}
.footer-about .footer-name {
  margin-bottom: 0.875rem;
  color: #fff;
  font: 500 1.75rem/1.1 var(--serif);
  letter-spacing: -0.015em;
}
.footer-about p:last-child {
  margin-bottom: 0;
}
.footer-links h2 {
  margin-bottom: 0.75rem;
  font: 600 1rem/1.3 var(--sans);
  letter-spacing: 0;
}
.footer-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links li {
  margin-bottom: 0.125rem;
}
.footer-links a {
  display: inline-block;
  padding-block: 0.25rem;
}
.footer-credit {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.2);
  color: #b9cbdd;
  font-size: 0.9375rem;
}

@media (max-width: 47.99rem) {
  .site-footer {
    grid-template-columns: 1fr 1fr;
  }
  .footer-about {
    grid-column: 1 / -1;
  }
}

/* 6. Home: the chart --------------------------------------------------------------------- */

/*
 * A strip of the world from Mexico to India. On wide screens the page title sits in the
 * open Atlantic, the way a chart's title block does, and each place is labelled where it is.
 * On narrow screens the title comes first, then the map, then the three places as a list.
 */
.chart {
  border-bottom: 1px solid var(--rule);
  background: var(--shoal);
}
.chart-sheet {
  position: relative;
  max-width: 105rem;
  margin-inline: auto;
  container-type: inline-size;
}
@media (min-width: 105.01rem) {
  .chart-sheet {
    border-inline: 1px solid var(--rule);
  }
}
.chart-map-area {
  position: relative;
}
.chart-map {
  display: block;
  width: 100%;
  height: auto;
}

.chart-dot {
  position: absolute;
  width: 0.875rem;
  height: 0.875rem;
  margin: -0.4375rem 0 0 -0.4375rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 0 1px var(--magenta);
}
.chart-dot--mexico {
  left: 11.34%;
  top: 72.31%;
}
.chart-dot--greece {
  left: 72.13%;
  top: 42.55%;
}
.chart-dot--dubai {
  left: 87.74%;
  top: 63.59%;
}

/* Longitude along the bottom edge, latitude up the left, as in a chart's margin. */
.chart-margin {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}
.chart-margin li {
  position: absolute;
  white-space: nowrap;
}
@media (max-width: 47.99rem) {
  .chart-margin {
    display: none;
  }
}
.chart-margin--lon li {
  bottom: 0.375rem;
  transform: translateX(-50%);
}
.chart-margin--lat li {
  left: 0.5rem;
  transform: translateY(-50%);
}

.chart-title {
  padding: clamp(2rem, 7vw, 3.5rem) var(--gutter) clamp(1.5rem, 5vw, 2.25rem);
  background: var(--deep);
}
.chart-title h1 {
  font-size: clamp(2.5rem, 10vw, 4rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
}
.chart-title p {
  max-width: 30rem;
  margin: 1rem 0 0;
  font-size: 1.1875rem;
  line-height: 1.45;
}

.chart-places {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--deep);
}
.chart-place a {
  display: block;
  padding: 1rem var(--gutter);
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.chart-place:first-child a {
  border-top: 0;
}
.chart-place-name {
  display: block;
  font: 500 1.5rem/1.15 var(--serif);
  letter-spacing: -0.012em;
}
.chart-place a:hover .chart-place-name {
  text-decoration: underline;
  text-decoration-color: var(--magenta);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}
.chart-place a:hover {
  color: var(--ink);
}
.chart-place-what,
.chart-place-time {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.35;
}
.chart-place-time {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 64rem) {
  .chart-title,
  .chart-places {
    background: none;
  }
  .chart-break {
    display: inline;
  }
  .chart-title {
    position: absolute;
    z-index: 2;
    left: 29.2%;
    top: 19%;
    width: 27%;
    padding: 0;
  }
  .chart-title h1 {
    font-size: clamp(2.125rem, 3.85cqw, 4.375rem);
    white-space: nowrap;
  }
  .chart-title p {
    margin-top: 1.1cqw;
    font-size: clamp(1rem, 1.25cqw, 1.3125rem);
  }

  .chart-place {
    position: absolute;
    z-index: 2;
    width: clamp(10rem, 12.4cqw, 13.5rem);
  }
  .chart-place a {
    padding: 0;
    border: 0;
  }
  .chart-place-name {
    font-size: clamp(1.25rem, 1.7cqw, 1.875rem);
  }
  .chart-place-what,
  .chart-place-time {
    font-size: clamp(0.8125rem, 0.97cqw, 1rem);
  }
  /* each label is placed in open water next to its marker */
  .chart-place--mexico {
    left: 2.6%;
    top: 76.5%;
  }
  .chart-place--greece {
    left: 73.4%;
    top: 46%;
  }
  .chart-place--dubai {
    left: 86.6%;
    top: 67.5%;
    width: clamp(8.5rem, 10.6cqw, 11.5rem);
  }
  /* a white halo keeps the labels readable where they cross a coastline */
  .chart-place a,
  .chart-title {
    text-shadow:
      0 0 3px var(--halo, #ddebf4),
      0 0 6px var(--halo, #ddebf4);
  }
  .chart-place--greece a {
    --halo: #f3e8bf;
  }
}

/* The one moment of motion: the three markers light up west to east when the page opens. */
@media (prefers-reduced-motion: no-preference) {
  .chart-dot {
    animation: chart-ping 0.9s ease-out both;
  }
  .chart-dot--greece {
    animation-delay: 0.35s;
  }
  .chart-dot--dubai {
    animation-delay: 0.7s;
  }
  @keyframes chart-ping {
    0% {
      box-shadow: 0 0 0 0 rgb(180 18 122 / 0.7);
      transform: scale(0.2);
    }
    60% {
      box-shadow: 0 0 0 1.1rem rgb(180 18 122 / 0);
      transform: scale(1.15);
    }
    100% {
      box-shadow: 0 0 0 1px var(--magenta);
      transform: scale(1);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* 7. Home: other sections ---------------------------------------------------------------- */

.start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding-block: 1.5rem;
  padding-inline: max(var(--gutter), calc((100% - var(--page)) / 2));
  border-bottom: 1px solid var(--rule);
}
.start p {
  margin: 0 0.5rem 0 0;
  font-weight: 500;
}

/* Three photographs standing on one baseline, each at its own shape. */
.plates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto auto auto;
  gap: 0 clamp(1.5rem, 3.5vw, 3.5rem);
}
.plate {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
}
.plate-photo {
  align-self: end;
}
.plate-photo img {
  display: block;
  width: 100%;
}
.plate h3 {
  margin-top: 1.25rem;
  font-size: clamp(1.75rem, 2.8vw, 2.25rem);
}
.plate h3 a {
  text-decoration: none;
}
.plate h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--magenta);
  text-decoration-thickness: 2px;
}
.plate p {
  margin: 0.625rem 0 0.875rem;
}
.plate .more {
  justify-self: start;
}

.more {
  display: inline-block;
  padding-block: 0.25rem;
  font-weight: 500;
}

/* An index: the name of each entry, a dotted leader, then what you will find there. */
.index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem clamp(2rem, 6vw, 6rem);
}
.index h3 {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--ink);
}
.index-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.index-list a {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.index-name {
  font-weight: 500;
  font-size: 1.125rem;
}
.index-list a:hover .index-name {
  text-decoration: underline;
  text-decoration-color: var(--magenta);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}
.index-list a:hover {
  color: var(--ink);
}
.index-leader {
  flex: 1 1 1.5rem;
  min-width: 1.5rem;
  border-bottom: 2px dotted var(--rule);
  transform: translateY(-0.25em);
}
.index-what {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  text-align: right;
}

.story-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1rem clamp(2rem, 6vw, 6rem);
}
.story-preview > h2 {
  margin: 0;
}
.story-preview p {
  max-width: 36rem;
  font: 400 clamp(1.25rem, 2.1vw, 1.5rem)/1.45 var(--serif);
  letter-spacing: -0.005em;
}

@media (max-width: 47.99rem) {
  .start {
    flex-direction: column;
    align-items: stretch;
  }
  .plates {
    grid-template-columns: 1fr;
    gap: 2.75rem 0;
  }
  .plate {
    display: block;
  }
  .index,
  .story-preview {
    grid-template-columns: 1fr;
  }
  .index-list a {
    flex-wrap: wrap;
  }
  .index-leader {
    display: none;
  }
  .index-what {
    flex-basis: 100%;
    text-align: left;
  }
}

/* 8. Place pages ------------------------------------------------------------------------- */

.place-head {
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  align-items: center;
  gap: 2.5rem clamp(2rem, 6vw, 6rem);
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem);
  padding-inline: max(var(--gutter), calc((100% - var(--page)) / 2));
}
.place-head h1 {
  font-size: clamp(3.75rem, 11vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.place-sub {
  margin: 0.875rem 0 0;
  font: italic 400 clamp(1.375rem, 2.6vw, 2rem)/1.2 var(--serif);
  letter-spacing: -0.01em;
}
.place-head .lede {
  margin-top: 1.5rem;
}
.lede {
  max-width: 34rem;
  font-size: 1.1875rem;
  line-height: 1.5;
}

/* A photograph of the place with a locator map tucked into its corner. */
.place-figure {
  position: relative;
  margin: 0;
  padding: 0 0 2.5rem 2.5rem;
}
.place-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}
.place-inset {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44%;
}
.place-inset img {
  display: block;
  width: 100%;
}
.place-inset-area {
  position: relative;
  display: block;
}
.place-pin {
  position: absolute;
  width: 0.75rem;
  height: 0.75rem;
  margin: -0.375rem 0 0 -0.375rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 0 1px var(--magenta);
}
.place-pin-name {
  position: absolute;
  white-space: nowrap;
  margin: -0.55rem 0 0 0.7rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  text-shadow:
    0 0 2px #fff,
    0 0 4px #fff;
}
.place-pin-name--left {
  margin-left: 0;
  transform: translateX(calc(-100% - 0.7rem));
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.75rem;
  padding-block: 0.875rem;
  padding-inline: max(var(--gutter), calc((100% - var(--page)) / 2));
  border-block: 1px solid var(--rule);
  background: var(--shoal-light);
}
.page-nav span {
  font-weight: 600;
}
.page-nav a {
  padding: 0.25rem 0;
}

/* Residence routes side by side on one ruled sheet. */
.routes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--ink);
  background: var(--rule);
}
.route {
  padding: 1.5rem clamp(1.25rem, 2.2vw, 1.75rem) 1rem;
  background: var(--deep);
}
.route h3 {
  margin-bottom: 0.375rem;
  font: 600 1.0625rem/1.3 var(--sans);
  letter-spacing: 0;
}
.route-figure {
  margin-bottom: 0.75rem;
  font: 500 clamp(1.5rem, 2.2vw, 1.875rem)/1.15 var(--serif);
  letter-spacing: -0.015em;
}

.next-places {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 2.5rem;
}
.next-places h2 {
  margin: 0;
  font-size: 1.5rem;
}
.next-places a {
  font: 500 clamp(1.75rem, 3.4vw, 2.5rem)/1.15 var(--serif);
  letter-spacing: -0.015em;
  text-decoration-thickness: 2px;
}

@media (max-width: 54.99rem) {
  .place-head {
    grid-template-columns: 1fr;
  }
  .place-figure {
    padding: 0 0 2rem 1.5rem;
    max-width: 34rem;
  }
}

/* 9. Text components --------------------------------------------------------------------- */

.prose {
  max-width: var(--measure);
}
.prose > :last-child {
  margin-bottom: 0;
}

.note {
  max-width: 46rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.note:last-child {
  margin-bottom: 0;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.75rem;
}

details {
  border-block: 1px solid var(--rule);
}
details + details {
  border-top: 0;
}
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-size: 1.125rem;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: "+";
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font: 400 1.25rem/1.55rem var(--sans);
  text-align: center;
}
details[open] > summary::after {
  content: "\2212";
}
summary:hover {
  color: var(--magenta);
}
details > :not(summary) {
  max-width: 46rem;
}
details > :last-child {
  margin-bottom: 1.25rem;
}
details + .note {
  margin-top: 1rem;
}

/* Steps that really are a sequence get counted in the display face. */
.steps {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  margin-bottom: 0.875rem;
  padding-left: 2.75rem;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.2em;
  font: 500 1.75rem/1.3 var(--serif);
}

.checks {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}
.checks li {
  position: relative;
  margin-bottom: 0.5rem;
  padding-left: 1.375rem;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.4375rem;
  height: 0.4375rem;
  background: var(--magenta);
}

/* A closing panel that invites an enquiry about one topic. */
.brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem 2.5rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--ink);
  background: var(--buff-light);
}
.brief h2 {
  margin-bottom: 0.375rem;
  font-size: 1.625rem;
}
.brief p {
  margin: 0;
  max-width: 40rem;
}

/* Field notes: longer how-to passages on the Mexico page. */
.field {
  max-width: 46rem;
}
.field h3 {
  margin: 2rem 0 0.75rem;
}
.field h3:first-child {
  margin-top: 0;
}

.aside-layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: start;
  gap: 1.5rem clamp(2rem, 6vw, 5rem);
}
.aside-layout > .aside-head h2 {
  margin: 0;
}
.aside-layout > .aside-head p {
  margin: 1rem 0 0;
  font-size: 1.125rem;
}
.aside-layout > .aside-wide {
  grid-column: 1 / -1;
}

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

@media (max-width: 54.99rem) {
  .aside-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 47.99rem) {
  .brief,
  .split {
    grid-template-columns: 1fr;
  }
}

/* 10. Tables and maps -------------------------------------------------------------------- */

.table-wrap {
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.5;
}
caption {
  padding-bottom: 0.625rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
}
th,
td {
  padding: 0.875rem 1rem;
  text-align: left;
  vertical-align: top;
}
thead th {
  border-bottom: 1px solid var(--ink);
  background: var(--shoal);
  font-size: 0.9375rem;
  font-weight: 600;
  vertical-align: bottom;
}
tbody th {
  min-width: 9.5rem;
  font-weight: 600;
}
tbody th,
tbody td {
  border-bottom: 1px solid var(--rule);
}
tbody tr:target {
  background: var(--buff-light);
  box-shadow: inset 3px 0 0 var(--magenta);
}
td a {
  display: inline-block;
}

/* On phones a wide table becomes one block per row, each cell labelled by its column. */
@media (max-width: 47.99rem) {
  .table-wrap--stack {
    overflow: visible;
  }
  .table-wrap--stack table,
  .table-wrap--stack caption,
  .table-wrap--stack tbody,
  .table-wrap--stack tr,
  .table-wrap--stack th,
  .table-wrap--stack td {
    display: block;
    width: 100%;
  }
  .table-wrap--stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .table-wrap--stack tbody tr {
    padding: 1rem 0 1.125rem;
    border-top: 1px solid var(--ink);
  }
  .table-wrap--stack tbody th,
  .table-wrap--stack tbody td {
    padding: 0.3125rem 0;
    border: 0;
  }
  .table-wrap--stack tbody th {
    font: 500 1.3125rem/1.25 var(--serif);
    letter-spacing: -0.01em;
  }
  .table-wrap--stack td::before {
    content: attr(data-label);
    display: block;
    color: var(--ink-soft);
    font-size: 0.875rem;
    font-weight: 600;
  }
  .table-wrap--stack tbody tr:target {
    padding-inline: 0.875rem;
  }
}

.map-details {
  margin-bottom: 1.5rem;
}
.area-map {
  margin: 0 0 1.25rem;
}
.street-map-frame {
  position: relative;
}
.street-map {
  height: clamp(18rem, 42vw, 28rem);
  background: var(--shoal);
  isolation: isolate;
}
.street-map-fallback {
  position: absolute;
  inset: 5px;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.street-map-fallback a {
  padding: 0.625rem 1rem;
  border: 1px solid var(--ink);
  background: var(--deep);
  pointer-events: auto;
}
.map-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 1rem 0 0.5rem;
  padding: 0;
  list-style: none;
}
.map-index a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
}
/* the numbered key: the same badge on the map and in the list under it */
.map-index span,
.leaflet-marker-icon.area-marker {
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 0 1px var(--magenta);
  color: #fff;
  font: 600 0.875rem/1 var(--sans);
}
.map-index span {
  width: 1.625rem;
  height: 1.625rem;
}
.area-map figcaption {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}
/* Leaflet's stylesheet loads after this one, so a bare .leaflet-container or .leaflet-tooltip
   rule here would lose to it. The extra .street-map class makes these win. */
.street-map.leaflet-container {
  background: var(--shoal);
  font-family: var(--sans);
}
.street-map .leaflet-tooltip {
  border: 1px solid var(--ink);
  border-radius: 2px;
  box-shadow: none;
  color: var(--ink);
  font: 500 0.875rem/1.2 var(--sans);
}

/* 11. Property listings ------------------------------------------------------------------ */

.listing {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  align-items: start;
  gap: 1.5rem clamp(2rem, 5vw, 4.5rem);
  padding-block: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--rule);
}
.listing:first-of-type {
  border-top-color: var(--ink);
}
/* photographs in a row share one height: each takes width in proportion to its shape */
.listing-photos {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.listing-photos figure {
  /* 12px is the frame (padding and border on both sides); the rest is shared by shape */
  flex: var(--shape, 1) 1 12px;
  min-width: 0;
  margin: 0;
}
.listing-photos figure:only-child {
  flex: 0 1 auto;
  width: min(100%, calc(21rem * var(--shape, 1)));
}
.listing-photos img {
  display: block;
  width: 100%;
}
.listing-photos figcaption {
  margin-top: 0.375rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.35;
}
.listing-place {
  margin-bottom: 0.25rem;
  color: var(--ink-soft);
  font-weight: 500;
}
.listing h3 {
  font-size: clamp(1.625rem, 2.6vw, 2rem);
}
.listing-price {
  margin: 0.375rem 0 1rem;
  font: 500 clamp(1.5rem, 2.4vw, 1.875rem)/1.15 var(--serif);
  letter-spacing: -0.012em;
}
.listing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 1.25rem 0 0;
}

@media (max-width: 54.99rem) {
  .listing {
    grid-template-columns: 1fr;
  }
}

/* 12. Forms and results ------------------------------------------------------------------ */

.tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 2rem clamp(1.5rem, 4vw, 3.5rem);
}
.tool {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--ink);
}
.tool h2 {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
}
.tool > p {
  margin-bottom: 0.5rem;
}

label {
  display: block;
  margin: 1.125rem 0 0.375rem;
  font-weight: 500;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  min-height: 2.875rem;
  padding: 0.5625rem 0.75rem;
  border: 1.5px solid var(--ink-soft);
  border-radius: 3px;
  background: var(--deep);
  color: var(--ink);
  font: inherit;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--ink);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--ink);
  outline-offset: 1px;
}
textarea {
  resize: vertical;
}
.tool .button {
  margin-top: 1.5rem;
}

.result {
  margin-top: 1.25rem;
  padding: 1rem 1.125rem;
  border-left: 3px solid var(--magenta);
  background: var(--buff-light);
}
.result dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.375rem 1.25rem;
  margin: 0;
}
.result dt {
  color: var(--ink-soft);
}
.result dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.result p {
  margin: 0.75rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}
.result p:first-child {
  margin-top: 0;
  color: var(--ink);
  font-size: inherit;
}

@media (max-width: 47.99rem) {
  .tools {
    grid-template-columns: 1fr;
  }
}

/* 13. Story ------------------------------------------------------------------------------ */

.page-head {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.25rem);
  padding-inline: max(var(--gutter), calc((100% - var(--page)) / 2));
}
.page-head h1 {
  max-width: 18ch;
  font-size: clamp(2.5rem, 6.4vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.page-head .lede {
  margin: 1.25rem 0 0;
}

.story {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--band);
  padding-inline: max(var(--gutter), calc((100% - var(--page)) / 2));
}
.story h1 {
  max-width: 14ch;
  font-size: clamp(2.75rem, 7vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.028em;
}
.story-deck {
  max-width: 44rem;
  margin: 1.75rem 0 0;
  font: italic 400 clamp(1.3125rem, 2.4vw, 1.75rem)/1.4 var(--serif);
  letter-spacing: -0.008em;
}
.story-body {
  max-width: var(--measure);
  margin: clamp(2.5rem, 6vw, 4rem) 0 0 auto;
  font-size: 1.125rem;
  line-height: 1.65;
}
.story-body h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
}
.story-body section:first-child h2 {
  margin-top: 0;
}
.story-links {
  margin: 0;
  padding: 0;
  list-style: none;
}
.story-links li {
  border-bottom: 1px solid var(--rule);
  font-weight: 500;
}
.story-links a {
  display: block;
  padding: 0.75rem 0;
}
.story-links li:first-child {
  border-top: 1px solid var(--rule);
}

/* 14. Enquiry dialog --------------------------------------------------------------------- */

.enquiry {
  width: min(30rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--deep);
  color: var(--ink);
  box-shadow: 0 1.5rem 4rem rgb(11 37 69 / 0.28);
}
.enquiry::backdrop {
  background: rgb(11 37 69 / 0.45);
}
.enquiry h2 {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
}
.enquiry p {
  margin-bottom: 0.25rem;
}
.enquiry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.enquiry .note {
  min-height: 1.5em;
  margin: 0.875rem 0 0;
}

/* 15. Print ------------------------------------------------------------------------------ */

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .page-nav,
  .enquiry,
  .start,
  .map-details {
    display: none;
  }
  body {
    font-size: 11pt;
  }
  .band,
  .place-head,
  .page-head,
  .story {
    padding: 1.2rem 0;
  }
  a {
    text-decoration: none;
  }
  .listing,
  .route,
  tr {
    break-inside: avoid;
  }
}
