/* Gradient editor landing (/gradient-editor) */

.gradient-editor-landing-app {
    --gradient-editor-preview-height: 250px;
    align-items: start;
    gap: 12px 16px;
}

    .gradient-editor-landing-app > .filter-landing-stage {
        align-self: start;
        height: auto;
    }

@media (min-width: 961px) {
    .gradient-editor-landing-app > .filter-landing-controls {
        grid-row: 1;
        align-self: start;
    }
}

.gradient-editor-landing-stage {
    position: relative;
    background: linear-gradient(160deg, #f4f6fb, #e8eef8);
    box-shadow: none;
    min-height: 0;
    height: auto;
    overflow: visible;
    padding: clamp(12px, 2vw, 20px);
    display: grid;
    gap: 14px;
    align-content: start;
}

.dark .gradient-editor-landing-stage {
    background: linear-gradient(160deg, #121722, #0d1118);
}

.gradient-editor-stage-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: stretch;
    width: 100%;
    height: var(--gradient-editor-preview-height);
    min-height: var(--gradient-editor-preview-height);
    max-height: var(--gradient-editor-preview-height);
}

.gradient-editor-preview {
    height: var(--gradient-editor-preview-height);
    min-height: 0;
    max-height: var(--gradient-editor-preview-height);
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.dark .gradient-editor-preview {
    border-color: rgba(255, 255, 255, 0.12);
}

.gradient-editor-angle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: stretch;
    align-self: stretch;
    min-width: 36px;
}

    .gradient-editor-angle input[type="range"] {
        writing-mode: vertical-lr;
        direction: rtl;
        width: 20px;
        height: var(--gradient-editor-preview-height);
        min-height: var(--gradient-editor-preview-height);
        max-height: var(--gradient-editor-preview-height);
        flex: 0 0 auto;
        accent-color: #7c3aed;
    }

.gradient-editor-landing-bar {
    padding: 0 10px 8px;
}

    .gradient-editor-landing-bar .gradient-bar {
        height: 28px;
        border-radius: 8px;
        margin-bottom: 22px;
    }

.dark .gradient-editor-landing-bar .gradient-bar {
    border-color: rgba(255, 255, 255, 0.14);
}

.gradient-editor-landing-bar .handle {
    width: 22px;
    height: 22px;
    top: 26px;
}

    .gradient-editor-landing-bar .handle.is-selected {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 1px 3px rgba(0, 0, 0, 0.4);
    }

.gradient-editor-fullscreen-btn {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
}

.gradient-editor-type-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 8px;
}

.gradient-editor-types {
    display: flex;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
}

    .gradient-editor-types .landing-cta {
        flex: 1 1 0;
        min-width: 0;
        min-height: 34px;
        padding: 6px 12px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

.gradient-editor-random {
    flex: 0 0 auto;
    width: 34px;
    min-width: 34px;
    height: auto;
    min-height: 34px;
    padding: 0;
}

.gradient-editor-count-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 8px;
}

    .gradient-editor-count-row .fractal-landing-select {
        min-width: 72px;
    }

.gradient-editor-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.gradient-editor-swatch {
    min-height: 36px;
    border: 1px solid rgba(16, 24, 40, 0.14);
    border-radius: 8px;
    color: #fff;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

    .gradient-editor-swatch.is-selected {
        outline: 2px solid #2563eb;
        outline-offset: 1px;
    }

.dark .gradient-editor-swatch.is-selected {
    outline-color: #93c5fd;
}

.gradient-editor-fields {
    display: grid;
    gap: 8px;
}

.gradient-editor-field {
    display: grid;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--landing-muted, #5b6578);
}

.gradient-editor-field-row {
    display: flex;
    gap: 6px;
}

.gradient-editor-field input {
    width: 100%;
    min-width: 0;
    padding: 5px 8px;
    border: 1px solid rgba(16, 24, 40, 0.14);
    border-radius: 8px;
    background: #fff;
    color: var(--main-100);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

    .gradient-editor-field input[readonly] {
        opacity: 0.88;
    }

.dark .gradient-editor-field input {
    border-color: rgba(255, 255, 255, 0.14);
    background: #171c26;
    color: #f5f5f5;
}

.gradient-editor-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 8px;
}

    .gradient-editor-copy svg {
        display: block;
        width: 18px;
        height: 18px;
        fill: currentColor;
    }

    .gradient-editor-copy.is-copied {
        color: #15803d;
    }

.gradient-editor-landing-controls .filter-landing-actions-3 {
    margin-top: 2px;
    grid-template-columns: 1fr 1fr;
}

    .gradient-editor-landing-controls .filter-landing-actions-3 .landing-cta {
        min-height: 38px;
        padding: 8px 14px;
        font-size: 0.9rem;
    }

@media (max-width: 960px) {
    .gradient-editor-landing-app {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

        .gradient-editor-landing-app > .filter-landing-stage {
            grid-row: 1;
        }

        .gradient-editor-landing-app > .filter-landing-controls {
            grid-row: 2;
            align-self: start;
        }

    .gradient-editor-landing-controls {
        padding-inline-start: 0;
    }

    .gradient-editor-stage-row {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
        height: auto;
        max-height: none;
        gap: 8px;
    }

    .gradient-editor-preview {
        min-height: var(--gradient-editor-preview-height);
        height: auto;
        max-height: none;
    }

    .gradient-editor-landing-stage {
        padding: 8px;
    }

    .gradient-editor-angle {
        min-height: 0;
        flex-direction: row;
        align-self: stretch;
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }

        .gradient-editor-angle input[type="range"] {
            writing-mode: horizontal-tb;
            direction: ltr;
            width: 100%;
            height: 28px;
            min-height: 0;
            max-height: none;
            flex: 1 1 auto;
        }
}

@media (max-width: 600px) {
    .seo-page:has(#seo-gradient-editor) {
        width: 100%;
    }

        .seo-page:has(#seo-gradient-editor) .seo-page-hero--filter-demo {
            padding: 12px 0 0;
            border-inline: 0;
            border-radius: 0;
            overflow: visible;
        }

        .seo-page:has(#seo-gradient-editor) .seo-page-hero-copy,
        .seo-page:has(#seo-gradient-editor) .gradient-editor-landing-controls,
        .seo-page:has(#seo-gradient-editor) .seo-page-section,
        .seo-page:has(#seo-gradient-editor) .seo-page-cta-band {
            padding-inline: max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
        }
}

body.filter-app-mode .gradient-editor-landing-app > .filter-landing-stage {
    height: auto;
    align-self: start;
}

body.filter-app-mode .gradient-editor-landing-stage {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 12px;
    height: auto;
    min-height: 0;
    overflow: hidden;
    padding: 16px 20px 12px;
}

body.filter-app-mode .gradient-editor-stage-row {
    flex: 0 0 auto;
    min-height: 0;
    width: 100%;
    height: var(--gradient-editor-preview-height);
    max-height: var(--gradient-editor-preview-height);
    margin-inline: auto;
}

body.filter-app-mode .gradient-editor-preview {
    min-height: 0;
    height: var(--gradient-editor-preview-height);
    max-height: var(--gradient-editor-preview-height);
    width: 100%;
}

body.filter-app-mode .gradient-editor-angle {
    min-height: 0;
    align-self: stretch;
}

    body.filter-app-mode .gradient-editor-angle input[type="range"] {
        min-height: var(--gradient-editor-preview-height);
        height: var(--gradient-editor-preview-height);
        max-height: var(--gradient-editor-preview-height);
    }

.dark body.filter-app-mode .gradient-editor-landing-bar {
    background: rgba(15, 20, 30, 0.72);
    border-color: rgba(255, 255, 255, 0.1);
}

body.filter-app-mode .gradient-editor-landing-bar .gradient-bar {
    margin-bottom: 28px;
}

body.filter-app-mode .gradient-editor-landing-bar .handle {
    top: 38px;
}

@media (max-width: 960px) {
    body.filter-app-mode .gradient-editor-landing-app {
        grid-template-rows: minmax(0, 1fr) auto;
        min-height: 0;
    }

        body.filter-app-mode .gradient-editor-landing-app > .filter-landing-stage {
            min-height: 0;
            height: 100%;
            overflow: hidden;
        }

    body.filter-app-mode .gradient-editor-landing-stage {
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
        min-height: 0;
        padding: 8px;
        overflow: hidden;
    }

    body.filter-app-mode .gradient-editor-stage-row {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        max-width: none;
        height: auto;
        margin-inline: 0;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    body.filter-app-mode .gradient-editor-preview {
        min-height: 0;
        height: auto;
    }

    body.filter-app-mode .gradient-editor-angle {
        align-self: stretch;
    }

        body.filter-app-mode .gradient-editor-angle input[type="range"] {
            height: 28px;
            min-height: 0;
            max-height: none;
        }

    body.filter-app-mode .gradient-editor-landing-bar {
        flex: 0 0 auto;
        max-width: none;
        padding: 8px 10px 28px;
    }

    body.filter-app-mode .gradient-editor-landing-app > .filter-landing-controls {
        z-index: 1;
        max-height: min(34vh, 220px);
        overflow: auto;
        min-height: 0;
        overscroll-behavior: contain;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 600px) {
    body.filter-app-mode .gradient-editor-landing-app > .filter-landing-controls {
        max-height: min(32vh, 200px);
        gap: 8px;
    }

    body.filter-app-mode .gradient-editor-field:not(:first-child):not(.gradient-editor-field--css) {
        display: none;
    }
}
