/* Approved artwork header. Keep the stage and working panels on their original light surfaces. */
html.rocodeArtworkHeader {
    /* Keep the approved character size as the window narrows. */
    --header-artwork-art-x: max(240px, calc(50% - 392px));
    --header-artwork-glass-fill: rgba(255, 255, 255, 0.26);
    --header-artwork-glass-ink: #ffffff;
    --header-artwork-control-inset: 16px;
}

@media (max-width: 1180px) {
    html.rocodeArtworkHeader { --header-artwork-control-inset: 10px; }
}

@media (max-width: 720px) {
    html.rocodeArtworkHeader { --header-artwork-control-inset: 6px; }
}

html.rocodeArtworkHeader .rocodeAppHeader {
    padding-right: var(--header-artwork-control-inset);
}

html.rocodeArtworkHeader .rocodeAppHeader,
html.rocodeArtworkHeader .entry .entryTopFloatingView {
    background-color: #4f95ff;
    background-image: url('../assets/brand/header-artwork.png?v=3');
    background-repeat: no-repeat;
    background-size: auto 90px;
    background-position: var(--header-artwork-art-x) 0;
}

html.rocodeArtworkHeader .entry .entryTopFloatingView {
    background-position: var(--header-artwork-art-x) calc(-1 * var(--rocode-header-height));
    box-shadow: inset 0 -1px 0 rgba(29, 79, 152, 0.2);
}

html.rocodeArtworkHeader .roboThinkLogo,
html.rocodeArtworkHeader .rocodeProjectIdentity {
    background: transparent;
    box-shadow: none;
}

html.rocodeArtworkHeader .roboThinkLogo::after {
    /* Show the supplied logo colors without an added outline or shadow. */
    filter: none;
}

html.rocodeArtworkHeader .rocodeProjectIdentity {
    border-left-color: transparent;
}

html.rocodeArtworkHeader .rocodeProjectName {
    color: #ffffff;
}

html.rocodeArtworkHeader .rocodeProjectSaveState[data-state] {
    color: #ffffff;
}

html.rocodeArtworkHeader .rocodeProjectName:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.12);
}

html.rocodeArtworkHeader .rocodeAppHeader .rocodeProjectName:focus {
    background: #f7faff;
    color: #173452;
    /* Keep the edit indicator inside the field, clear of the save status. */
    outline: 2px solid #163d79;
    outline-offset: -2px;
}

html.rocodeArtworkHeader .rocodeProjectSaveStateDot {
    background-color: rgba(255, 255, 255, 0.65);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}

html.rocodeArtworkHeader .rocodeAppHeader .rocodeHeaderButton,
html.rocodeArtworkHeader .rocodeHeaderHistorySlot .rocodeHistoryButton {
    border-color: rgba(255, 255, 255, 0.58);
    color: var(--header-artwork-glass-ink);
    background-color: var(--header-artwork-glass-fill);
    background-image: none;
    -webkit-backdrop-filter: blur(5px) saturate(115%);
    backdrop-filter: blur(5px) saturate(115%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 3px rgba(22, 61, 121, 0.1);
}

html.rocodeArtworkHeader .rocodeAppHeader :is(.rocodeLanguageControl, .rocodeHelpControl)::before {
    color: var(--header-artwork-glass-ink);
}

/* Only recolor the existing icon shapes; sizes and positions stay unchanged. */
html.rocodeArtworkHeader .rocodeProgramModeControl[data-current-program-mode='block']::before {
    background-image: url('../assets/controls/header/block-mode.svg');
}

html.rocodeArtworkHeader .rocodeProgramModeControl[data-current-program-mode='python']::before {
    background-image: url('../assets/controls/header/python-mode.svg');
}

html.rocodeArtworkHeader .rocodeFileControl::before {
    background-image: url('../assets/controls/header/file-menu.svg');
}

html.rocodeArtworkHeader .rocodeZoomControl::before {
    background-image: url('../assets/controls/header/app-zoom.svg');
}

html.rocodeArtworkHeader .rocodeAppHeader .rocodeHeaderButton::after {
    filter: brightness(0) invert(1);
}

html.rocodeArtworkHeader .rocodeAppHeader .rocodeHardwareControlLabel,
html.rocodeArtworkHeader .rocodeAppHeader .rocodeHardwareControlName::after {
    color: var(--header-artwork-glass-ink);
}

html.rocodeArtworkHeader .rocodeAppHeader .rocodeHeaderButton:hover,
html.rocodeArtworkHeader .rocodeAppHeader .rocodeHeaderButton.is-open,
html.rocodeArtworkHeader .rocodeHeaderHistorySlot .rocodeHistoryButton:not(:disabled):hover {
    border-color: rgba(255, 255, 255, 0.85);
    color: var(--header-artwork-glass-ink);
    background-color: rgba(255, 255, 255, 0.48);
}

html.rocodeArtworkHeader .rocodeHeaderHistorySlot .rocodeHistoryButton:not(:disabled):active {
    color: var(--header-artwork-glass-ink);
}

html.rocodeArtworkHeader #workspace .rocodeHeaderHistorySlot .rocodeHistoryButton:disabled {
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: rgba(255, 255, 255, 0.48) !important;
    background-color: rgba(255, 255, 255, 0.14) !important;
    opacity: 1;
}

html.rocodeArtworkHeader .rocodeHeaderHistorySlot::before {
    background: rgba(255, 255, 255, 0.6);
}

/* Inactive scenes are compact glass tabs; the active white tab remains
   attached to the workspace. Keep Entry's measured text widths unchanged. */
html.rocodeArtworkHeader .entry .entrySceneButtonWorkspace:not(.selectedScene) {
    margin-top: 4px;
}

html.rocodeArtworkHeader .entry .entrySceneButtonWorkspace:not(.selectedScene) .entrySceneInputCover {
    height: 30px;
    margin-top: 0;
    padding: 2px 10px;
    border-color: rgba(255, 255, 255, 0.58);
    border-radius: 8px;
    background-color: var(--header-artwork-glass-fill);
}

html.rocodeArtworkHeader .entry .entrySceneButtonWorkspace:not(.selectedScene) .entrySceneInputCover:hover {
    border-color: rgba(255, 255, 255, 0.85);
    background-color: rgba(255, 255, 255, 0.48);
}

html.rocodeArtworkHeader .entry .entrySceneButtonWorkspace:not(.selectedScene) .entrySceneFieldWorkspace {
    color: #ffffff;
}

html.rocodeArtworkHeader .entry .entrySceneAddButtonWorkspace {
    background-color: #f7faff;
    border-radius: 8px;
}

html.rocodeArtworkHeader .entry .entryTopFloatingView .blockCountView {
    height: 34px;
    align-items: center;
    gap: 4px;
    margin: 0 var(--header-artwork-control-inset) 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #ffffff;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

html.rocodeArtworkHeader .entry .entryTopFloatingView .blockCountView strong {
    color: inherit;
    font-weight: 700;
}

/* Keep the destination tabs the same height in every editor, even when the
   block toolbar is hidden. All editor panels start at the tabs' bottom edge. */
html.rocodeArtworkHeader #workspace > .entryPlaygroundWorkspace
    > .entryPlaygroundTabWorkspace .entryTabListItemWorkspace {
    min-height: 44px;
    line-height: 44px;
}

/* Match the header's right inset. Each editor row is 52px high: the tabs
   have 8px above and meet the panel below; zoom/memo buttons keep 10px on both sides. */
html.rocodeArtworkHeader #workspace .rocodeBlockToolbar.entryPlaygroundButtonTabWorkspace {
    right: var(--header-artwork-control-inset);
    top: 46px;
    height: 36px;
    /* Include the extra edge inset in Entry's existing wrap measurement. */
    padding-left: max(0px, calc(var(--header-artwork-control-inset) - 8px));
}

html.rocodeArtworkHeader #workspace > .entryPlaygroundWorkspace
    > :is(.entryPlaygroundCodeWorkspace, .entryPlaygroundPictureWorkspace,
        .entryPlaygroundSoundWorkspace, .entryPlaygroundTextWorkspace,
        .entryPlaygroundTableWorkspace) {
    top: 90px;
}

html.rocodeArtworkHeader #workspace .rocodeCompactBlockToolbar > .rocodeBlockToolbar {
    top: 98px;
}

html.rocodeArtworkHeader #workspace > .rocodeCompactBlockToolbar:has(> .rocodeBlockToolbar.entryCode)
    > .entryPlaygroundCodeWorkspace {
    top: 142px;
}

html.rocodeArtworkHeader .rocodeAppHeader :focus-visible,
html.rocodeArtworkHeader .entryTopFloatingView :focus-visible {
    outline: 3px solid #163d79;
    outline-offset: 2px;
}

/* Match the light glass tint without transparency when blur is unavailable
   or reduced transparency is requested. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    html.rocodeArtworkHeader .rocodeAppHeader .rocodeHeaderButton,
    html.rocodeArtworkHeader #workspace .rocodeHeaderHistorySlot .rocodeHistoryButton {
        background: #7db1ff !important;
    }
}

@media (prefers-reduced-transparency: reduce) {
    html.rocodeArtworkHeader .rocodeAppHeader .rocodeHeaderButton,
    html.rocodeArtworkHeader #workspace .rocodeHeaderHistorySlot .rocodeHistoryButton {
        background: #7db1ff !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}
