/* Desktop reading guide; the article and its figures remain the source of truth. */
.article-rail { display: none; }

@media screen and (min-width: 1120px) {
  body.persimmon-page { --reading-width: 760px; --shell-width: 1280px; }
  .persimmon-page .article-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--reading-width)) minmax(0, 1fr);
    column-gap: 0;
    width: min(var(--shell-width), calc(100% - 64px));
  }
  .persimmon-page .article-hero { grid-column: 1 / -1; grid-row: 1; }
  .persimmon-page .article-content {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    margin: 56px 0 0;
  }
  .persimmon-page .toc-mobile { display: none; }
  .persimmon-page .article-rail {
    display: flex;
    flex-direction: column;
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    width: min(196px, calc(100% - 32px));
    position: sticky;
    top: 108px;
    align-self: start;
    min-height: 0;
    max-height: calc(100dvh - 132px);
    margin-top: 56px;
    z-index: 2;
  }
  .persimmon-page .article-rail .article-toc {
    display: flex;
    flex-direction: column;
    position: static;
    width: 100%;
    min-height: 96px;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: none;
    box-shadow: none;
  }
  .persimmon-page .article-rail .toc-label {
    flex: 0 0 auto;
    margin-bottom: 12px;
    color: #777067;
    font-size: 11px;
    letter-spacing: .07em;
  }
  .article-rail .article-toc ol {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
    padding: 4px 6px 4px 0;
  }
  .persimmon-page .article-rail .article-toc a {
    padding: 4px 8px 4px 10px;
    color: #68645d;
    font-size: 14px;
    line-height: 1.4;
    border-left-color: transparent;
    border-radius: 0 6px 6px 0;
  }
  .article-rail .toc-h2:not(:first-child) { margin-top: 6px; }
  .article-rail .toc-h2 > a { font-weight: 500; }
  .persimmon-page .article-rail .article-toc a:hover { color: var(--ink); background: #eae8e1; }
  .persimmon-page .article-rail .article-toc a.active {
    /* Add weight in paint only, so letters and line breaks stay in place. */
    font-weight: 500;
    -webkit-text-stroke: .2px currentColor;
    color: var(--accent);
    background: color-mix(in srgb, var(--orange) 10%, transparent);
    border-left-color: var(--orange);
  }
}

@media print { .article-rail { display: none; } }

.persimmon-page .article-rail { min-width: 0; }
.persimmon-page .article-toc a { overflow-wrap: anywhere; }
