/* Header, footer, buttons, block styles. Ported from the components in reference/src. */

/* Shared container for the header and footer: the same box as the page content. */
.site-header__frame,
.site-footer__frame {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Buttons: reference/src/button-variants.ts */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding-inline: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  background: var(--wp--preset--color--brand);
  color: var(--wp--preset--color--brand-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.button:hover {
  background: color-mix(
    in srgb,
    var(--wp--preset--color--brand) 90%,
    transparent
  );
}

.button--sm {
  height: 2rem;
  padding-inline: 0.75rem;
  font-size: 0.75rem;
}

.button--ghost {
  background: transparent;
  color: var(--wp--preset--color--foreground);
}

.button--ghost:hover {
  background: var(--wp--preset--color--accent);
}

.button--outline {
  border-color: var(--wp--preset--color--input);
  background: var(--wp--preset--color--background);
  color: var(--wp--preset--color--foreground);
}

.button--outline:hover {
  background: var(--wp--preset--color--accent);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--wp--preset--color--foreground);
  cursor: pointer;
  transition: background-color 150ms ease;
}

.icon-button:hover {
  background: var(--wp--preset--color--accent);
}

.icon-button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:is(a, button, summary):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--wp--preset--color--brand) 50%, transparent);
}

/* Block buttons. Every style gets the same 1px border (transparent unless outlined) and the same
   padding, so all of them are h-10 like the app. Without this, core's outline style adds its own
   padding (0.667em 1.333em) on top of the border and outline buttons come out ~5px bigger. Padding
   set on a single button in the editor is inline, so it still wins. */
.wp-block-button .wp-block-button__link {
  border: 1px solid transparent;
  padding: calc(0.5rem - 1px) calc(1rem - 1px);
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.wp-block-button__link:hover {
  background-color: color-mix(
    in srgb,
    var(--wp--preset--color--brand) 90%,
    transparent
  );
}

.wp-block-button.is-style-outline .wp-block-button__link {
  border-color: var(--wp--preset--color--input);
  background: var(--wp--preset--color--background);
  color: var(--wp--preset--color--foreground);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--wp--preset--color--accent);
}

.wp-block-button.is-style-ghost .wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--foreground);
}

.wp-block-button.is-style-ghost .wp-block-button__link:hover {
  background: var(--wp--preset--color--accent);
}

.wp-block-button.is-style-on-dark .wp-block-button__link {
  background: var(--wp--preset--color--brand-foreground);
  color: var(--wp--preset--color--brand);
}

.wp-block-button.is-style-on-dark .wp-block-button__link:hover {
  background: color-mix(
    in srgb,
    var(--wp--preset--color--brand-foreground) 90%,
    transparent
  );
}

/* Outline and ghost for dark backgrounds (navy bands, heroes, covers): white text, a translucent
   white border for the outline, a faint white wash on hover. */
.wp-block-button.is-style-outline-on-dark .wp-block-button__link {
  border-color: color-mix(
    in srgb,
    var(--wp--preset--color--brand-foreground) 30%,
    transparent
  );
  background: transparent;
  color: var(--wp--preset--color--brand-foreground);
}

.wp-block-button.is-style-ghost-on-dark .wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--brand-foreground);
}

.wp-block-button:is(.is-style-outline-on-dark, .is-style-ghost-on-dark) .wp-block-button__link:hover {
  background: color-mix(
    in srgb,
    var(--wp--preset--color--brand-foreground) 10%,
    transparent
  );
}

.wp-block-button:is(.is-style-outline-on-dark, .is-style-ghost-on-dark) .wp-block-button__link:focus-visible {
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--wp--preset--color--brand-foreground) 50%, transparent);
}

/* Soft: tinted brand, for a second action beside a solid button (the PDF button on publications). */
.wp-block-button.is-style-soft .wp-block-button__link {
  background: var(--wp--preset--color--brand-tint);
  color: var(--wp--preset--color--brand);
}

.wp-block-button.is-style-soft .wp-block-button__link:hover {
  background: color-mix(
    in srgb,
    var(--wp--preset--color--brand) 14%,
    var(--wp--preset--color--background)
  );
}

/* Header */
.site-header {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0);
  z-index: 40;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(
    in srgb,
    var(--wp--preset--color--background) 85%,
    transparent
  );
  backdrop-filter: blur(12px);
}

.site-header__frame {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-inline-start: auto;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.375rem;
  color: var(--wp--preset--color--brand);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.site-logo__image {
  flex-shrink: 0;
  width: auto;
  height: 1.75rem;
}

.site-nav {
  display: none;
}

.site-nav__list,
.drawer__list,
.site-footer__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav__list a {
  display: block;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  color: var(--wp--preset--color--muted-foreground);
  font-size: 0.875rem;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.site-nav__list a:hover,
.site-nav__list .current-menu-item > a {
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--foreground);
}

/* Phones: at most two buttons in the bar; all of them are in the drawer. */
@media (max-width: 47.99rem) {
  .site-header__actions > .button:not(:nth-last-child(-n + 2 of .button)) {
    display: none;
  }
}

@media (min-width: 48rem) {
  .site-nav {
    display: block;
  }

  .site-header__menu {
    display: none;
  }
}

/* Search dialog (header search icon, assets/js/search.js) */
.search-dialog {
  width: min(40rem, 100% - 2 * var(--gutter));
  max-width: none;
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--wp--preset--color--background);
  color: var(--wp--preset--color--foreground);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%);
}

.search-dialog::backdrop {
  background: rgb(0 0 0 / 40%);
}

@media (prefers-reduced-motion: no-preference) {
  .search-dialog[open] {
    animation: search-dialog-in 180ms var(--ease-out);
  }

  @keyframes search-dialog-in {
    from {
      opacity: 0;
      transform: translateY(-0.5rem);
    }
  }
}

.search-dialog__form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
}

.search-dialog__icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: var(--wp--preset--color--muted-foreground);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-dialog__input {
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1rem;
}

.search-dialog__input:focus {
  outline: none;
}

.search-dialog__input::placeholder {
  color: var(--wp--preset--color--muted-foreground);
}

/* The browser's own clear button would sit next to ours. */
.search-dialog__input::-webkit-search-cancel-button {
  display: none;
}

.search-dialog__form .button {
  flex: none;
}

/* Drawer */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(24rem, 100%);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--hairline);
  background: var(--wp--preset--color--background);
  color: var(--wp--preset--color--foreground);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%);
}

.drawer[open] {
  display: flex;
  flex-direction: column;
}

.drawer::backdrop {
  background: rgb(0 0 0 / 40%);
}

@media (prefers-reduced-motion: no-preference) {
  .drawer[open] {
    animation: drawer-in 220ms var(--ease-drawer);
  }

  @keyframes drawer-in {
    from {
      transform: translateX(100%);
    }
  }
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--hairline);
}

.drawer__title {
  margin: 0;
  font-size: 1rem;
  letter-spacing: normal;
}

.drawer__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  overflow-y: auto;
}

.drawer__list {
  display: contents;
}

.drawer__row,
.drawer__list a {
  display: flex;
  align-items: center;
  height: 2.75rem;
  padding-inline: 0.75rem;
  border-radius: 0.375rem;
  color: var(--wp--preset--color--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.drawer__row:hover,
.drawer__list a:hover {
  background: var(--wp--preset--color--accent);
}

.drawer__footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--hairline);
}

/* Footer: the built-in one, same structure as reference/src/Footer.tsx. The band (navy, white
   text) and the block footer from Appearance > Footer are in footer.css. */

.site-footer__grid {
  display: grid;
  gap: 2.5rem;
  padding-block: 3rem;
}

.site-footer__about {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.site-footer__about p {
  max-width: 24rem;
  margin: 0;
  color: var(--footer-muted);
  font-size: 0.875rem;
}

.site-footer__heading {
  margin: 0 0 0.75rem;
  color: var(--footer-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 1.5;
  text-transform: uppercase;
}

.site-footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-footer__list a {
  color: var(--footer-text);
  font-size: 0.875rem;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.site-footer__list a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-footer__bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-block: 1.25rem;
  color: var(--footer-muted);
  font-size: 0.75rem;
  position: relative;
}

.site-footer__bottom p {
  margin: 0;
}

.site-footer__address {
  font-style: normal;
  line-height: 1.6;
}

.site-footer__address a,
.site-footer__social a {
  color: inherit;
  transition: color 150ms ease;
}

.site-footer__address a:hover,
.site-footer__social a:hover {
  color: var(--footer-text);
}

.site-footer__meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer__social {
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__social a {
  display: inline-flex;
}

@media (min-width: 40rem) {
  .site-footer__meta {
    align-items: flex-end;
    text-align: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-footer__list a,
  .site-footer__address a,
  .site-footer__social a {
    transition: none;
  }
}

/* The divider above the bottom row, across the content box only. */
.site-footer__bottom::after {
  content: "";
  position: absolute;
  inset: 0 var(--gutter) auto;
  border-top: 1px solid var(--footer-line);
}

@media (min-width: 40rem) {
  .site-footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

@media (min-width: 48rem) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    padding-block: 4rem;
  }
}

/* Rich-text styles */
.is-style-eyebrow {
  margin-block-end: 0.5rem;
  color: var(--wp--preset--color--brand-secondary);
  font-family: var(--wp--preset--font-family--mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.is-style-eyebrow + :is(h1, h2, h3, h4) {
  margin-block-start: 0;
}

.is-style-lead {
  color: var(--wp--preset--color--muted-foreground);
  font-size: 1.125rem;
  line-height: 1.625;
}

.is-style-muted {
  color: var(--wp--preset--color--muted-foreground);
}

@media (min-width: 48rem) {
  .is-style-lead {
    font-size: 1.25rem;
  }
}

.wp-block-quote {
  padding-inline-start: 1.25rem;
  border-inline-start: 4px solid var(--wp--preset--color--brand);
  font-size: 1.125em;
  font-weight: 500;
}

.wp-block-separator {
  border: 0;
  border-top: 1px solid var(--hairline);
}

/* Globe hero: reference/src/GlobeHero.tsx. The WebGL globe isn't ported; the poster is its first frame. */
.is-style-hero-globe {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 3.5rem 0 80%;
  overflow: hidden;
  /* clip, not just hidden: selecting the image in the editor would otherwise scroll the hero sideways. */
  overflow: clip;
}

.is-style-hero-globe::before {
  content: "";
  position: absolute;
  z-index: -2;
  top: 100%;
  left: 100%;
  width: 154%;
  aspect-ratio: 1;
  background: url("../images/poster-1000.webp") center / contain no-repeat;
  transform: translate(-75.4%, -75.4%);
}

.is-style-hero-globe::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(
    to bottom,
    var(--wp--preset--color--brand) 30%,
    color-mix(in srgb, var(--wp--preset--color--brand) 60%, transparent) 45%,
    transparent 65%
  );
  pointer-events: none;
}

.is-style-hero-globe > * {
  max-width: 34rem;
}

/* The hero bleeds to the window; its text starts where the frame's content does. */
.is-style-hero-globe > :not(.wp-block-image) {
  margin-inline: var(--hero-inset) !important;
}

/* The picture is an Image block inside the hero, so the client can replace it. It takes the globe
   poster's place (bottom right, square, uncropped); with the image style "Hero: fill" it covers the
   whole hero instead, for photos. Without an Image block the poster is drawn by ::before, so heroes
   made before this keep their globe. !important: the editor and image resizing put inline sizes on
   the image. */
.is-style-hero-globe:has(> .wp-block-image)::before {
  content: none;
}

.is-style-hero-globe > .wp-block-image {
  position: absolute;
  z-index: -2;
  top: 100%;
  left: 100%;
  width: 154%;
  max-width: none;
  aspect-ratio: 1;
  margin: 0;
  transform: translate(-75.4%, -75.4%);
}

.is-style-hero-globe > .wp-block-image + * {
  margin-block-start: 0;
}

.is-style-hero-globe
  > .wp-block-image
  :is(img, .components-resizable-box__container) {
  display: block;
  width: 100% !important;
  max-width: none;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: contain;
}

.is-style-hero-globe > .wp-block-image.is-style-hero-fill {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  transform: none;
}

.is-style-hero-globe > .wp-block-image.is-style-hero-fill img {
  object-fit: cover;
}

.is-style-hero-globe h1 {
  margin-block-end: 0.25em;
  color: inherit;
  font-size: var(--fs-hero);
  font-weight: 400;
}

.is-style-hero-globe :is(.is-style-eyebrow, .is-style-muted) {
  color: color-mix(
    in srgb,
    var(--wp--preset--color--brand-foreground) 75%,
    transparent
  );
}

.is-style-hero-globe .is-style-lead {
  color: color-mix(
    in srgb,
    var(--wp--preset--color--brand-foreground) 85%,
    transparent
  );
}

.is-style-hero-globe .wp-block-button.is-style-outline .wp-block-button__link {
  border-color: color-mix(
    in srgb,
    var(--wp--preset--color--brand-foreground) 30%,
    transparent
  );
  background: transparent;
  color: var(--wp--preset--color--brand-foreground);
}

.is-style-hero-globe
  .wp-block-button.is-style-outline
  .wp-block-button__link:hover {
  background: color-mix(
    in srgb,
    var(--wp--preset--color--brand-foreground) 10%,
    transparent
  );
}

.is-style-hero-globe .wp-block-button__link {
  height: 2.75rem;
  padding: 0.625rem 1.5rem;
}

@media (min-width: 48rem) {
  .is-style-hero-globe {
    padding-block-start: 5rem;
    padding-block-end: 50%;
  }

  .is-style-hero-globe::before,
  .is-style-hero-globe > .wp-block-image {
    width: 120%;
  }

}

@media (min-width: 64rem) {
  .is-style-hero-globe {
    justify-content: center;
    min-height: min(46rem, calc(100svh - var(--header-h)));
    padding-block: 6rem;
  }

  .is-style-hero-globe::before,
  .is-style-hero-globe > .wp-block-image {
    width: auto;
    height: 144%;
  }

  .is-style-hero-globe::after {
    background: linear-gradient(
      to right,
      var(--wp--preset--color--brand) 15%,
      color-mix(in srgb, var(--wp--preset--color--brand) 55%, transparent) 35%,
      transparent 55%
    );
  }
}

/* Article and archive templates */
.article-intro .wp-block-post-title {
  margin-block: 0;
}

.article-intro .wp-block-post-excerpt__excerpt {
  margin: 0;
  color: var(--wp--preset--color--muted-foreground);
  font-size: 1.125rem;
  line-height: 1.625;
}

.article-meta,
.article-intro .wp-block-post-terms {
  color: var(--wp--preset--color--muted-foreground);
  font-family: var(--wp--preset--font-family--mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.article-intro .wp-block-post-terms a {
  color: inherit;
  text-decoration: none;
}

.wp-block-post-featured-image.alignwide {
  margin-block: 0;
}

.wp-block-post-featured-image.alignwide img {
  width: 100%;
  border-radius: var(--radius);
}

.article-body {
  padding-block: var(--pad-lg);
}

.article-aside {
  display: grid;
  gap: 3rem;
  padding-block: var(--pad-lg);
}

.article-aside .wp-block-post-content {
  padding-block: 0;
}

@media (min-width: 64rem) {
  .article-aside {
    grid-template-columns: minmax(0, 1fr) 14rem;
  }

  .article-aside__side {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    align-self: start;
  }
}

.article-aside__side .wp-block-post-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1.4;
}

.article-aside__side .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}

/* Card grid: reference/src/Card.tsx */
.wp-block-post-template.is-layout-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 40rem) {
  .wp-block-post-template.is-layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .wp-block-post-template.is-layout-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
}

.is-style-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--wp--preset--color--background);
  transition: border-color 150ms ease;
}

.is-style-card:hover {
  border-color: var(--wp--preset--color--hairline-strong);
}

.is-style-card .wp-block-post-featured-image {
  margin: 0;
}

.is-style-card .wp-block-post-featured-image img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
}

.card__body > * {
  margin: 0;
}

.card__body .wp-block-post-terms {
  color: var(--wp--preset--color--muted-foreground);
  font-size: 0.875rem;
  text-transform: uppercase;
}

.card__body .wp-block-post-terms a {
  position: relative;
  z-index: 1;
  color: inherit;
  text-decoration: none;
}

.card__body .wp-block-post-title {
  font-size: var(--fs-h3);
}

.card__body .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}

/* The whole card is clickable, as in the app. */
.card__body .wp-block-post-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card__body .wp-block-post-excerpt__excerpt {
  margin: 0;
  font-size: 0.875rem;
}

/* Pagination: bordered page numbers, the current one solid navy; arrows as plain chevrons. */
.wp-block-query-pagination {
  gap: 0.5rem;
  margin-block-start: 3rem;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.wp-block-query-pagination a {
  text-decoration: none;
}

.wp-block-query-pagination-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wp-block-query-pagination-numbers .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding-inline: 0.5rem;
  border: 1px solid var(--wp--preset--color--input);
  border-radius: 0.375rem;
  color: var(--wp--preset--color--foreground);
  transition:
    background-color 150ms ease,
    border-color 150ms ease;
}

.wp-block-query-pagination-numbers a.page-numbers:hover {
  border-color: var(--wp--preset--color--hairline-strong);
  background: var(--wp--preset--color--accent);
}

.wp-block-query-pagination-numbers .current {
  border-color: var(--wp--preset--color--brand);
  background: var(--wp--preset--color--brand);
  color: var(--wp--preset--color--brand-foreground);
  font-weight: 600;
}

.wp-block-query-pagination-numbers .dots {
  border-color: transparent;
}

:is(.wp-block-query-pagination-previous, .wp-block-query-pagination-next) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.375rem;
  color: var(--wp--preset--color--foreground);
  font-size: 1.25rem;
  transition: background-color 150ms ease;
}

:is(.wp-block-query-pagination-previous, .wp-block-query-pagination-next):hover {
  background: var(--wp--preset--color--accent);
}

:is(.wp-block-query-pagination-previous, .wp-block-query-pagination-next) [class*="-arrow"] {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .wp-block-query-pagination-numbers .page-numbers,
  :is(.wp-block-query-pagination-previous, .wp-block-query-pagination-next) {
    transition: none;
  }
}

/* FAQ: native <details>, each a rounded card (docs/20 FAQ accordion) */
.wp-block-details {
  padding: 1rem 1.25rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--wp--preset--color--background);
  transition: border-color 150ms ease;
}

.wp-block-details:is(:hover, [open]) {
  border-color: var(--wp--preset--color--hairline-strong);
}

.wp-block-details + .wp-block-details {
  margin-block-start: 0.75rem;
}

.wp-block-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.wp-block-details summary::-webkit-details-marker {
  display: none;
}

.wp-block-details summary::after {
  content: "";
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  transform: rotate(45deg);
  transition: transform 200ms var(--ease-out);
}

.wp-block-details[open] summary::after {
  transform: rotate(-135deg);
}

.wp-block-details > :not(summary) {
  margin-block-start: 0.75rem;
  color: var(--wp--preset--color--muted-foreground);
}

@media (prefers-reduced-motion: no-preference) {
  .wp-block-details::details-content {
    display: block;
    block-size: 0;
    overflow: hidden;
    transition:
      block-size 200ms var(--ease-out),
      content-visibility 200ms allow-discrete;
  }

  .wp-block-details[open]::details-content {
    block-size: auto;
    block-size: calc-size(auto, size);
  }
}

/* Callouts: the app's Alert (status pair: strong colour for text, icon and a /30 border; the subtle
   tint behind). Group block styles; the Icon block inside is optional and any icon can be picked.
   Colours, border and padding set on the block in the editor still win. */
.wp-block-group:is(
  .is-style-callout-info,
  .is-style-callout-success,
  .is-style-callout-warning,
  .is-style-callout-danger
) {
  --callout: var(--wp--preset--color--brand);
  --callout-subtle: var(--wp--preset--color--brand-tint);
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--callout) 30%, transparent);
  border-radius: var(--radius);
  background-color: var(--callout-subtle);
  color: var(--callout);
  font-size: 0.875rem;
}

.wp-block-group.is-style-callout-success {
  --callout: var(--wp--preset--color--success);
  --callout-subtle: var(--wp--preset--color--success-subtle);
}

.wp-block-group.is-style-callout-warning {
  --callout: var(--wp--preset--color--warning);
  --callout-subtle: var(--wp--preset--color--warning-subtle);
}

.wp-block-group.is-style-callout-danger {
  --callout: var(--wp--preset--color--destructive);
  --callout-subtle: var(--wp--preset--color--destructive-subtle);
}

[class*="is-style-callout-"] > .wp-block-icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  /* Core sets line-height 0 on icons; take the text's back so 1lh is one line of it, and centre the
     icon on the first line. */
  line-height: inherit;
  margin-block-start: calc((1lh - 1.25rem) / 2);
}

[class*="is-style-callout-"] :is(p, h2, h3, h4, a) {
  color: inherit;
}

[class*="is-style-callout-"] strong {
  font-weight: 600;
}

/* Split hero: a Columns block style. Text beside a picture, no overlay. Below 64rem the columns stack
   (in the order the client set) and the text is centred; from 64rem they sit side by side, the text
   left-aligned and the picture filling its half of the frame. Grid, so core's own Columns
   breakpoint (782px) and per-column widths don't apply here. Alignment set on a block still wins. */
.wp-block-columns.is-style-hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin-block: 0;
}

/* The picture column: one image, video or cover, nothing else. "Only child" skips aria-hidden
   elements: the editor puts a hidden helper next to a selected block, and :only-child would then
   stop matching while the client works on the hero. Same for the sections below and in frame.css. */
.is-style-hero-split
  > .wp-block-column:has(
    > :is(.wp-block-image, .wp-block-video, .wp-block-cover):nth-child(1 of :not([aria-hidden])):nth-last-child(1 of :not([aria-hidden]))
  ) {
  position: relative;
}

.is-style-hero-split > .wp-block-column > .wp-block-image:nth-child(1 of :not([aria-hidden])):nth-last-child(1 of :not([aria-hidden])) {
  margin: 0;
}

/* !important: the editor puts an inline `height: auto` on the image (and a resize box around it when
   selected), and resizing it saves inline sizes; the picture must fill its half either way. */
.is-style-hero-split
  > .wp-block-column
  > .wp-block-image:nth-child(1 of :not([aria-hidden])):nth-last-child(1 of :not([aria-hidden]))
  :is(img, .components-resizable-box__container) {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.is-style-hero-split > .wp-block-column > .wp-block-image:nth-child(1 of :not([aria-hidden])):nth-last-child(1 of :not([aria-hidden])) img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* The text column(s). */
.is-style-hero-split
  > .wp-block-column:not(
    :has(> :is(.wp-block-image, .wp-block-video, .wp-block-cover):nth-child(1 of :not([aria-hidden])):nth-last-child(1 of :not([aria-hidden])))
  ) {
  align-self: center;
  padding: var(--pad-lg) var(--hero-inset);
}

:where(.is-style-hero-split > .wp-block-column) {
  text-align: center;
}

.is-style-hero-split
  > .wp-block-column
  > :not(:is(.wp-block-image, .wp-block-video, .wp-block-cover):nth-child(1 of :not([aria-hidden])):nth-last-child(1 of :not([aria-hidden]))) {
  max-width: 36rem;
  margin-inline: auto;
}

:where(
  .is-style-hero-split
    .wp-block-buttons:not([class*="is-content-justification-"])
) {
  justify-content: center;
}

.is-style-hero-split h1 {
  margin-block-end: 0.25em;
  font-size: var(--fs-hero);
}

@media (min-width: 64rem) {
  .wp-block-columns.is-style-hero-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: min(40rem, calc(100svh - var(--header-h)));
  }

  :where(.is-style-hero-split > .wp-block-column) {
    text-align: start;
  }

  .is-style-hero-split
    > .wp-block-column
    > :not(:is(.wp-block-image, .wp-block-video, .wp-block-cover):nth-child(1 of :not([aria-hidden])):nth-last-child(1 of :not([aria-hidden]))) {
    margin-inline: 0;
  }

  :where(
    .is-style-hero-split
      .wp-block-buttons:not([class*="is-content-justification-"])
  ) {
    justify-content: flex-start;
  }

  /* Side by side, the text keeps to the frame on the window side and to the gutter in the middle. */
  .is-style-hero-split > .wp-block-column:nth-child(1 of .wp-block-column) {
    padding-inline-end: var(--gutter);
  }

  .is-style-hero-split > .wp-block-column:nth-last-child(1 of .wp-block-column) {
    padding-inline-start: var(--gutter);
  }

  /* Out of the flow, so a tall photo fills its half instead of stretching the hero. */
  .is-style-hero-split > .wp-block-column > .wp-block-image:nth-child(1 of :not([aria-hidden])):nth-last-child(1 of :not([aria-hidden])) {
    position: absolute;
    inset: 0;
  }

  .is-style-hero-split > .wp-block-column > .wp-block-image:nth-child(1 of :not([aria-hidden])):nth-last-child(1 of :not([aria-hidden])) img {
    aspect-ratio: auto;
  }
}

/* Media row and media cards. Group block styles, rounded cards with a hairline border.
   - Media row (`media-row`): an optional Image block first, on top on phones and on the left from
     48rem at full height, then a `media-row__body` group.
   - Media cards: a `card-grid` Group holding 2, 3 or 4 `media-card` Groups (image on top, same body).
     Stacked on phones; from 48rem 2 or 3 side by side, 4 as 2x2, all the same height, with a gap.
   An image left empty or deleted renders nothing and the text takes its place. Images fill their
   space (cover) unless they have the "Fit (no crop)" style, for logos and transparent PNGs. A link on
   the title makes the whole row or card a link; it opens in a new tab (inc/setup.php) and shows the
   external-link icon. Rows placed one under another keep a small gap. */

/* One item: a row, or a card in a grid. */
.wp-block-group:is(.is-style-media-row, .is-style-media-card) {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: clip;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background-color: var(--wp--preset--color--background);
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.wp-block-group:is(.is-style-media-row, .is-style-media-card):is(:hover, :focus-within) {
  border-color: var(--wp--preset--color--hairline-strong);
}

.wp-block-group.is-style-media-row + .wp-block-group.is-style-media-row {
  margin-block-start: 1rem;
}

.wp-block-group:is(.is-style-media-row, .is-style-media-card) > * {
  margin: 0;
}

/* The image. Placeholders in the editor (no img yet) keep their normal flow. */
:is(.is-style-media-row, .is-style-media-card) > .wp-block-image:has(img) {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: none;
}

:is(.is-style-media-row, .is-style-media-card) > .wp-block-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  background: none;
}

:is(.is-style-media-row, .is-style-media-card) > .wp-block-image.is-style-fit img {
  padding: var(--pad-sm);
  object-fit: contain;
}

/* The editor wraps the img in a resizable box; let the img fill the figure as it does on the site. */
:is(.is-style-media-row, .is-style-media-card)
  > .wp-block-image
  > .components-resizable-box__container {
  position: static !important;
  width: auto !important;
  height: auto !important;
}

@media (prefers-reduced-motion: no-preference) {
  :is(.is-style-media-row, .is-style-media-card) > .wp-block-image img {
    transition: transform 200ms var(--ease-out);
  }

  :is(.is-style-media-row, .is-style-media-card):hover > .wp-block-image img {
    transform: scale(1.05);
  }
}

/* The text. */
.wp-block-group.media-row__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
}

.media-row__body > * {
  margin: 0;
}

.media-row__body :is(h2, h3, h4) {
  color: var(--wp--preset--color--brand);
  font-size: var(--fs-h4);
}

.media-row__body :is(h2, h3, h4) a {
  color: inherit;
  text-decoration: none;
}

.media-row__body > p:not([class*="is-style-"]) {
  color: var(--wp--preset--color--muted-foreground);
}

/* A linked title covers the whole row or card (on the site only, so the editor can still click into
   the blocks). The alt text tells screen readers about the new tab; the first line is the fallback
   for browsers without alt-text support in content. */
:where(body:not(.editor-styles-wrapper))
  .media-row__body
  :is(h2, h3, h4)
  a[href]::after {
  content: "";
  content: "" / " (opens in a new tab)";
  position: absolute;
  z-index: 1;
  inset: 0;
}

.media-row__body :is(h2, h3, h4) a:focus-visible {
  outline: none;
  box-shadow: none;
}

.wp-block-group:is(.is-style-media-row, .is-style-media-card):has(
    :is(h2, h3, h4) a:focus-visible
  ) {
  outline: 2px solid var(--wp--preset--color--brand);
  outline-offset: 2px;
}

/* Other links in the text stay clickable above the row link. */
.media-row__body p a {
  position: relative;
  z-index: 2;
}

/* External-link icon, top right, on linked rows and cards. */
.wp-block-group:is(.is-style-media-row, .is-style-media-card):has(:is(h2, h3, h4) a[href])::after {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 1rem;
  height: 1rem;
  background-color: var(--wp--preset--color--muted-foreground);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: background-color 150ms ease;
  pointer-events: none;
}

.wp-block-group:is(.is-style-media-row, .is-style-media-card):has(
    :is(h2, h3, h4) a[href]
  ):hover::after {
  background-color: var(--wp--preset--color--brand);
}

:is(.is-style-media-row, .is-style-media-card):has(:is(h2, h3, h4) a[href]) .media-row__body {
  padding-inline-end: 3rem;
}

/* Cards: image on top, the text below starting at the top, so a card without an image is as tall as
   its neighbours with the text where theirs starts. */
.wp-block-group.is-style-media-card {
  grid-template-rows: auto 1fr;
}

.wp-block-group.is-style-media-card:not(:has(> .wp-block-image)) {
  grid-template-rows: 1fr;
}

.is-style-media-card > .media-row__body {
  justify-content: flex-start;
}

/* The grid: one column on phones. */
.wp-block-group.is-style-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--card-gap);
}

.wp-block-group.is-style-card-grid > * {
  margin: 0;
}

/* The editor's add-block button sits on its own line under the cards. */
:is(.is-style-card-grid, .is-style-grid-2, .is-style-grid-3, .is-style-grid-4, .is-style-grid-5, .is-style-steps, .is-style-numbered-items) > .block-list-appender {
  grid-column: 1 / -1;
}

@media (min-width: 48rem) {
  .wp-block-group.is-style-media-row:has(> .wp-block-image) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }

  .is-style-media-row > .wp-block-image:has(img) {
    min-height: 10rem;
    aspect-ratio: auto;
  }

  /* 2 or 4 cards (or any other count): two columns. 3 cards: three. */
  .wp-block-group.is-style-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
  }

  .wp-block-group.is-style-card-grid:has(> :nth-child(3 of .is-style-media-card)):not(
      :has(> :nth-child(4 of .is-style-media-card))
    ) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Article pages: the featured image below the intro band, rounded, with room above it. */
.article-intro + .wp-block-group > .wp-block-post-featured-image.alignwide {
  margin-block-start: var(--pad-md);
}

/* Hero: narrow. A Group block style (`hero-narrow`), set to Full width: a short solid navy band
   with an eyebrow and a title, for inner pages such as the team page. The text lines up with the
   container. A background colour picked in the editor replaces the navy. */
.wp-block-group.is-style-hero-narrow {
  padding-block: clamp(2.5rem, 1.75rem + 3vw, 4rem);
  background-color: var(--wp--preset--color--brand);
  color: var(--wp--preset--color--brand-foreground);
}

/* With an Image block inside ("Hero: narrow with image"), the picture fills the right of the band
   and fades into the navy towards the text. Delete the image for a plain band. !important: the
   editor and image resizing put inline sizes on the image. */
.wp-block-group.is-style-hero-narrow:has(> .wp-block-image) {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.is-style-hero-narrow > .wp-block-image {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: 100%;
  max-width: none !important;
  height: 100%;
  margin: 0 !important;
  opacity: 0.45;
  mask-image: linear-gradient(to right, transparent, var(--wp--preset--color--brand) 55%);
}

@media (min-width: 48rem) {
  .is-style-hero-narrow > .wp-block-image {
    width: 65%;
    opacity: 1;
    mask-image: linear-gradient(to right, transparent, var(--wp--preset--color--brand) 45%);
  }
}

.is-style-hero-narrow > .wp-block-image :is(img, .components-resizable-box__container) {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  aspect-ratio: auto !important;
  object-fit: cover;
  object-position: center;
}

.is-style-hero-narrow > .wp-block-image + * {
  margin-block-start: 0;
}

.is-style-hero-narrow :is(h1, h2) {
  margin-block: 0.5rem 0;
  color: inherit;
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: 1.1;
}

.is-style-hero-narrow .is-style-eyebrow {
  margin-block-end: 0;
  color: color-mix(in srgb, var(--wp--preset--color--brand-foreground) 85%, transparent);
}

.is-style-hero-narrow p:not(.is-style-eyebrow) {
  max-width: 40rem;
  color: color-mix(in srgb, var(--wp--preset--color--brand-foreground) 85%, transparent);
}

/* Grids: Group block styles (`grid-2` … `grid-5`), used Wide. Any blocks inside become equal
   cells, all as tall as the tallest in their row; add, duplicate or delete cards and they reflow.
     grid-2: 1 column, 2 from 40rem
     grid-3: 1 column, 2 from 40rem, 3 from 75rem (cards stay wide enough for a photo beside text)
     grid-4: 1 column below 22rem, then 2, 3 from 40rem, 4 from 64rem
     grid-5: 1 column below 22rem, then 2, 3 from 40rem, 4 from 56rem, 5 from 72rem
   Each step is set so a card never gets narrower than about 11rem. */
.wp-block-group:is(.is-style-grid-2, .is-style-grid-3, .is-style-grid-4, .is-style-grid-5) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--card-gap);
}

.wp-block-group:is(.is-style-grid-2, .is-style-grid-3, .is-style-grid-4, .is-style-grid-5) > * {
  margin: 0;
}

@media (min-width: 22rem) {
  .wp-block-group:is(.is-style-grid-4, .is-style-grid-5) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
  }
}

@media (min-width: 40rem) {
  .wp-block-group:is(.is-style-grid-2, .is-style-grid-3) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wp-block-group:is(.is-style-grid-4, .is-style-grid-5) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--card-gap);
  }
}

@media (min-width: 56rem) {
  .wp-block-group.is-style-grid-5 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 72rem) {
  .wp-block-group.is-style-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 75rem) {
  .wp-block-group.is-style-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .wp-block-group.is-style-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Cards in a grid: media cards and post cards fill their cell too. */
:is(.is-style-grid-2, .is-style-grid-3, .is-style-grid-4, .is-style-grid-5) > :is(.is-style-media-card, .is-style-card) {
  height: auto;
}

/* Portrait placeholder: drawn when a card has no photo (an empty Image block renders nothing). */
:is(.person-card__head, .is-style-profile-card) {
  --portrait-placeholder:
    radial-gradient(ellipse 21% 18% at 50% 40%, var(--wp--preset--color--hairline-strong) 0 98%, transparent 100%),
    radial-gradient(ellipse 40% 26% at 50% 100%, var(--wp--preset--color--hairline-strong) 0 98%, transparent 100%),
    var(--wp--preset--color--muted);
}

/* Person card: a Group block style (`person-card`). `person-card__head` puts the photo beside the
   name and role (`person-card__info`); institution and location lines run full width under it, then
   a description and a row of badges, pushed to the bottom so cards in a row line up. */
.wp-block-group.is-style-person-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--wp--preset--color--background);
}

.is-style-person-card > * {
  margin: 0;
}

.wp-block-group.person-card__head {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.person-card__head > * {
  margin: 0;
}

.person-card__head:not(:has(> .wp-block-image))::before {
  content: "";
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--portrait-placeholder);
}

.person-card__head > .wp-block-image {
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--wp--preset--color--muted);
}

.person-card__head > .wp-block-image:has(img) {
  aspect-ratio: 1;
}

/* !important: the editor and image resizing put inline sizes on the image. */
:is(.person-card__head, .is-style-profile-card) > .wp-block-image :is(img, .components-resizable-box__container) {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  aspect-ratio: auto !important;
}

:is(.person-card__head, .is-style-profile-card) > .wp-block-image img {
  border-radius: 0;
  object-fit: cover;
  object-position: 50% 20%;
}

.wp-block-group.person-card__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.person-card__info > * {
  margin: 0;
}

:is(.is-style-person-card, .is-style-profile-card) :is(h3, h4) {
  color: var(--wp--preset--color--brand);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.25;
}

/* Icon lines under the photo, full width. */
.is-style-person-card > p[class*="is-style-icon-"] {
  margin-block-start: 0.375rem;
}

.is-style-person-card > .person-card__head + p[class*="is-style-icon-"] {
  margin-block-start: 0.875rem;
}

/* The description: a plain paragraph straight in the card, under a hairline. */
.is-style-person-card > p:not([class*="is-style-"]) {
  flex: 1;
  margin-block-start: 0.875rem;
  padding-block-start: 0.75rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.9375rem;
}

.is-style-person-card > .wp-block-group:is(.is-style-badges, .is-style-tags) {
  margin-block-start: 0.75rem;
}

@media (min-width: 40rem) {
  .wp-block-group.person-card__head {
    grid-template-columns: 6.5rem minmax(0, 1fr);
  }
}

/* Profile card: a Group block style (`profile-card`). Square photo on top, name, icon line, then a
   row of badges at the bottom. Made for a 4-column grid. */
.wp-block-group.is-style-profile-card {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.875rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--wp--preset--color--background);
}

.is-style-profile-card > * {
  margin: 0;
}

.is-style-profile-card:not(:has(> .wp-block-image))::before {
  content: "";
  aspect-ratio: 1;
  margin-block-end: 0.375rem;
  border-radius: var(--radius-sm);
  background: var(--portrait-placeholder);
}

.is-style-profile-card > .wp-block-image {
  overflow: hidden;
  margin-block-end: 0.375rem;
  border-radius: var(--radius-sm);
  background: var(--wp--preset--color--muted);
}

.is-style-profile-card > .wp-block-image:has(img) {
  aspect-ratio: 1;
}

.is-style-profile-card > .wp-block-image img {
  object-position: 50% 22%;
}

.is-style-profile-card :is(h3, h4) {
  font-size: 1rem;
  line-height: 1.3;
}

/* A plain paragraph (a project title, a short bio) under the name and icon lines. */
.is-style-profile-card > p:not([class*="is-style-"]) {
  margin-block-start: 0.375rem;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.is-style-profile-card > .wp-block-group:is(.is-style-badges, .is-style-tags) {
  margin-block-start: auto;
  padding-block-start: 0.5rem;
}

/* Linked cards. Link the title of a person, profile or post card and the whole card becomes the
   link: the link's ::after covers the card, which shows a pointer and a darker border. On the site
   only, so the editor can still click into the blocks. Other links in the card stay clickable above
   it. The link opens where the editor set it (same tab unless "Open in new tab" is ticked). Media
   rows and media cards work the same way (above) but always open a new tab. */
:is(.is-style-person-card, .is-style-profile-card, .is-style-card, .is-style-media-row, .is-style-media-card):has(:is(h2, h3, h4) a[href]) {
  position: relative;
  cursor: pointer;
}

:is(.is-style-person-card, .is-style-profile-card) {
  transition: border-color 150ms ease;
}

:is(.is-style-person-card, .is-style-profile-card):has(:is(h2, h3, h4) a[href]):hover {
  border-color: var(--wp--preset--color--hairline-strong);
}

:is(.is-style-person-card, .is-style-profile-card) :is(h2, h3, h4) a {
  color: inherit;
  text-decoration: none;
}

:is(.is-style-person-card, .is-style-profile-card):has(:is(h2, h3, h4) a[href]):hover :is(h2, h3, h4) a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

:where(body:not(.editor-styles-wrapper))
  :is(.is-style-person-card, .is-style-profile-card)
  :is(h2, h3, h4)
  a[href]::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
}

:is(.is-style-person-card, .is-style-profile-card) :is(h2, h3, h4) a:focus-visible {
  box-shadow: none;
}

:is(.is-style-person-card, .is-style-profile-card):has(:is(h2, h3, h4) a:focus-visible) {
  outline: 2px solid var(--wp--preset--color--brand);
  outline-offset: 2px;
}

:is(.is-style-person-card, .is-style-profile-card) p a {
  position: relative;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  :is(.is-style-person-card, .is-style-profile-card) {
    transition: none;
  }
}

/* Badges. Paragraph block styles, one per colour; the Group they sit in picks the shape:
   "Badges: pill" (`badges`, rounded ends, for roles and labels) or "Badges: tag" (`tags`, small
   rounded corners and mono type, for codes such as DC1) or "Badges: large" (`badges-lg`, bigger
   pills for a few key terms, such as the research domains). A plain paragraph in the row is its label
   ("Supervises:"). A badge on its own outside a row is a pill. Colours set on a badge in the editor
   still win. */
.wp-block-group:is(.is-style-badges, .is-style-badges-lg, .is-style-tags) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.wp-block-group:is(.is-style-badges, .is-style-badges-lg, .is-style-tags) > * {
  margin: 0;
}

:is(.is-style-badges, .is-style-badges-lg, .is-style-tags) > p:not([class*="is-style-badge"]) {
  margin-inline-end: 0.125rem;
  color: var(--wp--preset--color--muted-foreground);
  font-size: 0.8125rem;
}

p:is(
  .is-style-badge,
  .is-style-badge-solid,
  .is-style-badge-outline,
  .is-style-badge-success,
  .is-style-badge-warning,
  .is-style-badge-danger,
  .is-style-badge-neutral
) {
  --badge-fg: var(--wp--preset--color--brand);
  --badge-bg: var(--wp--preset--color--brand-tint);
  --badge-border: transparent;
  display: flex;
  align-items: center;
  width: fit-content;
  margin-block: 0;
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--badge-border);
  border-radius: 999px;
  background-color: var(--badge-bg);
  color: var(--badge-fg);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25rem;
  white-space: nowrap;
}

p.is-style-badge-solid {
  --badge-fg: var(--wp--preset--color--brand-foreground);
  --badge-bg: var(--wp--preset--color--brand);
}

p.is-style-badge-outline {
  --badge-bg: var(--wp--preset--color--background);
  --badge-border: color-mix(in srgb, var(--wp--preset--color--brand) 30%, transparent);
  font-weight: 500;
}

p.is-style-badge-success {
  --badge-fg: var(--wp--preset--color--success);
  --badge-bg: var(--wp--preset--color--success-subtle);
}

p.is-style-badge-warning {
  --badge-fg: var(--wp--preset--color--warning);
  --badge-bg: var(--wp--preset--color--warning-subtle);
}

p.is-style-badge-danger {
  --badge-fg: var(--wp--preset--color--destructive);
  --badge-bg: var(--wp--preset--color--destructive-subtle);
}

p.is-style-badge-neutral {
  --badge-fg: var(--wp--preset--color--foreground);
  --badge-bg: var(--wp--preset--color--muted);
  --badge-border: var(--hairline);
  font-weight: 500;
}

.is-style-tags > p[class*="is-style-badge"] {
  padding-inline: 0.5rem;
  border-radius: 0.375rem;
  font-family: var(--wp--preset--font-family--mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* A legend for badge colours: a flex Group of small tag rows. */
.wp-block-group.badge-legend > .is-style-tags > p:not([class*="is-style-badge"]) {
  margin-inline: 0.125rem 0;
}

/* Icon lines: paragraph block styles with an icon before the text (institution, location, email,
   link, date). For contact and meta lines in cards. */
p:is(
  .is-style-icon-institution,
  .is-style-icon-location,
  .is-style-icon-email,
  .is-style-icon-link,
  .is-style-icon-date
) {
  --icon: none;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

p[class*="is-style-icon-"]::before {
  content: "";
  flex: none;
  width: 0.9375rem;
  height: 0.9375rem;
  margin-block-start: calc((1lh - 0.9375rem) / 2);
  background-color: var(--wp--preset--color--muted-foreground);
  mask: var(--icon) center / contain no-repeat;
}

p.is-style-icon-institution {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V10m14 11V10M9 21v-6h6v6M2 10l10-6 10 6'/%3E%3C/svg%3E");
}

p.is-style-icon-location {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11a7 7 0 1 1 14 0c0 4.8-7 11-7 11z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E");
}

p.is-style-icon-email {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E");
}

p.is-style-icon-link {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7'/%3E%3C/svg%3E");
}

p.is-style-icon-date {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  font-family: var(--wp--preset--font-family--mono);
  font-variant-numeric: tabular-nums;
}

/* Breadcrumbs block (inc/breadcrumbs.php): the parent pages, then the current one. */
.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin: 0;
  padding: 0;
  color: var(--wp--preset--color--muted-foreground);
  font-size: 0.875rem;
  list-style: none;
}

.breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs__item + .breadcrumbs__item::before {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  background-color: currentcolor;
  opacity: 0.6;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.breadcrumbs__item a {
  color: inherit;
  text-decoration: none;
  transition: color 150ms ease;
}

.breadcrumbs__item a:hover {
  color: var(--wp--preset--color--foreground);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.breadcrumbs__item[aria-current] {
  color: var(--wp--preset--color--foreground);
  font-weight: 500;
}

.breadcrumbs-hint {
  margin: 0;
  font-size: 0.8125rem;
  opacity: 0.75;
}

/* On the navy hero. */
.is-style-hero-narrow .breadcrumbs__list {
  color: color-mix(in srgb, var(--wp--preset--color--brand-foreground) 72%, transparent);
}

.is-style-hero-narrow :is(.breadcrumbs__item a:hover, .breadcrumbs__item[aria-current]) {
  color: var(--wp--preset--color--brand-foreground);
}

.is-style-hero-narrow .wp-block-resilious-breadcrumbs + :is(h1, h2) {
  margin-block-start: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .breadcrumbs__item a {
    transition: none;
  }
}

/* Profile layout: a Group block style (`profile-layout`) with two groups, `profile-aside` (photo,
   links, key facts) and `profile-main`. From 64rem the aside is a sticky column on the left; below
   that it sits on top, its photo beside the links and the facts. */
.wp-block-group.is-style-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--pad-md);
}

.is-style-profile-layout > * {
  margin: 0;
  min-width: 0;
}

.wp-block-group.profile-aside {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: start;
  align-content: start;
  align-self: start;
  gap: 1rem 1.25rem;
}

.profile-aside > * {
  margin: 0;
}

.profile-aside > .wp-block-image,
.profile-aside:not(:has(> .wp-block-image))::before {
  grid-row: 1;
  grid-column: 1;
}

.profile-aside > .is-style-link-list {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
}

.profile-aside > .is-style-detail-list {
  grid-column: 1 / -1;
}

.profile-aside:not(:has(> .wp-block-image))::before {
  content: "";
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 22% 18% at 50% 38%, var(--wp--preset--color--hairline-strong) 0 98%, transparent 100%),
    radial-gradient(ellipse 42% 24% at 50% 100%, var(--wp--preset--color--hairline-strong) 0 98%, transparent 100%),
    var(--wp--preset--color--muted);
}

.profile-aside > .wp-block-image {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--wp--preset--color--muted);
}

.profile-aside > .wp-block-image:has(img) {
  aspect-ratio: 4 / 5;
}

.profile-aside > .wp-block-image :is(img, .components-resizable-box__container) {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  aspect-ratio: auto !important;
}

.profile-aside > .wp-block-image img {
  border-radius: 0;
  object-fit: cover;
  object-position: 50% 25%;
}

@media (min-width: 40rem) {
  .wp-block-group.profile-aside {
    grid-template-columns: 12rem minmax(0, 1fr);
  }

  .profile-aside > .is-style-link-list {
    grid-row: 2;
    grid-column: 1;
    align-self: start;
  }

  .profile-aside > .is-style-detail-list {
    grid-row: 1 / span 2;
    grid-column: 2;
  }
}

@media (min-width: 64rem) {
  .wp-block-group.is-style-profile-layout {
    grid-template-columns: 18rem minmax(0, 1fr);
    gap: clamp(2.5rem, 5vw, 4.5rem);
  }

  .wp-block-group.profile-aside {
    position: sticky;
    top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--header-h) + 1.5rem);
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-aside > :is(.wp-block-image, .is-style-link-list, .is-style-detail-list),
  .profile-aside:not(:has(> .wp-block-image))::before {
    grid-row: auto;
    grid-column: 1;
  }
}

/* The main column: an intro (`profile-intro`: badge row, title, lead) under a hairline, then
   sections, each an H2 with its content. */
.wp-block-group.profile-main {
  max-width: 50rem;
}

.profile-main > * {
  margin-block: 0;
}

.profile-main > * + * {
  margin-block-start: 1rem;
}

.profile-main > h2 {
  margin-block-start: clamp(2.25rem, 1.75rem + 1.5vw, 3rem);
  color: var(--wp--preset--color--brand);
  font-size: var(--fs-h3);
}

.profile-main > h2 + * {
  margin-block-start: 0.75rem;
}

.wp-block-group.profile-intro {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-block-end: var(--pad-sm);
  border-bottom: 1px solid var(--hairline);
}

.profile-intro > * {
  margin: 0;
}

.profile-intro > :is(h1, h2) {
  color: var(--wp--preset--color--brand);
  font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem);
  line-height: 1.15;
  text-wrap: balance;
}

.profile-intro > .is-style-lead {
  margin-block-start: 0.25rem;
}

/* Link list: a Group block style (`link-list`) of small rows, each a Group with an Icon block and a
   paragraph holding the link. The whole row is the link. Pick any icon in the Icon block; duplicate
   a row for another link. */
.wp-block-group.is-style-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.is-style-link-list > * {
  margin: 0;
}

.is-style-link-list > .wp-block-group {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--wp--preset--color--muted-foreground);
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.is-style-link-list > .wp-block-group > * {
  margin: 0;
}

.is-style-link-list .wp-block-icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}

.is-style-link-list p {
  min-width: 0;
  overflow: hidden;
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.is-style-link-list p a {
  color: var(--wp--preset--color--foreground);
  text-decoration: none;
}

:where(body:not(.editor-styles-wrapper)) .is-style-link-list p a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.is-style-link-list > .wp-block-group:has(a[href]):hover {
  background-color: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--brand);
}

.is-style-link-list > .wp-block-group:has(a:focus-visible) {
  outline: 2px solid var(--wp--preset--color--brand);
  outline-offset: 1px;
}

.is-style-link-list p a:focus-visible {
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .is-style-link-list > .wp-block-group {
    transition: none;
  }
}

/* Detail list: a Group block style (`detail-list`) of rows, each a Group with an Icon block, a label
   paragraph and a value paragraph (Shift+Enter for more lines). Narrow (the sidebar), the label sits
   above the value; from 32rem of room, label and value sit side by side. Give the list a background
   colour (as in the sidebar) and it becomes a padded, rounded panel. */
.wp-block-group.is-style-detail-list {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
}

.is-style-detail-list > * {
  margin: 0;
}

.wp-block-group.is-style-detail-list.has-background {
  padding: 0.25rem 1.125rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.is-style-detail-list > .wp-block-group {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  column-gap: 0.875rem;
  row-gap: 0.125rem;
  align-items: start;
  margin: 0;
  padding-block: 0.875rem;
}

.is-style-detail-list > .wp-block-group + .wp-block-group {
  border-top: 1px solid var(--hairline);
}

.is-style-detail-list > .wp-block-group > * {
  margin: 0;
}

.is-style-detail-list .wp-block-icon {
  grid-row: 1 / span 2;
  width: 1.25rem;
  height: 1.25rem;
  margin-block-start: 0.0625rem;
  color: var(--wp--preset--color--brand);
}

.is-style-detail-list > .wp-block-group > p:nth-of-type(1) {
  color: var(--wp--preset--color--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-transform: uppercase;
}

.is-style-detail-list > .wp-block-group > p:nth-of-type(2) {
  grid-column: 2;
  color: var(--wp--preset--color--foreground);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
}

@container (min-width: 32rem) {
  .is-style-detail-list > .wp-block-group {
    grid-template-columns: 1.25rem 12rem minmax(0, 1fr);
    padding-block: 1rem;
  }

  .is-style-detail-list .wp-block-icon {
    grid-row: 1;
  }

  .is-style-detail-list > .wp-block-group > p:nth-of-type(2) {
    grid-column: 3;
    grid-row: 1;
    padding-inline-start: 1rem;
    border-inline-start: 1px solid var(--hairline);
    font-weight: 400;
  }
}

/* Empty state: a Group block style (`empty-state`): an icon and a sentence in a dashed panel, for
   sections that will fill up later (publications, outputs). */
.wp-block-group.is-style-empty-state {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px dashed var(--wp--preset--color--hairline-strong);
  border-radius: var(--radius);
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--muted-foreground);
  font-size: 0.9375rem;
}

.is-style-empty-state > * {
  margin: 0;
}

.is-style-empty-state .wp-block-icon {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--wp--preset--color--muted-foreground);
}

/* Publications (inc/publications.php). The filter bar block, then cards from the "Publication card"
   pattern in a Query Loop: icon, details (title, authors, journal and year, research area badges),
   then type and the DOI and PDF buttons. The list item around each card is a size container: the
   icon shows from 36rem of card width, and the type and buttons move into a column on the right
   from 48rem (below the details under that). */
.publication-filters {
  margin-block-end: 1.5rem;
}

.publication-filters .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.publication-filters__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

@media (min-width: 40rem) {
  .publication-filters__fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .publication-filters__search {
    grid-column: 1 / -1;
  }
}

@media (min-width: 64rem) {
  .publication-filters__fields {
    grid-template-columns: minmax(0, 2.2fr) repeat(3, minmax(0, 1fr));
  }

  .publication-filters__search {
    grid-column: auto;
  }
}

.publication-filters__search {
  position: relative;
}

.publication-filters input[type="search"],
.publication-filters__select {
  width: 100%;
  height: 2.75rem;
  border: 1px solid var(--wp--preset--color--input);
  border-radius: 0.375rem;
  background-color: var(--wp--preset--color--background);
  color: var(--wp--preset--color--foreground);
  font: inherit;
  font-size: 0.9375rem;
  transition: border-color 150ms ease;
}

.publication-filters input[type="search"] {
  padding: 0 2.75rem 0 0.875rem;
}

.publication-filters input[type="search"]::placeholder {
  color: var(--wp--preset--color--muted-foreground);
}

.publication-filters__select {
  appearance: none;
  padding: 0 2.25rem 0 0.875rem;
  cursor: pointer;
  text-overflow: ellipsis;
}

/* Each select sits in a wrapper that draws its chevron. */
.publication-filters__control {
  position: relative;
  display: block;
}

.publication-filters__control::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.75rem;
  width: 1rem;
  height: 1rem;
  background-color: var(--wp--preset--color--muted-foreground);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    center / contain no-repeat;
  pointer-events: none;
  transform: translateY(-50%);
}

.publication-filters :is(input[type="search"], .publication-filters__select):hover {
  border-color: var(--wp--preset--color--hairline-strong);
}

.publication-filters :is(input[type="search"], .publication-filters__select):focus-visible {
  outline: none;
  border-color: var(--wp--preset--color--brand);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--wp--preset--color--brand) 25%, transparent);
}

.publication-filters__submit {
  position: absolute;
  top: 50%;
  right: 0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--wp--preset--color--foreground);
  cursor: pointer;
  transform: translateY(-50%);
}

.publication-filters__submit:hover {
  background: var(--wp--preset--color--accent);
}

.publication-filters__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-block-start: 1.5rem;
}

.publication-filters__count {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.publication-filters__clear {
  color: var(--wp--preset--color--muted-foreground);
  font-size: 0.875rem;
  text-underline-offset: 0.2em;
}

.publication-filters__clear:hover {
  color: var(--wp--preset--color--foreground);
}

.publication-filters__sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: auto;
  font-size: 0.875rem;
}

.publication-filters__sort label {
  color: var(--wp--preset--color--muted-foreground);
  white-space: nowrap;
}

.publication-filters__sort .publication-filters__select {
  width: auto;
  height: 2.25rem;
  border-color: transparent;
  font-weight: 500;
}

/* Without JavaScript, the bar applies through this button; with it, every change applies at once. */
.publication-filters__form.is-enhanced .publication-filters__apply {
  display: none;
}

/* In the editor the bar is a preview. */
.block-editor-block-list__block .publication-filters__form {
  pointer-events: none;
}

.block-editor-block-list__block .publication-filters__apply {
  display: none;
}

.publication-list .wp-block-post-template {
  display: grid;
  gap: var(--card-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.publication-list .wp-block-post-template > li {
  margin: 0;
}

/* The card's layout follows the width of the list item it sits in (a size container). */
.wp-block-post-template > li:has(> .is-style-publication-card) {
  container-type: inline-size;
}

.wp-block-group.is-style-publication-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--wp--preset--color--background);
  transition: border-color 150ms ease;
}

.wp-block-group.is-style-publication-card:hover {
  border-color: var(--wp--preset--color--hairline-strong);
}

.is-style-publication-card > * {
  margin: 0 !important;
}

/* Icon tile: shown from 36rem of card width. */
.is-style-publication-card > .wp-block-icon {
  display: none;
  align-self: start;
  width: 4.5rem;
  height: 4.5rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--wp--preset--color--brand-tint);
  color: var(--wp--preset--color--brand);
}

.is-style-publication-card > .wp-block-icon svg {
  width: 100%;
  height: 100%;
}

.publication-card__body,
.publication-card__aside {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.publication-card__body > *,
.publication-card__aside > * {
  margin: 0 !important;
}

.publication-card__body .wp-block-post-title {
  font-size: var(--fs-h4);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: pretty;
}

.publication-card__body .wp-block-post-title a {
  color: var(--wp--preset--color--brand);
  text-decoration: none;
}

.publication-card__body .wp-block-post-title a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.publication-authors {
  font-size: 0.9375rem;
}

.publication-citation {
  color: var(--wp--preset--color--muted-foreground);
  font-size: 0.9375rem;
  font-style: italic;
}

/* Research areas: linked badges (each opens the list filtered by that area). */
.wp-block-post-terms.publication-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-block-start: 0.5rem !important;
}

.wp-block-post-terms.publication-areas .wp-block-post-terms__separator {
  display: none;
}

.wp-block-post-terms.publication-areas a {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--wp--preset--color--brand-tint);
  color: var(--wp--preset--color--brand);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.wp-block-post-terms.publication-areas a:hover {
  background: var(--wp--preset--color--brand);
  color: var(--wp--preset--color--brand-foreground);
}

.wp-block-post-terms.publication-type {
  color: var(--wp--preset--color--muted-foreground);
  font-size: 0.875rem;
}

.wp-block-post-terms.publication-type a {
  color: inherit;
  text-decoration: none;
}

.wp-block-post-terms.publication-type a:hover {
  color: var(--wp--preset--color--foreground);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.publication-card__aside {
  gap: 0.75rem;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--hairline);
}

/* A card with nothing in its right column (no type, no links) shows no divider. */
.publication-card__aside:not(:has(.wp-block-post-terms, .wp-block-button)) {
  display: none;
}

.publication-links {
  gap: 0.5rem;
}

.publication-links:not(:has(.wp-block-button)) {
  display: none;
}

.publication-links .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.publication-links .wp-block-button__link::after {
  content: "";
  width: 1rem;
  height: 1rem;
  background-color: currentcolor;
  mask: var(--publication-link-icon) center / contain no-repeat;
}

.publication-doi {
  /* Arrow up-right: opens elsewhere. */
  --publication-link-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
}

.publication-pdf {
  /* Download. */
  --publication-link-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m-5-5 5 5 5-5M5 21h14'/%3E%3C/svg%3E");
}

@container (min-width: 36rem) {
  .wp-block-group.is-style-publication-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.5rem;
  }

  .is-style-publication-card > .wp-block-icon {
    display: block;
  }

  .is-style-publication-card > .publication-card__aside {
    grid-column: 2;
  }

  /* A card without its icon keeps one column. */
  .wp-block-group.is-style-publication-card:not(:has(> .wp-block-icon)) {
    grid-template-columns: minmax(0, 1fr);
  }

  .is-style-publication-card:not(:has(> .wp-block-icon)) > .publication-card__aside {
    grid-column: auto;
  }
}

@container (min-width: 48rem) {
  .wp-block-group.is-style-publication-card {
    grid-template-columns: auto minmax(0, 1fr) 12.5rem;
  }

  .wp-block-group.is-style-publication-card:not(:has(> .wp-block-icon)) {
    grid-template-columns: minmax(0, 1fr) 12.5rem;
  }

  .is-style-publication-card > .publication-card__aside,
  .is-style-publication-card:not(:has(> .wp-block-icon)) > .publication-card__aside {
    grid-column: auto;
    align-self: center;
    padding-block-start: 0;
    padding-inline-start: 1.5rem;
    border-block-start: 0;
    border-inline-start: 1px solid var(--hairline);
  }
}

/* Single publication: the intro band. */
.publication-intro .publication-authors {
  font-size: 1.0625rem;
}

.publication-intro > .publication-citation {
  margin-block-start: 0.25rem;
}

.article-intro .wp-block-post-terms.publication-areas {
  font-family: inherit;
  font-size: inherit;
}

.publication-intro .publication-links {
  margin-block-start: 0.5rem;
}

.publication-intro .wp-block-post-terms.publication-type {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .publication-filters :is(input[type="search"], .publication-filters__select),
  .wp-block-group.is-style-publication-card,
  .wp-block-post-terms.publication-areas a {
    transition: none;
  }
}

/* ------------------------------------------------------------------------------------------------
   Content building blocks (0.7.0, first used on the About page). Group and paragraph block styles;
   each piece is a pattern in the inserter. Text in them is ordinary blocks the client edits.
   ------------------------------------------------------------------------------------------------ */

/* Large badges. "Badges: large" (`badges-lg`) is a row of bigger pills for a few key terms; the
   badge colours are the usual paragraph styles. "Badge: large tile" (`badge-tile`) is a square-ish
   code label (WP1) on its own, used at the start of a Tile card. */
.wp-block-group.is-style-badges-lg {
  gap: 0.5rem;
}

.is-style-badges-lg > p[class*="is-style-badge"] {
  padding: 0.375rem 0.875rem;
  font-size: 0.9375rem;
  line-height: 1.5rem;
}

p.is-style-badge-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 4.5rem;
  margin-block: 0;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  background-color: var(--wp--preset--color--brand-tint);
  color: var(--wp--preset--color--brand);
  font-family: var(--wp--preset--font-family--mono);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.5rem;
  white-space: nowrap;
}

/* Number (circle): a paragraph style for a typed number (1, 2 …) in a navy circle. */
p.is-style-number {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-block: 0;
  border-radius: 50%;
  background-color: var(--wp--preset--color--brand);
  color: var(--wp--preset--color--brand-foreground);
  font-family: var(--wp--preset--font-family--mono);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1;
}

/* Shared by the cards below: hairline border, rounded, white, title in navy, text in grey. */
.wp-block-group:is(
    .is-style-feature-card,
    .is-style-image-item,
    .is-style-numbered-item,
    .is-style-tile-card
  ) {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background-color: var(--wp--preset--color--background);
}

:is(.is-style-feature-card, .is-style-image-item, .is-style-numbered-item, .is-style-tile-card)
  :is(h2, h3, h4) {
  color: var(--wp--preset--color--brand);
  font-size: var(--fs-h4);
  line-height: 1.3;
}

:is(.is-style-feature-card, .is-style-image-item, .is-style-numbered-item) p:not([class*="is-style-"]) {
  color: var(--wp--preset--color--muted-foreground);
}

/* Feature card (`feature-card`): a picture inset at the top (an Image block, empty until one is
   picked; it renders nothing while empty), a title and text. In a Grid the cards are as tall as the
   tallest. The image's "Fit (no crop)" style shows an illustration or logo whole. */
.wp-block-group.is-style-feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
}

.is-style-feature-card > * {
  margin: 0;
}

.is-style-feature-card > .wp-block-image {
  margin-block-end: 0.75rem;
}

.is-style-feature-card > .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.is-style-feature-card > .wp-block-image.is-style-fit img {
  object-fit: contain;
}

/* Image item (`image-item`): a compact row, a small picture on the left and the text on the
   right (a status badge, a sentence). Sized for half a page; it stacks by itself when its own
   width drops below 22rem, whatever column it sits in. */
.wp-block-group.is-style-image-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.25rem;
  container-type: inline-size;
}

.is-style-image-item > * {
  margin: 0;
}

.is-style-image-item > .wp-block-image {
  flex: 0 0 9rem;
}

.is-style-image-item > .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.is-style-image-item > .wp-block-image.is-style-fit img {
  object-fit: contain;
}

.is-style-image-item > .wp-block-group {
  display: flex;
  flex: 1 1 12rem;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  min-width: 0;
}

.is-style-image-item > .wp-block-group > * {
  margin: 0;
}

.is-style-image-item > .wp-block-group > p:not([class*="is-style-"]) {
  font-size: 0.9375rem;
}

@container (max-width: 22rem) {
  .is-style-image-item > .wp-block-image {
    flex-basis: 100%;
  }

  .is-style-image-item > .wp-block-image img {
    aspect-ratio: 16 / 9;
  }
}

.wp-block-group.is-style-image-item + .wp-block-group.is-style-image-item {
  margin-block-start: var(--card-gap);
}

/* Steps (`steps`): items under a navy top rule, a light grey fill on hover. Any child blocks
   (a Group with a title and a sentence each) become the steps, and the layout follows their
   count:
     phones: stacked
     tablet (48rem): 4 steps as two by two; 2 or 3 in one row; 5 or more in rows of 3
     desktop (64rem): one row, up to 6; 7 or more in rows of 4 */
.wp-block-group.is-style-steps {
  --steps-tablet: 1;
  --steps-desktop: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem var(--card-gap);
}

.wp-block-group.is-style-steps:has(> :nth-child(2 of .wp-block-group)) {
  --steps-tablet: 2;
  --steps-desktop: 2;
}

.wp-block-group.is-style-steps:has(> :nth-child(3 of .wp-block-group)) {
  --steps-tablet: 3;
  --steps-desktop: 3;
}

.wp-block-group.is-style-steps:has(> :nth-child(4 of .wp-block-group)) {
  --steps-tablet: 2;
  --steps-desktop: 4;
}

.wp-block-group.is-style-steps:has(> :nth-child(5 of .wp-block-group)) {
  --steps-tablet: 3;
  --steps-desktop: 5;
}

.wp-block-group.is-style-steps:has(> :nth-child(6 of .wp-block-group)) {
  --steps-desktop: 6;
}

.wp-block-group.is-style-steps:has(> :nth-child(7 of .wp-block-group)) {
  --steps-desktop: 4;
}

@media (min-width: 48rem) {
  .wp-block-group.is-style-steps {
    grid-template-columns: repeat(var(--steps-tablet), minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .wp-block-group.is-style-steps {
    grid-template-columns: repeat(var(--steps-desktop), minmax(0, 1fr));
  }
}

.is-style-steps > * {
  margin: 0;
  padding: 1rem 1rem 1.25rem;
  border-block-start: 3px solid var(--wp--preset--color--brand);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: background-color 150ms ease;
}

.is-style-steps > :hover {
  background-color: var(--wp--preset--color--muted);
}

.is-style-steps > * > * {
  margin-block: 0;
}

.is-style-steps > * > * + * {
  margin-block-start: 0.375rem;
}

.is-style-steps :is(h2, h3, h4) {
  color: var(--wp--preset--color--brand);
  font-size: var(--fs-h4);
  line-height: 1.3;
}

.is-style-steps p:not([class*="is-style-"]) {
  color: var(--wp--preset--color--muted-foreground);
  font-size: 0.9375rem;
}

/* Numbered items (`numbered-items`): a grid of Numbered item cards, two columns from 48rem; an
   odd last card spans the whole row. Numbered item (`numbered-item`): a typed number in a navy
   circle (paragraph style "Number (circle)") beside a title and text. */
.wp-block-group.is-style-numbered-items {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--card-gap);
}

.wp-block-group.is-style-numbered-items > * {
  margin: 0;
}

@media (min-width: 48rem) {
  .wp-block-group.is-style-numbered-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .is-style-numbered-items
    > :nth-last-child(1 of .wp-block-group):nth-child(odd of .wp-block-group) {
    grid-column: 1 / -1;
  }
}

.wp-block-group.is-style-numbered-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  padding: 1.5rem;
}

.wp-block-group.is-style-numbered-item:has(> p.is-style-number) {
  grid-template-columns: auto minmax(0, 1fr);
}

.is-style-numbered-item > * {
  margin: 0;
}

.is-style-numbered-item > .wp-block-group > * {
  margin-block: 0;
}

.is-style-numbered-item > .wp-block-group > * + * {
  margin-block-start: 0.375rem;
}

/* The title starts level with the middle of the circle. */
.is-style-numbered-item > p.is-style-number + .wp-block-group {
  padding-block-start: 0.5rem;
}

/* Tile card (`tile-card`): a large tile (paragraph style "Badge: large tile", e.g. WP1) on the
   left, then a title, text, a list and a tag row. The tile goes on top below 40rem. Cards one
   under another keep the card gap. */
.wp-block-group.is-style-tile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 1.5rem;
}

.is-style-tile-card > * {
  margin: 0;
}

.is-style-tile-card > p.is-style-badge-tile {
  align-self: start;
}

@media (min-width: 40rem) {
  .wp-block-group.is-style-tile-card:has(> p.is-style-badge-tile) {
    grid-template-columns: 5rem minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.75rem;
  }

  .is-style-tile-card > p.is-style-badge-tile {
    width: 100%;
    min-width: 0;
  }
}

.is-style-tile-card > .wp-block-group > * {
  margin-block: 0;
}

.is-style-tile-card > .wp-block-group > * + * {
  margin-block-start: 0.625rem;
}

.is-style-tile-card .wp-block-list {
  padding-inline-start: 1.25rem;
  font-size: 0.9375rem;
}

.is-style-tile-card .wp-block-list li + li {
  margin-block-start: 0.25rem;
}

.is-style-tile-card > .wp-block-group > :is(.is-style-badges, .is-style-badges-lg, .is-style-tags) {
  margin-block-start: 1rem;
}

.wp-block-group.is-style-tile-card + .wp-block-group.is-style-tile-card {
  margin-block-start: var(--card-gap);
}

/* Panel: navy (`panel-navy`): a rounded navy box with white text for a highlighted block of
   content (title, text, a list). A list of 5 items or more runs in two columns from 48rem. */
.wp-block-group.is-style-panel-navy {
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border-radius: var(--radius);
  background-color: var(--wp--preset--color--brand);
  color: var(--wp--preset--color--brand-foreground);
}

.is-style-panel-navy > * {
  margin-block: 0;
}

.is-style-panel-navy > * + * {
  margin-block-start: 0.75rem;
}

.is-style-panel-navy :is(h2, h3, h4) {
  color: inherit;
  font-size: var(--fs-h3);
}

.is-style-panel-navy :is(p, li) {
  color: color-mix(in srgb, var(--wp--preset--color--brand-foreground) 85%, transparent);
}

.is-style-panel-navy a:not(.wp-element-button) {
  color: var(--wp--preset--color--brand-foreground);
  text-underline-offset: 0.2em;
}

.is-style-panel-navy .wp-block-list {
  padding-inline-start: 1.25rem;
}

.is-style-panel-navy .wp-block-list li + li {
  margin-block-start: 0.375rem;
}

@media (min-width: 48rem) {
  .is-style-panel-navy .wp-block-list:has(> li:nth-child(5)) {
    column-gap: 2.5rem;
    columns: 2;
  }

  .is-style-panel-navy .wp-block-list:has(> li:nth-child(5)) li {
    break-inside: avoid;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-style-steps > * {
    transition: none;
  }
}

/* Feature cards have their picture on top, so a Grid: 3 columns of them goes to three from 64rem
   (other grid-3 cards wait until 75rem). */
@media (min-width: 64rem) {
  .wp-block-group.is-style-grid-3:has(> .is-style-feature-card) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* No grey behind a picked photo: the grey frame of person, profile and researcher-page photos is
   only for the empty slot (in the editor). A "Fit (no crop)" image shows on the card's own white. */
:is(.person-card__head, .is-style-profile-card, .profile-aside) > .wp-block-image:has(img[src]) {
  background: none;
}
