/* ===============================================================
   ToolDuck — ad-blocker support notice
   ===============================================================
   A compact support card, bottom-right on a desktop and a bottom sheet
   on a phone. Colours, radii, borders and the focus ring all come from
   the site tokens, so it belongs to ToolDuck without redefining anything.

   It is NOT a modal and there is no overlay: nothing here covers the
   page, and nothing here can stop the visitor using it.
   =============================================================== */

.adnotice {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    /* Above page content, below the sticky header, the nav drawer and the
       search panel — a support note must never sit on top of navigation. */
    z-index: 60;
    width: min(400px, calc(100vw - 2rem));
    padding: .85rem .95rem .9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--text);
    font-size: .875rem;
    line-height: 1.45;
}

.adnotice__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}

.adnotice__title {
    margin: 0;
    font-size: .9375rem;
    font-weight: 650;
}

.adnotice__close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    /* 32px, so the target is comfortable on a touch screen without a
       wrapper element around the real button. */
    width: 32px;
    height: 32px;
    margin: -.3rem -.3rem 0 0;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--ink-3);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.adnotice__close:hover {
    background: var(--bg-muted);
    color: var(--ink);
}

.adnotice__close:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.adnotice__body p {
    margin: .5rem 0 0;
    color: var(--ink-2);
}

.adnotice__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .85rem;
}

.adnotice__help {
    margin-top: .85rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
}

.adnotice__help p {
    margin: 0 0 .6rem;
    color: var(--ink-2);
}

/* The card toggles whole blocks with the `hidden` attribute, and a
   `display` declaration of our own would beat the attribute's default.
   One rule, so the two cannot disagree. */
.adnotice [hidden] {
    display: none !important;
}

/* ---- Phone --------------------------------------------------- */

@media (max-width: 560px) {
    .adnotice {
        right: .75rem;
        bottom: .75rem;
        left: .75rem;
        /* calc(100% - 24px) with the inset: full width minus the margin on
           each side, and never wider than the viewport. */
        width: auto;
        /* Short viewports are real — a landscape phone, or a keyboard open
           over the page. The card scrolls rather than growing past the
           screen, and its close button is always at the top of it. */
        max-height: calc(100vh - 1.5rem);
        overflow-y: auto;
    }
}

/* ---- Motion -------------------------------------------------- */

/* A short fade, and only for visitors who have not asked for less. The
   card is support messaging; it has no business performing. */
@media (prefers-reduced-motion: no-preference) {
    .adnotice {
        animation: adnotice-in .18s ease-out;
    }
}

@keyframes adnotice-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}
