html, body {
    margin: 0;
    padding: 0;
}

.wagtail-fedit-buttons {
    display: flex;
}

.wagtail-fedit-adapter-wrapper:has(> .wagtail-fedit-buttons:only-child) {
    position: relative;
    min-height: 24px;
}
.wagtail-fedit-field_bg_image {
    display: inline-flex;
}
.wagtail-fedit-adapter-wrapper:has(> .wagtail-fedit-buttons a:hover)::after,
.wagtail-fedit-adapter-wrapper:has(> .wagtail-fedit-buttons button:hover)::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.05);
    outline: 2px solid #333333;
    pointer-events: none;
    z-index: 300;
}
.wagtail-fedit-adapter-wrapper:not(.wagtail-fedit-block):has(.wagtail-fedit-adapter-wrapper) > .wagtail-fedit-buttons {
    right: 30px;
}
.wagtail-fedit-buttons {
    display: flex;
    gap: 0.5em;
    border-radius: 0.5em;
    position: absolute;
    right: 0;
    z-index: 1;
}

.wagtail-fedit-adapter-wrapper.wagtail-fedit-inline {
    display: flex;
    flex-direction: row;
}

.wagtail-fedit-inline > .wagtail-fedit-buttons {
    display: inline-block;
    position: relative;
    margin-left: 0.25rem;
    margin-right: 0.25rem;
    vertical-align: top;
    left: unset;
    right: unset;
}

.wagtail-fedit-adapter-wrapper .wagtail-fedit-adapter-wrapper > .wagtail-fedit-buttons {
    flex-direction: column-reverse;
}

/* .wagtail-fedit-field-wrapper > .wagtail-fedit-buttons { */
    /* position: relative; */
/* } */
.wagtail-fedit-adapter-wrapper > .wagtail-fedit-buttons .wagtail-fedit-toolbar-button,
.wagtail-fedit-adapter-wrapper > .wagtail-fedit-buttons button {
    vertical-align: middle;
}
.wagtail-fedit-buttons .wagtail-fedit-toolbar-button,
.wagtail-fedit-buttons button {
    border: none;
    background-color: rgba(0, 0, 0, 0.85);
    padding: 0.1em;
    border-radius: 0.25em;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}
.wagtail-fedit-buttons button,
.wagtail-fedit-buttons button svg,
.wagtail-fedit-buttons > a,
.wagtail-fedit-buttons > a svg,
.wagtail-fedit-buttons > a:hover svg,
.wagtail-fedit-buttons > a:visited,
.wagtail-fedit-buttons > a:hover,
.wagtail-fedit-buttons > a:active{
    color: white !important;
}
.wagtail-fedit-buttons svg {
    vertical-align: middle;
    color: white;
}
body:has(.wagtail-fedit-modal) {
    overflow: hidden;
}
/* *:target::after { */
    /* content: ''; */
    /* display: block; */
    /* position: absolute; */
    /* top: 0; */
    /* left: 0; */
    /* width: 100%; */
    /* height: 100%; */
    /* outline: 3px solid red; */
    /* pointer-events: none; */
    /* z-index: 300; */
/* } */
.wagtail-fedit-modal-wrapper:has(.wagtail-fedit-modal > :is(*)) {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 400;
    overflow: auto;
}
.wagtail-fedit-modal-wrapper .wagtail-fedit-modal {
    position: relative;
    min-width: max(60dvw, 15rem);
    min-height: max(60dvh, 15rem);
    outline: 2px solid #333333;
    outline-offset: -1px;
    box-shadow: 0 0 1em rgba(0, 0, 0, 0.5);
    border-radius: 0.25em;
    background-color: white;
    display: flex;
    flex-direction: column;
    gap: 1em;
    max-width: 80%;
    max-height: 80%;
    overflow: hidden;
    display: flex;
}
.wagtail-fedit-modal-wrapper:has(.wagtail-fedit-modal.fedit-full) {
    z-index: 9999;
}
.wagtail-fedit-modal-wrapper .wagtail-fedit-modal.fedit-full {
    height: 100%;
    width: 100%;
    max-width: unset;
    max-height: unset;
}
.wagtail-fedit-modal-wrapper .wagtail-fedit-modal.fedit-large {
    height: 100%;
    width: 100%;
}
@media (min-width: 768px) {
    .wagtail-fedit-modal-wrapper .wagtail-fedit-modal:not(.fedit-large, .fedit-full) {
        margin-top: -5%;
    }
}
@media (max-width: 1400px) {
    .wagtail-fedit-modal-wrapper {
        z-index: 9999;
    }
    .wagtail-fedit-modal-wrapper .wagtail-fedit-modal {
        max-width: 80%;
        max-height: 80%;
        width: 100%;
        height: 100%;
    }
}
@media (max-width: 1100px) {
    .wagtail-fedit-modal-wrapper .wagtail-fedit-modal {
        max-width: 90%;
        max-height: 90%;
    }
}
@media (max-width: 768px) {
    .wagtail-fedit-modal-wrapper .wagtail-fedit-modal {
        margin: 0;
        max-width: 100%;
        max-height: 100%;
    }
}
.wagtail-fedit-modal-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
}
.wagtail-fedit-modal-wrapper .wagtail-fedit-close-button {
    position: absolute;
    right: 0;
    top: 0;
    text-align: center;
    vertical-align: middle;
    padding: 0;
    width: 28px;
    height: 28px;
    font-size: 24px;
    font-size: 24px;
    border: none;
    border-radius: 0 0 0 0.5em;
    border: 1px solid rgb(172, 27, 27);
    border-right-width: 0;
    border-top-width: 0;
    background-color: rgb(255, 255, 255);
    color: rgb(172, 27, 27);
    cursor: pointer;
}
.wagtail-fedit-modal-wrapper .wagtail-fedit-close-button:hover {
    background-color: rgb(172, 27, 27);
    color: rgb(235, 235, 235);
}

.wagtail-fedit-banner-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 400;
    overflow: auto;
}
.wagtail-fedit-banner-modal iframe {
    min-height: 280px;
}