/**
 * theme-toggle.css
 * Shared button styles for WordPress and MediaWiki.
 *
 * WordPress:  enqueue this file alongside theme-toggle.js
 * MediaWiki:  add to $wgResourceModules['ext.themeToggle']['styles']
 *             or paste into MediaWiki:Common.css
 */

/* ── Button reset + sizing ───────────────────────────────── */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;           /* inherits header text colour in both platforms */
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
    /* Smooth icon swap */
    transition: opacity 0.15s ease, transform 0.2s ease;
}

.theme-toggle-btn:hover {
    opacity: 0.75;
    transform: scale(1.1);
}

.theme-toggle-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 4px;
}

.theme-toggle-btn svg {
    display: block;           /* prevents inline baseline gap */
    width: 1.5em;
    height: 1.5em;
}

/* ── MediaWiki: personal tools list item wrapper ─────────── */
#pt-theme-toggle {
    display: inline-flex;
    align-items: center;
    float: right;
    margin: -10px 0 0 30px;
    position: relative;
}

/* Vector 2022: align with other personal tools icons */
.vector-menu-content-list #pt-theme-toggle {
    padding: 0 4px;
}

/* ── WordPress / Enfold: nav list item wrapper ───────────── */
#header .av-main-nav .theme-toggle-item,
#header nav.main_menu .theme-toggle-item {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
}

/* ── Fixed fallback (when no nav target found) ───────────── */
#theme-toggle-fixed {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    background: var(--enfold-main-color-bg2, #f5f5f5);
    border: 1px solid var(--enfold-main-color-border, #ddd);
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

[data-theme="dark"] #theme-toggle-fixed {
    background: var(--enfold-main-color-bg2, #1a1a1a);
    border-color: var(--enfold-main-color-border, #333);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
