/* =========================================================
   Blog, author, and 404 pages. Loaded after style.css and
   reuses its tokens (--teal-*, --ink, --line, fonts, etc.).
   ========================================================= */

/* ---------- Breadcrumbs ---------- */
.breadcrumb {
  margin-bottom: 26px;
  font-size: 0.84rem;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  color: var(--ink-faint);
}

.breadcrumb li + li::before {
  content: "/";
  margin: 0 9px;
  color: var(--line);
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb a:hover {
  color: var(--teal-700);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--ink-faint);
  max-width: 42ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Listing header (index / category / tag) ---------- */
.list-header {
  padding-bottom: 52px;
}

.list-header .container {
  max-width: var(--max-page);
}

.list-header h1 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  max-width: 20ch;
  margin-bottom: 16px;
}

.h1-page {
  font-weight: 400;
  font-style: italic;
  color: var(--ink-faint);
}

.list-lede {
  color: var(--ink-soft);
  font-size: 1.1rem;
  max-width: 52ch;
  margin: 0;
}

.list-body {
  padding-top: 40px;
  padding-bottom: 8px;
}

.kicker-link {
  text-decoration: none;
  width: fit-content;
}

.kicker-link:hover {
  color: var(--blue-900);
}

/* ---------- Category chips ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.chip:hover {
  border-color: var(--teal-600);
  color: var(--teal-700);
}

.chip.is-active {
  background: var(--blue-900);
  border-color: var(--blue-900);
  color: #fff;
}

.chip-count {
  font-size: 0.74rem;
  opacity: 0.7;
}

/* ---------- Post cards ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px 28px;
}

.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.post-card-media {
  display: block;
  aspect-ratio: 1200 / 630;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(160deg, var(--teal-200), var(--teal-400) 60%, var(--blue-900));
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

a.post-card-media:hover img {
  transform: scale(1.03);
}

.post-card-media.is-empty {
  display: grid;
  place-items: center;
}

.post-card-media.is-empty .facet {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.55);
}

.post-card-body {
  padding-top: 18px;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.post-card-cat {
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--teal-700);
  text-decoration: none;
}

.post-card-cat:hover {
  text-decoration: underline;
}

.post-card-title {
  font-size: 1.28rem;
  line-height: 1.25;
  margin: 0 0 10px;
}

.post-card-title a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 0.25s var(--ease), color 0.2s ease;
}

.post-card-title a:hover {
  color: var(--teal-700);
  background-size: 100% 1px;
}

.post-card-excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state {
  padding: 56px 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 64px 0 0;
}

.page-link {
  min-width: 42px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

a.page-link:hover {
  border-color: var(--teal-600);
  color: var(--teal-700);
}

.page-link.is-current {
  background: var(--blue-900);
  border-color: var(--blue-900);
  color: #fff;
}

.page-gap {
  color: var(--ink-faint);
  padding: 0 2px;
}

/* ---------- Post: header ---------- */
.post-wrap {
  width: 100%;
  max-width: 984px;
  margin: 0 auto;
  padding: 0 28px;
}

.post-hero {
  background: var(--paper-alt);
  border-bottom: 1px solid var(--line);
  padding: 32px 0 44px;
}

.post-hero h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 24ch;
  margin-bottom: 18px;
}

.post-dek {
  font-size: 1.18rem;
  color: var(--ink-soft);
  max-width: 58ch;
  margin: 0 0 26px;
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.byline-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.post-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.post-dates-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 4px;
}

/* ---------- Post: figure + layout ---------- */
.post-figure {
  margin: 40px 0 0;
}

.post-figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.post-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, var(--max-text));
  gap: 48px;
  padding: 44px 0 16px;
  align-items: start;
}

.post-layout.no-toc {
  grid-template-columns: minmax(0, var(--max-text));
}

/* ---------- Post: body typography ---------- */
.post-body {
  font-size: 1.06rem;
  line-height: 1.75;
}

.post-body p,
.post-body li {
  font-size: inherit;
}

.post-body h2 {
  font-size: 1.5rem;
  line-height: 1.25;
}

.post-body h3 {
  font-size: 1.16rem;
  margin: 2em 0 0.6em;
  scroll-margin-top: 96px;
}

.post-body h4 {
  font-size: 1rem;
  margin: 1.8em 0 0.5em;
}

.post-body a {
  color: var(--teal-700);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-body a:hover {
  color: var(--blue-900);
}

.post-body ul,
.post-body ol {
  padding-left: 1.4em;
}

.post-body li {
  margin-bottom: 0.45em;
}

.post-body blockquote {
  margin: 1.8em 0;
  padding: 0.3em 0 0.3em 22px;
  border-left: 3px solid var(--teal-400);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.post-body blockquote p:last-child {
  margin-bottom: 0;
}

.post-body img {
  height: auto;
  margin: 1.8em 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.post-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.4em 0;
}

.post-body table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.95rem;
}

.post-body th,
.post-body td {
  border: 1px solid var(--line);
  padding: 9px 13px;
  text-align: left;
}

.post-body th {
  background: var(--paper-alt);
}

.post-body code {
  font-size: 0.9em;
  background: var(--paper-alt);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
}

.post-body pre {
  overflow-x: auto;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
}

/* ---------- Post: footer (disclaimer, tags, author) ---------- */
.post-foot {
  padding-top: 24px;
  padding-bottom: 24px;
}

.post-foot-inner {
  max-width: var(--max-text);
}

/* with a TOC rail, footer content lines up with the reading column */
@media (min-width: 981px) {
  .post-foot-inner.has-toc {
    margin-left: 248px;
  }
}

.disclaimer {
  margin: 8px 0 28px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.disclaimer p {
  margin: 0;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0;
}

.tag-list a {
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
}

.tag-list a::before {
  content: "#";
  color: var(--teal-500);
  margin-right: 2px;
}

.tag-list a:hover {
  border-color: var(--teal-600);
  color: var(--teal-700);
}

/* ---------- Author box / author cards ---------- */
.author-box {
  position: relative;
  overflow: hidden;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 26px 28px 26px 32px;
}

.author-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--teal-300), var(--teal-600) 55%, var(--blue-600));
}

.author-box-label {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.author-box-body,
.author-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.author-photo {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.author-photo.is-initial {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--teal-300), var(--teal-600));
  color: #fff;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
}

.author-name,
.author-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.author-name a {
  color: var(--ink);
  text-decoration: none;
}

.author-name a:hover {
  color: var(--teal-700);
}

.author-bio p {
  margin: 0 0 0.7em;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.author-more {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--ink-faint);
}

.author-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.author-card {
  padding: 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  scroll-margin-top: 96px;
}

.author-card:target {
  border-color: var(--teal-600);
  box-shadow: var(--shadow-md);
}

/* ---------- Related posts ---------- */
.related {
  margin-top: 64px;
  padding: 64px 0 8px;
  border-top: 1px solid var(--line);
}

.related h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin-bottom: 32px;
}

/* ---------- About page ---------- */
.about-prose {
  max-width: var(--max-text);
}

.about-prose h3 {
  font-size: 1.25rem;
  margin: 2.2em 0 0.6em;
}

.about-prose h3:first-child {
  margin-top: 0;
}

/* ---------- 404 ---------- */
.not-found {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0 24px;
}

.not-found-code {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(4.5rem, 12vw, 8rem);
  line-height: 1;
  color: var(--teal-300);
  margin: 0 0 8px;
}

.not-found h1 {
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  margin-bottom: 16px;
}

.not-found p {
  color: var(--ink-soft);
  max-width: 44ch;
}

.not-found-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: center;
  margin-top: 28px;
}

.not-found-art {
  max-width: 300px;
  margin: 0 auto;
  transform: rotate(-5deg);
  filter: drop-shadow(0 18px 30px rgba(30, 93, 116, 0.18));
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .post-layout,
  .post-layout.no-toc {
    grid-template-columns: minmax(0, var(--max-text));
    gap: 0;
  }

  .post-foot-inner.has-toc {
    margin-left: 0;
  }

  .not-found {
    grid-template-columns: 1fr;
    padding-top: 48px;
  }

  .not-found-art {
    order: -1;
    max-width: 200px;
    margin: 0;
  }

  .author-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .post-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .post-wrap {
    padding: 0 20px;
  }

  .post-hero {
    padding: 24px 0 34px;
  }

  .post-body {
    font-size: 1.02rem;
  }

  .author-box {
    padding: 22px 20px 22px 24px;
  }

  .author-box-body,
  .author-card {
    flex-direction: column;
    gap: 14px;
  }

  .breadcrumb [aria-current="page"] {
    max-width: 24ch;
  }

  .pagination {
    margin-top: 48px;
  }
}
