/*
 Zvezda.bg Gutenberg / Pattern editor
*/

/* Main editor canvas */
body.block-editor-iframe__body {
    padding: 30px !important;
}

/* kill full viewport sections only in editor */
body.block-editor-iframe__body section,
body.block-editor-iframe__body .min-h-screen {
    min-height: auto !important;
}

/* force content to fit */
body.block-editor-iframe__body .wp-block,
body.block-editor-iframe__body .is-root-container > * {
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* hero images */
body.block-editor-iframe__body img {
    max-width: 100% !important;
    height: auto !important;
}

/* stop horizontal crop */
body.block-editor-iframe__body * {
    box-sizing: border-box;
}

body.block-editor-iframe__body {
    overflow-x: hidden !important;
}

/* FINAL: prevent horizontal crop inside Gutenberg editor canvas */
body.block-editor-iframe__body,
body.block-editor-iframe__body .editor-styles-wrapper,
body.block-editor-iframe__body .is-root-container {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Force every inner frontend container to fit editor width */
body.block-editor-iframe__body section,
body.block-editor-iframe__body section *,
body.block-editor-iframe__body .wp-block,
body.block-editor-iframe__body .wp-block *,
body.block-editor-iframe__body [class*="max-w-"],
body.block-editor-iframe__body [class*="w-screen"],
body.block-editor-iframe__body [class*="min-w-"] {
    max-width: 100% !important;
}

/* Disable frontend viewport tricks in editor */
body.block-editor-iframe__body [class*="w-screen"] {
    width: 100% !important;
}

body.block-editor-iframe__body [class*="-translate"],
body.block-editor-iframe__body [class*="translate-x"],
body.block-editor-iframe__body [class*="-left-"],
body.block-editor-iframe__body [class*="-right-"] {
    transform: none !important;
    left: auto !important;
    right: auto !important;
}

/* Selected pattern should behave like a normal card */
body.block-editor-iframe__body .block-editor-block-list__block {
    max-width: 960px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow: hidden !important;
}

/* Inner images must not create horizontal scroll */
body.block-editor-iframe__body img,
body.block-editor-iframe__body picture,
body.block-editor-iframe__body video {
    max-width: 100% !important;
    height: auto !important;
}

/* Make hero preview compact */
body.block-editor-iframe__body section:first-of-type {
    border-radius: 12px !important;
    overflow: hidden !important;
}

/* ZVEZDA Gutenberg visual repair */

/* Editor only - disable frontend hero behaviour */
.editor-styles-wrapper section {
    min-height: auto !important;
    height: auto !important;
}

/* Hero images visible, not cropped */
.editor-styles-wrapper img {
    object-fit: contain !important;
    object-position: center center !important;
    height: auto !important;
}

/* kill absolute fullscreen layers */
.editor-styles-wrapper .absolute,
.editor-styles-wrapper [class*="absolute"] {
    position: relative !important;
}

/* restore hero text flow */
.editor-styles-wrapper .relative {
    position: relative !important;
}

/* comfortable editing card */
.editor-styles-wrapper .wp-block {
    max-width: 1100px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

