/* =========================================================
   Blog: listing (home.php, archive.php, search.php) and article (single.php)
   ========================================================= */

/* ---------- Breadcrumb (blog and article title bands) ---------- */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font: 500 11px/1.5 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.crumbs li {
  display: flex;
  gap: 10px;
  min-width: 0;
}
.crumbs li + li::before {
  content: '/';
  color: rgba(255, 255, 255, 0.3);
}
.crumbs a {
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.25s;
}
.crumbs a:hover {
  color: var(--green);
}
.crumbs [aria-current] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 42ch;
}

/* ---------- Title band of the listing ---------- */
.blog-hero__title {
  font-size: clamp(48px, 9vw, 132px);
}
.blog-hero__lead {
  max-width: 62ch;
  margin: 0;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  text-wrap: pretty;
}

.blog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.blog-cats a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  transition:
    background 0.25s,
    border-color 0.25s,
    color 0.25s;
}
.blog-cats a:hover {
  border-color: #fff;
}
.blog-cats a[aria-current] {
  background: var(--green);
  border-color: var(--green);
  color: var(--ink);
}

/* ---------- Listing ---------- */
.blog {
  background: var(--bg);
  padding: clamp(48px, 7vw, 96px) 0 clamp(80px, 10vw, 140px);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(16px, 2vw, 28px);
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(10, 22, 51, 0.04);
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -18px rgba(10, 22, 51, 0.28);
}
.post-card__cover {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink);
}
.post-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.post-card:hover .post-card__cover img {
  transform: scale(1.04);
}
.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: clamp(20px, 2.2vw, 28px);
}
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-card__meta a {
  position: relative;
  z-index: 2;
  color: var(--blue);
}
.post-card__meta a:hover {
  color: var(--green);
}
.post-card__title {
  margin: 0;
  font-size: clamp(19px, 1.6vw, 23px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}
/* The whole card is clickable through the title link. */
.post-card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.post-card__title a:focus-visible {
  outline: none;
}
.post-card:has(.post-card__title a:focus-visible) {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.post-card__excerpt {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}
.post-card__date {
  margin-top: auto;
  font-size: 13px;
  color: var(--muted);
}

/* Featured (first article of the blog) */
.post-card--featured {
  margin-bottom: clamp(16px, 2vw, 28px);
}
@media (min-width: 900px) {
  .post-card--featured {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
  .post-card--featured .post-card__cover {
    aspect-ratio: auto;
    min-height: 360px;
  }
  .post-card--featured .post-card__body {
    justify-content: center;
    padding: clamp(32px, 4vw, 56px);
  }
  .post-card--featured .post-card__title {
    font-size: clamp(26px, 2.6vw, 38px);
  }
  .post-card--featured .post-card__excerpt {
    font-size: 17px;
  }
  .post-card--featured .post-card__date {
    margin-top: 8px;
  }
}

/* Drawn cover (articles without a featured image) */
.post-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: clamp(18px, 2vw, 26px);
  overflow: hidden;
  background: var(--ink);
  color: #fff;
}
.post-cover--1 {
  background: var(--blue);
}
.post-cover--2 {
  background: linear-gradient(135deg, #04102b 0%, #0a2e8c 100%);
}
.post-cover__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(160deg, #000 20%, transparent 85%);
}
.post-cover__label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}
.post-cover__word {
  position: relative;
  align-self: flex-end;
  font-size: clamp(44px, 6vw, 84px);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: rgba(255, 255, 255, 0.12);
  transition: color 0.4s;
}
.post-cover__word span {
  color: var(--green);
}
.post-card:hover .post-cover__word {
  color: rgba(255, 255, 255, 0.22);
}

/* Pagination */
.blog-pages {
  margin-top: clamp(40px, 5vw, 64px);
}
.blog-pages .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.blog-pages .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  transition:
    background 0.25s,
    color 0.25s;
}
.blog-pages a.page-numbers:hover {
  background: var(--ink);
  color: #fff;
}
.blog-pages .current {
  background: var(--green);
  color: var(--ink);
}
.blog-pages .dots {
  background: transparent;
}

.blog-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: clamp(32px, 5vw, 64px);
  border-radius: 22px;
  background: #fff;
  font-size: 18px;
}
.blog-empty p {
  margin: 0;
}

/* Related articles */
.blog--related {
  padding-top: 0;
}
.blog-related__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: clamp(24px, 3vw, 36px);
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
.blog-related__title {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 600;
  color: var(--text);
}
.blog-related__all {
  font-weight: 600;
  color: var(--blue);
}
.blog-related__all:hover {
  color: var(--green);
}

/* ---------- Article: title band ---------- */
.post-hero__inner {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
  gap: clamp(16px, 2.4vw, 26px);
}
.post-hero .eyebrow a {
  color: inherit;
}
.post-hero .eyebrow a:hover {
  color: var(--green);
}
.post-hero__title {
  margin: 0;
  font-size: clamp(34px, 5.4vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 600;
  text-wrap: balance;
}
.post-hero__lead {
  max-width: 68ch;
}
.post-hero__meta,
.post-hero__langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
}
.post-hero__langs span {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.post-hero__langs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #fff;
  font-weight: 500;
}
.post-hero__langs a:hover {
  border-color: var(--green);
  color: var(--green);
}

/* ---------- Article: body ---------- */
@media (min-width: 980px) {
  .post-layout {
    grid-template-columns: 240px minmax(0, 760px);
  }
}
.post-toc summary {
  list-style: none;
  cursor: pointer;
}
.post-toc summary::-webkit-details-marker {
  display: none;
}
.post-toc details ol {
  margin-top: 16px;
}
@media (min-width: 980px) {
  .post-toc summary {
    pointer-events: none;
  }
}
@media (max-width: 979.98px) {
  .post-toc details {
    padding: 16px 18px;
    border-radius: 16px;
    background: #fff;
  }
  .post-toc summary::after {
    content: ' +';
  }
  .post-toc details[open] summary::after {
    content: ' –';
  }
  .post-toc details ol {
    display: flex;
  }
}

.post-main {
  min-width: 0;
}
.post-figure {
  margin: 0 0 clamp(28px, 4vw, 44px);
}
.post-figure img {
  width: 100%;
  height: auto;
  border-radius: 22px;
}

.post-content {
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.78;
  color: var(--text-2);
}
.post-content > :first-child {
  margin-top: 0;
}
.post-content p,
.post-content ul,
.post-content ol,
.post-content figure,
.post-content blockquote,
.post-content .table-scroll,
.post-content pre {
  margin: 0 0 1.25em;
}
.post-content h2 {
  margin: 2.2em 0 0.7em;
  scroll-margin-top: 110px;
  font-size: clamp(25px, 2.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}
.post-content h3 {
  margin: 1.8em 0 0.5em;
  scroll-margin-top: 110px;
  font-size: clamp(19px, 1.6vw, 23px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--text);
}
.post-content strong {
  color: var(--text);
}
.post-content a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(10, 46, 140, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.25s;
}
.post-content a:hover {
  text-decoration-color: var(--green);
}
.post-content ul,
.post-content ol {
  padding-left: 1.3em;
}
.post-content li {
  margin-bottom: 0.45em;
}
.post-content li::marker {
  color: var(--green);
  font-weight: 700;
}
.post-content blockquote {
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--green);
  font-size: 1.08em;
  color: var(--text);
}
.post-content code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-2);
  font: 500 0.88em/1.4 var(--mono);
  color: var(--text);
}
.post-content pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--ink);
  color: #e3ecff;
}
.post-content pre code {
  padding: 0;
  background: none;
  color: inherit;
}
.post-content img {
  height: auto;
  border-radius: 16px;
}
.post-content figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}
.table-scroll {
  overflow-x: auto;
  border-radius: 16px;
  background: #fff;
}
.post-content table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
.post-content th,
.post-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.post-content th {
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-2);
}
.post-content tr:last-child td {
  border-bottom: 0;
}
.post-content .summary {
  margin: 0 0 2em;
}

/* ---------- Article: footer ---------- */
.post-footer {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: clamp(40px, 5vw, 56px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.post-tags a {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-2);
  font-size: 14px;
  color: var(--text-2);
}
.post-tags a:hover {
  color: var(--blue);
}
.post-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.post-share .mono-label {
  margin-right: 6px;
}
.post-share a,
.post-share button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 0.25s,
    color 0.25s;
}
.post-share a:hover,
.post-share button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.post-cta {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  padding: clamp(28px, 4vw, 44px);
  border-radius: 22px;
  background: var(--ink);
  color: #fff;
}
.post-cta__title {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.post-cta__text {
  margin: 0;
  max-width: 56ch;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}
.post-cta .btn-row {
  margin-top: 6px;
}
.post-content .summary ul {
  margin: 0;
  padding-left: 0;
}
.post-content .summary li {
  margin-bottom: 0;
}
.post-content .summary li::marker {
  content: none;
}
