/* ==========================================================================
   Page + Content Variants
   ========================================================================== */

.letter-body {
  text-wrap: pretty;
  orphans: 3;
  widows: 3;
}

.letter-body :is(h1, h2, h3, h4, h5, h6) {
  text-wrap: balance;
  break-after: avoid;
}

.page--prose .letter-body {
  font-family: var(--serif-font);
  font-weight: 400;
  font-size: var(--text-reading);
  line-height: var(--leading-body);
}

.page--prose .letter-body strong,
.page--prose .letter-body b,
.page--prose .letter-body a {
  font-weight: 700;
}

.page--purpose .prose-subheading {
  font-weight: 600;
}

/* Indexes and forms use the stable body role. Individual post bodies receive
   the reading role from .email-meta + .letter-body above. */
.page--posts:not(.page--post-detail) .letter-body {
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

.section-heading {
  margin: 0 0 10px;
}

.page--values .letter-body .section-heading {
  margin-bottom: 10px;
}

.section-heading em strong {
  font-size: var(--text-title);
}

.section-heading--spaced {
  margin-top: 20px;
}

.disclosure {
  margin: 0 0 6px;
}

.disclosure-summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--color-text-day);
  cursor: var(--cursor-light), pointer;
  transition: color 0.2s ease;
}

.disclosure-summary::-webkit-details-marker {
  display: none;
}

.disclosure-summary::before {
  content: ">";
  font-family: var(--mono-font);
  font-size: var(--font-size-xs);
  line-height: 1;
  color: currentColor;
  text-shadow: none;
  transform-origin: center;
  transition: transform 0.2s ease, color 0.2s ease;
  margin-top: 3px;
}

.disclosure[open] .disclosure-summary::before {
  transform: rotate(90deg);
  color: currentColor;
}

.disclosure-summary:hover,
.disclosure[open] .disclosure-summary:hover {
  color: rgba(255, 255, 255, 0.95);
}

.disclosure-summary:hover::before,
.disclosure[open] .disclosure-summary:hover::before {
  color: rgba(255, 255, 255, 0.95);
}

.disclosure-title {
  display: block;
  font-size: var(--text-title);
  line-height: var(--leading-tight);
  font-style: italic;
  font-weight: 400;
  color: inherit;
  transition: color 0.2s ease;
}

/* Cross-browser cap-height trimming for Plantin Now Italic. Its ascent is
   0.75em, descent 0.25em, and cap height 0.682em. */
.disclosure-title::before {
  content: "";
  display: table;
  margin-bottom: -0.068em;
}

.disclosure-title::after {
  content: "";
  display: table;
  margin-top: -0.25em;
}

.page--values .letter-body .icon-list {
  margin: 6px 0 14px 20px;
  padding: 0;
  list-style: none;
}

.icon-list > li {
  margin: 0 0 3px;
  position: relative;
  padding-inline-start: 16px;
}

.icon-list--star > li::before {
  content: "✶";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  color: var(--color-text-day);
}

.theme-night .disclosure-summary {
  color: rgba(240, 240, 240, 0.8);
}

.theme-night .disclosure[open] .disclosure-summary::before {
  color: rgba(240, 240, 240, 0.8);
}

.theme-night .disclosure-summary:hover,
.theme-night .disclosure[open] .disclosure-summary:hover {
  color: rgba(255, 255, 255, 0.95);
}

.theme-night .disclosure-summary:hover::before,
.theme-night .disclosure[open] .disclosure-summary:hover::before {
  color: rgba(255, 255, 255, 0.95);
}

.theme-night .icon-list--star > li::before {
  color: rgba(240, 240, 240, 0.8);
}

/* Readable page treatment */
.content-page .letter-body a,
.content-page .email-meta a,
.content-page .letter-footer a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
}

.content-page .letter-body a:hover,
.content-page .email-meta a:hover,
.content-page .letter-footer a:hover,
.theme-night .content-page .letter-body a:hover,
.theme-night .content-page .email-meta a:hover,
.theme-night .content-page .letter-footer a:hover {
  color: var(--color-text-day);
  text-decoration-style: solid;
}

.theme-night .content-page .letter-body a:hover,
.theme-night .content-page .email-meta a:hover,
.theme-night .content-page .letter-footer a:hover {
  color: #fff;
}

.content-page .email-meta {
  padding-bottom: 24px;
  margin-bottom: 36px;
  border-bottom: 1px solid rgba(39, 37, 34, 0.18);
}

.theme-night .content-page .email-meta {
  border-bottom-color: rgba(244, 242, 238, 0.18);
}

.page--post-detail .letter-footer {
  padding-top: 28px;
  margin-top: 48px;
  border-top: 1px solid rgba(39, 37, 34, 0.14);
}

.theme-night .page--post-detail .letter-footer {
  border-top-color: rgba(244, 242, 238, 0.14);
}

.page--posts:not(.page--post-detail) .posts-list {
  margin: 20px 0;
}

.page--posts:not(.page--post-detail) .posts-list li {
  margin: 6px 0;
}

.page--posts:not(.page--post-detail) .posts-list li > a {
  text-decoration: none;
}

.content-page .disclosure-summary {
  color: inherit;
  cursor: var(--cursor-dark), pointer;
}

.page--values .disclosure-summary {
  align-items: center;
  padding-block: 7px;
  /* Follow the page's interpolated theme color directly. A second color
     transition here repeatedly restarted and made the control flash. */
  transition: none;
}

.page--values .disclosure-summary > em {
  display: contents;
}

.page--values .disclosure-summary::before {
  content: "";
  box-sizing: border-box;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: 0;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.page--values .disclosure-title {
  transition: none;
}

.page--values .disclosure-summary:is(:hover, :focus-visible) .disclosure-title {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
}

/* Spinning star on hover, matching .nav-link. The summary's ::before is the
   chevron and the title's pseudo-elements trim cap height, so the star lives
   on the summary's ::after. */
.page--values .disclosure-summary::after {
  content: "";
  width: 15px;
  height: 15px;
  background: url('../cursor-light.svg') center/contain no-repeat;
  transform-origin: center;
  flex: 0 0 auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}

body:not(.theme-night) .page--values .disclosure-summary::after {
  background-image: url('../cursor-dark.svg');
}

.page--values .disclosure-summary:is(:hover, :focus-visible)::after {
  opacity: 1;
  animation: navLinkStarSpin 1.15s linear infinite;
}

.content-page.page--values .disclosure[open] .disclosure-summary::before {
  color: currentColor;
  transform: rotate(45deg);
}

.content-page .disclosure-summary::before {
  color: currentColor;
  text-shadow: none;
}

.content-page .disclosure-summary:hover,
.content-page .disclosure[open] .disclosure-summary:hover,
.content-page .disclosure-summary:hover::before,
.content-page .disclosure[open] .disclosure-summary:hover::before {
  color: var(--color-text-day);
}

.theme-night .content-page .disclosure-summary {
  color: inherit;
  cursor: var(--cursor-light), pointer;
}

.theme-night .content-page .disclosure-summary:hover,
.theme-night .content-page .disclosure[open] .disclosure-summary:hover,
.theme-night .content-page .disclosure-summary:hover::before,
.theme-night .content-page .disclosure[open] .disclosure-summary:hover::before {
  color: #fff;
}

@media (min-width: 801px) {
  /* Navigation links reserve room for their hover star. Match that inset so
     the MENU label and link text share the same right-hand alignment. */
  .menu-trigger-toggle {
    padding-inline-end: 21px;
  }

  /* Keep fixed footer controls outside the centered reading column on
     intermediate widths, then ease them back to the shared desktop gutter. */
  .site-footer-bar {
    padding-inline: clamp(28px, calc(50vw - 520px), var(--frame-inline));
  }
}

@media (min-width: 801px) and (max-width: 1100px) {
  .content-surface,
  .page--prose .content-surface,
  .page--post-detail .content-surface {
    width: min(680px, calc(100vw - 360px));
  }
}

