/*
 * One stylesheet for every page. Colours are the brand colours in brand/README.md.
 * No fonts, pictures or styles are loaded from another server.
 */
:root {
  color-scheme: light dark;
  --ground: #f8efdc;
  --panel: #ffffff;
  --text: #2f241c;
  --line: #e4cfa9;
  --accent: #9a5530;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #2a2420;
    --panel: rgb(248 239 220 / 0.06);
    --text: #f8efdc;
    --line: rgb(228 207 169 / 0.3);
    --accent: #e0a77b;
  }
}

/* Plain elements. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 1.0625rem / 1.6 var(--sans);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 2rem 0 0.75rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 1rem 0 1.5rem;
  font-size: 2.5rem;
}

h2 {
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 1.625rem;
}

p,
ul,
ol,
table {
  margin: 0 0 1.1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.4rem;
}

li::marker {
  color: var(--accent);
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

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

code {
  padding: 0.1em 0.3em;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

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

figure {
  margin: 0;
}

figcaption {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th,
td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 600;
}

/* The parts of a page. */

.top,
main,
.foot {
  width: min(100% - 2.5rem, 46rem);
  margin-inline: auto;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 2rem 1rem;
}

.logo {
  display: block;
  margin: 0;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links li {
  margin: 0;
}

/* A finger needs a target at least 48 pixels tall, not one line of text. */
.links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

.stores li {
  margin: 0;
}

.stores a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.5rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.stores a:hover {
  border-color: var(--accent);
}

main {
  padding-block: 1rem 3rem;
}

.lead {
  margin: 1rem 0 1.5rem;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.3;
  text-wrap: balance;
}

.shots {
  display: grid;
  gap: 1.25rem;
  margin-block: 2rem;
}

.shots img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* The short film on the home page. Its size is set in the page, so nothing moves when it loads. */
.film {
  margin-block: 1rem 1.5rem;
}

.film video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* A screenshot inside a guide. */
.shot {
  margin-block: 2rem;
}

.shot img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* The end of a guide: where to get it, and which version the page describes. */
.get {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.applies {
  font-size: 0.9375rem;
}

.panel {
  margin-top: 3rem;
  padding: 1.5rem 1.5rem 0.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.panel h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.panel code {
  background: none;
}

.foot {
  padding-block: 1.5rem 3rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

.foot p {
  margin: 0.75rem 0 0;
}

@media (min-width: 44rem) {
  .shots {
    grid-template-columns: 1fr 1fr;
  }

  td:first-child {
    width: 55%;
  }
}

/* On a narrow screen each table row becomes a short block, so nothing scrolls sideways. */
@media (max-width: 43.99rem) {
  h1 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1.4rem;
  }

  .panel {
    padding-inline: 1rem;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  tr {
    padding-block: 0.75rem;
    border-bottom: 1px solid var(--line);
  }

  td {
    padding: 0;
    border: 0;
  }

  td + td {
    margin-top: 0.35rem;
  }

  td + td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
  }
}

/*
 * The bar that asks a visitor from one of our ads in Europe before the Google tag loads (ads.js).
 * Nobody else ever sees it. The page gets room at its end as tall as the bar, and scrolling to a
 * link or a focused button stops above the bar, so the bar can always be scrolled clear of the
 * store buttons.
 */
.has-ad-ask {
  scroll-padding-bottom: var(--ad-ask, 8rem);
}

.has-ad-ask body {
  padding-bottom: var(--ad-ask, 8rem);
}

.ad-ask {
  position: fixed;
  inset: auto 0 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem max(1rem, env(safe-area-inset-left)) max(0.75rem, env(safe-area-inset-bottom));
  background: var(--ground);
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  line-height: 1.4;
  animation: ad-ask-in 0.2s ease-out;
}

/* At the top of the page, in its flow, where at the bottom it would hide a store button. */
.ad-ask.ad-ask-top {
  position: static;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-bottom: 0.75rem;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

.ad-ask p {
  max-width: 44rem;
  margin: 0;
}

.ad-ask-buttons {
  display: flex;
  gap: 0.5rem;
}

.ad-ask button {
  min-width: 7rem;
  min-height: 44px;
  padding: 0.4rem 1rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.ad-ask button:hover {
  border-color: var(--accent);
}

.ad-ask button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@keyframes ad-ask-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-ask {
    animation: none;
  }
}
