.blog-hero {
  position: relative;
  min-height: auto;
  padding: clamp(120px, 14vw, 180px) 0 clamp(72px, 10vw, 120px);
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 22%, rgba(49, 113, 181, 0.18), transparent 32%),
    linear-gradient(135deg, var(--bg-surface), var(--bg));
  border-bottom: 1px solid var(--line);
}

.blog-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
}

.blog-hero__visual {
  position: absolute;
  top: clamp(96px, 12vw, 150px);
  right: max(24px, calc((100vw - var(--max-w)) / 2));
  width: min(36vw, 430px);
  aspect-ratio: 1;
  border-radius: 34% 66% 44% 56%;
  background:
    linear-gradient(135deg, rgba(49, 113, 181, 0.92), rgba(90, 154, 213, 0.46)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.18) 0 1px, transparent 1px 18px);
  box-shadow: var(--shadow-glow);
  opacity: 0.88;
}

.blog-hero__visual span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.82);
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.08em;
}

.blog-hero--photo {
  padding: 0;
  /* Always fill the full viewport width and derive height from the 3:1 ratio.
     No max-height: combining max-height with aspect-ratio makes the browser
     shrink the WIDTH to keep the ratio, which leaves a gap on the right and
     ties the hero size to window height. */
  width: 100%;
  aspect-ratio: 3 / 1;
  min-height: 320px;
  display: flex;
  align-items: center;
}

.blog-hero--photo .blog-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 1;
}

.blog-hero--photo .blog-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Light, theme-adaptive scrim weighted to the left text-safe zone so the
   overlaid title stays legible without darkening the illustration. */
.blog-hero--photo .blog-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    var(--bg) 0%,
    color-mix(in srgb, var(--bg) 50%, transparent) 32%,
    transparent 60%
  );
}

.blog-hero--photo .wrap {
  position: relative;
  z-index: 1;
  padding-bottom: clamp(24px, 4vw, 48px);
}

.blog-hero__content {
  position: relative;
  z-index: 1;
  max-width: 660px;
}

.blog-hero h1 {
  margin: 14px 0 20px;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  font-weight: 800;
  color: var(--text);
}

.blog-hero p {
  max-width: 54ch;
  margin-bottom: 30px;
  color: var(--text-mid);
  font-size: clamp(1.02rem, 1.8vw, 1.2rem);
}

.blog-nav {
  position: relative;
  z-index: 2;
  padding: 20px 0;
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  border-bottom: 1px solid var(--line);
}

.blog-nav__inner {
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* old Edge/IE */
}

.blog-nav__inner::-webkit-scrollbar {
  display: none;               /* Chrome/Safari */
}

/* Edge fades hint at more categories; classes are toggled by blog.js only
   when the row is actually scrollable in that direction, so the first/last
   pill never looks faded at the extremes. */
.blog-nav__inner.has-fade-right {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
}

.blog-nav__inner.has-fade-left {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent);
          mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent);
}

.blog-nav__inner.has-fade-left.has-fade-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
          mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
}

.blog-categories {
  display: flex;
  gap: 10px;
  min-width: max-content;
}

.blog-categories a {
  scroll-snap-align: start;
}

.blog-categories a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-mid);
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.blog-categories a:hover,
.blog-categories a.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.section--blog-submission {
  background: var(--bg);
  padding-top: clamp(8px, 2vw, 24px);
  padding-bottom: clamp(56px, 8vw, 96px);
}

.submission-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: clamp(20px, 4vw, 40px);
  padding: clamp(28px, 4vw, 44px) clamp(28px, 5vw, 52px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--bg-card), var(--blue-subtle));
  box-shadow: var(--shadow-card);
}

.submission-banner__text {
  flex: 1 1 420px;
}

.submission-banner h2 {
  margin: 8px 0 10px;
}

.submission-banner p {
  max-width: 56ch;
  margin-bottom: 0;
  color: var(--text-mid);
}

.submission-banner__cta {
  flex: 0 0 auto;
}

.section--blog-grid {
  padding-top: clamp(40px, 6vw, 64px);
  padding-bottom: clamp(48px, 7vw, 80px);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(22px, 3vw, 34px);
}

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  /* Match the home page cards (.feature-tile uses 22px). */
  border-radius: 22px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.post-card:hover {
  transform: translateY(-6px);
  border-color: var(--blue-bright);
  box-shadow: var(--shadow-glow);
}

.post-card__image {
  display: block;
  padding: 18px;
  background: linear-gradient(135deg, var(--blue-subtle), rgba(49, 113, 181, 0.16));
}

.post-card__image--photo {
  padding: 0;
  background: var(--bg-input);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.post-card__image--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.post-card:hover .post-card__image--photo img {
  transform: scale(1.06);
}

.post-card__illustration {
  display: grid;
  place-items: center;
  min-height: 210px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,0.55), transparent 18%),
    linear-gradient(145deg, var(--blue), var(--blue-deep));
  color: var(--white);
  overflow: hidden;
  position: relative;
}

.post-card__illustration::before,
.post-card__illustration::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
}

.post-card__illustration::before {
  inset: 28px;
}

.post-card__illustration::after {
  width: 180px;
  height: 180px;
  right: -42px;
  bottom: -58px;
}

.post-card__illustration span {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-size: clamp(4rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1;
}

.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 28px;
}

.post-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.post-card__category {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-card__meta time {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.post-card__title {
  margin-bottom: 12px;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  line-height: 1.22;
}

.post-card__excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 24px;
  color: var(--text-mid);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-card__cta {
  align-self: flex-start;
  margin-top: auto;
  padding: 10px 20px;
  font-size: 0.82rem;
  font-weight: 700;
}

.post-card__cta::after {
  content: "\2192";
  transition: transform 200ms ease;
}

.post-card:hover .post-card__cta::after {
  transform: translateX(4px);
}

.page-hero .archive-title {
  color: var(--blue);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
}

.single-post-page {
  padding: clamp(56px, 7vw, 96px) 0 clamp(64px, 9vw, 104px);
  background:
    radial-gradient(circle at 12% 10%, rgba(49, 113, 181, 0.16), transparent 30%),
    var(--bg);
}

.single-article {
  margin-bottom: clamp(36px, 5vw, 60px);
}

.single-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.back-to-posts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--blue);
  font-weight: 800;
}

.back-to-posts::before {
  content: "<";
}

.single-post-title {
  margin: 0 0 28px;
  color: var(--text);
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  font-weight: 800;
  line-height: 1.08;
}

.single-post-date {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.9rem;
}

.single-post-featured-image {
  display: grid;
  place-items: center;
  min-height: clamp(260px, 42vw, 440px);
  margin-bottom: 42px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 75% 20%, rgba(255,255,255,0.45), transparent 20%),
    linear-gradient(145deg, var(--blue), var(--blue-deep));
  color: rgba(255,255,255,0.86);
  box-shadow: var(--shadow-glow);
  overflow: hidden;
}

.single-post-featured-image span {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 7vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.07em;
}

.single-post-featured-image--photo {
  display: block;
  /* Definite height so the img's height:100% + object-fit:cover resolve.
     16:10 matches the featured-image spec, so a correct image isn't cropped.
     Reset the placeholder's min-height so the ratio governs at every width
     (otherwise the min-height floor zoom-crops the image on mobile). */
  aspect-ratio: 16 / 10;
  min-height: 0;
  background: var(--bg-input);
}

.single-post-featured-image--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-content {
  max-width: var(--prose-width);
  color: var(--text-mid);
  font-size: clamp(1.05rem, 1.6vw, 1.18rem);
  line-height: 1.85;
}

.post-content h2,
.post-content h3 {
  margin: 1.6em 0 0.65em;
  color: var(--text);
}

.post-content p,
.post-content ul,
.post-content ol {
  margin-bottom: 1.45em;
}

/* Article footer: tags (as pills) + share buttons */
.single-article__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: clamp(36px, 5vw, 52px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-mid);
  font-size: 0.8rem;
  font-weight: 700;
  transition: border-color 160ms ease, color 160ms ease;
}

.post-tags a:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* Light end-of-article CTAs (sign-up band + institution collapsible) */
.single-article-ctas {
  display: grid;
  gap: 16px;
  margin-bottom: clamp(48px, 7vw, 80px);
}

.single-article-ctas .institution-cta {
  margin-top: 0;
  max-width: none;
}

.single-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: clamp(18px, 3vw, 32px);
  padding: clamp(24px, 3.5vw, 38px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--bg-card), var(--blue-subtle));
  box-shadow: var(--shadow-card);
}

.single-cta__text {
  flex: 1 1 340px;
}

.single-cta__text .label {
  color: var(--blue);
}

.single-cta__text h2 {
  margin: 8px 0 8px;
  color: var(--text);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
}

.single-cta__text p {
  max-width: 52ch;
  margin: 0;
  color: var(--text-mid);
}

.single-cta__btn {
  flex: 0 0 auto;
}

/* "Read next" related-posts row at the end of the article */
.section--read-next {
  padding-top: clamp(40px, 6vw, 64px);
  padding-bottom: 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 1024px) {
  .blog-hero__visual {
    opacity: 0.2;
    width: 62vw;
  }
}

@media (max-width: 640px) {
  .blog-categories {
    padding-bottom: 4px;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .submission-banner,
  .single-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .single-cta__btn,
  .submission-banner__cta {
    width: 100%;
    justify-content: center;
  }

  .post-card__meta {
    align-items: flex-start;
    flex-direction: column;
  }
}
