/*
 * The blog's v5 additions.
 *
 * site.css already carries the prototype's post cards, prose and document
 * grid. This file only fills what the listing and article need on top of them:
 * search, pagination, the share rail, the author box and a reading-progress
 * line. Every colour comes from the v5 tokens, so light/dark both work.
 */

/* Reading progress */
.blog-progress {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 90;
  height: 3px;
  pointer-events: none;
}

.blog-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
}

/* Listing */
.blog-list {
  padding-block: 48px 72px;
}

.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 28px;
}

.blog-toolbar .chips {
  flex: 1 1 440px;
}

.chips .count {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.chips [aria-current="true"] .count {
  color: inherit;
  opacity: .75;
}

.blog-search {
  display: flex;
  flex: 0 1 380px;
  gap: 8px;
  min-width: min(100%, 300px);
}

.blog-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding-inline: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
}

.blog-search input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.blog-search .btn {
  height: 44px;
  padding-inline: 16px;
}

.blog-search .btn svg {
  width: 18px;
  height: 18px;
}

.pg-hero a.kick:hover {
  border-color: var(--brand);
}

.blog-results {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 14px;
  color: var(--ink-2);
}

.post .th {
  display: block;
}

.post .th:hover img {
  transform: scale(1.015);
}

.post .th img {
  transition: transform .35s ease;
}

.post-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  color: var(--ink-3);
}

.post-ph svg {
  width: 38px;
  height: 38px;
  stroke-width: 1.4;
}

.post .tag:hover,
.post h3 a:hover {
  color: var(--brand-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Pagination */
.blog-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
}

.blog-pager a,
.blog-pager > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.blog-pager a:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.blog-pager [aria-current="page"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.blog-pager .is-disabled {
  opacity: .4;
}

.blog-pager .gap {
  border: 0;
  background: none;
  padding-inline: 2px;
}

.blog-pager svg {
  width: 16px;
  height: 16px;
}

.blog-pager .prev svg {
  transform: rotate(90deg);
}

.blog-pager .next svg {
  transform: rotate(-90deg);
}

[dir="rtl"] .blog-pager .prev svg {
  transform: rotate(-90deg);
}

[dir="rtl"] .blog-pager .next svg {
  transform: rotate(90deg);
}

/* Article */
.blog-article {
  padding-block: 56px 72px;
}

.blog-cover {
  margin: 0 0 30px;
}

.blog-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.blog-aside .chips a,
.blog-aside .chips span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding-inline: 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.blog-share {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.blog-share a,
.blog-share button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding-inline: 8px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.blog-share a:hover,
.blog-share button:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.blog-share .blog-copy {
  grid-column: 1 / -1;
}

.blog-share .is-copied {
  border-color: var(--ok);
  color: var(--ok);
}

.blog-share svg {
  width: 17px;
  height: 17px;
  flex: none;
}

/* The article body keeps its structural rules from rich-content.css, but the
   colours and sizes come from the v5 prose style instead of the old theme. */
.rich-content {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 2;
}

.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
  color: var(--ink);
}

.rich-content h2 {
  font-size: 22px;
  margin: 44px 0 10px;
}

.rich-content h3 {
  font-size: 18px;
  margin: 28px 0 8px;
}

.rich-content a {
  color: var(--brand-text);
}

.rich-content blockquote {
  border-inline-start-color: var(--brand);
  background: var(--surface);
  color: var(--ink);
}

.rich-content pre,
.rich-content .ql-syntax {
  background: var(--surface-2);
  color: var(--ink);
}

.rich-content code {
  background: var(--surface-2);
  color: var(--ink);
}

.rich-content th,
.rich-content td {
  border-color: var(--line);
}

.rich-content th {
  color: var(--ink);
}

.rich-content hr {
  border-top-color: var(--line);
}

.blog-author {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 34px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.blog-avatar {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.jr-initials.blog-avatar {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-2);
}

.blog-author__eb {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-text);
}

.blog-author b {
  display: block;
  font-size: 15px;
  color: var(--ink);
}

.blog-author p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}

.blog-back {
  margin-top: 30px;
}

.blog-back svg {
  transform: rotate(-90deg);
}

[dir="ltr"] .blog-back svg {
  transform: rotate(90deg);
}

@media (max-width: 960px) {
  .blog-article .doc {
    display: flex;
    flex-direction: column;
  }

  .blog-article .blog-aside {
    order: 2;
    position: static;
    max-height: none;
  }

  .blog-article .prose {
    order: 1;
    max-width: none;
  }
}

@media (max-width: 620px) {
  .blog-toolbar {
    align-items: stretch;
  }

  .blog-search {
    flex-basis: 100%;
  }

  .blog-share {
    grid-template-columns: 1fr 1fr;
  }
}
