:root {
  --paper: #E9E9E9;
  --ink: #2d3142;
  --accent: #6c757d;
}

body {
  margin: 0;
  overflow: hidden;
  background: #E9E9E9;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 200;
}

/* Canvas */
#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
}

.hidden {
  display: none;
}

/* Content layer
   Underneath the canvas and out of sight, but still in the accessibility tree
   and in the page source. Not display:none, which would remove it from both. */
.sr-layer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Detail view */
.item {
  position: fixed;
  inset: 0;
  z-index: 2;

  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 0 48px;

  padding: 48px;
  box-sizing: border-box;

  background: rgba(233, 233, 233, 0.94);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s;
}

.item.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.item-figure {
  margin: 0;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-image {
  display: block;
  max-width: min(46vw, 620px);
  max-height: 72vh;
  width: auto;
  height: auto;
  background: var(--paper);
}

.item-text {
  flex: 0 1 380px;
  max-width: 380px;
  align-self: center;
  color: var(--ink);
}

.item-eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.item-title {
  margin: 0 0 18px;
  font-size: 26px;
  font-weight: 200;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

/* the one rule, in the section's colour */
.item-title::after {
  content: "";
  display: block;
  width: 46px;
  height: 1px;
  margin-top: 18px;
  background: var(--accent);
}

.item-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
}

/* an author `display` beats the browser's [hidden] rule, so restate it */
.item-desc[hidden],
.item-fields[hidden],
.item-fields dt[hidden],
.item-link[hidden] {
  display: none;
}

.item-fields {
  margin: 22px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

.item-fields dt {
  margin-top: 12px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
}

.item-fields dd {
  margin: 3px 0 0;
}

.item-link {
  display: inline-block;
  margin-top: 22px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

.item-link:hover {
  border-bottom-color: var(--accent);
}

.item-close {
  position: fixed;
  top: 22px;
  right: 28px;

  background: none;
  border: 0;
  padding: 8px;

  font-family: inherit;
  font-weight: 200;
  font-size: 26px;
  line-height: 1;
  color: var(--accent);

  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.25s ease;
}

.item-close:hover {
  opacity: 1;
}

@media (max-width: 760px) {
  .item {
    padding: 64px 28px 28px;
    align-content: flex-start;
    overflow-y: auto;
  }

  .item-image {
    max-width: 100%;
    max-height: 46vh;
  }

  .item-text {
    flex: 1 1 100%;
    max-width: 100%;
    margin-top: 28px;
  }
}
