/**
 * Blocksy parent theme compatibility overrides.
 * Add Blocksy-specific resets and selector fixes here.
 *
 * @package log-core
 */

/* Hide Blocksy's built-in breadcrumb on pages with our own breadcrumb */
body.single-product .ct-breadcrumbs,
body.woocommerce-page.single-product .ct-breadcrumbs {
    display: none !important;
}

/* Blocksy's global form focus state (inc/dynamic-styles/global/forms.php)
 * defaults --theme-form-field-border-focus-color to its accent colour
 * (#2872fa, a plain blue) with no brand awareness. Any input/select/
 * textarea without its own :focus override — e.g. plugin-rendered forms
 * we haven't specifically styled — flashes that blue instead of the site's
 * plum palette. Re-pointing the variables here fixes it everywhere in one
 * place instead of chasing every individual form. */
/* !important: Blocksy injects its own --theme-form-* values via an inline
 * <style> block in wp_head (dynamic-styles), often after this stylesheet,
 * so a plain :root override loses the tie on load order alone. */
:root {
    --theme-form-field-border-focus-color: var(--plum-700, #4BE3B5) !important;
    --theme-form-text-focus-color: var(--ink-900, #061112) !important;
    --theme-form-field-background-focus-color: var(--white, #ffffff) !important;
}

/* Blocksy forces `width: var(--theme-block-width)` (effectively 100%) on
 * every direct child of `.entry-content.is-layout-constrained`. Our page
 * hero/stats-bar components (.page-banner, .stats-bar, etc.) also set
 * non-zero left/right margins, so the two combine into an overflow: full
 * container width PLUS margin on each side pushes the box past its
 * container edge (clips content on narrow-content pages like Shipping
 * Policy). Resetting to width:auto restores normal margin-aware sizing
 * for any content-area child, sitewide. This file already loads after
 * Blocksy's ct-main-styles (see inc/compat/blocksy.php dependency), so
 * no !important is needed to win the cascade tie. */
.entry-content.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    width: auto;
}

/* Website 11: bridge the parent theme's palette variables onto the dark reference tokens so
   anything Blocksy renders on its own (notices, forms, links, buttons) matches the child theme. */
html:root {
    --theme-palette-color-1: var(--log-mint);
    --theme-palette-color-2: var(--log-aqua);
    --theme-palette-color-3: var(--log-text-soft);
    --theme-palette-color-4: var(--log-text-strong);
    --theme-palette-color-5: var(--log-border);
    --theme-palette-color-6: var(--log-surface-2);
    --theme-palette-color-7: var(--log-bg);
    --theme-palette-color-8: var(--log-surface);
    --theme-text-color: var(--log-text);
    --theme-headings-color: var(--log-text-strong);
    --theme-link-initial-color: var(--log-mint);
    --theme-link-hover-color: var(--log-text-strong);
    --theme-border-color: var(--log-border);
    --theme-form-field-border-initial-color: var(--log-border);
    --theme-form-selection-field-initial-color: var(--log-border);
    --theme-form-selection-field-active-color: var(--log-mint);
    --theme-button-text-initial-color: var(--log-on-accent);
    --theme-button-text-hover-color: var(--log-on-accent);
    --theme-button-background-initial-color: var(--log-mint);
    --theme-button-background-hover-color: var(--log-aqua);
}
