// Welcome page: Woo Swatches > Welcome

.gsws-welcome {
    --ink: #1d2327;
    --ink-soft: #50575e;
    --ink-faint: #8c8f94;
    --line: #dcdcde;
    --card: #ffffff;
    --brand-1: #5b21e0;
    --brand-2: #9b2fd6;
    --brand-tint: #f4effd;
    --brand-line: #e2d6fb;
    --accent-tint: #fdeee9;
    --good-bg: #eaf7ee;
    --good-ink: #1e7a3e;
    --info-bg: #e9f1fd;
    --info-ink: #1d4ed8;
    --warn-bg: #fdf3e1;
    --warn-ink: #9a5b00;
    --shadow-sm: 0 1px 2px rgba(29, 23, 58, .06);
    --shadow-md: 0 8px 24px -8px rgba(60, 20, 120, .18);
    --sticky-top: var(--wp-admin--admin-bar--height, 32px);
    --tabs-h: 64px;
    --page-w: 1120px;

    // Stretch edge to edge over #wpcontent's left padding.
    margin-left: -20px;
    color: var(--ink);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;

    *,
    *::before,
    *::after { box-sizing: border-box; }

    h1, h2, h3, h4 { color: var(--ink); text-wrap: balance; }

    a { color: var(--brand-1); }

    code {
        background: #f5f1fc;
        color: var(--brand-1);
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 12.5px;
    }

    // ---------- PAGE HEAD ----------
    &__head {
        background: var(--card);
        padding: 22px 28px 0;
    }

    &__head-inner {
        max-width: var(--page-w);
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;

        h1 {
            margin: 0;
            padding: 0;
            font-size: 21px;
            font-weight: 700;
            line-height: 1.3;
        }
    }

    &__logo {
        display: block;
        width: 40px;
        height: 40px;
        flex: none;
    }

    &__ver {
        font-size: 11.5px;
        font-weight: 700;
        color: var(--brand-1);
        background: var(--brand-tint);
        border: 1px solid var(--brand-line);
        padding: 3px 8px;
        border-radius: 999px;

        &.is-pro {
            color: #fff;
            border-color: transparent;
            background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
        }
    }

    // ---------- TABS ----------
    &__tabs {
        position: sticky;
        top: var(--sticky-top);
        z-index: 20;
        background: rgba(255, 255, 255, .92);
        backdrop-filter: saturate(1.4) blur(8px);
        border-bottom: 1px solid var(--line);
        padding: 0 28px;

        .tabs {
            position: relative;
            max-width: var(--page-w);
            display: flex;
            gap: 4px;
            height: var(--tabs-h);
            align-items: center;
            overflow-x: auto;
            scrollbar-width: none;

            &::-webkit-scrollbar { display: none; }
        }

        .tab {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 9px 14px;
            border-radius: 9px;
            font-size: 13.5px;
            font-weight: 600;
            color: var(--ink-soft);
            text-decoration: none;
            white-space: nowrap;
            transition: color .15s ease, background .15s ease;

            svg {
                width: 16px;
                height: 16px;
                flex: none;
                opacity: .75;
                transition: opacity .15s ease;
            }

            &:hover {
                color: var(--ink);
                background: #f6f7f7;

                svg { opacity: 1; }
            }

            &:focus { box-shadow: none; }

            &:focus-visible {
                outline: 2px solid var(--brand-1);
                outline-offset: 2px;
            }

            &.current {
                color: var(--brand-1);
                background: var(--brand-tint);

                svg { opacity: 1; }
            }
        }

        .tabs-indicator {
            position: absolute;
            bottom: 0;
            left: 0;
            height: 3px;
            width: 0;
            border-radius: 3px 3px 0 0;
            background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
            transition: transform .25s ease, width .25s ease;
            pointer-events: none;
        }
    }

    &__content {
        max-width: calc(var(--page-w) + 56px);
        padding: 28px;
    }

    // Sections land just below the sticky tab bar when linked.
    section[id] { scroll-margin-top: calc(var(--sticky-top) + var(--tabs-h) + 20px); }

    // ---------- BUTTONS ----------
    .btn {
        font-weight: 700;
        font-size: 13.5px;
        line-height: 1.4;
        border-radius: 8px;
        padding: 11px 18px;
        border: none;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        transition: transform .12s ease;

        &:hover { transform: translateY(-1px); }
    }

    .btn-brand {
        background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
        color: #fff;
        box-shadow: 0 6px 16px -4px rgba(91, 33, 224, .45);

        &:hover,
        &:focus { color: #fff; }
    }

    .btn-outline {
        background: #fff;
        color: var(--ink);
        border: 1.5px solid var(--line);

        &:hover,
        &:focus { color: var(--ink); }
    }

    // ---------- HERO / AT A GLANCE ----------
    .welcome-hero {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 36px;
        align-items: center;
        padding: 32px;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: var(--shadow-sm);
    }

    .welcome-copy {
        .kicker { margin: 0 0 10px; }

        h2 {
            font-size: 25px;
            line-height: 1.3;
            margin: 0 0 12px;
        }

        > p:not(.kicker) {
            font-size: 14.5px;
            color: var(--ink-soft);
            line-height: 1.65;
            margin: 0 0 18px;
            max-width: 640px;
        }
    }

    .welcome-stats {
        display: flex;
        gap: 22px;
        margin-bottom: 20px;
        flex-wrap: wrap;

        div {
            font-size: 12.5px;
            color: var(--ink-soft);
        }

        b {
            display: block;
            font-size: 18px;
            color: var(--ink);
        }
    }

    .welcome-ctas {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
    }

    // The "Included free" card next to the hero copy.
    .glance-card {
        position: relative;
        border-radius: 14px;
        overflow: hidden;
        padding: 26px 26px 22px;
        color: #fff;
        box-shadow: var(--shadow-md);
        background:
            radial-gradient(circle at 85% 0%, rgba(255, 255, 255, .16), transparent 55%),
            linear-gradient(135deg, #2a1065, var(--brand-1) 55%, #c23fb0);

        h3 {
            color: #fff;
            font-size: 19px;
            line-height: 1.3;
            margin: 0 0 16px;
        }

        ul {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 9px;
        }

        li {
            position: relative;
            margin: 0;
            padding-left: 28px;
            font-size: 13.5px;
            line-height: 1.5;
            color: #f1eaff;

            &::before {
                content: "";
                position: absolute;
                left: 0;
                top: 1px;
                width: 19px;
                height: 19px;
                border-radius: 50%;
                background: rgba(255, 255, 255, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
            }
        }
    }

    .glance-kicker {
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: #e6d9ff;
        margin: 0 0 8px;
    }

    .glance-foot {
        margin-top: 18px;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, .22);

        a {
            color: #fff;
            font-weight: 700;
            font-size: 13.5px;
            text-decoration: none;

            &:hover,
            &:focus { text-decoration: underline; color: #fff; }
        }
    }

    // ---------- SECTIONS ----------
    section.block { margin-top: 52px; }

    .block-head {
        margin-bottom: 22px;

        h3 {
            font-size: 21px;
            line-height: 1.3;
            margin: 0 0 8px;
        }

        p:not(.kicker) {
            font-size: 14px;
            color: var(--ink-soft);
            line-height: 1.6;
            margin: 0;
            max-width: 720px;
        }
    }

    .kicker {
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--brand-1);
        margin: 0 0 8px;
    }

    // ---------- USAGE STEPS ----------
    .usage-steps {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .usage-step {
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 18px;
        box-shadow: var(--shadow-sm);

        .num {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: var(--brand-tint);
            color: var(--brand-1);
            font-weight: 800;
            font-size: 13px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 12px;
        }

        h4 {
            font-size: 14px;
            margin: 0 0 6px;
        }

        p {
            font-size: 12.5px;
            color: var(--ink-soft);
            line-height: 1.55;
            margin: 0;
        }

        code { font-size: 11.5px; }

        a {
            font-weight: 600;
            text-decoration: none;

            &:hover,
            &:focus { text-decoration: underline; }
        }
    }

    // ---------- FAQ ----------
    .faq {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .faq-item {
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 10px;
        overflow: hidden;

        &.open {
            .chev { transform: rotate(180deg); }
            .faq-a { max-height: 520px; }
        }
    }

    .faq-q {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 15px 18px;
        margin: 0;
        border: 0;
        background: none;
        text-align: left;
        cursor: pointer;
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        color: var(--ink);

        &:focus-visible {
            outline: 2px solid var(--brand-1);
            outline-offset: -2px;
        }

        .chev {
            color: var(--ink-faint);
            font-size: 13px;
            transition: transform .18s ease;
            flex: none;
        }
    }

    .faq-a {
        max-height: 0;
        overflow: hidden;
        transition: max-height .22s ease;

        p {
            margin: 0;
            padding: 0 18px 16px;
            font-size: 13.5px;
            color: var(--ink-soft);
            line-height: 1.65;
        }

        p + p { margin-top: -6px; }

        ul {
            list-style: disc;
            margin: -6px 0 0;
            padding: 0 18px 16px 38px;
            font-size: 13.5px;
            color: var(--ink-soft);
            line-height: 1.65;

            li { margin: 0; }
        }

        a { font-weight: 600; }
    }

    .docs-band {
        margin-top: 28px;
        background: var(--brand-tint);
        border: 1px solid var(--brand-line);
        border-radius: 12px;
        padding: 22px 26px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        flex-wrap: wrap;

        h4 {
            margin: 0 0 4px;
            font-size: 15.5px;
        }

        p {
            margin: 0;
            font-size: 13px;
            color: var(--ink-soft);
        }
    }

    // ---------- CHANGELOG ----------
    .changelog-switch {
        display: inline-flex;
        gap: 4px;
        margin-bottom: 18px;
        padding: 4px;
        background: var(--brand-tint);
        border: 1px solid var(--brand-line);
        border-radius: 999px;
    }

    .changelog-switch__btn {
        padding: 6px 20px;
        background: none;
        border: 0;
        border-radius: 999px;
        color: var(--brand-1);
        font-size: 13px;
        font-weight: 700;
        line-height: 1.4;
        cursor: pointer;

        &.is-active {
            color: #fff;
            background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
        }

        &:focus-visible {
            outline: 2px solid var(--brand-1);
            outline-offset: 2px;
        }
    }

    .changelog {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .release {
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 18px 20px;
        box-shadow: var(--shadow-sm);

        ul {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        li {
            display: flex;
            align-items: baseline;
            gap: 10px;
            margin: 0;
            font-size: 13.5px;
            color: var(--ink-soft);
            line-height: 1.5;
        }
    }

    .release-head {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
        flex-wrap: wrap;

        h4 {
            margin: 0;
            font-size: 15px;
        }

        time {
            font-size: 12px;
            color: var(--ink-faint);
        }

        .latest {
            font-size: 10.5px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .05em;
            color: var(--good-ink);
            background: var(--good-bg);
            padding: 3px 8px;
            border-radius: 999px;
        }
    }

    .tag {
        flex: none;
        min-width: 74px;
        text-align: center;
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
        padding: 2px 8px;
        border-radius: 5px;
        background: #f0f0f1;
        color: var(--ink-soft);

        &.added { background: var(--good-bg); color: var(--good-ink); }
        &.improved { background: var(--info-bg); color: var(--info-ink); }
        &.fixed { background: var(--accent-tint); color: #b33a22; }
        &.updated { background: var(--warn-bg); color: var(--warn-ink); }
        &.removed { background: #f6e8ec; color: #9f1d3f; }
    }

    .changelog-more {
        margin-top: 16px;
        font-size: 13.5px;
        font-weight: 600;
    }

    // ---------- REVIEWS ----------
    // Masonry columns, so a long review doesn't leave gaps next to short ones.
    .reviews {
        column-count: 3;
        column-gap: 16px;
    }

    .review {
        display: flex;
        flex-direction: column;
        margin: 0 0 16px;
        break-inside: avoid;
        padding: 20px;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 12px;
        box-shadow: var(--shadow-sm);

        h4 {
            margin: 0 0 6px;
            font-size: 14.5px;
            line-height: 1.4;
        }

        blockquote {
            flex: 1;
            margin: 0 0 16px;
            color: var(--ink-soft);
            font-size: 13.5px;
            line-height: 1.6;
        }

        figcaption {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
        }

        b,
        time { display: block; }

        time {
            color: var(--ink-faint);
            font-size: 12px;
        }
    }

    .review-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 10px;

        .review-stars { margin-bottom: 0; }
    }

    .review-source {
        padding: 2px 8px;
        border-radius: 999px;
        background: var(--brand-tint);
        color: var(--brand-1);
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
    }

    .review-stars {
        margin-bottom: 10px;
        color: #f5a623;
        font-size: 15px;
        letter-spacing: 2px;
        line-height: 1;
    }

    .review-avatar {
        display: grid;
        place-items: center;
        flex: none;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: var(--brand-tint);
        color: var(--brand-1);
        font-weight: 700;
    }

    .reviews-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 20px;
    }

    // ---------- RESPONSIVE ----------
    @media (max-width: 1100px) {
        .usage-steps { grid-template-columns: repeat(2, 1fr); }
        .reviews { column-count: 2; }
        .welcome-hero { grid-template-columns: minmax(0, 1fr); }
    }

    @media (max-width: 782px) {
        // #wpcontent padding drops to 10px here.
        margin-left: -10px;

        &__head,
        &__tabs,
        &__content {
            padding-left: 16px;
            padding-right: 16px;
        }

        .welcome-hero { padding: 20px; }
        .usage-steps,
        .reviews { column-count: 1; }

        .tab { padding: 8px 11px; }
    }

    // The admin bar stops being fixed below 600px.
    @media (max-width: 600px) {
        --sticky-top: 0px;

        .glance-card { padding: 20px; }
    }

    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: .001ms !important;
            transition-duration: .001ms !important;
        }
    }
}
