/*
  tellwrightmedia.com: the one stylesheet, for the company's pages and for
  each app's section, such as /booktanuk/ (docs/setup/WEBSITE.md).
  Ember Stone, the same look as the Book Tanuk app: warm white, soft
  charcoal text and one deep rust color, used sparingly, in light and dark.
  Phone first: one column, fluid widths, system fonts only (nothing is
  downloaded from another site). test/site/site_files_test.dart checks
  that every text color reads at 4.5:1 or more on its background.
*/

:root {
  color-scheme: light dark;
  --bg: #fcfbf9;          /* warm white */
  --surface: #f3f1ee;     /* a light warm gray for boxes, header, footer */
  --note: #fbe9df;        /* soft rust, behind warnings */
  --onnote: #58230c;      /* text on the soft rust */
  --text: #26201d;        /* soft charcoal */
  --muted: #605955;
  --brand: #a3401a;       /* rust: the filled button */
  --onbrand: #ffffff;     /* text on the button */
  --link: #a3401a;
  --heading: #26201d;
  --accent: #a3401a;      /* small marks only, never a block of color */
  --border: #ddd8d4;
  --focus: #a3401a;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161312;        /* warm near-black */
    --surface: #211f1c;
    --note: #642e18;
    --onnote: #f9ded0;
    --text: #e9e5e2;
    --muted: #c1b9b3;
    --brand: #eaa581;     /* light rust */
    --onbrand: #521e06;
    --link: #eaa581;
    --heading: #e9e5e2;
    --accent: #eaa581;
    --border: #413c38;
    --focus: #eaa581;
  }
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 40rem) {
  .wrap {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Skip link: off screen until it has the keyboard focus. */
.skip {
  position: absolute;
  left: 0.5rem;
  top: -10rem;
  z-index: 2;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--link);
  border: 2px solid var(--focus);
  border-radius: 0.5rem;
}

.skip:focus {
  top: 0.5rem;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

/* Email addresses and web addresses may break anywhere on a narrow phone. */
a[href^="mailto:"],
.address {
  overflow-wrap: anywhere;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  display: block;
  flex: none;
}

.site-header ul,
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header nav a,
.site-footer nav a {
  display: inline-block;
  padding: 0.5rem 0;
}

.site-header nav a[aria-current="page"],
.site-footer nav a[aria-current="page"] {
  font-weight: 700;
}

/* Main text */
main {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

h1,
h2,
h3 {
  color: var(--heading);
  font-weight: 700;
  line-height: 1.25;
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 1rem;
}

h2 {
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

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

li {
  margin-bottom: 0.4rem;
}

li > ul,
li > ol {
  margin-top: 0.4rem;
}

.lead {
  font-size: 1.2rem;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.small {
  color: var(--muted);
  font-size: 0.9rem;
}

/* A box for key points and a box for warnings. */
.box,
.warning {
  margin: 1.5rem 0;
  padding: 1rem 1rem 0.25rem;
  border-radius: 0.75rem;
}

.box {
  background: var(--surface);
  border: 1px solid var(--border);
}

.warning {
  background: var(--note);
  color: var(--onnote);
  border-left: 6px solid var(--accent);
}

.box h2,
.warning h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 1.25rem;
}

/* The home pages' opening. */
.hero {
  padding: 0.5rem 0 0.5rem;
}

.hero h1 {
  font-size: 2.25rem;
  line-height: 1.15;
}

@media (min-width: 40rem) {
  .hero h1 {
    font-size: 2.75rem;
  }
}

/* A list with a small rust dot for each point. */
.points {
  list-style: none;
  padding: 0;
}

.points li {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
}

.points li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.6em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

/* The one filled button, such as "Get Book Tanuk". */
.button {
  display: inline-block;
  margin: 0.25rem 0 1rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--onbrand);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  text-decoration: underline;
}

/* The get-the-app page: one card per store. */
.store {
  margin: 1rem 0;
  padding: 1rem 1rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
}

.store h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 1.25rem;
}

/* Contents list on the long pages. */
.contents {
  margin: 1.5rem 0;
  padding: 1rem 1rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.contents h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 1.15rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.95rem;
}

.site-footer .wrap {
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
}

.site-footer p {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  .site-header nav,
  .skip {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
