/* Write the Docs India
   The page is laid out like a document: a left margin that
   holds section numbers and dates, ruled sections, and revision marks.
   Colors come from the logo SVG. Saffron is 2.9:1 on white, so it is only
   used for rules and marks, never for text. */

:root {
  --wtdi-navy: #07038d;
  --wtdi-navy-dark: #05026a;
  --wtdi-saffron: #ff671f;
  --wtdi-green: #046a38;
  --wtdi-ink: #1f2328;
  --wtdi-muted: #4b5563;
  --wtdi-line: #e5e7eb;
  --wtdi-rule: #9ca3af;
  --wtdi-paper: #ffffff;
  --wtdi-tint: #f6f7f9;

  --wtdi-serif: "Martel", Georgia, serif;
  --wtdi-sans: "Martel Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wtdi-hand: "Kalam", "Comic Sans MS", cursive;
  --wtdi-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wtdi-measure: 66ch;
  --wtdi-gutter: 1rem;
  --wtdi-margin: 0px;
}

@media (min-width: 48rem) {
  :root {
    --wtdi-gutter: 1.5rem;
    --wtdi-margin: 8rem;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--wtdi-paper);
  color: var(--wtdi-ink);
  font-family: var(--wtdi-sans);
  font-size: 1.125rem;
  line-height: 1.6;
}

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

h1,
h2,
h3 {
  font-family: var(--wtdi-serif);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  color: var(--wtdi-navy);
}

h2 {
  font-size: 1.625rem;
  color: var(--wtdi-ink);
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--wtdi-ink);
  margin-top: 2rem;
}

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

a {
  color: var(--wtdi-navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--wtdi-saffron);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--wtdi-navy);
  outline-offset: 2px;
}

code {
  font-family: var(--wtdi-mono);
  font-size: 0.85em;
  background: var(--wtdi-tint);
  border: 1px solid var(--wtdi-line);
  border-radius: 2px;
  padding: 0.05em 0.3em;
}

/* Page frame */

.wtdi-page {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 var(--wtdi-gutter);
}

/* The double rules from the logo: saffron on top, green at the bottom */

.wtdi-rule {
  height: 12px;
  border: 0 solid;
}

.wtdi-rule--saffron {
  border-color: var(--wtdi-saffron);
  border-top-width: 6px;
  border-bottom-width: 2px;
}

.wtdi-rule--green {
  border-color: var(--wtdi-green);
  border-top-width: 2px;
  border-bottom-width: 6px;
}

/* Skip link */

.wtdi-skip {
  position: absolute;
  left: -999px;
}

.wtdi-skip:focus {
  left: var(--wtdi-gutter);
  top: 1rem;
  z-index: 10;
  background: var(--wtdi-paper);
  padding: 0.5rem 0.75rem;
}

/* Title block: the logo works as a drop cap, with the intro wrapping around it */

.wtdi-title {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.wtdi-title::after {
  content: "";
  display: block;
  clear: both;
}

.wtdi-title > p {
  max-width: var(--wtdi-measure);
}

.wtdi-dropcap {
  float: left;
  width: 112px;
  margin: 0.35rem 1.25rem 0.5rem 0;
}

.wtdi-lede {
  font-size: 1.35rem;
  line-height: 1.45;
}

@media (min-width: 48rem) {
  .wtdi-dropcap {
    width: 240px;
    margin: 0.35rem 2rem 1rem 0;
  }

  /* Keep the intro in one column beside the logo instead of wrapping a
     stray line underneath it */
  .wtdi-title > p {
    overflow: hidden;
  }
}

/* Document body with the contents list as a sticky sidebar on the right */

.wtdi-doc {
  display: flex;
  flex-direction: column;
}

.wtdi-doc__toc {
  padding: 1.25rem 0 0.5rem;
  border-top: 1px solid var(--wtdi-rule);
}

.wtdi-doc .wtdi-sec__body::before {
  left: 0;
  right: 0;
}

@media (min-width: 64rem) {
  .wtdi-doc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 15rem;
    column-gap: 3rem;
  }

  .wtdi-doc__main {
    grid-column: 1;
    grid-row: 1;
  }

  .wtdi-doc__toc {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    position: sticky;
    top: 1.5rem;
    padding-top: 2.5rem;
  }
}

@media (min-width: 48rem) {
  .wtdi-doc .wtdi-sec__body {
    padding-left: var(--wtdi-margin);
  }
}

.wtdi-toc__title {
  font-family: var(--wtdi-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--wtdi-muted);
  margin: 0 0 0.5rem;
}

.wtdi-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wtdi-toc li {
  border-bottom: 1px solid var(--wtdi-line);
}

.wtdi-toc a {
  display: flex;
  gap: 0.75rem;
  padding: 0.45rem 0;
  text-decoration: none;
  color: var(--wtdi-ink);
}

.wtdi-toc a:hover {
  color: var(--wtdi-navy);
}

.wtdi-toc__more {
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

.wtdi-toc__more a {
  display: inline;
  padding: 0;
  color: var(--wtdi-navy);
  text-decoration: underline;
}

/* Actions */

.wtdi-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-top: 1.5rem;
}

/* Handwritten margin notes, like an editor's pencil on a draft. Use sparingly. */

.wtdi-scribble {
  display: inline-block;
  font-family: var(--wtdi-hand);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--wtdi-green);
  transform: rotate(-2deg);
}

.wtdi-scribble--left::before {
  content: "\2190\00a0";
}

h2 .wtdi-scribble {
  font-size: 1.05rem;
  margin-left: 0.75rem;
  vertical-align: 0.15em;
}

.wtdi-button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--wtdi-navy);
  border-radius: 2px;
  background: var(--wtdi-navy);
  color: var(--wtdi-paper);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.3;
}

.wtdi-button:hover {
  background: var(--wtdi-navy-dark);
  border-color: var(--wtdi-navy-dark);
  text-decoration: none;
}

.wtdi-button--quiet {
  background: transparent;
  color: var(--wtdi-navy);
}

.wtdi-button--quiet:hover {
  background: var(--wtdi-tint);
  border-color: var(--wtdi-navy);
}

/* Numbered sections. The number hangs in the left margin on wider screens. */

.wtdi-num {
  font-family: var(--wtdi-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--wtdi-navy);
}

.wtdi-sec__body {
  position: relative;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}

.wtdi-sec__body > * {
  max-width: var(--wtdi-measure);
}

.wtdi-sec:not(.wtdi-sec--first) .wtdi-sec__body::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--wtdi-gutter);
  right: var(--wtdi-gutter);
  border-top: 1px solid var(--wtdi-rule);
}

.wtdi-sec h2 .wtdi-num {
  display: block;
  margin-bottom: 0.25rem;
}

@media (min-width: 48rem) {
  .wtdi-sec__body {
    padding-left: calc(var(--wtdi-gutter) + var(--wtdi-margin));
  }

  .wtdi-sec h2 {
    position: relative;
  }

  .wtdi-sec h2 .wtdi-num {
    position: absolute;
    left: calc(-1 * var(--wtdi-margin));
    top: 0.45em;
    margin: 0;
  }
}

.wtdi-meta {
  font-family: var(--wtdi-mono);
  font-size: 0.85rem;
  color: var(--wtdi-muted);
}

/* Reference tables */

.wtdi-ref {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.wtdi-prose > .wtdi-ref {
  max-width: none;
}

.wtdi-ref th,
.wtdi-ref td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 1.25rem 0.6rem 0;
  border-bottom: 1px solid var(--wtdi-line);
  overflow-wrap: anywhere;
}

.wtdi-ref th {
  font-family: var(--wtdi-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--wtdi-muted);
  border-bottom: 1px solid var(--wtdi-ink);
}

.wtdi-ref td:first-child {
  white-space: nowrap;
  overflow-wrap: normal;
}

/* Events */

.wtdi-events {
  list-style: none;
  padding: 0;
}

.wtdi-events li {
  padding: 0.25rem 0 0.5rem;
}

.wtdi-events li + li {
  margin-top: 1rem;
}

.wtdi-events p {
  margin: 0 0 0.25rem;
}

.wtdi-events__title {
  font-family: var(--wtdi-serif);
  font-size: 1.2rem;
  font-weight: 600;
}

/* Revision mark: a change bar in the margin next to anything new */

.wtdi-revmark {
  position: relative;
}

.wtdi-revmark::before {
  content: "";
  position: absolute;
  top: 0.2rem;
  bottom: 0.2rem;
  left: -0.75rem;
  border-left: 3px solid var(--wtdi-saffron);
}

.wtdi-note {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--wtdi-green);
  background: var(--wtdi-tint);
}

.wtdi-note::before {
  content: "Note";
  display: block;
  font-family: var(--wtdi-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--wtdi-green);
}

/* Past events and debriefs: dates sit in the margin */

.wtdi-past {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--wtdi-line);
}

.wtdi-past li {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--wtdi-line);
}

.wtdi-past time {
  padding-top: 0.2rem;
}

@media (min-width: 48rem) {
  .wtdi-sec__body > .wtdi-past {
    max-width: calc(var(--wtdi-measure) + var(--wtdi-margin));
    margin-left: calc(-1 * var(--wtdi-margin));
  }

  .wtdi-past li {
    grid-template-columns: var(--wtdi-margin) 1fr;
    gap: 0;
  }
}

/* Organisers and quotes */

.wtdi-people {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--wtdi-line);
}

.wtdi-people li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--wtdi-line);
}

.wtdi-people .wtdi-muted {
  display: block;
  font-size: 0.95rem;
}

.wtdi-quote {
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--wtdi-rule);
  font-family: var(--wtdi-serif);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.55;
}

.wtdi-quote p {
  margin: 0;
}

/* Posts */

.wtdi-prose h2 {
  margin-top: 2.5rem;
}

.wtdi-sec--first .wtdi-sec__body {
  padding-top: 2.5rem;
}

/* Footer */

.wtdi-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--wtdi-rule);
  font-size: 0.95rem;
}

.wtdi-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.wtdi-footer__inner p {
  margin: 0;
  max-width: 46ch;
}

.wtdi-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Utilities */

.wtdi-muted {
  color: var(--wtdi-muted);
}

.wtdi-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
