/* ==========================================================================
   Other WoWS Tool Tabs
   --------------------------------------------------------------------------
   Reusable cross-site navigation tabs that appear to rise from the footer.

   Place .tool-dock INSIDE .site-footer. The footer itself remains transparent;
   the "behind the footer" illusion is created by anchoring a compact tab to
   the footer border and increasing its height upward on hover/focus.

   Depends on theme variables:
   --panel-soft, --panel-raised, --surface-hover, --border, --border-strong,
   --text, --heading, --muted, --blue, --blue-soft, --focus-ring, --shadow-soft
   ========================================================================== */

:root {
    --tool-tab-collapsed-height: 40px;
    --tool-tab-expanded-height: 112px;
    --tool-tab-clearance: 16px;
}

.tool-dock {
    position: absolute;
    left: 4px;
    bottom: 100%;
    z-index: 5;

    display: flex;
    align-items: flex-end;
    gap: 8px;

    max-width: calc(100% - 8px);
    transform: translateY(-2px);
}

/*
 * Only this short title strip is visible at rest.
 *
 * Because the dock is anchored at the footer's top border with bottom: 100%,
 * increasing the height makes the tab grow upward while its bottom edge stays
 * visually attached to that border.
 */
.tool-tab {
    display: block;

    width: max-content;
    min-width: 160px;
    max-width: 230px;
    height: var(--tool-tab-collapsed-height);
    padding: 8px 12px;

    overflow: hidden;

    border: 1px solid var(--border-strong);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;

    color: var(--text);
    background:
        linear-gradient(145deg,
            var(--panel-raised),
            var(--panel-soft));

    box-shadow: 0 -5px 14px rgba(0, 0, 0, 0.10);

    text-decoration: none;

    transition:
        height 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
        border-color 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
}

.tool-tab:hover,
.tool-tab:focus-visible {
    height: var(--tool-tab-expanded-height);

    color: var(--text);
    border-color: var(--blue);

    box-shadow:
        0 -10px 25px rgba(0, 0, 0, 0.16),
        0 0 0 1px var(--blue-soft);
}

.tool-tab:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.tool-tab-title {
    display: flex;
    align-items: center;
    gap: 8px;

    height: 22px;

    color: var(--heading);

    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;

    white-space: nowrap;
}

.tool-tab-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;

    object-fit: contain;

    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tool-tab:hover .tool-tab-icon,
.tool-tab:focus-visible .tool-tab-icon {
    transform: scale(1.1);
}

.tool-tab-description {
    margin: 14px 0 0;

    color: var(--muted);

    font-size: 0.72rem;
    line-height: 1.45;

    opacity: 0;
    transform: translateY(5px);

    transition:
        opacity 150ms ease 45ms,
        transform 190ms ease 45ms;
}

.tool-tab:hover .tool-tab-description,
.tool-tab:focus-visible .tool-tab-description {
    opacity: 1;
    transform: translateY(0);
}

.tool-dock-label {
    align-self: flex-end;

    margin: 0 4px 12px 0;

    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/*
 * Touch devices do not have a dependable hover interaction.
 * Keep the compact tab visible and make the whole thing a normal link.
 */
@media (hover: none) {

    .tool-tab,
    .tool-tab:hover,
    .tool-tab:focus-visible {
        height: 40px;
    }

    .tool-tab-description {
        display: none;
    }
}

@media (max-width: 520px) {
    .tool-dock {
        left: 0;
        right: 0;
        gap: 6px;

        max-width: 100%;
    }

    .tool-tab {
        min-width: 0;
        max-width: min(210px, calc(100vw - 36px));
    }

    .tool-tab-title {
        font-size: 0.72rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .tool-tab,
    .tool-tab-icon,
    .tool-tab-description {
        transition: none;
    }
}