/* Factsogy floating widgets: back-to-top button, cookie consent banner, small helpers. Requires base.css. */

/* Footer icons: cut-out shapes (YouTube play, Spotify waves) take the footer background */
.footer-social a {
    --icon-cut: var(--surface);
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-button:hover {
    color: var(--accent);
}

/* ---------- Back to top ---------- */

.to-top {
    position: fixed;
    right: clamp(16px, 3vw, 32px);
    bottom: calc(clamp(16px, 3vw, 32px) + var(--consent-offset, 0px));
    z-index: 60;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s var(--ease-out), bottom 0.25s var(--ease-out);
}

.to-top:not(.is-visible) {
    pointer-events: none;
}

.to-top.is-visible {
    opacity: 1;
    transform: none;
}

.to-top:hover {
    transform: translateY(-3px);
}

.to-top svg {
    width: 22px;
    height: 22px;
}

/* ---------- Cookie consent ---------- */

.consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    padding: 0 clamp(12px, 3vw, 24px) clamp(12px, 3vw, 24px);
    pointer-events: none;
}

.consent[hidden] {
    display: none;
}

.consent-inner {
    pointer-events: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px 32px;
    align-items: center;
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 24px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    animation: consent-in 0.4s var(--ease-out);
}

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

.consent-title {
    font-size: 22px;
    margin: 0 0 6px;
}

.consent p {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
}

.consent-actions {
    display: flex;
    gap: 10px;
}

/* Accept and Reject look the same on purpose: no nudging towards Accept. */
.consent-actions .btn {
    min-width: 110px;
    justify-content: center;
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

.consent-actions .btn:hover {
    background: transparent;
    color: var(--text);
}

@media (max-width: 640px) {
    .consent-inner {
        grid-template-columns: 1fr;
    }

    .consent-actions .btn {
        flex: 1;
    }
}
