:root {
  --content-width: 309px;
  --content-padding: 32px;
}

/* spec 6.17. */
@media (hover: none) and (pointer: coarse) {
  :root {
    --content-width: 321px;
  }
}

/* spec 6.1., 6.4. */
html {
  background-color: #fff;
  scrollbar-gutter: stable;
  overflow-x: clip;
}

/* spec 6.1., 6.2., 6.3., 6.5., 6.6., 6.7., 6.8., 6.9., 6.10. */
body {
  background-color: #fff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  margin: 0 auto;
  max-width: var(--content-width);
  padding: 96px var(--content-padding);
  gap: 20px;
}

/* spec 6.12., 6.13., 6.14. */
.header {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

/* spec 10.1. */
.essay {
  display: block;
  -webkit-user-select: text;
  user-select: text;
}

.essay > * + * {
  margin-top: 20px;
}

.essay > * + hr,
.essay > hr + * {
  margin-top: 4px;
}

.essay > hr {
  margin-bottom: 0;
}

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

.essay img {
  border-radius: 5px;
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}

/* spec 10.9. */
span[data-md-comment] {
  font-size: 0;
  line-height: 0;
}

del,
s {
  opacity: 0.3;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: currentColor;
  transition:
    opacity var(--transition-duration) var(--transition-easing),
    text-decoration-color var(--transition-duration) var(--transition-easing);
}

del.enter,
s.enter {
  opacity: 1;
  text-decoration-color: transparent;
}

hr {
  border: none;
  height: 2px;
  background: #eeeff2;
  /* body gap is 20px; net 4px above/below. */
  margin: -16px 0;
  width: 100%;
  flex-shrink: 0;
}

ul.spaced li + li {
  margin-top: 10px;
}

blockquote {
  position: relative;
  margin: 0;
  padding-left: 10px;
}

blockquote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc((19px / 4 - 2px) / 2),
    black calc((19px / 4 - 2px) / 2),
    black calc((19px / 4 + 2px) / 2),
    transparent calc((19px / 4 + 2px) / 2),
    transparent calc(19px / 4)
  );
}

::selection {
  background: rgba(0, 0, 0, 0.15);
}

@media (hover: none) and (pointer: coarse) {
  blockquote::before {
    background: repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc((20px / 4 - 2px) / 2),
      black calc((20px / 4 - 2px) / 2),
      black calc((20px / 4 + 2px) / 2),
      transparent calc((20px / 4 + 2px) / 2),
      transparent calc(20px / 4)
    );
  }
}
