/* Blog pages: the index, the posts and the glossary, in English (/blog/)
   and Chinese (/zh/blog/). The pages themselves are generated by
   blog/build.py; this file is edited by hand. */

/* ── Nav: the Blog link stays lit on blog pages ── */

.nav-links a.nav-current {
  color: #fff;
}

.nav-links a.nav-current::after {
  transform: scaleX(1);
}

/* ── Page header ── */

.blog-hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  padding: 8rem 1.25rem 3rem; /* clears the fixed nav */
}

.blog-hero-inner {
  max-width: 720px; /* lines up with the 760px columns below, less their padding */
  margin: 0 auto;
}

.blog-hero .sec-label {
  color: var(--blue-bright);
}

.blog-hero h1 {
  color: #fff;
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -.8px;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.blog-hero-sub {
  color: var(--gray-300);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 640px;
}

.post-crumb {
  display: inline-block;
  margin-bottom: 1.25rem;
  color: var(--blue-bright);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
}

.post-crumb:hover {
  text-decoration: underline;
}

.post-meta {
  color: var(--gray-300);
  font-size: .88rem;
}

/* ── Post body ── */

.post-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.25rem 1rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--gray-900);
}

.post-body h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.4px;
  line-height: 1.3;
  margin: 2.75rem 0 1rem;
}

.post-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy-light);
  line-height: 1.35;
  margin: 2rem 0 .75rem;
}

.post-body > :first-child {
  margin-top: 0;
}

.post-body h2,
.post-body h3,
.post-body dt {
  scroll-margin-top: 88px; /* fixed nav plus a little air */
}

.post-body p {
  margin: 0 0 1.15rem;
}

.post-body ul {
  margin: 0 0 1.25rem 1.25rem;
}

.post-body li {
  margin-bottom: .55rem;
  padding-left: .25rem;
}

.post-body a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-body a:hover {
  color: var(--navy-light);
}

.post-body strong {
  font-weight: 700;
}

/* Figures: one drawing or photo across the column, or two side by side */

.post-body figure {
  margin: 2rem 0 2.25rem;
}

.post-body figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  background: #fff;
}

.post-body figure.figure-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: .75rem;
}

.post-body figure.figure-pair figcaption {
  grid-column: 1 / -1;
}

.post-body figcaption {
  margin-top: .75rem;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--gray-500);
}

.post-body figure.figure-pair figcaption {
  margin-top: 0;
}

/* "For your consultant" notes */

.post-body .callout {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--ice-light);
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
  font-size: .98rem;
}

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

/* Glossary */

.glossary dt {
  margin-top: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}

.glossary dt:first-child {
  margin-top: 0;
}

.glossary dd {
  margin: .3rem 0 0;
}

/* ── Series box at the end of each page ── */

.series {
  max-width: 760px;
  margin: 1.5rem auto 4.5rem;
  padding: 0 1.25rem;
}

.series-box {
  padding: 1.5rem 1.75rem;
  background: var(--off-white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
}

.series-box .sec-label {
  margin-bottom: .5rem;
}

.series-box ol {
  margin: 0 0 1rem 1.25rem;
}

.series-box li {
  margin-bottom: .45rem;
  padding-left: .25rem;
  line-height: 1.5;
}

.series-box li[aria-current] {
  color: var(--navy);
  font-weight: 600;
}

.series-box a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

.series-box a:hover {
  text-decoration: underline;
}

.series-box p {
  margin: 0;
}

/* ── Blog index ── */

.post-list {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4.5rem;
  display: grid;
  gap: 1.25rem;
}

.post-card {
  position: relative;
  padding: 1.75rem;
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}

.post-card:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 40px rgba(11, 29, 51, .08);
  transform: translateY(-3px);
}

.post-card .sec-label {
  margin-bottom: .5rem;
}

.post-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .6rem;
}

.post-card h2 a {
  color: var(--navy);
  text-decoration: none;
}

/* The title link covers the whole card */
.post-card h2 a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
}

.post-card h2 a:focus-visible {
  outline: none;
}

.post-card:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.post-card p {
  margin-bottom: 1rem;
  font-size: .95rem;
  line-height: 1.65;
  color: var(--gray-500);
}

.post-card:hover .plink {
  gap: 10px;
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .blog-hero {
    padding: 6.5rem 1.25rem 2.25rem;
  }

  .blog-hero h1 {
    font-size: 1.75rem;
    letter-spacing: -.5px;
  }

  .post-body {
    padding-top: 2.25rem;
    font-size: 1rem;
  }

  .post-body h2 {
    font-size: 1.35rem;
    margin-top: 2.25rem;
  }

  .post-body figure.figure-pair {
    grid-template-columns: 1fr;
  }

  .series-box,
  .post-card {
    padding: 1.25rem;
  }
}

/* ── Print: the article only ── */

@media print {
  nav,
  footer,
  .cta,
  .series {
    display: none;
  }

  .blog-hero {
    background: none;
    padding: 0 0 1rem;
  }

  .blog-hero h1,
  .blog-hero .sec-label,
  .post-meta {
    color: #000;
  }

  .post-crumb {
    display: none;
  }

  .post-body {
    padding: 0;
  }

  .post-body figure {
    break-inside: avoid;
  }
}
