/* ==========================================================================
 *   Obsidian Publish – Native Transclusions (seamless embeds)
 *   Activation: add `cssclasses: embed-clean` to a page’s frontmatter.
 *   Goal: make embedded notes render exactly like inline/native content.
 *   ========================================================================== */

/* 1) Hide embed chrome (title + link icon) */
.embed-clean :where(.markdown-embed-title, .markdown-embed .markdown-embed-link) {
    display: none !important;
}

/* 2) Remove all container styling & scrolling so margins can collapse natively */
.embed-clean :where(.markdown-embed, .internal-embed) {
    border: 0 !important;
    box-shadow: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    max-height: none !important;
}

/* Publish wraps content in `.markdown-embed-content` — reset that too */
.embed-clean .markdown-embed-content {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    overflow: visible !important;
    max-height: none !important;
}

/* 3) Preserve native typography & spacing inside embeds
 *      (No p/li/heading tweaks → true “as-if-inline” behavior) */

/* 4) Ensure no artificial gaps around embeds (themes sometimes add these) */
.embed-clean :where(.markdown-embed, .internal-embed) {
    margin-block: 0 !important;
}
.embed-clean > :where(.markdown-embed, .internal-embed):first-child {
    margin-block-start: 0 !important;
}
.embed-clean > :where(.markdown-embed, .internal-embed):last-child {
    margin-block-end: 0 !important;
}

/* 5) Nested embeds: keep them seamless as well */
.embed-clean .markdown-embed-content :where(.markdown-embed, .internal-embed) {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    max-height: none !important;
}

/* 6) Media inside embeds should behave like native inline media */
.embed-clean .markdown-embed-content img,
.embed-clean .markdown-embed-content video,
.embed-clean .markdown-embed-content canvas,
.embed-clean .markdown-embed-content svg {
    max-width: 100%;
    height: auto;
}

/* 7) Safety: don’t alter callouts/footnotes/backlinks spacing—inherit defaults */
.embed-clean .markdown-embed-content .callout,
.embed-clean .markdown-embed-content .footnotes,
.embed-clean .markdown-embed-content .backlink {
    margin-block: revert;
    padding: revert;
    border: revert;
    background: revert;
}
