/* Blog pages. Uses tokens.css and site.css; same look as the homepage. */

.site-main {
  min-height: 70vh;
}

.blog-index {
  padding-top: calc(var(--header) + clamp(56px, 6vw, 120px));
}
.blog-index__title {
  font-size: var(--t-h1);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.blog-index__empty {
  margin-top: 32px;
  font-size: var(--t-body1);
  color: var(--mute);
}

.post-list {
  list-style: none;
  margin-top: clamp(40px, 4vw, 72px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2vw, 36px);
}
.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.post-card__img {
  aspect-ratio: 16 / 10;
  border-radius: var(--r-sm);
  background: var(--stone);
  overflow: hidden;
}
.post-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .post-card:hover .post-card__img img {
    transform: scale(1.03);
  }
}
.post-card__meta {
  margin-top: 20px;
  font-size: var(--t-body3);
  color: var(--mute);
}
.post-card__title {
  margin-top: 8px;
  font-size: var(--t-h4);
  line-height: 1.2;
}
.post-card__excerpt {
  margin-top: 10px;
  font-size: var(--t-body2);
  line-height: 1.5;
  color: var(--ink-2);
}

.post {
  padding-top: calc(var(--header) + clamp(56px, 6vw, 120px));
}
.post__head {
  max-width: 1040px;
}
.post__back {
  font-size: var(--t-body3);
  color: var(--mute);
}
@media (hover: hover) and (pointer: fine) {
  .post__back:hover {
    color: var(--ink);
  }
}
.post__title {
  margin-top: 20px;
  font-size: var(--t-h1);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.post__meta {
  margin-top: 20px;
  font-size: var(--t-body2);
  color: var(--mute);
}
.post__cover {
  margin-top: clamp(32px, 4vw, 64px);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--stone);
}
.post__cover img {
  width: 100%;
  height: auto;
}

.post__body {
  max-width: 720px;
  margin: clamp(40px, 4vw, 72px) auto 0;
  font-size: var(--t-body1);
  line-height: 1.5;
  color: var(--ink-2);
}
.post__body > * + * {
  margin-top: 1.1em;
}
.post__body h2 {
  margin-top: 2em;
  font-size: var(--t-h3);
  line-height: 1.15;
  color: var(--ink);
}
.post__body h3 {
  margin-top: 1.6em;
  font-size: var(--t-h4);
  line-height: 1.2;
  color: var(--ink);
}
.post__body a {
  color: var(--ink);
  border-bottom: 1px solid currentColor;
}
.post__body blockquote {
  padding-left: 24px;
  border-left: 2px solid var(--amber);
  font-size: var(--t-sub);
  line-height: 1.35;
  color: var(--ink);
}
.post__body ul,
.post__body ol {
  padding-left: 1.2em;
}
.post__body figure img {
  width: 100%;
  height: auto;
  border-radius: var(--r-sm);
}
.post__body figcaption {
  margin-top: 10px;
  font-size: var(--t-body3);
  color: var(--mute);
}

.post__cta {
  max-width: 720px;
  margin: clamp(48px, 5vw, 96px) auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--stone);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.post__cta p {
  font-size: var(--t-h4);
  line-height: 1.2;
}

@media (max-width: 1100px) {
  .post-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 720px) {
  .post-list {
    grid-template-columns: 1fr;
  }
  .post__cta {
    flex-direction: column;
    align-items: flex-start;
  }
  .post__body {
    font-size: var(--t-body2);
  }
}

/* cover credit under the cover image, and the references at the end of a post */
.post__credit {
  margin-top: 10px;
  font-size: 13px;
  color: var(--mute);
}
.post__refs {
  max-width: 720px;
  margin: 48px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--stone);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.post__refs-label {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mute);
}
.post__body video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-sm);
}

/* a short video in a post: a tap pauses it, and a play mark shows while it is paused (PostVideo.tsx) */
.post-video {
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.post-video video {
  cursor: pointer;
}
.post-video__mark {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--raise) 88%, transparent);
  color: var(--ink);
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.post-video.is-paused .post-video__mark {
  opacity: 1;
  transform: none;
}
.post-video__mark .icon {
  width: 22px;
  height: 22px;
}

/* touch screens: a press state and a 44 px tap area for the way back to the blog */
@media (hover: none) and (pointer: coarse) {
  .post-card,
  .post__back {
    -webkit-tap-highlight-color: transparent;
  }
  .post-card:active .post-card__img img {
    opacity: 0.85;
  }
  .post__back {
    display: inline-block;
    padding: 13px 8px;
    margin: -13px -8px;
  }
  .post__back:active {
    color: var(--ink);
  }
}
