/* Mikhael AI Writer — Show Citations toggle */

/* JS adds .aiw-citation-marker to every <sup> in post content (skipping code/pre). */
.aiw-citation-marker {
    display: none !important;
}
body.aiw-citations-on .aiw-citation-marker {
    display: revert !important;
}

/* Toggle UI ----------------------------------------------------------------- */

.aiw-toggle {
    --aiw-border: rgba(0, 0, 0, 0.2);
    --aiw-bg: rgba(0, 0, 0, 0.03);
    --aiw-bg-hover: rgba(0, 0, 0, 0.07);
    font-size: 0.9em;
    line-height: 1.2;
}

.aiw-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.45em 0.9em;
    background: var(--aiw-bg);
    border: 1px solid var(--aiw-border);
    color: inherit;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    line-height: 1.2;
    transition: background-color 120ms ease;
}
.aiw-toggle-btn:hover,
.aiw-toggle-btn:focus-visible {
    background: var(--aiw-bg-hover);
}
.aiw-toggle-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.aiw-toggle-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    flex: 0 0 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M7.17 6A4.17 4.17 0 0 0 3 10.17v6.33A1.5 1.5 0 0 0 4.5 18h4A1.5 1.5 0 0 0 10 16.5v-4A1.5 1.5 0 0 0 8.5 11H7a3 3 0 0 1 3-3V6h-2.83Zm10 0A4.17 4.17 0 0 0 13 10.17v6.33A1.5 1.5 0 0 0 14.5 18h4a1.5 1.5 0 0 0 1.5-1.5v-4A1.5 1.5 0 0 0 18.5 11H17a3 3 0 0 1 3-3V6h-2.83Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.aiw-toggle-label-hide,
body.aiw-citations-on .aiw-toggle-label-show {
    display: none;
}
body.aiw-citations-on .aiw-toggle-label-hide {
    display: inline;
}

/* Placement: inline pill at top of article */
.aiw-toggle-inline {
    margin: 0 0 1.25em 0;
}

/* Placement: banner at literal bottom of post content */
.aiw-toggle-banner {
    margin: 1.5em 0 0.5em 0;
    padding: 0.75em 0;
    text-align: center;
}
.aiw-toggle-banner .aiw-toggle-sentence {
    margin-right: 0.5em;
    opacity: 0.85;
}

/* Placement: floating action button, bottom-right, sticky */
.aiw-toggle-floater {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 9000;
    margin: 0;
}
.aiw-toggle-floater .aiw-toggle-btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    background: #fff;
    color: #222;
    border-color: rgba(0, 0, 0, 0.18);
}
body.aiw-citations-on .aiw-toggle-floater .aiw-toggle-btn {
    background: #222;
    color: #fff;
    border-color: #222;
}

/* Mobile: floater becomes an icon-only circle */
@media (max-width: 767px) {
    .aiw-toggle-floater .aiw-toggle-btn {
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }
    .aiw-toggle-floater .aiw-toggle-label-show,
    .aiw-toggle-floater .aiw-toggle-label-hide {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aiw-toggle-btn {
        transition: none;
    }
}
