/* G-Utilities Framework - Main Entry Point */
/* Base: html-template/brixies/core_framework.css with gg- prefix (see scripts/prefix-core-framework.js) */

/* 1. Base: brixies core framework with --gg-* variables and .gg-theme-* */
@import url('./gg-core-framework.css');

/* 2. Plugin overrides (.theme-accent, .gg-container, spacing/fonts, admin-parsed vars) */
@import url('./g-utilities-overrides.css');

/* 3. Custom overrides: enqueued by PHP (ggg-blocks.php) when assets/css/g-utilities-custom.css exists */

/* Additional utilities can be added here */
/* Note: .gg-container is in g-utilities-overrides.css */

/* ===== BLOCK SCOPE - Theme isolation ===== */
/* All typography inside blocks inherits from block container (beats theme specificity) */
/* Exclude .kb-button (Cadence Advanced Button) so its color is not overridden by inherit */
.g-blocks-wrapper h1,
.g-blocks-wrapper h2,
.g-blocks-wrapper h3,
.g-blocks-wrapper h4,
.g-blocks-wrapper h5,
.g-blocks-wrapper h6,
.g-blocks-wrapper p,
.g-blocks-wrapper a:not(.gg-button):not(.kb-button),
.g-blocks-wrapper li,
.g-blocks-wrapper span,
.g-blocks-wrapper blockquote {
  color: inherit;
}
.g-blocks-wrapper a:not(.gg-button):not(.kb-button) {
  text-decoration: inherit;
}

/* ===== DARK THEME FALLBACK - Override inherit when plugin theme is dark but site theme is not ===== */
/* When plugin uses dark theme but parent site doesn't support it, explicitly set colors */
html.gg-theme-dark .g-blocks-wrapper,
[gg-data-theme="dark"] .g-blocks-wrapper,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"],
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"],
html.gg-theme-dark [class*="wp-block-acf-g-"],
[gg-data-theme="dark"] [class*="wp-block-acf-g-"] {
  color: var(--gg-text-body);
  background-color: var(--gg-bg-body);
}
html.gg-theme-dark .g-blocks-wrapper h1,
html.gg-theme-dark .g-blocks-wrapper h2,
html.gg-theme-dark .g-blocks-wrapper h3,
html.gg-theme-dark .g-blocks-wrapper h4,
html.gg-theme-dark .g-blocks-wrapper h5,
html.gg-theme-dark .g-blocks-wrapper h6,
[gg-data-theme="dark"] .g-blocks-wrapper h1,
[gg-data-theme="dark"] .g-blocks-wrapper h2,
[gg-data-theme="dark"] .g-blocks-wrapper h3,
[gg-data-theme="dark"] .g-blocks-wrapper h4,
[gg-data-theme="dark"] .g-blocks-wrapper h5,
[gg-data-theme="dark"] .g-blocks-wrapper h6,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"] h1,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"] h2,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"] h3,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"] h4,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"] h5,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"] h6,
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"] h1,
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"] h2,
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"] h3,
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"] h4,
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"] h5,
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"] h6 {
  color: var(--gg-text-title);
}
html.gg-theme-dark .g-blocks-wrapper p,
html.gg-theme-dark .g-blocks-wrapper li,
html.gg-theme-dark .g-blocks-wrapper span,
html.gg-theme-dark .g-blocks-wrapper blockquote,
html.gg-theme-dark .g-blocks-wrapper div,
[gg-data-theme="dark"] .g-blocks-wrapper p,
[gg-data-theme="dark"] .g-blocks-wrapper li,
[gg-data-theme="dark"] .g-blocks-wrapper span,
[gg-data-theme="dark"] .g-blocks-wrapper blockquote,
[gg-data-theme="dark"] .g-blocks-wrapper div,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"] p,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"] li,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"] span,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"] blockquote,
html.gg-theme-dark [class*="wp-block-ggg-blocks-"] div,
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"] p,
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"] li,
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"] span,
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"] blockquote,
[gg-data-theme="dark"] [class*="wp-block-ggg-blocks-"] div {
  color: var(--gg-text-body);
}

