/**
 * Dark-mode bridge for Content Control components.
 * It intentionally contains selectors for this plugin only. No body-wide or
 * administrator-only styling lives here.
 */
html[data-gmf-theme="dark"] body:not(.wp-admin) :where(
    .gm-content,
    .gm-table-shell,
    .gm-content-table-shell,
    .gm-blocklist,
    .gms-hero,
    .gms-secondary-wrap,
    .gmug,
    .gm-pg-shell,
    .gm-pg-modern-wrap,
    .gm-showcase-v15,
    .premium-purchase-wrapper,
    #left-column-info-container
) {
    color: var(--gmf-content-text, #d3dde7) !important;
}

html[data-gmf-theme="dark"] body:not(.wp-admin) :where(
    .gm-content,
    .gm-table-shell,
    .gm-content-table-shell,
    .gm-blocklist,
    .gms-hero,
    .gms-secondary-wrap,
    .gmug,
    .gm-pg-shell,
    .gm-pg-modern-wrap,
    .gm-showcase-v15,
    .premium-purchase-wrapper,
    #left-column-info-container
) :where(h1, h2, h3, h4, h5, h6, strong, b, .gm-card__title, .gmw-title, .gm-faq__title, .gm-faq-q, .gmbl-title, .gms-card-title, .gms-secondary-title, .gmug-module-head, .gmug-subhead, .gm-pg-title, .gm-pg-heading, .premium-info-card-title, .product-meta-value) {
    color: var(--gmf-content-heading, #f6f9fc) !important;
    opacity: 1 !important;
}

html[data-gmf-theme="dark"] body:not(.wp-admin) :where(
    .gm-content,
    .gm-table-shell,
    .gm-content-table-shell,
    .gm-blocklist,
    .gms-hero,
    .gms-secondary-wrap,
    .gmug,
    .gm-pg-shell,
    .gm-pg-modern-wrap,
    .gm-showcase-v15,
    .premium-purchase-wrapper,
    #left-column-info-container
) :where(p, li, td, dd, .gm-card__text, .gmw-desc, .gm-faq__desc, .gm-faq-a, .gmbl-desc, .gms-card-desc, .gms-secondary-desc, .gmug-note-body, .gmug-timing-copy, .gm-pg-desc, .gm-pg-meta, .product-short-desc-content, .product-meta-label, .premium-update-date, .premium-select-option-msg) {
    color: var(--gmf-content-text, #d3dde7) !important;
    opacity: 1 !important;
}

/* Neutral component surfaces. Semantic warning/info cards keep their own hue. */
html[data-gmf-theme="dark"] body:not(.wp-admin) :where(
    .gm-content .gm-table-wrap,
    .gm-content table,
    .gm-content .gm-card,
    .gm-content .gmw,
    .gm-content .gm-faq-item details,
    .gm-content .gm-linkpack,
    .gm-content .gm-audio-tx,
    .gm-table-shell,
    .gm-table,
    .gm-content-table-shell,
    .gm-content-table,
    .gmbl-card,
    .gms-card,
    .gms-secondary-card,
    .gmug-module,
    .gmug-stat,
    .gmug-step,
    .gmug-choice-card,
    .gmug-group-card,
    .gmug-recommendation,
    .premium-purchase-wrapper,
    .premium-info-card,
    .social-proof-container,
    .int-btn,
    .woocommerce-variation-add-to-cart .quantity,
    form.cart:not(.variations_form) .quantity
) {
    border-color: var(--gmf-content-border, rgba(226,237,247,.16)) !important;
    background: var(--gmf-content-surface, #0a1e35) !important;
    color: var(--gmf-content-text, #d3dde7) !important;
    box-shadow: none !important;
}

html[data-gmf-theme="dark"] body:not(.wp-admin) :where(
    .gm-content table thead th,
    .gm-content table tbody tr:nth-child(even),
    .gm-table thead th,
    .gm-table tbody tr:nth-child(even),
    .gm-content-table thead th,
    .gm-content-table tbody tr:nth-child(even),
    .gm-faq-item summary,
    .gmug-note,
    .premium-update-date,
    .text-price-badge
) {
    border-color: var(--gmf-content-border, rgba(226,237,247,.16)) !important;
    background: var(--gmf-content-surface-soft, #102943) !important;
    color: var(--gmf-content-text, #d3dde7) !important;
}

html[data-gmf-theme="dark"] body:not(.wp-admin) :where(
    .gm-content table th,
    .gm-content table td,
    .gm-table th,
    .gm-table td,
    .gm-content-table th,
    .gm-content-table td,
    .product-meta-item,
    .compact-price-card
) {
    border-color: var(--gmf-content-border, rgba(226,237,247,.16)) !important;
}

/* Product-layout controls are emitted by a late inline style, so these
 * deliberately carry stronger scoped selectors. */
html[data-gmf-theme="dark"] body:not(.wp-admin) .premium-purchase-wrapper table.variations th label,
html[data-gmf-theme="dark"] body:not(.wp-admin) .premium-purchase-wrapper .quantity input.qty,
html[data-gmf-theme="dark"] body:not(.wp-admin) form.cart:not(.variations_form) .quantity input.qty {
    color: var(--gmf-content-heading, #f6f9fc) !important;
}
html[data-gmf-theme="dark"] body:not(.wp-admin) .premium-purchase-wrapper .quantity :where(.plus, .minus, input[type="button"]),
html[data-gmf-theme="dark"] body:not(.wp-admin) form.cart:not(.variations_form) .quantity :where(.plus, .minus, input[type="button"]) {
    border: 1px solid var(--gmf-content-border, rgba(226,237,247,.16)) !important;
    background: var(--gmf-content-surface-soft, #102943) !important;
    color: var(--gmf-content-heading, #f6f9fc) !important;
}

/* Usage guide cards use !important in their own palette; preserve their tone
 * while removing dazzling white backgrounds in night mode. */
html[data-gmf-theme="dark"] body:not(.wp-admin) .gmug button.gmug-time-card {
    border-color: var(--gmf-content-border, rgba(226,237,247,.16)) !important;
    background: var(--gmf-content-surface-soft, #102943) !important;
}
html[data-gmf-theme="dark"] body:not(.wp-admin) .gmug button.gmug-time-card:not(.is-selected),
html[data-gmf-theme="dark"] body:not(.wp-admin) .gmug button.gmug-time-card:not(.is-selected) .gmug-time-label {
    color: var(--gmf-content-muted, #aebdca) !important;
}
html[data-gmf-theme="dark"] body:not(.wp-admin) .gmug .gmug-note-mark {
    border-color: var(--gmf-content-border, rgba(226,237,247,.16)) !important;
    background: var(--gmf-content-surface-soft, #102943) !important;
    color: var(--gmf-content-heading, #f6f9fc) !important;
}

/* Content plugin links use Foundation's semantic link color. */
html[data-gmf-theme="dark"] body:not(.wp-admin) :where(.gm-content, .gmug, .gm-blocklist, .gms-hero, .gms-secondary-wrap) a:not(.button):not(.btn) {
    color: var(--gmf-content-link, #86d0ff) !important;
}
