.editorial-home #quarto-content { display: block; }
.editorial-home #quarto-document-content { margin: 0; }
.editorial-home #title-block-header:empty { display: none; }
.editorial-home .quarto-listing { padding: 0; }
.editorial-home .notebook-list a { color: inherit; text-decoration: none; }
.editorial-home .notebook-list a:hover { text-decoration: underline; }

.essay-gallery {
  --gallery-gap: clamp(.4rem, .65vw, .7rem);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gallery-gap);
  padding-inline: var(--gallery-gap);
}
.essay-card {
  --inset: clamp(1.1rem, 5cqw, 2.4rem);
  --height: clamp(19.5rem, 29vw, 30rem);
  grid-column: span 4;
  min-width: 0;
  container-type: inline-size;
  perspective: 1600px;
}
.cover-1, .cover-2 { grid-column: span 6; }
.essay-link {
  display: block;
  height: 100%;
  color: var(--cover-ink);
  text-decoration: none;
  touch-action: manipulation;
}
.essay-link:is(:hover, :visited, :active) { color: var(--cover-ink); }
.editorial-home .essay-link:focus-visible { outline-color: var(--ink); outline-offset: 2px; }
.cover-turn {
  display: grid;
  min-height: var(--height);
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .48s cubic-bezier(.3,.7,.2,1);
}
.essay-card.is-flipped .cover-turn { transform: rotateY(180deg); }
.cover-face {
  grid-area: 1 / 1;
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--cover-paper);
  color: var(--cover-ink);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.cover-front {
  display: grid;
  grid-template-rows: minmax(11rem, 1fr) auto;
  transform: translateZ(1px);
}
.cover-art { position: relative; grid-area: 1 / 1; min-width: 0; }
.cover-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.editorial-home .cover-title, .editorial-home .article-title {
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -.043em;
  line-height: 1.03;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.editorial-home .cover-title {
  position: relative;
  grid-area: 2 / 1;
  align-self: center;
  padding: .78em var(--inset) .86em;
  font-size: clamp(1.55rem, 6.8cqw, 2.6rem);
}
.title-compound { display: inline-block; max-width: 100%; }
.cover-kicker, .back-date {
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.lead-cover {
  --inset: clamp(1.65rem, 4.5cqw, 5rem);
  --height: clamp(22rem, 35.5vw, 39rem);
  grid-column: 1 / -1;
  margin-inline: calc(-1 * var(--gallery-gap));
}
.lead-cover .cover-front {
  grid-template: auto minmax(min-content, 1fr) / 47% 1fr;
}
.lead-cover .cover-art {
  position: absolute;
  inset: 0 0 0 43%;
  grid-area: auto;
  clip-path: ellipse(99% 150% at 103% 103%);
}
.lead-cover .cover-art img { object-position: 50% 14%; transform: scaleX(-1); }
.cover-kicker {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: calc(var(--inset) * .7) 0 0 var(--inset);
}
.cover-kicker::before { content: ""; width: 2rem; height: 1px; background: currentColor; }
.lead-cover .cover-title {
  padding: .65em 0 1em var(--inset);
  font-size: clamp(1.72rem, 4.13cqw, 5rem);
  line-height: 1;
}
.cover-1 .cover-front { grid-template-rows: minmax(74cqw, 1fr); }
.cover-1 .cover-art img { object-position: right 46%; }
.cover-1 .cover-title {
  grid-area: 1 / 1;
  place-self: start;
  margin-top: 0 !important; /* Quarto adds a first-heading margin on small screens. */
  max-width: 72%;
  padding: .54em 1.15em .62em var(--inset);
  border-bottom-right-radius: 1.6em 100%;
  background: var(--cover-paper);
  font-size: clamp(1.35rem, 5.65cqw, 3rem);
}
.cover-2 .cover-front { grid-template: 1fr / 48% 1fr; }
.cover-2 .cover-art {
  position: absolute;
  inset: 0 0 0 43%;
  grid-area: auto;
  clip-path: ellipse(100% 90% at 107% 50%);
}
.cover-2 .cover-art img { object-position: 53% 54%; transform: scaleX(-1); }
.cover-2 .cover-art img[src$="/sgd/cover.webp"] { object-position: 10% center; }
.cover-2 .cover-title {
  grid-area: 1 / 1;
  padding: var(--inset) .35em var(--inset) var(--inset);
  font-size: clamp(1.55rem, 6cqw, 3.05rem);
}
.cover-3 .cover-front { grid-template-rows: auto minmax(11rem, 1fr); }
.cover-3 .cover-title { grid-row: 1; padding: .62em var(--inset); }
.cover-3 .cover-art { grid-row: 2; }
.cover-3 .cover-art img { object-position: 50% 32%; }

.cover-4 .cover-front {
  grid-template-rows: 1fr auto;
  gap: var(--inset);
  padding: var(--inset);
}
.cover-4 .cover-art {
  align-self: center;
  aspect-ratio: 1;
  /* The shallow arch trims only the sky above the outer figures. */
  border-radius: 50% 50% 0 0 / 10% 10% 0 0;
  overflow: hidden;
}
.cover-4 .cover-art img { object-fit: contain; }
.cover-4 .cover-title { padding: 0; text-align: center; }
.cover-3 .cover-title, .cover-4 .cover-title {
  font: italic 400 clamp(1.65rem, 8.3cqw, 3.2rem)/1.02 var(--serif);
  letter-spacing: -.045em;
}
.cover-3 .cover-title::first-line, .cover-4 .cover-title::first-line {
  font-family: var(--sans);
  font-weight: 600;
  font-style: normal;
}
.cover-5 .cover-front { grid-template: 1fr / minmax(0, 1fr) auto; }
.cover-5 .cover-title {
  grid-area: 1 / 2;
  place-self: stretch;
  align-content: center;
  margin: 0;
  padding: .25em .22em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  font-size: clamp(2.65rem, 15cqw, 6rem);
  line-height: 1;
}
.cover-5 .title-ampersand { font: italic 400 1em/1 var(--serif); }

.cover-back {
  transform: rotateY(180deg) translateZ(1px);
  padding: var(--inset);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: .9rem;
}
.back-copy { max-width: 43rem; }
.editorial-home .article-title {
  margin-bottom: .55rem;
  font-size: clamp(1.35rem, 5.5cqw, 2.35rem);
}
.essay-summary { font: 1.05rem/1.4 var(--serif); }
.essay-summary > :last-child { margin-bottom: 0; }
.read-essay { font-size: .95rem; text-decoration: underline; text-underline-offset: .25em; }
.lead-cover .article-title { font-size: clamp(2rem, 4cqw, 4.5rem); }
.lead-cover .essay-summary { font-size: clamp(1.1rem, 1.7cqw, 1.6rem); }

@media (min-width: 40.001rem) and (max-width: 62rem) {
  .lead-cover .cover-front { grid-template-columns: 48.5% 1fr; }
  .essay-card:not(.lead-cover) { grid-column: span 6; }
  .essay-card:last-child:nth-child(even) { grid-column: 1 / -1; }
  .cover-5:last-child .cover-art img { object-position: 50% 8%; }
  .cover-5:last-child .cover-title { font-size: clamp(3rem, 8cqw, 4.8rem); }
}

.notebook {
  margin: clamp(2rem, 4.6vw, 5rem) var(--gutter) 0;
  padding: clamp(1.6rem, 3.7vw, 4.5rem);
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: var(--gutter);
  background: #e3e5d6;
  color: #303427;
}
.notebook h2 {
  border: 0;
  padding: 0;
  margin: 0;
  font: 400 clamp(2.8rem, 5vw, 5.6rem)/.98 var(--serif);
  letter-spacing: -.065em;
}
.notebook h2 em { display: block; }
.notebook-list { padding: 0; margin: 0; list-style: none; }
.notebook-list li { border-top: 1px solid #aaaf9c; }
.notebook-list li:last-child { border-bottom: 1px solid #aaaf9c; }
.notebook-list a {
  display: block;
  padding: .9rem 0;
  font-size: clamp(1.05rem, 1.5vw, 1.5rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.notebook-list a:hover { text-decoration: underline; text-underline-offset: .2em; }

@media (max-width: 40rem) {
  .essay-card:not(.lead-cover) { grid-column: 1 / -1; --height: clamp(18rem, 76vw, 27rem); }
  .lead-cover { --inset: clamp(1.15rem, 4.5cqw, 1.7rem); --height: auto; }
  .lead-cover .cover-front { grid-template: minmax(clamp(12rem, 60vw, 21rem), 1fr) auto / 1fr; }
  .lead-cover .cover-art {
    position: relative;
    inset: auto;
    grid-area: 1 / 1;
    clip-path: ellipse(110% 101% at 100% 0%);
  }
  .lead-cover .cover-art img { object-position: 50% 75%; }
  .lead-cover .cover-kicker {
    z-index: 1;
    align-self: start;
    justify-self: start;
    margin: 1rem;
    padding: .45rem .75rem;
    border-radius: 2rem;
    background: var(--paper);
  }
  .lead-cover .cover-kicker::before { display: none; }
  .lead-cover .cover-title {
    padding: .45em var(--inset) .66em;
    font-size: clamp(1.65rem, 8.35cqw, 3rem);
  }
  .notebook { grid-template-columns: 1fr; gap: 1.5rem; }
  .notebook h2 em { display: inline; }
}
@media screen and (prefers-reduced-motion: no-preference) {
  .essay-card.is-in-view, .bio-intro, .faq-answers > .is-in-view {
    animation: editorial-arrive 360ms ease-out;
  }
}
@keyframes editorial-arrive {
  from { opacity: .55; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .cover-turn { transition: none; }
}
