/* Shared layout for article discovery and long-form reading. */
.home-intro, .home-section, .topic-directory, .reading-trail, .mobile-toc, .feed-link {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-color);
}
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
}
#hero.home-intro {
  min-height: 0;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}
.intro-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
#hero.home-intro h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -.035em; margin: .2rem 0 .8rem; }
#hero.home-intro p { margin: 0; max-width: 46rem; opacity: 1; }
#hero.home-intro .eyebrow, #hero.home-intro .home-motto { font-size: .875rem; color: var(--text-secondary-color); }
#hero.home-intro .home-motto { margin-top: .6rem; }
#hero.home-intro .home-focus { font-size: 1.1rem; }
.home-photo { width: 180px; height: 135px; object-fit: cover; border-radius: .7rem; }
.home-section { margin-bottom: 2.5rem; }
.home-section h2 { font-size: 1.3rem; font-weight: 650; margin: 0 0 1rem; }
.featured-grid, .topic-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.featured-post { display: flex; flex-direction: column; min-width: 0; border-radius: .65rem; overflow: hidden; background: var(--secondary-color); }
.featured-post, .post-row, .topic-links a, .series-neighbor { color: var(--text-color); text-decoration: none; }
.featured-post:hover, .post-row:hover, .topic-links a:hover, .series-neighbor:hover { color: var(--primary-color); }
.featured-post > img { width: 100%; height: 210px; object-fit: cover; }
.post-copy { padding: 1rem; }
.post-copy h3 { font-size: 1.04rem; font-weight: 650; line-height: 1.55; margin: 0 0 .5rem; }
.post-copy p { color: var(--text-secondary-color); font-size: .9rem; line-height: 1.75; margin-bottom: .7rem; }
.post-copy time { font-size: .8rem; color: var(--text-secondary-color); }
.topic-links a { display: flex; gap: .7rem; justify-content: space-between; align-items: center; padding: 1rem; border: 1px solid var(--text-secondary-color); border-radius: .5rem; }
.topic-links strong { font-weight: 600; }
.topic-links span { color: var(--text-secondary-color); font-size: .8rem; white-space: nowrap; }
.section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.section-heading > a, .topic-backlink { color: var(--primary-color); font-size: .9rem; }
.post-row { display: block; border-bottom: 1px solid var(--secondary-color); }
.post-row .post-copy { padding: 1rem 0; }
.home-section .post-row .post-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.5rem; }
.home-section .post-row h3 { grid-column: 1; }
.home-section .post-row p { grid-column: 1; margin: 0; }
.home-section .post-row time { grid-column: 2; grid-row: 1; }
.topic-directory { max-width: 900px; padding-top: 3rem; padding-bottom: 3rem; }
.topic-directory h1 { font-size: 2.3rem; font-weight: 700; }
.directory-intro, .topic-description { color: var(--text-secondary-color); line-height: 1.8; }
.topic-directory section { padding-top: 3rem; scroll-margin-top: 90px; }
.topic-directory h2 { font-size: 1.5rem; font-weight: 650; }
.topic-directory .post-row { border-bottom-color: var(--text-secondary-color); }
.tag-directory > h1 { margin-top: .75rem; }
.tag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.tag-card { display: block; padding: 1.25rem; border-radius: .65rem; background: var(--secondary-color); color: var(--text-color); text-decoration: none; }
.tag-card:hover { color: var(--primary-color); }
.tag-card h3 { font-size: 1.1rem; font-weight: 650; line-height: 1.5; }
.tag-card .section-heading span { flex-shrink: 0; font-size: .85rem; }
.tag-card p, .tag-count { color: var(--text-secondary-color); font-size: .9rem; line-height: 1.8; margin: 0; }
.tag-subscribe { display: inline-block; margin-top: 1.5rem; color: var(--primary-color); }
.comments-section { margin-top: 2.5rem; margin-bottom: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--text-secondary-color); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text-color); }
.comments-section.container { max-width: 900px; margin-bottom: 0; padding-bottom: 2rem; }
.comments-section h2 { font-size: 1.3rem; font-weight: 650; }
.comments-intro, .comments-links { font-size: .9rem; line-height: 1.8; color: var(--text-secondary-color); }
.comments-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1rem; }
.comments-links a { color: var(--primary-color); }
.comments-section .giscus { min-height: 200px; }
.feed-link { text-align: center; padding: 1.5rem; }
.feed-link a { color: var(--primary-color) !important; text-decoration: underline; text-underline-offset: .25em; }
.reading-trail { margin: 2.5rem 0 1rem; padding: 1.25rem; background: var(--secondary-color); border-radius: .65rem; }
.reading-trail h2 { font-size: 1.2rem; font-weight: 650; }
.series-position { margin: .75rem 0 0; color: var(--text-secondary-color); font-size: .9rem; }
.series-neighbor { display: block; padding-top: 1rem; }
.series-neighbor span { display: block; color: var(--text-secondary-color); font-size: .85rem; }
.series-neighbor strong { font-size: 1rem; font-weight: 600; }
.mobile-toc { display: none; }
#single .page-content :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: 145px; }
#single .featured-image img { max-height: 240px; width: auto; object-fit: contain; box-shadow: none; }
@media (max-width: 991.98px) {
  .mobile-toc { display: block; position: sticky; top: 80px; z-index: 9; margin-bottom: 1rem; background: var(--secondary-color); border-radius: .5rem; box-shadow: 0 2px 8px #0001; }
  .mobile-toc summary { cursor: pointer; padding: .75rem 1rem; font-size: .95rem; font-weight: 600; }
  .mobile-toc nav { max-height: 50vh; overflow-y: auto; padding: 0 1rem 1rem; }
  .mobile-toc ul { list-style: none; padding-left: 1rem; margin: 0; }
  .mobile-toc > details > nav > ul { padding-left: 0; }
  .mobile-toc a { display: block; padding: .35rem 0; color: var(--text-color); text-decoration: none; line-height: 1.5; }
  #single aside.toc { display: none; }
  .topic-links { gap: .65rem; }
  .topic-links a { flex-wrap: wrap; }
}
@media (max-width: 575.98px) {
  #hero.home-intro { padding: 1.75rem 0; }
  .intro-layout { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: .75rem; padding-left: 1rem; padding-right: 1rem; }
  .home-photo { width: 88px; height: 66px; margin-top: 2rem; }
  .home-section { padding-left: 1rem; padding-right: 1rem; margin-bottom: 2rem; }
  .featured-grid, .topic-links { grid-template-columns: 1fr; }
  .tag-grid { grid-template-columns: 1fr; }
  .featured-post { flex-direction: row; }
  .featured-post > img { width: 84px; height: 84px; margin: 1rem 0 1rem 1rem; border-radius: .35rem; }
  .featured-post .post-copy { min-width: 0; }
  .featured-post .post-copy p { display: none; }
  .post-copy h3 { font-size: 1rem; }
  .home-section .post-row .post-copy { display: block; }
  .home-section .post-row p { margin-bottom: .5rem; }
  .topic-directory { padding: 2rem 1rem; }
  .topic-links a { padding: .85rem 1rem; }
  #single .featured-image img { max-height: 180px; }
}
