/**
 * Page Editor Styles
 *
 * Applied only when editing pages for a full-width editing experience.
 */

.editor-styles-wrapper {
  padding: 0 !important;
}

.is-root-container {
  padding: 0 !important;
  max-width: none !important;
}

/* Remove title wrapper space - content starts at top */
.editor-visual-editor__post-title-wrapper {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Remove gap between top-level sections only */
.is-root-container > .wp-block-group,
.is-root-container > .wp-block-cover,
.is-root-container > section,
.is-root-container > .alignfull {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Hide decorative/animation elements in editor */
/* The LLM adds this class to empty divs used for CSS animations/backgrounds */
/* WordPress wraps blocks in extra divs, so we need :has() to hide the parent wrapper too */
.editor-styles-wrapper .miles-editor-hidden,
.editor-styles-wrapper :has(> .miles-editor-hidden) {
  display: none !important;
}

/* Reduce extra space WordPress adds after content for block insertion */
/* WordPress adds a ::after pseudo-element on body for click area - minimize it */
.editor-styles-wrapper::after {
      height: 100px !important;
      min-height: 100px !important;
    }

    /* ============================================
       EDITOR TYPOGRAPHY FALLBACK
       (Moved from styles.css Editor Compatibility)
       ============================================ */
    .editor-styles-wrapper {
      font-family: var(--font-body);
      font-size: 16px;
      line-height: 1.6;
      color: var(--black);
      background: var(--paper);
    }

    /* ============================================
       DISABLE ANIMATIONS IN EDITOR
       ============================================ */
    .editor-styles-wrapper .animate-on-scroll {
      opacity: 1 !important;
      transform: none !important;
      transition: none !important;
    }

    /* ============================================
       GRID/FLEX CONTAINER BLOCK SPACING RESET
       Reset WordPress's default margin-top on blocks
       inside grid/flex containers so layout renders
       as designed.
       ============================================ */
    .editor-styles-wrapper .hero-main > .block-editor-block-list__block,
    .editor-styles-wrapper .hero-content > .block-editor-block-list__block,
    .editor-styles-wrapper .hero-cta-group > .block-editor-block-list__block,
    .editor-styles-wrapper .hero-image-frame > .block-editor-block-list__block,
    .editor-styles-wrapper .hero-footer > .block-editor-block-list__block,
    .editor-styles-wrapper .hero-socials > .block-editor-block-list__block,
    .editor-styles-wrapper .ticker-track > .block-editor-block-list__block,
    .editor-styles-wrapper .news-grid > .block-editor-block-list__block,
    .editor-styles-wrapper .news-card > .block-editor-block-list__block,
    .editor-styles-wrapper .news-card-content > .block-editor-block-list__block {
      margin-top: 0 !important;
    }

    .editor-styles-wrapper .card-info > .block-editor-block-list__block,
    .editor-styles-wrapper .cards-grid > .block-editor-block-list__block,
    .editor-styles-wrapper .guide-card > .block-editor-block-list__block,
    .editor-styles-wrapper .guides-grid > .block-editor-block-list__block,
    .editor-styles-wrapper .community-content > .block-editor-block-list__block,
    .editor-styles-wrapper .community-actions > .block-editor-block-list__block,
    .editor-styles-wrapper .collage-grid > .block-editor-block-list__block,
    .editor-styles-wrapper .newsletter-card > .block-editor-block-list__block,
    .editor-styles-wrapper .newsletter-form > .block-editor-block-list__block,
    .editor-styles-wrapper .footer-main > .block-editor-block-list__block,
    .editor-styles-wrapper .footer-nav > .block-editor-block-list__block,
    .editor-styles-wrapper .footer-bottom > .block-editor-block-list__block {
      margin-top: 0 !important;
    }

    /* ============================================
       EDITOR ABSOLUTE POSITIONING FIXES
       WordPress's block wrappers break absolute
       positioning - force it back.
       ============================================ */
    .editor-styles-wrapper .block-editor-block-list__block.hero-bg-block,
    .editor-styles-wrapper .block-editor-block-list__block.news-bg-shape,
    .editor-styles-wrapper .block-editor-block-list__block.community-bg-shape,
    .editor-styles-wrapper .block-editor-block-list__block.collage-sticker {
      position: absolute !important;
    }

    /* ============================================
       EDITOR MARGIN PARITY
       Doubled class selectors override WordPress
       default flow-layout margins.
       ============================================ */
    .post-meta-bar.post-meta-bar { margin-block-end: var(--space-md); }
    .post-title.post-title { margin-block-end: var(--space-md); }
    .single-post-title.single-post-title { margin-block-end: var(--space-md); }
    .post-title-hero.post-title-hero { margin-block-start: 0; margin-block-end: 0; }
    .page-header.page-header { margin-block-end: var(--space-sm); }
    .page-subtitle.page-subtitle { margin-block-start: var(--space-sm); }
    .post-content-section.post-content-section { margin-block-start: 0; margin-block-end: 0; }
    .post-content-body.post-content-body { margin-block-start: 0; margin-block-end: 0; }

    /* Single post template editor fixes */
    .editor-styles-wrapper .block-editor-block-list__block.featured-image-frame::before {
      position: absolute !important;
    }
    .editor-styles-wrapper .block-editor-block-list__block.single-post-title::after {
      position: absolute !important;
    }
    .editor-styles-wrapper .block-editor-block-list__block.post-content-wrapper h2::after {
      position: absolute !important;
    }

    /* Post title hero editor fixes */
    .editor-styles-wrapper .block-editor-block-list__block.post-title-hero-tape {
      position: absolute !important;
    }
    .editor-styles-wrapper .post-title-hero-title.wp-block-post-title::after {
      position: absolute !important;
    }

    /* Featured image gallery editor fixes */
    .editor-styles-wrapper .block-editor-block-list__block.featured-image-gallery-accent {
      position: absolute !important;
    }

    /* Post content editor fixes */
    .editor-styles-wrapper .post-content-pull-quote::before,
    .editor-styles-wrapper .post-content-pull-quote::after {
      position: absolute !important;
    }
    .editor-styles-wrapper .post-content-body hr::before {
      position: absolute !important;
    }

    /* Editor flex container fixes - tags and navigation */
    .editor-styles-wrapper .post-tags-list > .block-editor-block-list__block,
    .editor-styles-wrapper .post-navigation > .block-editor-block-list__block,
    .editor-styles-wrapper .post-tags-sticker-list > .block-editor-block-list__block,
    .editor-styles-wrapper .post-nav-brutalist-link > .block-editor-block-list__block,
    .editor-styles-wrapper .post-nav-brutalist-direction > .block-editor-block-list__block {
      margin-top: 0 !important;
    }
