/*
 * The flyer page (index.html is written by scripts/build-flyer.mjs). Its one colour is the
 * flyer's own forest green, taken from the SVG's background, so page and flyer read as one sheet.
 */
@font-face {
  font-family: "Apfel Grotezk";
  src: url("/fonts/apfel-grotezk/400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* The flyer's background, exactly as pdftocairo writes it (#3a5045). */
  --forest: rgb(22.698975% 31.399536% 27.099609%);
  --peach: #e8bfa0;
  color-scheme: dark;
  background: var(--forest);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--forest);
  color: #fff;
  font:
    400 1rem/1.4 "Apfel Grotezk",
    system-ui,
    sans-serif;
}

img {
  display: block;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--peach);
  outline-offset: 3px;
}

/* Screen readers and search engines get the flyer's text from here; the images only show it. */
.flyer-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Portrait: the flyer's pieces, stacked in one column. */
.sheet {
  display: none;
}

.stack {
  box-sizing: border-box;
  width: min(100%, 32rem);
  margin-inline: auto;
  padding: max(2.5rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(2.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.stack img {
  width: 100%;
  height: auto;
}

.stack a {
  display: block;
}

.part + .part {
  margin-top: 2.25rem;
}

.part-portrait + .part-caption {
  margin-top: 0.5rem;
}

.part-contact + .part-offer {
  margin-top: 1.25rem;
}

/*
 * The one thing that isn't the flyer: a quiet outline button in the flyer's peach (5.1:1 on its
 * green). Clicking the flyer itself opens the PDF; this one downloads it.
 */
.download {
  box-sizing: border-box;
  width: min(100%, 32rem);
  margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-right)) max(2.5rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

.download a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1.125rem;
  border: 1px solid var(--peach);
  border-radius: 999px;
  color: var(--peach);
  font-size: 0.9375rem;
  text-decoration: none;
}

.download a:hover {
  background: var(--peach);
  color: var(--forest);
}

.download svg {
  flex: none;
}

/* 404.html: CloudFront serves it for every missing path. */
.not-found {
  box-sizing: border-box;
  width: min(100%, 32rem);
  margin-inline: auto;
  padding: 3rem 1rem;
}

.not-found h1 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 400;
}

.not-found a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* Landscape: page 1 whole, as large as the window allows, centred on its own green. */
@media (orientation: landscape) {
  body {
    display: grid;
    place-items: center;
  }

  .stack {
    display: none;
  }

  /* The button row below the sheet takes 4.5rem of the window's height. */
  .sheet {
    display: block;
    width: min(100vw, (100vh - 4.5rem) * 16 / 9);
    width: min(100vw, (100dvh - 4.5rem) * 16 / 9);
  }

  .download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 4.5rem;
    padding-block: 0;
  }

  .sheet img {
    width: 100%;
    height: auto;
  }
}
