.rich-text {
  position: relative;
  background-color: rgb(var(--color-background));
}

.rich-text .block-button-group .button {
  white-space: normal;
}

.rich-text__background-image {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  user-select: none;
}

.rich-text__background-image img,
.rich-text__background-image svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

a.rich-text__link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
}

.rich-text__content {
  position: relative;
  z-index: 3;
  pointer-events: none;
}

.rich-text__content > * {
  pointer-events: auto;
}

/* BWE Archive: readable policy, story, and campaign copy as a public dossier. */
.bwe-text-dossier {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: rgb(var(--color-text));
  background:
    linear-gradient(rgb(var(--color-text) / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--color-text) / 4%) 1px, transparent 1px),
    rgb(var(--color-background));
  background-size: 100% 4px, 34px 100%, auto;
  border-block: 1px solid rgb(var(--color-text) / 34%);
}

.bwe-text-dossier::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, rgb(0 0 0 / 16%), transparent 24%, transparent 76%, rgb(0 0 0 / 16%));
}

.bwe-text-dossier .rich-text__background-image {
  background: #090a0a;
}

.bwe-text-dossier .rich-text__background-image::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgb(255 255 255 / 7%) 4px),
    rgb(0 0 0 / 38%);
}

.bwe-text-dossier .rich-text__background-image img,
.bwe-text-dossier .rich-text__background-image svg {
  filter: grayscale(1) contrast(1.08);
}

.bwe-text-dossier .rich-text__content {
  width: min(100%, 1120px);
  margin-inline: auto;
  background: rgb(var(--color-background) / 91%);
  border: 1px solid rgb(var(--color-text) / 42%);
  box-shadow: 10px 10px 0 rgb(0 0 0 / 20%);
  backdrop-filter: blur(6px);
}

.bwe-text-dossier__header {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  padding-block-end: 16px;
  border-block-end: 1px solid rgb(var(--color-text) / 34%);
}

.bwe-text-dossier__header > div {
  display: grid;
  gap: 5px;
}

.bwe-text-dossier__header div > span,
.bwe-text-dossier__status {
  font-family: var(--font-body-family);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.14em;
}

.bwe-text-dossier__header div > span {
  opacity: 0.66;
}

.bwe-text-dossier__header strong {
  font-family: var(--font-heading-family);
  font-size: clamp(21px, 2.4vw, 34px);
  line-height: 1.08;
  letter-spacing: 0.04em;
}

.bwe-text-dossier__status {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: #ff3344;
  border: 1px solid #ff3344;
}

.bwe-text-dossier .rich-text__content > :is(.block-heading, h1, h2, h3) {
  max-width: 24ch;
  font-family: var(--font-heading-family);
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.08;
  text-wrap: balance;
  letter-spacing: 0.025em;
}

.bwe-text-dossier .rich-text__content > :is(.block-rich-text, .rte) {
  width: min(100%, 72ch);
  font-size: max(17px, 1em);
  line-height: 1.72;
}

.bwe-text-dossier .rich-text__content :is(p, li) {
  font-size: inherit;
  line-height: inherit;
}

.bwe-text-dossier .rich-text__content :is(ul, ol) {
  padding-inline-start: 1.5em;
}

.bwe-text-dossier .rich-text__content :is(a:not(.button)) {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  text-decoration-color: #ff3344;
}

.bwe-text-dossier .block-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.bwe-text-dossier .block-button-group .button {
  min-width: 150px;
  min-height: 50px;
  padding-inline: 20px;
  font-size: 16px;
  border-radius: 0;
}

.bwe-text-dossier .block-button-group .button:hover,
.bwe-text-dossier .block-button-group .button:focus-visible {
  box-shadow: inset 0 -4px 0 #ff3344;
}

.bwe-text-dossier .decorative-line {
  background: repeating-linear-gradient(0deg, rgb(var(--color-text) / 62%) 0 7px, transparent 7px 12px);
}

.bwe-text-dossier .rich-text__link:focus-visible {
  outline: 3px solid #ff3344;
  outline-offset: -6px;
}

@media (max-width: 959px) {
  .bwe-text-dossier .rich-text__content {
    width: calc(100% - 28px);
    padding: 24px 20px;
    box-shadow: 7px 7px 0 rgb(0 0 0 / 20%);
  }

  .bwe-text-dossier__header {
    align-items: flex-start;
  }

  .bwe-text-dossier__header div > span,
  .bwe-text-dossier__status {
    font-size: 14px;
  }

  .bwe-text-dossier .rich-text__content > :is(.block-rich-text, .rte) {
    font-size: 17px;
    line-height: 1.68;
  }
}

@media (max-width: 599px) {
  .bwe-text-dossier .rich-text__content {
    width: calc(100% - 20px);
    padding: 20px 14px;
  }

  .bwe-text-dossier__header {
    display: grid;
    gap: 12px;
  }

  .bwe-text-dossier__status {
    justify-self: start;
  }

  .bwe-text-dossier .block-button-group,
  .bwe-text-dossier .block-button-group .button {
    width: 100%;
  }
}
