@font-face {
  font-family: 'Joscelyn';
  src: url('/assets/fonts/Joscelyn.woff2');
}

:where(.layout-will) h2 {
  text-align: right;
}

:where(.layout-will) main {
  background-color: #fbf2e1;
}

.will-body {
  line-height: 2em;
  transition: opacity 0.1s ease;
  white-space: nowrap;

  &:where([data-script='secretary-hand']) {
    font-family: 'Joscelyn';
  }

  &:where([data-script='round-hand']) {
    font-family: 'Pinyon Script';
    font-size: 1.5em;
  }

  &.modern {
    font-family: inherit;
    letter-spacing: 2px;
    font-size: inherit;
  }
}

.font-toggle {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.5rem;
  font-size: 1.4rem;
  color: #5a4020;
  cursor: pointer;
  user-select: none;

  & input[type='checkbox'] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
  }

  & .toggle-label {
    transition: opacity 0.2s;
  }

  & .toggle-label--secretary {
    opacity: 1;
  }

  & .toggle-label--modern {
    opacity: 0.45;
  }

  &:has(input:checked) .toggle-label--secretary {
    opacity: 0.45;
  }

  &:has(input:checked) .toggle-label--modern {
    opacity: 1;
  }
}

.toggle-pill {
  position: relative;
  width: 4.4rem;
  height: 2.4rem;
  background: #c9a05a;
  border-radius: 9999px;
  transition: background 0.1s;
  flex-shrink: 0;

  &::after {
    content: '';
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    width: 1.8rem;
    height: 1.8rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.1s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }

  .font-toggle:has(input:checked) & {
    background: #7a9e7e;

    &::after {
      transform: translateX(2rem);
    }
  }
}
