.dmp-image-label-wrap {
    position: relative;
    display: inline-block;
    width: max-content;
    max-width: 100%;
    vertical-align: top;
}

.dmp-image-label-wrap img {
    display: block;
    max-width: 100%;
    height: auto;
}

.dmp-hero .dmp-image-label-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
}

.dmp-hero .dmp-image-label-wrap img {
    width: 100%;
}

.dmp-hero .dmp-image-label {
    z-index: 4;
}

.dmp-hero.dmp-has-image-label .dmp-hero__overlay {
    pointer-events: none;
}

.dmp-image-label-source[hidden] {
    display: none !important;
}

.dmp-image-label {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 2;
    box-sizing: border-box;
    max-width: calc(100% - 1.5rem);
    padding: 0.35em 0.7em;
    border: 0;
    border-radius: 4px;
    margin: 0;
    background: var(--wp--preset--color--black);
    color: var(--wp--preset--color--white);
    font-family: var(--wp--preset--font-family--secondary);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    pointer-events: none;
}

.dmp-image-label--has-info {
    pointer-events: auto;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.dmp-image-label--has-info:hover,
.dmp-image-label--has-info:focus-visible {
    background: var(--wp--preset--color--secondary);
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 2px;
}

.dmp-image-label-dialog {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.dmp-image-label-dialog[hidden] {
    display: none !important;
}

.dmp-image-label-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: var(--wp--preset--color--secondary);
    opacity: 0.55;
    cursor: pointer;
}

.dmp-image-label-dialog__panel {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(100%, 30rem);
    max-height: min(78vh, 32rem);
    overflow: auto;
    padding: 1.15rem 1.15rem 1.4rem;
    border-radius: 12px 12px 0 0;
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--black);
}

.dmp-image-label-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dmp-image-label-dialog__title {
    margin: 0;
    font-family: var(--wp--preset--font-family--secondary);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.dmp-image-label-dialog__close {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--wp--preset--color--black);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.dmp-image-label-dialog__close span {
    pointer-events: none;
}

.dmp-image-label-dialog__close:hover,
.dmp-image-label-dialog__close:focus-visible {
    background: var(--wp--preset--color--light);
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 2px;
}

.dmp-image-label-dialog__body {
    font-family: var(--wp--preset--font-family--secondary);
    font-size: var(--wp--preset--font-size--base);
    line-height: 1.5;
}

.dmp-image-label-dialog__body p {
    margin: 0 0 0.75rem;
}

.dmp-image-label-dialog__body p:last-child {
    margin-bottom: 0;
}

body.dmp-image-label-dialog-open {
    overflow: hidden;
}

@media (min-width: 640px) {
    .dmp-image-label-dialog {
        align-items: center;
        padding: 1.5rem;
    }

    .dmp-image-label-dialog__panel {
        border-radius: 8px;
    }
}

.block-editor-block-list__block.dmp-has-image-label figure {
    display: grid;
    grid-template-columns: minmax(0, max-content);
    justify-content: center;
    max-width: 100%;
}

.block-editor-block-list__block.dmp-has-image-label figure > img,
.block-editor-block-list__block.dmp-has-image-label figure > .components-resizable-box__container {
    grid-column: 1;
    grid-row: 1;
    max-width: 100%;
}

.block-editor-block-list__block.dmp-has-image-label figure > figcaption {
    grid-column: 1;
    grid-row: 2;
}

.block-editor-block-list__block.dmp-has-image-label .components-resizable-box__container {
    position: relative;
}

.block-editor-block-list__block.dmp-has-image-label figure::after,
.block-editor-block-list__block.dmp-has-image-label .components-resizable-box__container::after {
    box-sizing: border-box;
    max-width: calc(100% - 1.5rem);
    padding: 0.35em 0.7em;
    border-radius: 4px;
    background: var(--wp--preset--color--black);
    color: var(--wp--preset--color--white);
    font-family: var(--wp--preset--font-family--secondary);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    pointer-events: none;
    content: var(--dmp-image-label);
}

.block-editor-block-list__block.dmp-has-image-label figure::after {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    align-self: end;
    position: relative;
    margin: 0 0.75rem 0.75rem 0;
    z-index: 2;
}

.block-editor-block-list__block.dmp-has-image-label .components-resizable-box__container::after {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 2;
}

.block-editor-block-list__block.dmp-has-image-label figure:has(.components-resizable-box__container)::after {
    content: none;
}
