/* Library (blog) section — additive only. Reuses tokens/layout classes from
   main.css (--sand-*, --ink-*, --accent-green, --line, .section-blockish,
   .program-wrap, .program-kicker, .video-frame) rather than redefining them. */

.lib-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  max-width: 20ch;
  line-height: 1.05;
}

.lib-meta {
  margin: 0.4rem 0 0;
  color: var(--ink-700);
  font-size: 0.95rem;
}

.lib-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.lib-tag-pill {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  color: var(--ink-700);
  text-decoration: none;
}

.lib-tag-pill:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.lib-cover {
  width: 100%;
  max-width: 46rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  margin: 0 auto;
}

.lib-body-wrap {
  display: grid;
  gap: 2.5rem;
  /* .lib-hero already carries section-blockish's own bottom padding (4.75rem)
     right above this — no extra top padding needed here, or the two stack
     into an oversized gap between the tag pills and the cover image. */
  padding-bottom: 3rem;
  max-width: 46rem;
}

.lib-toc {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  background: var(--sand-100);
}

.lib-toc-title {
  margin: 0 0 0.6rem;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--ink-700);
}

.lib-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.lib-toc-item a {
  color: var(--ink-900);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.lib-toc-item a:hover {
  border-bottom-color: var(--accent-green);
}

.lib-toc-h3 {
  padding-left: 1rem;
  font-size: 0.92rem;
}

.lib-body h2,
.lib-body h3 {
  /* .site-top header is sticky — without this, a TOC anchor click scrolls the
     heading directly under it, hiding the heading. */
  scroll-margin-top: 6rem;
}

.lib-body {
  display: grid;
  gap: 1.4rem;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink-900);
}

/* main.css's global h1/h2/h3 rule already zeroes their margin, but plain
   elements (p, blockquote, img) still carry browser default margins, which
   stack on top of the grid `gap` above and double the visual spacing. The
   grid gap is the single source of spacing here — all children reset to 0,
   with a bit of extra breathing room added before subheadings only. */
.lib-body p,
.lib-body blockquote,
.lib-body img,
.lib-body figure {
  margin: 0;
}

.lib-body h2 {
  font-size: 1.7rem;
  margin-top: 0.6rem;
}

.lib-body h3 {
  font-size: 1.3rem;
  margin-top: 0.3rem;
}

.lib-body img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.lib-body blockquote {
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent-green);
  color: var(--ink-700);
  font-style: italic;
}

.lib-author-box {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  padding: 1.5rem;
  border: 1px solid var(--line);
  background: var(--sand-100);
}

.lib-author-photo {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.lib-author-name {
  margin: 0 0 0.35rem;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1rem;
}

.lib-author-role {
  font-family: "Public Sans", sans-serif;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink-700);
  font-weight: 400;
}

.lib-author-bio {
  margin: 0;
  color: var(--ink-700);
  font-size: 0.95rem;
  line-height: 1.6;
}

.lib-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.lib-card {
  display: grid;
  border: 1px solid var(--line);
  background: var(--sand-100);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.lib-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.lib-card-thumb--placeholder {
  background: var(--sand-200);
}

.lib-card-body {
  padding: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.lib-card-title {
  margin: 0;
  font-size: 1.2rem;
}

.lib-card-excerpt {
  margin: 0;
  color: var(--ink-700);
  font-size: 0.95rem;
  line-height: 1.55;
}

.lib-card-meta {
  margin: 0;
  color: var(--ink-700);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lib-empty {
  color: var(--ink-700);
}

.lib-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 2.5rem;
}

.lib-pagination a {
  font-family: "Oswald", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration-thickness: 1px;
  color: var(--ink-900);
}

@media (max-width: 640px) {
  .lib-author-box {
    flex-direction: column;
  }
}
