/* Blog post hero: full-width looping video with the headline beside it.
   Linked only from posts that have a hero (scripts/blog_hero.py). */
.post-hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
}
.post-hero-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}
.post-hero-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
  display: block;
}
.post-hero-toggle {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--paper) 70%, transparent);
  background: color-mix(in srgb, var(--navy) 72%, transparent);
  color: #fff;
  font: 600 16px/1 var(--sans);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.post-hero-toggle:hover { background: var(--navy); }
.post-hero-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.post-hero-text {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 32px 0;
}
.post-hero h1 {
  color: var(--navy);
  font-size: clamp(37px, 4.5vw, 60px);
  letter-spacing: -0.05em;
  line-height: 1.1;
  margin: 18px 0 20px;
}
:root[data-theme="dark"] .post-hero h1 { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .post-hero h1 { color: var(--ink); } }
.post-hero .crumbs { font-size: 14px; margin: 0; }
.post-hero .crumbs a {
  color: var(--teal-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-hero .meta { font-size: 13px; color: var(--muted); margin: 0; }
.post.has-hero { padding-top: 36px; }
@media (max-width: 600px) {
  .post-hero-text { padding: 26px 24px 0; }
  .post-hero h1 { font-size: 37px; }
  .post.has-hero { padding-top: 28px; }
}
/* Wide screens: the headline sits in the open sky on the left, over a soft
   fade into the page colour so it stays readable in light and dark. */
@media (min-width: 1000px) {
  .post-hero-media { aspect-ratio: 16 / 7; }
  .post-hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg,
      var(--paper) 0%,
      color-mix(in srgb, var(--paper) 92%, transparent) 30%,
      color-mix(in srgb, var(--paper) 78%, transparent) 46%,
      color-mix(in srgb, var(--paper) 30%, transparent) 60%,
      transparent 72%);
  }
  .post-hero-text {
    position: absolute;
    inset: 0 auto 0 0;
    width: min(46%, 640px);
    max-width: none;
    margin: 0;
    padding: 0 0 0 var(--pad);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .post-hero h1 { font-size: clamp(38px, 3.6vw, 54px); }
}
@media (prefers-reduced-motion: reduce) {
  .post-hero-toggle { display: none; }
}
