/* Keep body images within the content-page text column. */
body.node--type-content-page .content-page-detail__body .field--name-body img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: clamp(2.25rem, 5vw, 4rem) 0;
  border-radius: clamp(0.8rem, 2vw, 1.25rem);
  box-shadow: 0 18px 48px rgba(44, 37, 27, 0.14);
  transform: none;
}

body.node--type-content-page .content-page-detail__body .field--name-body figure,
body.node--type-content-page .content-page-detail__body .field--name-body picture {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
}

body.node--type-content-page .content-page-detail__body .field--name-body figure img,
body.node--type-content-page .content-page-detail__body .field--name-body picture img {
  margin-inline: 0;
}

/* Friendly custom 404 page. */
.content-page-detail:has(.yyt-404) > .content-page-hero {
  display: none;
}

.content-page-detail:has(.yyt-404) > .content-page-detail__body {
  padding-top: clamp(2rem, 6vw, 5rem);
}

.yyt-404 {
  position: relative;
  overflow: hidden;
  max-width: 76rem;
  margin: clamp(1rem, 4vw, 3rem) auto;
  padding: clamp(3rem, 8vw, 7rem) clamp(1.25rem, 6vw, 5rem);
  border: 1px solid rgba(151, 105, 32, 0.2);
  border-radius: clamp(1.5rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 88% 12%, rgba(189, 143, 69, 0.2), transparent 28rem),
    linear-gradient(145deg, #fffdf8 0%, #f8f1e5 100%);
  text-align: center;
}

.yyt-404::before,
.yyt-404::after {
  position: absolute;
  color: rgba(137, 91, 23, 0.1);
  font-family: Georgia, serif;
  line-height: 1;
  pointer-events: none;
}

.yyt-404::before {
  content: "404";
  top: -0.18em;
  left: -0.08em;
  font-size: clamp(8rem, 24vw, 20rem);
  font-weight: 700;
}

.yyt-404::after {
  content: "✦";
  right: 6%;
  bottom: 4%;
  font-size: clamp(4rem, 10vw, 8rem);
}

.yyt-404__inner {
  position: relative;
  z-index: 1;
  max-width: 47rem;
  margin-inline: auto;
}

.yyt-404__code {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  margin-bottom: 1.25rem;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  background: #8c5d19;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.yyt-404 h1 {
  margin: 0 0 1rem;
  color: #2f2922;
  font-size: clamp(2.35rem, 7vw, 5rem);
  line-height: 1.02;
}

.yyt-404 p {
  max-width: 38rem;
  margin: 0 auto;
  color: #5e554b;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.yyt-404__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 2rem;
}

.yyt-404__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.35rem;
  border: 1px solid #8c5d19;
  border-radius: 999px;
  background: #8c5d19;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.yyt-404__button--secondary {
  background: transparent;
  color: #6f4710;
}

body.node--type-content-page .content-page-detail__body .field--name-body .yyt-404__button {
  color: #fff;
}

body.node--type-content-page .content-page-detail__body .field--name-body .yyt-404__button--secondary {
  color: #6f4710;
}

.yyt-404__button:hover,
.yyt-404__button:focus-visible {
  transform: translateY(-2px);
  background: #6f4710;
  color: #fff;
}

body.node--type-content-page .content-page-detail__body .field--name-body .yyt-404__button:hover,
body.node--type-content-page .content-page-detail__body .field--name-body .yyt-404__button:focus-visible {
  color: #fff;
}

.yyt-404__button:focus-visible {
  outline: 3px solid rgba(140, 93, 25, 0.35);
  outline-offset: 3px;
}

@media (max-width: 35rem) {
  .yyt-404__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .yyt-404__button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .yyt-404__button {
    transition: none;
  }
}
