/* ============================================================
   Captwiki Site Logo — Stylesheet
   2026 Edition | Zero extra DOM | GPU-only animations
   ============================================================ */

/* ── Base wrapper ────────────────────────────────────────── */
.captwiki-site-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    /* remove phantom inline gap */
}

.captwiki-site-logo img,
.captwiki-site-logo svg {
    display: block;
    height: auto;
    max-width: 100%;
    /* GPU-composited — no layout thrash */
    transition: transform 0.3s ease,
        opacity 0.3s ease,
        filter 0.3s ease,
        box-shadow 0.3s ease;
    will-change: transform, opacity, filter;
}

/* ── Text Logo ───────────────────────────────────────────── */
.captwiki-site-logo .cwk-text-logo {
    display: inline-block;
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-decoration: none;
    transition: color 0.3s ease, filter 0.3s ease;
    white-space: nowrap;
}

.captwiki-site-logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    outline-offset: 4px;
    /* visible focus ring without layout shift */
}

/* ── Dark mode — auto img switch via JS + CSS fallback ───── */
/*    If JS unavailable, CSS hides/shows via picture-like trick */
@media (prefers-color-scheme: dark) {
    .captwiki-site-logo[data-dark-logo] img {
        /* JS handles src swap; this adds extra safety opacity */
        opacity: 0.95;
    }
}

/* ============================================================
   HOVER ANIMATIONS
   All transform-based — GPU composited, zero layout shift
   ============================================================ */

/* Zoom In */
.captwiki-site-logo.cwk-anim-zoom-in:hover img,
.captwiki-site-logo.cwk-anim-zoom-in:hover svg {
    transform: scale(1.08);
}

/* Zoom Out */
.captwiki-site-logo.cwk-anim-zoom-out:hover img,
.captwiki-site-logo.cwk-anim-zoom-out:hover svg {
    transform: scale(0.93);
}

/* Lift Up */
.captwiki-site-logo.cwk-anim-lift:hover img,
.captwiki-site-logo.cwk-anim-lift:hover svg {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

/* Rotate CW */
.captwiki-site-logo.cwk-anim-rotate-cw:hover img,
.captwiki-site-logo.cwk-anim-rotate-cw:hover svg {
    transform: rotate(6deg) scale(1.04);
}

/* Pulse */
.captwiki-site-logo.cwk-anim-pulse img,
.captwiki-site-logo.cwk-anim-pulse svg {
    animation: cwk-logo-pulse 2s ease-in-out infinite;
}

@keyframes cwk-logo-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

/* Shake */
.captwiki-site-logo.cwk-anim-shake:hover img,
.captwiki-site-logo.cwk-anim-shake:hover svg {
    animation: cwk-logo-shake 0.5s ease;
}

@keyframes cwk-logo-shake {
    0% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-5px) rotate(-2deg);
    }

    30% {
        transform: translateX(5px) rotate(2deg);
    }

    45% {
        transform: translateX(-4px) rotate(-1deg);
    }

    60% {
        transform: translateX(4px) rotate(1deg);
    }

    75% {
        transform: translateX(-2px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Flip Horizontal */
.captwiki-site-logo.cwk-anim-flip-h:hover img,
.captwiki-site-logo.cwk-anim-flip-h:hover svg {
    transform: scaleX(-1);
}

/* Glow — color set via Elementor control → inline CSS var */
.captwiki-site-logo.cwk-anim-glow:hover img,
.captwiki-site-logo.cwk-anim-glow:hover svg {
    filter: drop-shadow(0 0 10px #0073aa);
    /* default; overridden by Elementor */
}

/* Fade Dim */
.captwiki-site-logo.cwk-anim-fade-dim:hover img,
.captwiki-site-logo.cwk-anim-fade-dim:hover svg {
    opacity: 0.55;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Respect reduced-motion system preference */
@media (prefers-reduced-motion: reduce) {

    .captwiki-site-logo img,
    .captwiki-site-logo svg,
    .captwiki-site-logo .cwk-text-logo {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus ring for keyboard users — visible without mouse */
.captwiki-site-logo a:focus-visible {
    outline: 3px solid currentColor;
    border-radius: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {

    .captwiki-site-logo img,
    .captwiki-site-logo svg {
        max-width: 80%;
    }
}