/* blog-post.css: moved out of post_detail.html on 2026-09-04 (typography step 4).
   Loaded from the template's extra_head so it keeps applying after the shared sheets. */
/* ---------- Page frame ---------- */
/* The fixed nav sits straight on the hero: a hairline instead of header.js's scroll shadow (set inline, hence !important). */
#nav {
  box-shadow: none !important;
  border-bottom: 1px solid #e8e2e0;
}

.blog-article {
  padding: 0 0 100px;
  color: #2b2626;
}

.blog-article .article-kicker {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: #7A6363;
  margin: 0;
}

.breadcrumb {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px 12px;
  font-family: 'Montserrat-Regular', sans-serif;
  font-size: var(--fs-sm);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #7A6363;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: #999;
}

.breadcrumb span:last-child {
  color: #2b2626;
  font-family: 'Montserrat-Medium', sans-serif;
}

/* ---------- Hero ---------- */
.article-hero {
  position: relative;
  /* Own stacking context: the hero can never rise above the fixed nav or its menu overlay. */
  z-index: 0;
  isolation: isolate;
  height: 640px;
  overflow: hidden;
  background: #1a1616;
}

.article-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(20,14,14,0.8) 100%);
}

.article-hero-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 20px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.article-hero .article-kicker {
  color: #e9dcdc;
}

.article-hero h1 {
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  text-transform: none;
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: 0;
  color: #fff;
  max-width: 880px;
  margin: 0;
  text-wrap: balance;
}

.article-meta {
  font-family: 'Montserrat-Regular', sans-serif;
  font-size: var(--fs-sm);
  color: #e9dcdc;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.article-meta-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.5);
}

.article-author {
  color: inherit;
  text-decoration: none;
  font-family: 'Montserrat-Medium', sans-serif;
}

.article-author:hover {
  text-decoration: underline;
}

/* No featured image: same header, on the page's cream instead of a photo. */
.article-hero--plain {
  height: auto;
  background: #f9f7f6;
}

.article-hero--plain .article-hero-text {
  position: static;
  padding: 70px 20px 60px;
}

.article-hero--plain .article-kicker,
.article-hero--plain .article-meta {
  color: #7A6363;
}

.article-hero--plain h1 {
  color: #000;
}

/* ---------- Two-column layout ---------- */
.article-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 20px 0;
  display: grid;
  grid-template-columns: minmax(0, 700px) 300px;
  grid-template-areas: "main side";
  justify-content: space-between;
  gap: 80px;
  align-items: start;
}

.article-main {
  grid-area: main;
  min-width: 0;
}

.article-side {
  grid-area: side;
  position: sticky;
  top: 140px;
  /* Taller than the viewport, a sticky block never shows its bottom: cap it and scroll inside. */
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  /* No system scrollbar: one-line entries keep the rail short, a bottom fade hints at the rest. */
  scrollbar-width: none;
  mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
  -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- Table of contents ---------- */
.toc {
  border-top: 1px solid #000;
  padding-top: 16px;
}

/* Way out of the article while the rail is pinned. */
.toc-back {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: #000;
  text-decoration: none;
  display: block;
  margin-bottom: 18px;
}

.toc-back:hover {
  color: #7A6363;
}

.toc-fold-back {
  display: none;
}

.toc-title {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: #7A6363;
  margin: 0 0 14px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.toc-list li {
  margin: 0;
  padding: 0;
}

.article-side::-webkit-scrollbar {
  display: none;
}

.toc-list a {
  font-family: 'Montserrat-Regular', sans-serif;
  font-size: var(--fs-sm);
  line-height: var(--lh-heading);
  color: #7A6363;
  text-decoration: none;
  display: block;
  padding: 7px 0 7px 14px;
  /* One line per entry so fourteen sections still fit beside the article; the full title is in the tooltip. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 1.5px solid #ebe5e3;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.toc-list a:hover {
  color: #000;
  border-left-color: #947A7A;
}

/* Folded contents (phones and tablets); hidden beside the rail on desktop. */
.toc-fold {
  display: none;
  border: 1px solid #e8e2e0;
}

.toc-fold-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-family: 'Montserrat-Regular', sans-serif;
  font-size: var(--fs-sm);
  cursor: pointer;
  list-style: none;
}

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

.toc-fold-title {
  font-family: 'Montserrat-Medium', sans-serif;
  color: #2b2626;
  flex-shrink: 0;
}

.toc-fold-count {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #7A6363;
  min-width: 0;
}

.toc-fold-count svg {
  transition: transform 0.2s ease;
}

.toc-fold[open] .toc-fold-count svg {
  transform: rotate(180deg);
}

.toc-fold-list {
  list-style: none;
  margin: 0;
  padding: 4px 16px 14px;
  border-top: 1px solid #e8e2e0;
}

.toc-fold-list li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #f0ebe9;
}

.toc-fold-list li:last-child {
  border-bottom: 0;
}

.toc-fold-list a {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  padding: 9px 0;
  font-family: 'Montserrat-Regular', sans-serif;
  font-size: var(--fs-sm);
  line-height: var(--lh-heading);
  color: #7A6363;
  text-decoration: none;
}

.toc-fold-list a:hover {
  color: #000;
}

.toc-fold-list i {
  font-style: normal;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  color: #b9a7a7;
  padding-top: 2px;
}

.toc-list a.is-current {
  color: #000;
  border-left-color: #947A7A;
  font-family: 'Montserrat-Medium', sans-serif;
}

.toc-fold-list a.is-current {
  color: #000;
  font-family: 'Montserrat-Medium', sans-serif;
}

.toc-fold-list a.is-current i {
  color: #947A7A;
}

/* The pinned bar names the current chapter once reading has begun. */
.toc-fold-current {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2b2626;
}

.side-cta {
  background: #f9f7f6;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-cta-title {
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-h4);
  line-height: var(--lh-heading);
  color: #000;
  margin: 0;
}

.side-cta-text {
  font-family: 'Montserrat-Regular', sans-serif;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: #5c4f4f;
  margin: 0;
}

/* ---------- Article body ---------- */
.article-content {
  font-family: 'Montserrat-Regular', sans-serif;
  line-height: var(--lh-loose);
  color: #2b2626;
  text-align: left;
  counter-reset: section;
}

.article-content p {
  margin: 0 0 24px;
  /* header.css sets every <p> to 15px, 23px, tracked 0.84px; lists inherit 16px from the
     container, so without this the body reads as two sizes. */
  line-height: var(--lh-loose);
  letter-spacing: 0;
  text-align: left;
}

.article-content > p:first-child::first-letter {
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-jumbo);
  line-height: var(--lh-tight);
  float: left;
  padding: 8px 10px 0 0;
  color: #947A7A;
}

.article-content h2 {
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  letter-spacing: 0;
  color: #000;
  margin: 56px 0 22px;
}

/* Section number + rule, drawn by CSS counter — nothing to author. */
.article-content h2::before {
  counter-increment: section;
  content: counter(section, decimal-leading-zero);
  display: block;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  color: #947A7A;
  margin-bottom: 18px;
  background: linear-gradient(#e8e2e0, #e8e2e0) no-repeat right center / calc(100% - 40px) 1px;
}

.article-content h3 {
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-h4);
  line-height: var(--lh-heading);
  color: #000;
  margin: 34px 0 14px;
}

.article-content ol {
  margin: 0 0 24px;
  padding-left: 26px;
}

/* Bullets are a short brand-colored dash, the same stroke as the "at a glance" card. */
.article-content ul {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.article-content li {
  margin-bottom: 12px;
  text-align: left;
}

.article-content ul > li {
  position: relative;
  padding-left: 30px;
}

.article-content ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 14px;
  height: 1.5px;
  background: #947A7A;
}

/* Lists of named places (every item opens with a <strong>, tagged by
   mark_ledger_lists() in the view): the name on its own line, on hairlines, like the FAQ. */
.article-content ul.article-ledger {
  border-top: 1px solid #000;
  margin-bottom: 30px;
}

.article-content ul.article-ledger > li {
  padding: 18px 0;
  margin: 0;
  border-bottom: 1px solid #e8e2e0;
  line-height: var(--lh-body);
  color: #4a4040;
}

.article-content ul.article-ledger > li::before {
  content: none;
}

.article-content ul.article-ledger > li > strong {
  display: block;
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-h4);
  line-height: var(--lh-heading);
  color: #000;
  margin-bottom: 4px;
}

.article-content a {
  color: #7A6363;
  text-decoration: underline;
}

.article-content a:hover {
  color: #000;
}

.article-content img {
  max-width: 100%;
  height: auto;
  margin: 30px 0;
}

.article-content .blog-figure {
  margin: 8px 0 30px;
}

.article-content .blog-figure img {
  display: block;
  margin: 0;
  width: 100%;
}

.article-content .blog-figure figcaption {
  margin-top: 12px;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: #7A6363;
  text-align: left;
}

/* Scrolls sideways only when the cells cannot wrap narrow enough (wrap_tables in views.py). */
.article-content .article-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 30px;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: var(--fs-md);
}

.article-content th {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: #7A6363;
  font-weight: 400;
  text-align: left;
  padding: 0 16px 12px 0;
  border-bottom: 1px solid #000;
}

.article-content td {
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid #e8e2e0;
  vertical-align: top;
  line-height: var(--lh-body);
  color: #4a4040;
  font-size: var(--fs-md);
}

.article-content td:first-child {
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-lg);
  color: #000;
}

.article-content blockquote {
  border-top: 1px solid #000;
  border-bottom: 1px solid #e8e2e0;
  padding: 26px 0;
  margin: 30px 0;
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
  color: #000;
  font-style: normal;
}

.article-content blockquote p {
  margin: 0;
}

/* A blockquote opening with a <strong> label ("Hitotoki note:") is a note, not a pull quote:
   body type on a brand-colored rule. Anything else stays an excerpt in Gilda. */
.article-content blockquote:has(> strong:first-child),
.article-content blockquote:has(> p:first-child > strong:first-child) {
  border-top: 0;
  border-bottom: 0;
  border-left: 1.5px solid #947A7A;
  padding: 4px 0 4px 22px;
  font-family: 'Montserrat-Regular', sans-serif;
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
  color: #4a4040;
}

.article-content blockquote strong {
  font-family: 'Montserrat-Medium', sans-serif;
  font-weight: 500;
  color: #000;
}

.article-content hr {
  border: none;
  border-top: 1px solid #e8e2e0;
  margin: 40px 0;
}

/* "Quick answer" block → "At a glance" card */
.article-content .highlight {
  border: 1px solid #e8e2e0;
  padding: 28px 34px;
  margin: 12px 0 36px;
}

/* The card title is a <strong> alone in the first paragraph AND followed by the list ("Where to stay in
   Kyoto — quick answer"). A run-in label ("Hitotoki recommendation: …") is also a lone <strong> for
   :only-child (text nodes do not count), hence the second :has(): it is never followed by a <ul>. */
.article-content .highlight > p:first-child:has(> strong:only-child):has(+ ul) {
  border-bottom: 1px solid #e8e2e0;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.article-content .highlight > p:first-child:has(> strong:only-child):has(+ ul) strong {
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-h4);
  color: #000;
}

.article-content .highlight strong {
  font-family: 'Montserrat-Medium', sans-serif;
  font-weight: 500;
  color: #000;
}

.article-content .highlight > p:last-child {
  margin-bottom: 0;
}

.article-content .highlight ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 40px;
}

.article-content .highlight li {
  position: relative;
  padding-left: 18px;
  margin: 0;
  line-height: var(--lh-body);
}

.article-content .highlight li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 1.5px;
  background: #947A7A;
}


/* FAQ as a ledger: questions in Gilda on hairlines, answers a step smaller.
   The section wrapper comes from wrap_faq_section() in the view. */
.article-content .article-faq h2 {
  margin-bottom: 8px;
}

.article-content .article-faq h3 {
  font-size: var(--fs-h4);
  line-height: var(--lh-heading);
  margin: 0;
  padding: 22px 0 8px;
}

.article-content .article-faq h3:first-of-type {
  border-top: 1px solid #000;
}

.article-content .article-faq p {
  line-height: var(--lh-body);
  color: #4a4040;
  margin: 0;
  padding-bottom: 22px;
  border-bottom: 1px solid #e8e2e0;
}

/* A multi-paragraph answer keeps its rule for the last paragraph only. */
.article-content .article-faq p:has(+ p) {
  padding-bottom: 12px;
  border-bottom: 0;
}

.article-content h2[id],
.article-content h3[id] {
  scroll-margin-top: 140px;
}

/* ---------- Author ---------- */
.author-box {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 26px;
  align-items: center;
  padding: 34px 0 0;
  margin-top: 30px;
  border-top: 1px solid #000;
}

.author-box-photo img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.author-box-name {
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-h4);
  color: #000;
  text-decoration: none;
  display: block;
  margin: 4px 0 2px;
}

.author-box-name:hover {
  color: #7A6363;
}

.author-box-title {
  font-family: 'Montserrat-Regular', sans-serif;
  font-size: var(--fs-sm);
  color: #7A6363;
  margin: 0 0 8px;
}

.author-box-bio {
  font-family: 'Montserrat-Regular', sans-serif;
  font-size: var(--fs-sm);
  color: #5c4f4f;
  line-height: var(--lh-body);
  margin: 0;
}

/* ---------- CTA (full width, shown below the article) ---------- */
/* The end-of-article block (.article-cta) carries its own styles in
   includes/article_cta.html, shared with the index and author pages.
   The desktop rail reuses .article-cta-button outside that block: */
.article-cta-button {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: #fff;
  background: #947A7A;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  padding: 14px 24px;
  border: 1px solid #947A7A;
  display: inline-block;
  text-align: center;
  transition: all 0.3s ease;
}

.article-cta-button:hover {
  background: #fff;
  color: #7A6363;
}

/* ---------- Continue reading (direction B: horizontal cards, square image) ---------- */
.article-related {
  max-width: 1120px;
  margin: 90px auto 0;
  padding: 0 20px;
}

.related-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  margin-bottom: 34px;
  border-bottom: 1px solid #000;
}

.related-title {
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-h2);
  letter-spacing: 0;
  color: #000;
  margin: 0;
}

.related-all {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: #7A6363;
  text-decoration: none;
}

.related-all:hover {
  color: #000;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
}

.related-post-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 22px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.related-post-image {
  width: 200px;
  height: 200px;
  object-fit: cover;
  display: block;
}

.related-post-image--empty {
  background: #f9f7f6;
}

.related-post-content time {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: #7A6363;
  display: block;
  margin-bottom: 6px;
}

.related-post-content h3 {
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-h4);
  line-height: var(--lh-heading);
  color: #000;
  margin: 0 0 6px;
}

.related-post-card:hover h3 {
  color: #7A6363;
}

.related-post-content p {
  font-family: 'Montserrat-Regular', sans-serif;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: #5c4f4f;
  margin: 0;
}

/* ---------- Prev / Next (direction B) ---------- */
.article-prevnext {
  max-width: 1120px;
  margin: 80px auto 0;
  padding: 0 20px;
}

.article-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #000;
}

.prevnext-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 34px 40px 34px 0;
  text-decoration: none;
}

.prevnext-newer {
  align-items: flex-end;
  text-align: right;
  padding: 34px 0 34px 40px;
}

.prevnext-label {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: #7A6363;
}

.prevnext-title {
  font-family: 'GildaDisplay-Regular', serif;
  font-weight: 400;
  font-size: var(--fs-h4);
  line-height: var(--lh-heading);
  color: #000;
  max-width: 480px;
}

.prevnext-link:hover .prevnext-title {
  color: #7A6363;
}

.article-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 20px 0;
  display: flex;
  justify-content: center;
}

.back-to-blog {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: #7A6363;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  padding: 13px 26px;
  border: 1px solid #947A7A;
  display: inline-block;
  transition: all 0.3s ease;
}

.back-to-blog:hover {
  background: rgba(148, 122, 122, 0.1);
}

/* Under 1050px header.css zeroes main's top margin: the page clears the 80px fixed nav itself. */
@media screen and (max-width: 1050px) {
  .blog-article {
    padding-top: 80px;
  }
}

/* ---------- Tablet: rail folds under the hero ---------- */
@media screen and (max-width: 1024px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "side" "main";
    gap: 36px;
    padding-top: 36px;
  }

  .article-side {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
    /* The desktop fade would eat the folded box's bottom edge. */
    mask-image: none;
    -webkit-mask-image: none;
  }

  /* The folded contents ride under the fixed nav (80px once scrolled) and stay there;
     the open list overlays the text instead of pushing it. */
  .article-side {
    position: sticky;
    top: 56px; /* header.js shrinks the phone nav to 55px once scrolled */
    z-index: 5;
  }

  .toc-fold {
    position: relative;
    background: #fff;
  }

  .toc-fold[open] .toc-fold-list {
    position: absolute;
    left: -1px;
    right: -1px;
    top: 100%;
    background: #fff;
    border: 1px solid #e8e2e0;
    border-top: 0;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 16px 32px rgba(40, 30, 30, 0.10);
  }

  /* Once pinned, the bar becomes the header's second line: full width, the nav's
     background, a single hairline — no longer a card floating over the text. */
  .article-side.is-pinned .toc-fold {
    margin: 0 -20px;
    background: #F5F5F5;
    border: 0;
    border-bottom: 1px solid #e8e2e0;
  }

  .article-side.is-pinned .toc-fold-summary {
    padding: 11px 20px;
  }

  /* Pinned, the kicker gives way to the way out: "← Blog", then the chapter being read. */
  .article-side.is-pinned .toc-fold-title {
    display: none;
  }

  .article-side.is-pinned .toc-fold-back {
    display: inline;
    flex-shrink: 0;
    font-family: var(--font-ui);
    font-size: var(--fs-xs);
    letter-spacing: var(--ls-caps);
    text-transform: uppercase;
    color: #000;
    text-decoration: none;
  }

  .article-side.is-pinned .toc-fold[open] .toc-fold-list {
    left: 0;
    right: 0;
    border: 0;
    border-bottom: 1px solid #e8e2e0;
  }

  .side-cta {
    display: none;
  }

  /* The rail's list gives way to the folded contents. */
  .toc {
    display: none;
  }

  .toc-fold {
    display: block;
  }

  .related-posts-grid {
    gap: 28px;
  }

  .related-post-card {
    grid-template-columns: 140px 1fr;
  }

  .related-post-image {
    width: 140px;
    height: 140px;
  }
}

/* ---------- Phone ---------- */
@media screen and (max-width: 780px) {
  .blog-article {
    padding-bottom: 80px;
  }

  .breadcrumb span:last-child {
    display: none;
  }

  .article-hero {
    height: 520px;
  }

  .article-hero-text {
    align-items: flex-start;
    text-align: left;
    padding: 0 22px 26px;
    gap: 12px;
  }

  .article-hero h1 {
    font-size: var(--fs-h3);
    line-height: var(--lh-tight);
  }

  .article-meta {
    justify-content: flex-start;
    gap: 8px;
  }

  .article-hero--plain .article-hero-text {
    padding: 40px 22px 36px;
  }

  .article-layout {
    padding: 26px 22px 0;
  }

  .article-side.is-pinned .toc-fold {
    margin: 0 -22px;
  }

  .article-side.is-pinned .toc-fold-summary {
    padding: 11px 22px;
  }

  .article-content > p:first-child::first-letter {
    font-size: var(--fs-display);
    padding: 6px 8px 0 0;
  }

  .article-content h2 {
    font-size: var(--fs-h3);
    margin-top: 44px;
  }

  .article-content h3 {
    font-size: var(--fs-h4);
  }

  .article-content .highlight {
    padding: 20px;
  }

  .article-content .highlight ul {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  /* Inside the card the table scrolls across the card's padding, up to its rule: a
     column cut at the card edge is the cue that there is more to the right. */
  .article-content .highlight .article-table {
    margin-left: -20px;
    margin-right: -20px;
    padding: 0 20px;
  }

  .article-content .blog-figure {
    margin-left: -22px;
    margin-right: -22px;
  }

  .article-content .blog-figure figcaption {
    padding: 0 22px;
  }

  /* Cells wrap first: a taller row reads better than a sideways scroll. The wrapper above only
     scrolls when wrapping is not enough (a month-by-month table on a 390px phone). */
  .article-content th {
    font-size: var(--fs-xs);
    padding: 0 10px 10px 0;
  }

  .article-content td {
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
    padding: 12px 10px 12px 0;
  }

  .article-content td:first-child {
    font-size: var(--fs-md);
  }

  .article-content blockquote {
    font-size: var(--fs-h4);
  }

  .article-content h2[id],
  .article-content h3[id] {
    scroll-margin-top: 114px;
  }

  .author-box {
    grid-template-columns: 64px 1fr;
    gap: 16px;
  }

  .author-box-photo img {
    width: 64px;
    height: 64px;
  }

  .article-related,
  .article-prevnext {
    margin-top: 60px;
    padding: 0 22px;
  }

  .related-title {
    font-size: var(--fs-h4);
  }

  .related-posts-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .related-post-card {
    grid-template-columns: 110px 1fr;
    gap: 14px;
  }

  .related-post-image {
    width: 110px;
    height: 110px;
  }

  .article-prevnext {
    grid-template-columns: minmax(0, 1fr);
    border-top: 1px solid #e8e2e0;
  }

  .prevnext-link,
  .prevnext-newer {
    align-items: flex-start;
    text-align: left;
    padding: 16px 0;
    border-bottom: 1px solid #e8e2e0;
    gap: 6px;
  }

  .prevnext-title {
    font-size: var(--fs-lg);
  }
}
