/* Copyright © Rob Art | Illustration 2026 */
/**
 * WP 7.0 admin-form restore.
 * Reverts WP 7.0's enlarged inputs / buttons and indigo theme back to the
 * familiar WP 6.x look so plugin UIs render as they were designed.
 *
 * Scope: #wpbody-content — the WP core admin content container. This catches
 * pages that use <div class="wrap"> AND pages that use a custom top-level
 * wrapper (like IndexifiWP). Does NOT touch the WP admin chrome (toolbar,
 * sidebar menu) which lives outside #wpbody-content.
 *
 * Enqueue this BEFORE the plugin's own admin CSS so plugin-specific overrides
 * (toggle switches, custom dropdowns, etc.) win on cascade.
 */

/* ── 1. Restore the admin theme colour to classic WP blue ───────────────── */
#wpbody-content {
    --wp-admin-theme-color: #2271b1;
    --wp-admin-theme-color--rgb: 34, 113, 177;
    --wp-admin-theme-color-darker-10: #135e96;
    --wp-admin-theme-color-darker-10--rgb: 19, 94, 150;
    --wp-admin-theme-color-darker-20: #0a4b78;
    --wp-admin-theme-color-darker-20--rgb: 10, 75, 120;
}

/* ── 2. Text inputs / textareas / selects ───────────────────────────────── */
#wpbody-content input[type="text"],
#wpbody-content input[type="search"],
#wpbody-content input[type="tel"],
#wpbody-content input[type="time"],
#wpbody-content input[type="url"],
#wpbody-content input[type="week"],
#wpbody-content input[type="password"],
#wpbody-content input[type="color"],
#wpbody-content input[type="date"],
#wpbody-content input[type="datetime"],
#wpbody-content input[type="datetime-local"],
#wpbody-content input[type="email"],
#wpbody-content input[type="month"],
#wpbody-content input[type="number"],
#wpbody-content select,
#wpbody-content textarea {
    min-height: 30px;
    height: auto;
    padding: 0 8px;
    border-radius: 3px;
    border-color: #8c8f94;
    line-height: 2;
    font-size: 14px;
    box-shadow: 0 0 0 transparent;
}

#wpbody-content textarea {
    padding: 6px 8px;
    line-height: 1.5;
    min-height: 60px;
}

#wpbody-content input[type="number"] {
    padding-right: 4px;
}

#wpbody-content input[type="search"] {
    -webkit-appearance: textfield;
}

/* Number-input spinners — keep them compact */
#wpbody-content input[type="number"]::-webkit-inner-spin-button,
#wpbody-content input[type="number"]::-webkit-outer-spin-button {
    height: 28px;
}

/* ── 3. Buttons ─────────────────────────────────────────────────────────── */
#wpbody-content .button,
#wpbody-content .button-secondary {
    min-height: 30px;
    line-height: 2.15384615;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 400;
    border-radius: 3px;
    border-width: 1px;
    border-style: solid;
    box-sizing: border-box;
    box-shadow: none;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: baseline;
}

#wpbody-content .button-large {
    min-height: 32px;
    line-height: 2.30769231;
    padding: 0 12px;
}

#wpbody-content .button-small {
    min-height: 26px;
    line-height: 2.18181818;
    padding: 0 8px;
    font-size: 11px;
}

/* Secondary (default) button colours */
#wpbody-content .button,
#wpbody-content .button-secondary {
    background: #f6f7f7;
    border-color: #2271b1;
    color: #2271b1;
}
#wpbody-content .button:hover,
#wpbody-content .button-secondary:hover {
    background: #f0f0f1;
    border-color: #0a4b78;
    color: #0a4b78;
}

/* Primary button — solid classic-blue fill, white text */
#wpbody-content .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    text-shadow: none;
    box-shadow: none;
}
#wpbody-content .button-primary:hover,
#wpbody-content .button-primary:focus {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}
#wpbody-content .button-primary:focus {
    box-shadow:
        0 0 0 1px #fff,
        0 0 0 3px #2271b1;
}

/* ── 4. Checkboxes & radios — native rendering, classic blue check ────────
   Wrapped in :where() so the rules have ZERO specificity. That lets any
   plugin-specific selector (e.g. `.blwp-sidebar-toggle input { display:none }`)
   override these without needing !important.                              */
:where(#wpbody-content input[type="checkbox"]),
:where(#wpbody-content input[type="radio"]) {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #fff;
    border: 1px solid #8c8f94;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    padding: 0;
    margin: -4px 4px 0 0;
    vertical-align: middle;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: 0.05s border-color ease-in-out;
}

:where(#wpbody-content input[type="radio"]) {
    border-radius: 50%;
}

:where(#wpbody-content input[type="checkbox"]) {
    border-radius: 3px;
}

:where(#wpbody-content input[type="radio"]),
:where(#wpbody-content input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

:where(#wpbody-content input[type="radio"]:checked)::before {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    margin: 0;
    background: #2271b1;
    border-radius: 50%;
}

:where(#wpbody-content input[type="checkbox"]:checked)::before {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    margin: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M14.83 4.89l1.34.94-5.81 8.38H9.02L5.78 9.67l1.34-1.25 2.57 2.99z' fill='%232271b1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
}

:where(#wpbody-content input[type="checkbox"]:focus),
:where(#wpbody-content input[type="radio"]:focus) {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: 2px solid transparent;
}
