/* Include nested heading spans, form controls and the guest page's sibling dock. */
:is(.yalda, .tribute)[data-davati-envelope],
:is(.yalda, .tribute)[data-davati-envelope] *,
.guest-custom-template-page:has(:is(.yalda, .tribute)[data-davati-envelope]) .invite-floating-menu,
.guest-custom-template-page:has(:is(.yalda, .tribute)[data-davati-envelope]) .invite-floating-menu * {
  letter-spacing: 0 !important;
}

/* Keep keyboard focus in the invitation's reading order without drawing a frame. */
:is(.yalda, .tribute)[data-davati-envelope] :focus,
.guest-custom-template-page:has(:is(.yalda, .tribute)[data-davati-envelope]) .invite-floating-menu :focus {
  outline: none !important;
  box-shadow: none !important;
}

:is(.yalda, .tribute)[data-davati-envelope] :is(a, button, summary):focus-visible {
  text-decoration: underline;
  text-underline-offset: .26em;
}

:is(.yalda, .tribute)[data-davati-envelope] :is(button, input, textarea, select):focus-visible {
  filter: brightness(.9);
}

:is(.yalda, .tribute)[data-davati-envelope] .invite-input:focus-visible {
  border-color: var(--line);
}

.guest-custom-template-page:has(:is(.yalda, .tribute)[data-davati-envelope]) .invite-floating-menu :is(button, a):focus-visible {
  filter: brightness(.85);
}

@media (max-width: 650px) {
  .tribute[data-davati-envelope] .scene { container-type: inline-size; }
  .tribute[data-davati-envelope] .art {
    /* Scale the portrait artwork and its viewing distance together. */
    --art-width: min(74cqw, 34svh, 290px);
    width: var(--art-width);
    height: auto;
    aspect-ratio: 4 / 5;
    perspective: calc(2.2 * var(--art-width));
    flex: none;
  }
  .tribute.mother[data-davati-envelope] .leaf { background-position: center; }
}
