:root {
  --ground: #f5efe3;
  --ink: #433c31;
  --gold: #c9a25e;
  --on-gold: #433c31;
  --rule: rgba(67, 60, 49, 0.18);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #2c2a4a;
    --ink: #f5efe3;
    --rule: rgba(245, 239, 227, 0.2);
  }
}
* { box-sizing: border-box; }
html { background: var(--ground); color: var(--ink); font-family: var(--serif); }
body {
  margin: 0 auto;
  max-width: 38rem;
  padding: 3rem 1.25rem calc(3.25rem + 1px + env(safe-area-inset-bottom)); /* room for the doors bar */
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  line-height: 1.6;
  font-size: 1.05rem;
}
h1, h2, h3 { font-weight: normal; text-transform: lowercase; line-height: 1.2; margin: 0; }
h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.4rem; margin: 3rem 0 1.5rem; padding-bottom: .4rem; border-bottom: 1px solid var(--rule); }
h3 { font-size: 1.2rem; }
.lede { margin: 0 0 .75rem; }
.small { font-size: .9rem; opacity: .7; }
article { margin: 0 0 2.75rem; }
.local { font-size: .95rem; opacity: .8; margin: .1rem 0 .75rem; }
.been { display: inline-block; font-size: .8rem; color: var(--ink); border: 1px solid var(--gold); border-radius: 999px; padding: 0 .55rem; margin-left: .5rem; vertical-align: middle; }
blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 2px solid var(--gold); font-style: italic; }
blockquote cite { display: block; font-style: normal; font-size: .85rem; opacity: .7; margin-top: .25rem; }
.practical { font-size: .95rem; margin: .75rem 0 0; }
.practical p { margin: .25rem 0; }
figure { margin: 1rem 0 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--rule); }
figcaption { font-size: .85rem; opacity: .8; margin-top: .4rem; }
a { color: var(--gold); }
.maps {
  display: inline-block; margin-top: .9rem; padding: .5rem 1rem;
  border: 1px solid var(--gold); border-radius: 999px;
  background: var(--gold); color: var(--on-gold); text-decoration: none; font-size: .95rem;
}
.maps:active { opacity: .85; }
footer { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .85rem; opacity: .7; }
.epigraph { font-style: italic; margin: 0 0 1rem; }
nav { margin: 1.5rem 0 0; font-size: .95rem; }
nav a { color: var(--gold); text-decoration: none; }
section h2 { margin-top: 4rem; }
.when { margin: -1.2rem 0 .5rem; font-size: .9rem; opacity: .8; }
.intro { margin: 0 0 2rem; }
.state { display: inline-block; font-size: .8rem; border-radius: 999px; padding: 0 .55rem; margin-left: .5rem; vertical-align: middle; border: 1px solid var(--gold); color: var(--ink); }
.state-changed { border-style: dashed; }
.state-gone { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.state-note { font-size: .95rem; margin: -.25rem 0 .75rem; }
/* the letters page (letters/) */
.about { font-style: italic; margin: 0 0 2rem; }
.para { margin: 0 0 1.25rem; scroll-margin-top: 1rem; }
.para .fr { margin: 0; }
.para .en { margin: .35rem 0 0; font-size: .95rem; opacity: .8; }
.letters-page footer a, .letters-page .small a { color: inherit; }
.letters-page article h3 a { text-decoration: none; }
@media (min-width: 60rem) and (orientation: landscape) {
  /* the margin becomes a gutter to the left of the words */
  .letters-page .text { padding-left: 6rem; }
  .letters-page .margin { float: left; clear: left; width: 5rem; margin: .2rem 0 .5rem -6rem; }
}
.letters { font-size: .95rem; margin: .5rem 0 0; }
.letters a { text-decoration: none; }
/* the four doors (site.js): a bar fixed at the bottom of the phone … */
nav.doors { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; z-index: 1; background: var(--ground); border-top: 1px solid var(--rule); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); font-size: 1rem; }
nav.doors ul { list-style: none; margin: 0; padding: 0; display: flex; }
nav.doors li { flex: 1; text-align: center; }
nav.doors a { display: block; line-height: 3.25rem; color: var(--gold); text-decoration: none; }
nav.doors a.here { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .3em; }
nav.doors .sub { display: none; }
.letters-page h1#title, .pictures-page h1#title { display: inline-block; }   /* so "↑ list" sits beside it */
.up { font-size: .9rem; margin-left: .75rem; text-decoration: none; vertical-align: baseline; }
.neighbours { font-size: .95rem; margin: -.5rem 0 1rem; }
.neighbours a { text-decoration: none; }
.linked { border-top: 1px solid var(--rule); margin-top: 1.5rem; padding-top: .75rem; font-size: .95rem; }
.linked p { margin: 0 0 .25rem; }
.linked a { text-decoration: none; }
/* the margin: the works a paragraph names, small; the words flow past */
.margin { float: right; clear: right; width: 4.5rem; margin: .2rem 0 .5rem 1rem; }
.margin .ref { display: block; color: var(--ink); text-decoration: none; }
.margin img { display: block; width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--rule); background: var(--rule); }
.margin span { display: block; font-size: .75rem; line-height: 1.3; margin: .2rem 0 .6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.linked { clear: both; }
.row { margin: 0 0 1.25rem; }
.row h3 { font-size: 1.05rem; }
.row h3 a { text-decoration: none; }
.row p { margin: .15rem 0 0; }
/* the prints door */
.prints-page .ja { font-size: .95rem; opacity: .8; margin: 0 0 .9rem; }
.prints-page .n { font-size: .85rem; opacity: .6; margin-right: .5rem; }
.prints-page .what { margin: 0 0 4rem; padding-bottom: 2rem; border-bottom: 1px solid var(--rule); }
.prints-page .what h2, .prints-page article h2 { margin: 0 0 1rem; padding: 0; border: 0; font-size: 1.25rem; }
.prints-page article h2 { margin-bottom: .15rem; }
.prints-page .what p { margin: 0 0 1rem; }
.prints-page article { margin: 0 0 4rem; }
.prints-page .note { margin: 1rem 0 0; }
body.pictures-page { max-width: 76rem; }
/* the pictures door */
.pictures-page main h2 { margin-top: 3rem; }
.pictures-page main h3 { font-size: 1.05rem; margin: 1.75rem 0 .6rem; }
.pictures-page footer a { color: inherit; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .75rem; }
.tile { display: block; color: var(--ink); text-decoration: none; }
.tile img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; border: 1px solid var(--rule); background: var(--rule); }
.tile span { display: block; font-size: .8rem; line-height: 1.3; margin-top: .3rem; opacity: .85; }
.picture figure { margin: 0; }
.picture figure img { width: auto; max-width: 100%; max-height: calc(100vh - 9rem); margin: 0 auto; }
.picture .note { margin: 1rem 0 0; }
.pictures-page h1#title:focus { outline: none; }
@media (max-width: 30rem) { .grid { grid-template-columns: repeat(3, 1fr); } }   /* three across on a phone */
/* … and a rail on the left of the ipad in landscape */
@media (min-width: 60rem) and (orientation: landscape) {
  body { max-width: 76rem; padding-bottom: 4rem; display: grid; grid-template-columns: 9rem minmax(0, 1fr); column-gap: 2rem; }
  body > header, body > main, body > footer { grid-column: 2; min-width: 0; }
  /* the rail stays at the same place on every door: the body is 76rem everywhere and the text doors cap their column instead */
  body[data-door="places"] > header, body[data-door="places"] > main, body[data-door="places"] > footer,
  body[data-door="prints"] > header, body[data-door="prints"] > main, body[data-door="prints"] > footer { max-width: 35.5rem; }
  /* the letters door too: a letter's words keep the 35.5rem, with the margin's 6rem gutter to their left */
  body[data-door="letters"] > header, body[data-door="letters"] > main, body[data-door="letters"] > footer { max-width: 41.5rem; }
  nav.doors { position: sticky; top: 1rem; bottom: auto; left: auto; right: auto; grid-column: 1; grid-row: 1 / span 3; align-self: start; background: none; border: 0; padding: 0; }
  nav.doors ul { display: block; }
  nav.doors li { text-align: left; }
  nav.doors a { line-height: 2; }
  nav.doors .sub { display: block; margin-top: 1rem; font-size: .9rem; }
  nav.doors .sub a { color: var(--ink); line-height: 1.6; }
  nav#chapters { display: none; }
}
@media print { nav.doors { display: none; } .prints-page article { break-inside: avoid; } }
