/* SUBSTACK POPUP */
.substack-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* no backdrop-filter here either, see lightbox.css */
    background: rgba(24, 18, 19, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 200; /* above the sidebar (101) and the index button */
}
.substack-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.substack-dialog {
    position: relative;
    width: min(480px, calc(100vw - 3rem));
    background: white;
    border-radius: 0.25rem;
    /* the embed paints its own white card — clip it to our rounded corners */
    overflow: hidden;
    padding: 2rem 1rem 1rem;
}
.substack-dialog iframe {
    display: block;
    width: calc(100% - 1rem);
    height: calc(100% - 3rem);
    border: 0;
    margin: auto;
}
.substack-close {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 2rem;
    line-height: 1;
    color: #251C1D;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: sans-serif;
    z-index: 1; /* over the iframe */
}

/* the embed stacks its form vertically on narrow screens, so it needs the height */
@media only screen and (max-width: 600px) {
    .substack-dialog {
        width: min(320px, calc(100vw - 2rem));
    }
}
