/* An Embed in result copy (GLOSSARY.md "Embed"), written by EmbedMarkup: the frame fills a container as wide as the
   copy, at the ratio the creator pasted. */
.embed {
    display: block;
    width: 100%;
    margin: 1rem 0;
}

.embed > iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.embed-16x9 {
    aspect-ratio: 16 / 9;
}

.embed-4x3 {
    aspect-ratio: 4 / 3;
}

.embed-1x1 {
    aspect-ratio: 1 / 1;
}

/* A portrait video (a Short) stays phone-sized and centred instead of filling a desktop screen */
.embed-9x16 {
    aspect-ratio: 9 / 16;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* In the admin's score setup an embed is named where it sits, never loaded */
.embed-preview {
    display: inline-block;
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    border: 1px dashed var(--md-sys-color-outline);
    border-radius: 4px;
}

/* A booking calendar: as wide as the copy and tall enough to book in without scrolling inside it, until the frame
   reports its height and the embed script sets that. Until its consent is there the frame has no address and stays
   out of the layout; the placeholder beside it says why. */
.embed-calendar > iframe {
    height: 720px;
}

.embed-calendar > iframe:not([src]) {
    display: none;
}

.embed-consent {
    display: block;
    padding: 1rem;
    border: 1px dashed var(--md-sys-color-outline);
    border-radius: 4px;
}

/* Gone once the calendar loads: the embed script sets hidden, which display: block above would otherwise override */
.embed-consent[hidden] {
    display: none;
}

.embed-consent-text {
    display: block;
    margin-bottom: 0.75rem;
}

.embed-open {
    display: inline-block;
    margin-top: 0.5rem;
}
