/* ------------------------------------------------------------------
   Reading aids for long-form pages: a contents list, a reading-time
   line, and a two-level "short version / full detail" mode that only
   hides elements the reader can bring back. Default is full detail, so
   nothing is hidden for a crawler or a first-time reader.
   ------------------------------------------------------------------ */

.rd-tools {
  margin: 34px 0 8px;
  padding: 18px 20px 16px;
  border: 1px solid var(--line, #e8e3da);
  border-radius: 14px;
  background: var(--paper, #fffdf9);
}

.rd-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
}

.rd-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a7f6b;
}

.rd-kicker span {
  font-weight: 400;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--muted, #737985);
}

/* Segmented reading-mode switch */
.rd-mode {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #ddd6c8;
  border-radius: 999px;
  background: #fff;
}

.rd-mode button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 6px 13px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.3;
  color: #5f6570;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.rd-mode button:hover {
  background: #f2eee6;
}

.rd-mode button[aria-pressed="true"] {
  background: #1c2b3a;
  color: #fffdf9;
}

.rd-mode button:focus-visible {
  outline: 2px solid #b08c2e;
  outline-offset: 2px;
}

/* Contents list */
.rd-toc {
  margin-top: 12px;
}

.rd-toc summary {
  cursor: pointer;
  font-size: 13px;
  color: #6b6f79;
  list-style: none;
}

.rd-toc summary::-webkit-details-marker {
  display: none;
}

.rd-toc summary::before {
  content: "▸";
  display: inline-block;
  width: 14px;
  color: #b08c2e;
  transition: transform .16s ease;
}

.rd-toc[open] summary::before {
  transform: rotate(90deg);
}

.rd-toc ol {
  margin: 10px 0 2px;
  padding-left: 20px;
  columns: 2;
  column-gap: 30px;
  font-size: 14px;
  line-height: 1.5;
}

.rd-toc li {
  margin: 0 0 7px;
  break-inside: avoid;
}

.rd-toc a {
  color: #26303d;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.rd-toc a:hover {
  border-bottom-color: #cba86a;
}

/* Short version: a generated digest replaces the contents list. The page
   below it is untouched, so switching back costs nothing. */
.rd-summary {
  display: none;
  margin-top: 14px;
}

.rd-brief .rd-summary {
  display: block;
}

.rd-brief .rd-toc {
  display: none;
}

.rd-summary-head {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a7f6b;
}

.rd-summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rd-summary li + li {
  border-top: 1px solid #f0ebe1;
}

.rd-summary a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
}

.rd-summary b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #26303d;
}

.rd-summary span {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #5f6570;
}

.rd-summary a:hover b {
  color: #8a6d1f;
}

@media (max-width: 720px) {
  .rd-tools {
    margin: 26px 0 4px;
    padding: 15px 16px 14px;
  }
  .rd-toc ol {
    columns: 1;
    font-size: 13.5px;
  }
  .rd-head {
    gap: 8px 12px;
  }
}
