/* Bioøkonomi 0.1.6 – iteration 47.
 * All overrides are page-scoped: no changes to account/report/admin screens.
 * Designed to load AFTER Biomassekort 1.7.0, Pyrolyse 0.1.0 and Extendable.
 */

/* Documented low-contrast text pairs in Biomassekort 1.7.0. */
body.page-id-53 .be-biomass-map .be-filters input::placeholder { color:#3f5245; opacity:1; }
body.page-id-53 .be-biomass-map .be-filter-note,
body.page-id-53 .be-biomass-map .be-view-controls > span,
body.page-id-53 .be-biomass-map .be-view-controls button:not([aria-pressed="true"]),
body.page-id-53 .be-biomass-map .be-legend,
body.page-id-53 .be-biomass-map .be-chart-caption,
body.page-id-53 .be-biomass-map .be-list-head,
body.page-id-53 .be-biomass-map .be-region-chart-title,
body.page-id-53 .be-biomass-map .be-region-sub,
body.page-id-53 .be-biomass-map .be-mobile-label { color:#3f5245; }
body.page-id-53 .be-biomass-map .be-provenance { color:#dce8db; }
/* Additional short instructional labels on light panels. */
body.page-id-53 .be-biomass-map .be-stats span,
body.page-id-53 .be-biomass-map .be-region-tag,
body.page-id-53 .be-biomass-map .be-kicker:not(.be-hero .be-kicker) { color:#3e6048; }

/* Pyrolyse: labels currently lighter than 4.5:1 on white/pale panels. */
body.page-id-68 .be-pyrolyse-guide .be-pyrolyse-eyebrow:not(.be-pyrolyse-hero .be-pyrolyse-eyebrow),
body.page-id-68 .be-pyrolyse-flow span,
body.page-id-68 .be-pyrolyse-flow small,
body.page-id-68 .be-pyrolyse-check legend,
body.page-id-68 .be-pyrolyse-check [data-check-count] { color:#355242; }

/* Shared keyboard focus styling (only these three pages). */
body:is(.page-id-53,.page-id-26,.page-id-68) :is(a,button,input,select,textarea,[role="button"],[tabindex="0"]):focus-visible {
    outline:3px solid #204eaa;
    outline-offset:3px;
}
body.page-id-53 .be-biomass-map .be-hero a:focus-visible,
body.page-id-68 .be-pyrolyse-hero a:focus-visible {
    outline-color:#ffdc85;
}

/* Text links stay recognisable when color is not perceived. */
body.page-id-26 .ext-card .wp-block-button__link,
body.page-id-68 .be-pyrolyse-guide .be-pyrolyse-nav a {
    text-underline-offset:3px;
}

/* Coherent minimum pointer targets; avoid enlarging the non-interactive chart bars. */
body.page-id-53 .be-biomass-map :is(button,select,input[type="search"]),
body.page-id-68 .be-pyrolyse-guide :is(button,select),
body.page-id-26 .ext-card .wp-block-button__link,
body:is(.page-id-53,.page-id-26,.page-id-68) .wp-block-navigation__responsive-container-open,
body:is(.page-id-53,.page-id-26,.page-id-68) .wp-block-navigation__responsive-container-close {
    min-height:44px;
}
body.page-id-53 .be-biomass-map .be-view-controls button,
body.page-id-53 .be-biomass-map .be-region-view button,
body.page-id-68 .be-pyrolyse-guide .be-pyrolyse-nav a {
    min-height:44px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

@media (max-width:700px) {
    body.page-id-53 .be-biomass-map,
    body.page-id-68 .be-pyrolyse-guide {
        width:min(100%,calc(100vw - 24px));
        max-width:100%;
    }
    body.page-id-53 .be-biomass-map .be-region-link-box > div { min-width:0; }
    body.page-id-53 .be-biomass-map .be-region-link-box input { min-width:0; width:100%; }
    body.page-id-53 .be-biomass-map .be-region-actions { min-width:0; }
    body.page-id-68 .be-pyrolyse-guide .be-pyrolyse-nav {
        overscroll-behavior-x:contain;
        scrollbar-width:thin;
    }
}
@media (max-width:430px) {
    body.page-id-26 .entry-content .ext-grid { grid-template-columns:minmax(0,1fr) !important; }
    body.page-id-26 .entry-content .ext-card { min-width:0; overflow-wrap:anywhere; }
    body.page-id-26 .entry-content .ext-card img { max-width:100%; height:auto; }
    body.page-id-53 .be-biomass-map .be-region-view,
    body.page-id-53 .be-biomass-map .be-view-controls { flex-wrap:wrap; }
    body.page-id-53 .be-biomass-map .be-view-controls button { padding-inline:9px; }
    body.page-id-53 .be-biomass-map .be-results { min-width:0; }
    body.page-id-68 .be-pyrolyse-guide .be-pyrolyse-nav a { flex-shrink:0; }
}
@media (max-width:360px) {
    body.page-id-53 .be-biomass-map .be-region-link-box > div { flex-wrap:wrap; }
    body.page-id-53 .be-biomass-map .be-region-link-box button { flex:1 1 100%; }
    body.page-id-68 .be-pyrolyse-guide .be-pyrolyse-hero h2 { overflow-wrap:anywhere; }
}
@media (prefers-reduced-motion:reduce) {
    body.page-id-53 .be-biomass-map *,
    body.page-id-68 .be-pyrolyse-guide *,
    body.page-id-26 .ext-card * { scroll-behavior:auto !important; transition-duration:0s !important; animation-duration:0s !important; }
}

/* TranslatePress renders its current language as a div[role=button].
 * Make the keyboard affordance discoverable without overriding its behavior. */
body:is(.page-id-53,.page-id-26,.page-id-68) .trp-language-switcher .trp-language-item__current[role="button"] {
    min-height:44px;
}
body:is(.page-id-53,.page-id-26,.page-id-68) .trp-language-switcher .trp-language-item__current[role="button"]:focus-visible {
    outline:3px solid #204eaa;
    outline-offset:3px;
}

/* 0.1.2: additional pale-panel text with verified low original contrast.
 * Original module CSS includes #7c897d, #87958a, #708474, #7a897d
 * on very light surfaces. These scoped overrides leave dark heroes intact.
 */
body.page-id-53 .be-biomass-map .be-row-title small,
body.page-id-53 .be-biomass-map .be-missing,
body.page-id-53 .be-biomass-map .be-detail-facts dt,
body.page-id-53 .be-biomass-map .be-detail-facts dd small,
body.page-id-53 .be-biomass-map .be-compare-empty > span,
body.page-id-53 .be-biomass-map .be-availability-item dt {
    color:#3b5745;
}
body.page-id-53 .be-biomass-map .be-source-note { color:#3b5745 !important; }
body.page-id-53 .be-biomass-map .be-method h2 em { color:#315a42; }
body.page-id-68 .be-pyrolyse-guide .be-pyrolyse-intro h2 em,
body.page-id-68 .be-pyrolyse-guide .be-pyrolyse-flow > b { color:#315a42; }
/* Reserve enough tap area for touch and focus at all responsive widths. */
body.page-id-53 .be-biomass-map .be-chart-row,
body.page-id-53 .be-biomass-map .be-data-row,
body.page-id-53 .be-biomass-map .be-region-row {
    min-height:44px;
}

/* Iteration 47 / 0.1.4: observed companion-module card labels.
 * Original credits.css and lca.css use #5c8068 on pale cards (3.8-4.4:1).
 * Excludes dark module heroes; affects only the three audited public pages.
 */
body:is(.page-id-53,.page-id-26,.page-id-68) .be-credits-link small,
body:is(.page-id-53,.page-id-26,.page-id-68) .be-lca-link small {
    color: #3b5745;
}

/* 0.1.5: source-verified pale partner-card labels on the three public pages.
 * Five companion stylesheets use #5c8068 against #e8f0e7 here; their
 * individual full-page dark heroes are intentionally excluded.
 */
body:is(.page-id-53,.page-id-26,.page-id-68) :is(
  .be-esg-link,
  .be-heat-link,
  .be-agri-link,
  .be-market-link,
  .be-projects-link
) > small {
  color:#3b5745;
}

/* 0.1.6: verified remaining pale text in the three modules embedded
 * within Biomassekort only. Original colors are #718277, #648071,
 * #708474 and #60846b on pale/white panels. The single new foreground
 * #355242 exceeds 4.5:1 on all audited panel backgrounds.
 * Do not apply to heroes or to these tools on their own pages.
 */
body.page-id-53 .be-biomass-map .be-biokul label span,
body.page-id-53 .be-biomass-map .be-biokul-results span,
body.page-id-53 .be-biomass-map .be-biogas small {
    color:#355242;
}
