/* growmedia.co.nz: black and white, mobile first. Dark mode swaps the two. Nothing loads from anywhere else: the
   pages use the system font, and the logo is drawn in the page itself (index.html) or comes from /logo.svg. */

:root {
  color-scheme: light dark;
  --bg: #fff;
  --ink: #000;
  --muted: #595959;
  --line: #dcdcdc;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --ink: #fff;
    --muted: #a6a6a6;
    --line: #333;
  }
}

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

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

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

a {
  color: inherit;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.18em;
}

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

/* The logo. The fern is painted in the page colour over the solid G, so it reads as cut out of it. logo.js adds
   .grow to <html> before anything is drawn, keeping the fern hidden until the animation's first frame. */
.logo .ink {
  fill: var(--ink);
}

.logo .fern {
  fill: var(--bg);
}

.grow .logo .fern {
  visibility: hidden;
}

/* Home: the logo in the middle, the apps under it, the footer at the bottom. */
.home {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.home main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2.25rem, 7vh, 4rem);
  padding: 3rem 1.25rem 2rem;
}

.home h1 {
  margin: 0;
  line-height: 0;
}

.home .logo {
  display: block;
  width: min(74vw, 50vh, 400px);
  width: min(74vw, 50svh, 400px);
  height: auto;
}

.apps {
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem 4rem;
  text-align: center;
}

.apps > li {
  flex: none;
  margin: 0;
}

/* The app names echo MEDIA in the logo: bold capitals, widely spaced. */
.app {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  margin-right: -0.2em; /* the spacing after the last letter, taken back so the name stays centred */
}

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

.stores {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

/* Every page: the footer. */
.site-footer {
  padding: 1.25rem 1rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0.2rem 0;
}

.site-footer a:hover {
  color: var(--ink);
}

/* Other pages: the logo in the corner (it goes home), then the text. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--ink);
  border: 2px solid var(--ink);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
}

.brand {
  display: inline-block;
  line-height: 0;
}

.brand img {
  width: 64px;
  height: auto;
}

@media (prefers-color-scheme: dark) {
  .brand img {
    filter: invert(1);
  }
}

.doc {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

body:not(.home) .site-footer {
  border-top: 1px solid var(--line);
}

h1 {
  font-size: clamp(2rem, 1.55rem + 2.2vw, 2.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.35em;
}

h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 2.3em 0 0.6em;
}

h3 {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 1.8em 0 0.4em;
}

h1,
h2,
h3,
[id] {
  scroll-margin-top: 1rem;
}

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

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

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

strong {
  font-weight: 700;
}

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

.lead {
  font-size: 1.12rem;
}

.toc {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 0.5rem;
  margin: 2rem 0;
}

.toc h2 {
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}

.toc ol {
  margin: 0 0 0.5rem;
  padding-left: 1.6rem;
}

.toc li {
  break-inside: avoid;
}

.toc li + li {
  margin-top: 0.15rem;
}

.summary {
  border: 2px solid var(--ink);
  padding: 1.1rem 1.25rem 0.35rem;
  margin: 2rem 0;
}

.summary > h2:first-child {
  margin-top: 0;
}

address {
  font-style: normal;
  margin: 0 0 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

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

th + th,
td + td {
  padding-left: 0.6rem;
}

thead th {
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
}

@media (min-width: 40em) {
  body {
    font-size: 1.125rem;
  }

  .site-header {
    padding: 2rem 1.5rem 0;
  }

  .doc {
    padding: 2rem 1.5rem 4rem;
  }

  .toc ol {
    columns: 2;
    column-gap: 2.5rem;
  }
}

@media print {
  .skip-link,
  .toc {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .brand img {
    filter: none;
  }

  a[href^="http"]::after,
  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
  }
}
