/* Title-led editorial index. Site tokens/fonts/chrome remain the shared authority.
   Light paper follows Rhythm's existing brand; square editorial surfaces, gently
   rounded form controls, and the host's pill call buttons have distinct roles. */
.blog-page main { container: blog / inline-size; }
.library-shell { padding-block: 2.75rem 5rem; }
.library-intro { margin-bottom: 2.75rem; }
.library-eyebrow { color: var(--coral-dark); font-size: 1rem; font-weight: 600; margin-bottom: .75rem; }
.library-intro h1 { max-width: none; font-size: clamp(2.25rem, 3.6vw, 3.25rem); font-weight: 500; line-height: 1.16; text-wrap: pretty; }
.library-intro h1 + p { margin-top: 1rem; font-size: 1.25rem; max-width: 55rem; }
.library-layout { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: 4rem; align-items: start; }
.library-topics { border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.library-topics h2 { font: 600 1.0625rem/1.4 'Source Sans 3', sans-serif; letter-spacing: 0; margin-bottom: 1rem; }
.library-topics ul, .library-list { list-style: none; padding: 0; }
.library-shell :where(button, input, select) { font: inherit; min-height: 2.75rem; color: var(--ink); }
.library-shell button { cursor: pointer; }
.library-topics button { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; width: 100%; padding: .65rem .75rem; border: 0; border-left: 3px solid transparent; background: transparent; text-align: left; font-size: 1.0625rem; line-height: 1.4; }
.library-topics button[aria-pressed="true"] { border-left-color: var(--coral-dark); background: var(--coral-50); font-weight: 600; }
.library-topics button:hover { color: var(--coral-dark); text-decoration: underline; text-underline-offset: .2em; }
.topic-count { font-variant-numeric: tabular-nums; color: var(--warm-gray); }
.topic-note { margin-top: 1.75rem; padding-inline: .9rem; font-size: 1rem; color: var(--warm-gray); }
.library-tools { margin-bottom: 1.75rem; }
.library-tools label { display: block; font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }
.library-tools input { width: 100%; border: 1px solid var(--warm-gray); border-radius: .25rem; background: transparent; padding: .8rem 1rem; font-size: 1.125rem; appearance: none; }
.library-tools input::placeholder { color: var(--warm-gray); opacity: 1; }
.library-shell select { background: var(--paper); border: 1px solid var(--warm-gray); border-radius: .25rem; padding: .5rem 1.75rem .5rem .75rem; max-width: 100%; font-size: 1rem; }
.library-results-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.library-results-bar h2 { font-size: 1.5rem; font-weight: 500; }
#library-count { font-size: 1rem; color: var(--warm-gray); margin: 0; }
.sort-field { max-width: 100%; margin-left: auto; display: flex; align-items: center; gap: .5rem; font-size: 1rem; }
.filter-state { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-block: .75rem .5rem; font-size: 1rem; }
.filter-state p { color: var(--warm-gray); }
#library-reset, [data-empty-reset] { border: 0; background: transparent; padding: .5rem .25rem; color: var(--coral-dark); text-decoration: underline; text-underline-offset: .2em; font-size: 1rem; }
#library-reset { flex-shrink: 0; }
#library-reset:disabled { color: var(--warm-gray); text-decoration: none; cursor: default; }
.library-list { border-bottom: 1px solid var(--stone); }
.library-entry { position: relative; border-top: 1px solid var(--stone); padding: 1.75rem 1.75rem 2rem; }
.entry-heading { padding-right: 7.5rem; min-height: 5rem; }
.entry-topic { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .875rem; font-size: .875rem; line-height: 1.5; }
.entry-category { color: var(--coral-dark); font-weight: 600; background: var(--coral-50); border-radius: .25rem; padding: .2rem .6rem; }
.entry-kind { color: var(--warm-gray); }
.entry-heading h3 { margin-top: .8rem; font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: 1.9375rem; line-height: 1.25; letter-spacing: -.025em; text-wrap: pretty; }
.entry-link { color: var(--ink); text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: .16em; display: inline-block; min-height: 2.75rem; padding-block: .15rem; }
.entry-link:hover, .entry-link:focus-visible { color: var(--coral-dark); text-decoration-color: currentColor; }
.entry-details summary { position: absolute; right: 1.5rem; top: 1.75rem; display: flex; align-items: center; gap: .65rem; padding: .25rem; min-height: 2.75rem; list-style: none; cursor: pointer; font-size: .9375rem; color: var(--warm-gray); border-radius: .25rem; }
.entry-details summary::-webkit-details-marker { display: none; }
.disclosure-mark { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: 0 0 auto; border: 1px solid var(--coral-dark); border-radius: 50%; color: var(--coral-dark); }
.disclosure-mark::before { content: '+'; font-size: 1.5rem; line-height: 1; }
.entry-details[open] .disclosure-mark { background: var(--coral-dark); color: var(--paper); }
.entry-details[open] .disclosure-mark::before { content: '−'; }
.entry-details summary:hover, .entry-details summary:focus-visible { color: var(--coral-dark); }
.entry-details summary:hover .disclosure-mark { background: var(--coral-50); color: var(--coral-dark); }
.library-entry:has(details[open]) { background: #F3EEE6; border-top-color: var(--coral-dark); }
.library-entry:has(details[open]) .entry-category { background: var(--paper); }
.entry-preview { margin-top: 1.25rem; padding: 0 0 0 1.25rem; border-left: 2px solid var(--coral-dark); max-width: 38rem; }
.entry-summary { font-size: 1.25rem; line-height: 1.7; }
.entry-meta { font-size: 1rem; color: var(--warm-gray); margin-top: .75rem; }
.entry-read { display: inline-flex; align-items: center; gap: 1rem; min-height: 2.75rem; padding-block: .5rem; margin-top: 1rem; font-size: 1.0625rem; font-weight: 600; }
.entry-read span { font-size: 1.5rem; line-height: 1; }
@media (hover: hover) {
  .library-entry:hover { background: #F3EEE6; }
}
.library-empty { border-top: 1px solid var(--stone); padding: 2.5rem 1.25rem 3rem; }
.library-empty h3 { font: 500 1.75rem/1.3 'Fraunces', Georgia, serif; }
.library-empty p { max-width: 35rem; margin-top: 1rem; }
.library-end { margin-top: 1.5rem; color: var(--warm-gray); font-size: 1rem; }
.mobile-topic { display: none; }
.no-script { padding-block: 1rem; font-size: 1rem; }
.demo-notice { background: var(--green-50); padding-block: .65rem; font-size: .9375rem; line-height: 1.5; }
.demo-notice a { display: inline-block; }
.library-shell [hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .entry-details[open] .entry-preview { animation: library-reveal 160ms ease-out; }
  @keyframes library-reveal { from { opacity: 0; transform: translateY(-.2rem); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .blog-page *, .blog-page *::before, .blog-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 1023px) {
  .library-layout { grid-template-columns: 11rem minmax(0, 1fr); gap: 2rem; }
  .entry-heading h3 { font-size: 1.75rem; }
  .sort-field { margin-left: 0; }
}
@container blog (max-width: 47.99rem) {
  .library-shell { padding-block: 2rem 3rem; }
  .library-intro { margin-bottom: 2rem; }
  .library-intro h1 { max-width: 20ch; }
  .library-intro h1 + p { font-size: 1.125rem; }
  .library-layout { display: block; }
  .library-topics { display: none; }
  .mobile-topic { display: block; margin-top: 1rem; }
  .mobile-topic select { width: 100%; }
  .library-tools { margin-bottom: 1.5rem; }
  .library-results-bar { gap: .6rem 1rem; }
  .sort-field { width: 100%; margin-top: .25rem; }
  .sort-field select { flex: 1; }
  .library-entry { padding: 1.5rem .25rem 1.75rem; }
  .entry-heading { padding-right: 0; min-height: 0; }
  .entry-topic { padding-right: 6.75rem; min-height: 2.75rem; gap: .4rem .75rem; align-content: center; }
  .entry-category { padding-inline: .5rem; }
  .entry-heading h3 { margin-top: .9rem; font-size: 1.625rem; line-height: 1.3; letter-spacing: -.02em; }
  .entry-details summary { right: 0; top: 1.5rem; gap: .4rem; padding-inline: .15rem; }
  .disclosure-mark { width: 2rem; height: 2rem; }
  .entry-preview { margin-top: 1rem; padding-left: 1rem; }
  .entry-summary { font-size: 1.1875rem; }
  .library-entry:has(details[open]) { background: transparent; }
  .library-empty { padding-inline: 0; }
}
@media (forced-colors: active) {
  .library-topics button[aria-pressed="true"] { border-left-color: Highlight; outline: 1px solid; }
  .entry-link { text-decoration-color: LinkText; }
}
/* Keep blog reading chrome in flow, including at enlarged text sizes. */
.blog-page .announcement-bar { position: static; }
.library-layout:has(.library-topics[hidden]) { display: block; }
.library-results { min-width: 0; }
.sort-field select { min-width: 0; }
/* Search and sorting share a quiet control row; topic and sort pair on phones. */
.library-tools { display: grid; grid-template-columns: minmax(0, 1fr) 11rem; gap: 1rem; align-items: end; }
.sort-field { display: block; margin: 0; width: 100%; }
.sort-field select { width: 100%; min-height: 3.5rem; }
@container blog (max-width: 47.99rem) {
  .library-shell { padding-top: 1.5rem; }
  .library-intro { margin-bottom: 1.5rem; }
  .library-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .search-field { grid-column: 1 / -1; }
  .mobile-topic, .sort-field { margin: 0; }
  .mobile-topic select, .sort-field select { min-height: 3rem; }
}
