/**
 * Block Overrides
 * Remove color and border styles from core blocks inside ARTBID blocks
 */

/* ==========================================
   ARTBID BLOCKS - CORE BLOCK OVERRIDES
   Remove any color/border styles applied to core blocks
   ========================================== */

/* Inner Hero - Override all inline styles */
.inner-hero p,
.inner-hero h1,
.inner-hero h2,
.inner-hero h3,
.inner-hero h4,
.inner-hero h5,
.inner-hero h6,
.inner-hero ul,
.inner-hero ol,
.inner-hero li,
.inner-hero figure,
.inner-hero img {
    border: none !important;
    border-radius: 0 !important;
}

/* Text Block - Override all inline styles */
.content-text-block p,
.content-text-block h1,
.content-text-block h2,
.content-text-block h3,
.content-text-block h4,
.content-text-block h5,
.content-text-block h6,
.content-text-block ul,
.content-text-block ol,
.content-text-block li,
.content-text-block figure,
.content-text-block img {
    border: none !important;
}

/* Pullquote - Override all inline styles */
.artbid-pullquote p,
.artbid-pullquote cite,
.artbid-pullquote blockquote {
    border: none !important;
}

/* Button Section - Override all inline styles */
.button-section .wp-block-button__link {
    /* Borders controlled by button styles, not user */
}


/* ==========================================
   REMOVE WORDPRESS COLOR CLASSES
   Strip out color classes that may be applied
   ========================================== */

/* Remove background color classes */
.inner-hero [class*="has-background"],
.content-text-block [class*="has-background"],
.artbid-pullquote [class*="has-background"] {
    background-color: transparent !important;
}

/* Remove text color classes (except buttons) */
.inner-hero p[class*="has-"][class*="-color"],
.inner-hero h1[class*="has-"][class*="-color"],
.inner-hero h2[class*="has-"][class*="-color"],
.inner-hero h3[class*="has-"][class*="-color"],
.inner-hero h4[class*="has-"][class*="-color"],
.inner-hero h5[class*="has-"][class*="-color"],
.inner-hero h6[class*="has-"][class*="-color"],
.content-text-block p[class*="has-"][class*="-color"],
.content-text-block h1[class*="has-"][class*="-color"],
.content-text-block h2[class*="has-"][class*="-color"],
.content-text-block h3[class*="has-"][class*="-color"],
.content-text-block h4[class*="has-"][class*="-color"],
.content-text-block h5[class*="has-"][class*="-color"],
.content-text-block h6[class*="has-"][class*="-color"] {
    color: inherit !important;
}

/* ==========================================
   REMOVE BORDER RADIUS AND WIDTH
   ========================================== */

/* Images in ARTBID blocks - no border radius unless specifically styled */
.inner-hero .wp-block-image img,
.content-text-block .wp-block-image img {
    border-radius: 0 !important;
}

/* Lists in ARTBID blocks - no borders */
.inner-hero .wp-block-list,
.content-text-block .wp-block-list {
    border: none !important;
}

/* ==========================================
   SPECIFICITY OVERRIDES
   Use !important to ensure these override inline styles
   ========================================== */

/* Remove any inline color styles */
.inner-hero [style*="color"],
.content-text-block [style*="color"],
.artbid-pullquote [style*="color"] {
    /* Let block-specific data-bg attributes handle colors */
}

/* Remove any inline background styles */
.inner-hero [style*="background"],
.content-text-block [style*="background"] {
    /* Let block-specific data-bg attributes handle backgrounds */
}

/* Remove any inline border styles */
.inner-hero [style*="border"],
.content-text-block [style*="border"],
.artbid-pullquote [style*="border"] {
    /* No custom borders allowed */
}

/* ==========================================
   WORDPRESS CORE LAYOUT FIXES
   ========================================== */

/* Remove unwanted spacing between all top-level blocks */
/* WordPress core adds spacing-8 by default to all children of .wp-site-blocks */
:where(.wp-site-blocks) > * {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}

/* Remove unwanted top margin on footer from WordPress core */
:where(.wp-site-blocks) > footer {
    margin-block-start: 0 !important;
}

/* Also remove from header if it has unwanted margin */
:where(.wp-site-blocks) > header {
    margin-block-start: 0 !important;
}

/* Remove unwanted top margin on main element */
:where(.wp-site-blocks) > main {
    margin-block-start: 0 !important;
}

/* Remove unwanted spacing between blocks in editor */
/* WordPress core adds spacing-8 between all blocks in flow layout */
.editor-styles-wrapper :root :where(.is-layout-flow) > * {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}

/* Allow blocks to define their own spacing using data-spacing attributes */
.editor-styles-wrapper [data-spacing] {
    /* Block-specific spacing controlled via data-spacing attribute */
}
