/*
 * Base Elements and Typography
 */

/* Signifier by KLIM Type Foundry.
   klim.co.nz/retail-fonts/signifier/
   klim.co.nz/licences/web-fonts/ */
@font-face {
  font-family: 'Signifier';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/signifier-web-regular.woff2') format('woff2'),
       url('../fonts/signifier-web-regular.woff') format('woff');
}

@font-face {
  font-family: 'Signifier';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/signifier-web-regular-italic.woff2') format('woff2'),
       url('../fonts/signifier-web-regular-italic.woff') format('woff');
}

@font-face {
  font-family: 'Signifier';
  font-style: normal;
  font-weight: bold;
  font-display: swap;
  src: url('../fonts/signifier-web-medium.woff2') format('woff2'),
       url('../fonts/signifier-web-medium.woff') format('woff');
}

:root {
  font-size: 1em;

  /* Font-sizes */
  --fs-10: 0.625rem; /* 10 */
  --fs-12: 0.75rem;  /* 12 */
  --fs-14: 0.875rem; /* 14 */
  --fs-16: 1rem;     /* 16 */
  --fs-18: 1.125rem; /* 18 */
  --fs-20: 1.25rem;  /* 20 */
  --fs-22: 1.375rem; /* 22 */
  --fs-24: 1.5rem;   /* 24 */
  --fs-28: 1.75rem;  /* 28 */
  --fs-30: 1.875rem; /* 30 */
  --fs-32: 2rem;     /* 32 */
  --fs-34: 2.125rem; /* 34 */
  --fs-36: 2.25rem;  /* 36 */

  /* Line height */
  --leading: 1.6;

  /* Spacing */
  --sp-b: var(--fs-10);
  --sp-hb: calc(var(--sp-b) / 2);
  --sp-2b: calc(2 * var(--sp-b));
  --sp-3b: calc(3 * var(--sp-b));
  --sp-4b: calc(4 * var(--sp-b));
  --sp-5b: calc(5 * var(--sp-b));
  --sp-6b: calc(6 * var(--sp-b));

  /* Colors */
  --color-mono-lightest: #F1F0EA;
  --color-mono-light: #E6E2DE;
  --color-mono-mid: #999;
  --color-mono-dark: #212020;
  --color-mono-darkest: #0D0D0D;
  --color-mint: #B1DAB8;
  --color-purple: #9685f5;

  --color-text: var(--color-mono-darkest);
  --color-stroke: var(--color-mono-light);
  --color-background: var(--color-mono-lightest);
  --color-highlight: var(--color-purple);

  color: var(--color-text);
  background: var(--color-background);
}

::selection {
  background-color: var(--color-mint);
}

/*@media (prefers-color-scheme: dark) {

  :root {
    --color-text: var(--color-mono-lightest);
    --color-background: var(--color-mono-darkest);
    --color-stroke: var(--color-mono-dark);
    --color-highlight: var(--color-mint);
  }

  ::selection {
    background-color: var(--color-purple);
  }
}*/

.skip-to-content {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}

.skip-to-content:focus {
  z-index: 3;
  width: auto;
  height: auto;
  overflow: visible;
  white-space: normal;
  clip: auto;
  clip-path: none;
}

/*
 * Helpers
 */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/*
 * Base Elements and Typography
 */

:root {
  font-family: Signifier, Times, Times New Roman, serif;
  line-height: var(--leading);
}

img {
  display: block;
  width: 100%;
}

figure {
  margin: 0;
}

figcaption {
  margin-top: var(--sp-hb);
  font-family: monospace;
  color: var(--color-mono-mid);
}

em {
  font-style: italic;
}

small {
  display: inline-block;
  font-size: var(--fs-14);
  color: var(--color-mono-mid);
/*  line-height: var(--fs-24);*/
}

a {
  color: var(--color-text);
  transition: color 0.1s linear;
}

a:hover,
a:focus {
  color: var(--color-highlight);
}

h1, h2, h3, p, blockquote {
  margin-top: var(--fs-30);
  margin-bottom: var(--fs-30);
}

h1 {
  font-size: var(--fs-22);
  /* h1 either appears on the top of the page or sits on the sidebar;
     It doesn't need to differentiate itself against h2 */
}

h2 {
  font-size: var(--fs-20);
}

h3, h4, p, li {
  font-size: var(--fs-18);
}

/* Lists */

ul, ol {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
}

li {
  list-style-type: none;
}

  /* Misc */
code {
  font-family: monospace;
  background-color: var(--color-stroke);
}

hr {
  margin-top: var(--sp-6b);
  margin-bottom: var(--sp-6b);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-color: var(--color-stroke);
}

/* Special characters */
.move-icon::before {
  content: "";
  display: inline-block;
  position: relative;
  top: 0.15em;
  height: 1em;
  width: 1em;
  background-image: url(../images/move-icon-dark.svg);
  background-size: 100%;
  margin-right: 0.25em;
}

/*@media (prefers-color-scheme: dark) {
  .move-icon::before {
    background-image: url(../images/move-icon-light.svg);
  }
}*/

@media screen and (min-width: 750px) {

  h1 {
    font-size: var(--fs-24);
  }

  h2 {
    font-size: var(--fs-22);
  }

  h3, h4 ,p, li {
    font-size: var(--fs-20);
  }
}

/* Skip to content */
.skip-to-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}

.skip-to-content:focus {
  z-index: 3;
  width: auto;
  height: auto;
  padding-left: var(--sp-b);
  padding-right: var(--sp-b);
  overflow: visible;
  white-space: normal;
  clip: auto;
  clip-path: none;
  color: var(--color-text);
  background-color: var(--color-mint);
}

/*@media (prefers-color-scheme: dark) {

  .skip-to-content:focus {
    background-color: var(--color-purple);
  }
}*/

/*
 * Components
 */

/*
 ** Content area
 */

/* Remove margin-bottom from the first element inside content-area */
.content-area > :first-child {
  margin-top: 0;
}

/* Remove margin-bottom from the last element inside content-area */
.content-area > :last-child {
  margin-bottom: 0;
}

.content-area p {
  margin-top: var(--fs-16);
  margin-bottom: var(--fs-16);
}

.content-area h3 {
  padding-bottom: var(--fs-16);
  margin-bottom: var(--fs-16);
  border-bottom: 1px solid var(--color-stroke);
}

.content-area h4 {
  margin-bottom: var(--fs-8);
}

.content-area h3 + p {
  margin-top: var(--fs-16);
}

.content-area ul,
.content-area ol {
  margin-top: var(--fs-16);
  margin-bottom: var(--fs-16);

  ul,
  ol {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: var(--fs-16);
  }
}

.content-area ul li {
  list-style-type: disc;
}

.content-area ul li::marker {
  content: "\2022\00A0\00A0";
}

.content-area ol li {
  list-style-type: decimal;
}

.content-area a[href^="http"]:after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 2px;
  background-image: url(../images/external-link-dark.svg);
  background-repeat: no-repeat;
  background-size: 100%;
}

/*@media (prefers-color-scheme: dark) {

  .content-area a[href^="http"]:after {
    background-image: url(../images/external-link-light.svg);
  }
}*/

.content-area blockquote {
  overflow: hidden;
  margin-left: calc(0px - var(--sp-2b));
  margin-right: 0;
  padding-left: var(--sp-2b);
  padding-right: var(--sp-2b);
  background-color: var(--color-stroke);
}

.content-area code {
  padding: var(--sp-hb);
  border-radius: 2px;
  font-size: var(--fs-16);
  word-break: break-all;
}

.content-area img {
  border-radius: 4px;
}

.content-area figure {
  margin-bottom: var(--fs-30);
}

.content-area video {
  display: block;
  width: 100%;
}

@media screen and (min-width: 1000px) {

  .content-area a[href^="http"]:after {
    width: 10px;
    height: 10px;
  }
}

/*
 ** Notice
 */

.notice {
  padding: var(--fs-16) var(--fs-20) var(--fs-16) var(--fs-20);
  margin-left: calc(-1 * var(--fs-20));
  margin-right: calc(-1 * var(--fs-20));
  background-color: var(--color-mono-light);
  border-radius: var(--sp-hb);
}

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

.notice > :last-child {
  margin-bottom: 0;
}

.notice-heading {
  font-size: var(--fs-20);
}

/*
 ** Document Group
 */

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--sp-b);
  margin-top: var(--fs-30);
  margin-bottom: var(--fs-30);
  border-bottom: 2px solid var(--color-stroke);
}

.section-header h2 {
  margin-top: 0;
  margin-bottom: 0;
}

.document-group {
  margin-top: var(--sp-3b);
  margin-bottom: var(--sp-3b);
}

/* Override .content-area styles */
.document-group h3 + p {
  margin-top: unset;
  margin-bottom: var(--sp-b);
}

.document-group h3 {
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: var(--sp-b);
  border-bottom: 0;
  line-height: var(--sp-20);
}

.document-group ul {
  margin-top: 0;
  margin-bottom: 0;
}

.document-group ul li {
  border-bottom: 1px solid var(--color-stroke);
  list-style-type: none;
}

.document-group li:first-child {
  border-top: 1px solid var(--color-stroke);
}

.document-group ul li::marker {
  content: none;
}

.document-group a {
  display: block;
  padding-top: var(--sp-b);
  padding-bottom: var(--sp-b);
  line-height: var(--fs-20);
  text-decoration: none;
}

/*
 * Video embed
 */

.video-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/*
 * Layout
 */

body {
  padding: var(--sp-2b);
}

header {
  display: grid;
  grid-template-columns: var(--sp-3b) 1fr;
  margin-bottom: var(--sp-6b);
  align-items: center;
}

header .client-heading {
  text-transform: uppercase;
  font-size: var(--fs-12);
  font-weight: bold;
  letter-spacing: 2px;
  text-decoration: none;
}

header .logo {
  position: relative;
  top: -2px;
  left: -4px;
  display: block;
  width: 20px;
  height: 20px;
}

/*@media (prefers-color-scheme: dark) {

  header .logo {
    fill: var(--color-mono-lightest);
  }
}*/

header .logo svg {
  width: 100%;
  height: 100%;
}

main {
  padding-left: var(--sp-3b);
}

main nav {
  position: fixed;
  left: 0;
  overflow: hidden;
  bottom: 0;
  padding: 20px 10px;
}

main nav a {
  display: block;
  width: var(--sp-3b);
  color: var(--color-text);
  background-color: var(--color-stroke);
  text-decoration: none;
  text-align: center;
  line-height: var(--leading);
  border-radius: 2px;
  transition: opacity 0.1s linear;
}

main nav a:hover,
main nav a:focus {
  color: var(--color-text);
  opacity: 0.5;
}

main nav a:not(:last-child) {
  margin-bottom: var(--sp-b);
}

main nav a span {
  display: none;
}

main nav a.hidden {
  opacity: 0;
}

.page-title {
  margin-top: 0;
}

.content-area {
  max-width: 640px;
  grid-column: 2/3;
}

@media screen and (min-width: 600px) {

  body {
    padding: var(--sp-4b);
  }

  main {
    display: grid;
  }

  header,
  main {
    grid-template-columns: 1fr 2fr;
    grid-column-gap: var(--sp-3b);
  }

  main {
    padding-left: 0;
  }

  main nav {
    padding: 0;
    left: var(--sp-4b);
    bottom: var(--sp-4b);
  }
}

@media screen and (min-width: 1000px) {

  body {
    padding: var(--sp-6b);
  }

  header,
  main {
    grid-template-columns: 1fr 3fr;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
  }

  main nav {
    left: var(--sp-6b);
    bottom: var(--sp-6b);
  }
}

@media screen and (min-width: 1400px) {

  header,
  main {
    grid-template-columns: 1fr 2fr 1fr;
    grid-column-gap: var(--sp-6b);
  }

  header h1,
  .content-area {
    grid-column: 2/3;
  }
}

/*
 ** Base structure
 */

 /* safe area for Apple notch phones */
 /*@supports(padding: max(0px)) {

  .main-content {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}*/
