/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Copyright (C) 2026 Bijstaan */
/**
 * The static half of the whitelabel.
 *
 * Everything that depends on configuration is generated by front/style.php.
 * What is left here is the small amount that is true whenever the plugin is
 * active at all: making the logo behave when the uploaded image is not the
 * shape core's was.
 */

/* Core sizes the logo by background-size on a fixed-height span, which assumes
   roughly its own aspect ratio. An uploaded logo is rarely the same shape, so
   letting it letterbox inside the space beats cropping somebody's wordmark. */
.glpi-logo {
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* ------------------------------------------------------------- dark theme */

/*
 * Muted / helper text on the dark palettes, scoped to the plugin's own
 * config page (the only surface this plugin renders).
 *
 * Core's `.text-muted` is `color: var(--tblr-muted) !important`
 * (css/includes/_base.scss:630) — a property override, whatever its
 * specificity, silently loses to that. The working mechanic is to redefine
 * the VARIABLE inside the plugin's scope, so core's !important legitimately
 * resolves against our value. `.form-text` keys to `--tblr-secondary-color`,
 * a Tabler literal GLPI's dark palettes never re-darken (rgba(31,41,55,.75)
 * — near-invisible on a dark card), so that variable is redefined in the
 * same scope.
 *
 * `transparent 12%` is the measured house formula: on auror_dark
 * (body #1f2936, body text #9ca8c0) it clears 4.5:1 with margin against the
 * body, the card surface, and the tertiary-tinted logo preview boxes; 28%
 * measured UNDER the floor (3.48–3.75:1). Never self-reference a variable
 * in its own redefine (circular, silently invalid).
 */
:root[data-glpi-theme-dark="1"] .whitelabel-config {
    --tblr-muted: color-mix(in srgb, var(--tblr-body-color), transparent 12%);
    --tblr-secondary-color: color-mix(in srgb, var(--tblr-body-color), transparent 12%);
}

/*
 * `-lt` badges are not theme-safe: the "what is branded" status badges keep
 * their tint but their text colour (core paints it with !important) sits
 * under the 4.5:1 floor on auror_dark. Tone lift as a property override on
 * the fixed status colour, with matching !important.
 */
:root[data-glpi-theme-dark="1"] .whitelabel-config .badge.bg-green-lt {
    color: color-mix(in srgb, var(--tblr-green, #2fb344), white 35%) !important;
}
:root[data-glpi-theme-dark="1"] .whitelabel-config .badge.bg-secondary-lt {
    color: color-mix(in srgb, var(--tblr-secondary, #6c757d), white 35%) !important;
}

/*
 * The logo preview boxes paint --tblr-bg-surface-tertiary, slightly lighter
 * than the card on auror_dark — the 12% formula above measured 4.38:1 on
 * that tint, just under the floor. Tightened to 8% for these boxes only
 * (the same lighter-surface exception glpikedb measured for its ticket
 * banner).
 */
:root[data-glpi-theme-dark="1"] .whitelabel-config .whitelabel-preview {
    --tblr-secondary-color: color-mix(in srgb, var(--tblr-body-color), transparent 8%);
}
