/**
 * pf-v6-alert slot visibility rules
 * Sets custom properties that shadow DOM reads to conditionally hide slot containers
 */

/* Hide title container when no default slot content */
pf-v6-alert:empty {
  --_has-title: none;
}

/* Hide action container when no action slot content (only applies when not dismissable) */
pf-v6-alert:not([dismissable]):not(:has([slot="action"])) {
  --_has-action: none;
}

/* Hide action-group container when no actions slot content */
pf-v6-alert:not(:has([slot="actions"])) {
  --_has-actions: none;
}

/* Hide description container when no description slot content (expandable alerts handle this with Go template logic) */
pf-v6-alert:not([expandable]):not(:has([slot="description"])) {
  --_has-description: none;
}

/**
 * pf-v6-alert-group lightdom styles
 * Hides the component when empty
 */
pf-v6-alert-group:empty {
  display: none;
}

/* pf-v6-button slot visibility rules
 * Sets custom properties that shadow DOM reads to conditionally hide slot containers
 */

/* Hide icon-start slot when no content */
pf-v6-button:not(:has([slot="icon-start"])) {
  --_has-icon-start: none;
}

/* Hide icon-end slot when no content */
pf-v6-button:not(:has([slot="icon-end"])) {
  --_has-icon-end: none;
}

/**
 * pf-v6-card slot visibility rules
 * Sets custom properties that shadow DOM reads to conditionally hide slot containers
 */

/**
 * Hide header container only when BOTH header and title slots are empty
 * (title is nested inside header, so header should show if either has content)
 */
pf-v6-card:not(:has([slot="header"])):not(:has([slot="title"])) {
  --_has-header: none;
}

/* Hide title container when no title slot content */
pf-v6-card:not(:has([slot="title"])) {
  --_has-title: none;
}

/* Hide footer container when no footer slot content */
pf-v6-card:not(:has([slot="footer"])) {
  --_has-footer: none;
}

/* Hide body container when element is empty (no content at all) */
pf-v6-card:empty {
  --_has-default: none;
}

/* pf-v6-toggle-group-item slot visibility rules
 * Sets custom properties that shadow DOM reads to conditionally hide slot containers
 */

/* Hide wrapper when element is empty (no content at all) */
pf-v6-toggle-group-item:empty {
  --_has-content: none;
}

