/* Photographic red lacquer and frosted glass commands.
   This sheet is shared with the homepage and changes paint only. Component
   sizing, hidden states, tool tabs, switches and editor/icon controls remain
   controlled by their own stylesheets. Load after photographic-glass.css. */
.grey-site.glass-depth {
    --photo-button-fill: #940d14;
    --photo-button-hover-fill: #ad1018;
    --photo-button-text: #fff;
    --photo-button-border: rgba(247, 79, 85, .9);
    --photo-button-border-light: rgba(255, 223, 220, .95);
    --photo-button-border-shade: rgba(92, 7, 13, .8);
    --photo-button-radius: 11px;
    --photo-button-blur: none;
    --photo-button-shine: linear-gradient(170deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, .035) 32%, transparent 49%, rgba(50, 0, 6, .16) 84%, rgba(255, 80, 85, .1) 100%);
    --photo-button-hover-shine: linear-gradient(170deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, .055) 35%, transparent 52%, rgba(55, 0, 6, .16));
    --photo-button-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 1px 0 0 rgba(255, 200, 197, .26), inset 0 -1px 1px rgba(51, 0, 6, .42), 0 1px 1px rgba(255, 255, 255, .55), 0 3px 5px rgba(45, 18, 20, .2), 0 8px 15px rgba(60, 16, 20, .12), 0 0 11px rgba(237, 38, 47, .16);
    --photo-button-hover-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), inset 1px 0 0 rgba(255, 200, 197, .34), inset 0 -1px 1px rgba(51, 0, 6, .42), 0 1px 1px rgba(255, 255, 255, .7), 0 4px 6px rgba(45, 18, 20, .2), 0 9px 18px rgba(60, 16, 20, .16), 0 0 16px rgba(237, 38, 47, .27);
}

/* Explicit command classes avoid painting navigation toggles, carousels,
   text editors, syntax tools and selection controls as submit buttons. The
   important paint rules replace older component and glass-depth overrides. */
.grey-site.glass-depth :is(
    .header-cta, .dark-command, .button:not(.read-more), .ghost-dark,
    button[type="submit"]:not(.article-action):not(.member-section-options button),
    .json-tool-action:not(.json-search-step):not(.json-tree-toggle),
    .comparer-action, .password-tool-action, .date-tool-action, .date-text-action,
    .encoder-action, .ico-tool-action, .ico-file-action, .downloader-action,
    .downloader-clear-action, .bgr-action:not(.bgr-icon), .ai-btn:not(.ai-icon),
    .ns-button:not(.ns-icon), .margin-primary, .user-access-edit,
    .google-secondary, .reference-command, .invoice-print-button,
    .process-builder-clear, .process-template-stage-add,
    [data-builder-next], .protected-note > [data-login-open],
    .project-list.tool-list > article > a
):not(:is(
    .menu-toggle, .search-toggle, .nav-dropdown-toggle, .modal-close, .scroll-top,
    .portfolio-image-trigger, .portfolio-lightbox-close, .project-image-preview-remove,
    .project-attachment-remove, .article-action, .article-code-copy,
    .json-tree-toggle, .json-search-step, .ns-icon, .ai-icon, .bgr-icon,
    .reference-icon, [role="tab"], [role="switch"], [aria-pressed],
    .article-body-toolbar *, .member-section-options *
)) {
    --photo-button-current-fill: var(--photo-button-fill);
    --photo-button-current-shine: var(--photo-button-shine);
    --photo-button-current-shadow: var(--photo-button-shadow);
    box-sizing: border-box;
    color: var(--photo-button-text) !important;
    background-color: var(--photo-button-current-fill) !important;
    background-image: var(--photo-button-current-shine) !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
    border-color: var(--photo-button-border) !important;
    border-top-color: var(--photo-button-border-light) !important;
    border-bottom-color: var(--photo-button-border-shade) !important;
    border-radius: var(--photo-button-radius) !important;
    box-shadow: var(--photo-button-current-shadow) !important;
    -webkit-backdrop-filter: var(--photo-button-blur) !important;
    backdrop-filter: var(--photo-button-blur) !important;
    filter: none !important;
    text-shadow: none !important;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

/* Clear commands have opaque dark labels, a fine polished steel rim, and a
   soft white reflection. Their original sizes and component spacing stay. */
.grey-site.glass-depth :is(
    .ghost-dark, .button.secondary, .google-secondary,
    .json-tool-action:not(.json-primary-action):not(.json-search-find),
    .comparer-action:not(.comparer-primary-action),
    .password-copy-action, .date-text-action,
    .encoder-action:not(.encoder-primary-action),
    .ico-tool-action:not(.ico-primary-action),
    .downloader-clear-action, .bgr-action:not(.bgr-primary),
    .ai-btn:not(.ai-primary), .ns-button:not(.ns-primary),
    .invoice-print-button, .process-builder-clear
) {
    --photo-button-fill: rgba(255, 255, 255, .8);
    --photo-button-hover-fill: rgba(255, 255, 255, .94);
    --photo-button-text: #252528;
    --photo-button-border: rgba(131, 126, 129, .48);
    --photo-button-border-light: rgba(255, 255, 255, .98);
    --photo-button-border-shade: rgba(110, 104, 108, .48);
    --photo-button-blur: blur(12px);
    --photo-button-shine: linear-gradient(163deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .25) 32%, transparent 52%, rgba(135, 124, 128, .075) 87%, rgba(255, 255, 255, .46));
    --photo-button-hover-shine: linear-gradient(163deg, #fff, rgba(255, 255, 255, .36) 34%, transparent 55%, rgba(179, 27, 39, .04));
    --photo-button-shadow: inset 0 1px 0 #fff, inset 1px 0 0 rgba(255, 255, 255, .8), inset 0 -1px 0 rgba(111, 101, 107, .16), 0 1px 1px rgba(255, 255, 255, .75), 0 3px 5px rgba(38, 31, 35, .14), 0 8px 14px rgba(38, 31, 35, .07), 0 0 9px rgba(218, 37, 47, .055);
    --photo-button-hover-shadow: inset 0 1px 0 #fff, inset 1px 0 0 #fff, inset 0 -1px 0 rgba(163, 28, 39, .2), 0 1px 1px rgba(255, 255, 255, .85), 0 4px 6px rgba(38, 31, 35, .14), 0 9px 16px rgba(38, 31, 35, .1), 0 0 13px rgba(218, 37, 47, .14);
}

.grey-site.glass-depth :is(
    .header-cta, .dark-command, .button:not(.read-more), .ghost-dark,
    button[type="submit"]:not(.article-action):not(.member-section-options button),
    .json-tool-action:not(.json-search-step):not(.json-tree-toggle),
    .comparer-action, .password-tool-action, .date-tool-action, .date-text-action,
    .encoder-action, .ico-tool-action, .ico-file-action, .downloader-action,
    .downloader-clear-action, .bgr-action:not(.bgr-icon), .ai-btn:not(.ai-icon),
    .ns-button:not(.ns-icon), .margin-primary, .user-access-edit,
    .google-secondary, .reference-command, .invoice-print-button,
    .process-builder-clear, .process-template-stage-add,
    [data-builder-next], .protected-note > [data-login-open],
    .project-list.tool-list > article > a
):not(:is(
    .menu-toggle, .search-toggle, .nav-dropdown-toggle, .modal-close, .scroll-top,
    .portfolio-image-trigger, .portfolio-lightbox-close, .project-image-preview-remove,
    .project-attachment-remove, .article-action, .article-code-copy,
    .json-tree-toggle, .json-search-step, .ns-icon, .ai-icon, .bgr-icon,
    .reference-icon, [role="tab"], [role="switch"], [aria-pressed],
    .article-body-toolbar *, .member-section-options *
)):hover:not(:disabled):not([aria-disabled="true"]) {
    --photo-button-current-fill: var(--photo-button-hover-fill);
    --photo-button-current-shine: var(--photo-button-hover-shine);
    --photo-button-current-shadow: var(--photo-button-hover-shadow);
    color: var(--photo-button-text) !important;
    background-color: var(--photo-button-current-fill) !important;
    background-image: var(--photo-button-current-shine) !important;
    box-shadow: var(--photo-button-current-shadow) !important;
    border-color: var(--photo-button-border) !important;
    border-top-color: var(--photo-button-border-light) !important;
    border-bottom-color: var(--photo-button-border-shade) !important;
    filter: none !important;
    transform: none;
}

/* A pressed command settles into its contact shadow without moving text. */
.grey-site.glass-depth :is(
    .header-cta, .dark-command, .button:not(.read-more), .ghost-dark,
    button[type="submit"]:not(.article-action):not(.member-section-options button),
    .json-tool-action:not(.json-search-step):not(.json-tree-toggle),
    .comparer-action, .password-tool-action, .date-tool-action, .date-text-action,
    .encoder-action, .ico-tool-action, .ico-file-action, .downloader-action,
    .downloader-clear-action, .bgr-action:not(.bgr-icon), .ai-btn:not(.ai-icon),
    .ns-button:not(.ns-icon), .margin-primary, .user-access-edit,
    .google-secondary, .reference-command, .invoice-print-button,
    .process-builder-clear, .process-template-stage-add,
    [data-builder-next], .protected-note > [data-login-open],
    .project-list.tool-list > article > a
):not(:is(
    .menu-toggle, .search-toggle, .nav-dropdown-toggle, .modal-close, .scroll-top,
    .portfolio-image-trigger, .portfolio-lightbox-close, .project-image-preview-remove,
    .project-attachment-remove, .article-action, .article-code-copy,
    .json-tree-toggle, .json-search-step, .ns-icon, .ai-icon, .bgr-icon,
    .reference-icon, [role="tab"], [role="switch"], [aria-pressed],
    .article-body-toolbar *, .member-section-options *
)):active:not(:disabled):not([aria-disabled="true"]) {
    box-shadow: inset 0 1px 3px rgba(34, 14, 18, .23), inset 0 -1px 0 rgba(255, 255, 255, .38), 0 2px 3px rgba(39, 27, 31, .16), 0 0 8px rgba(218, 37, 47, .12) !important;
}

/* Text commands keep their established inline dimensions and clear wording. */
.grey-site.glass-depth .text-command {
    color: #2a2528;
    border-bottom-color: rgba(138, 113, 119, .55);
    text-shadow: none;
}
.grey-site.glass-depth .text-command:hover {
    color: #9f101a;
    border-bottom-color: #bd1722;
}
.grey-site.glass-depth :is(.header-cta, .dark-command, .button, .ghost-dark, .reference-command) > i {
    color: inherit;
    text-shadow: none;
}

/* Delete/remove commands retain a clear red danger treatment, including
   existing secondary controls inside explicit destructive forms. */
.grey-site.glass-depth :is(
    form[action$="/delete"], form[action$="/remove"],
    .portfolio-admin-delete, .subscription-delete
) :is(button[type="submit"], .button):not(:is(
    .project-attachment-remove, .project-image-preview-remove, .article-action,
    .article-body-toolbar *, .member-section-options *
)),
.grey-site.glass-depth :is(.button-danger, .danger, [data-danger]):not(:is([role="switch"], [role="tab"])) {
    --photo-button-fill: #800b13;
    --photo-button-hover-fill: #a2111b;
    --photo-button-text: #fff;
    --photo-button-border: rgba(206, 47, 62, .92);
    --photo-button-border-light: rgba(255, 201, 204, .9);
    --photo-button-border-shade: rgba(78, 4, 12, .88);
    --photo-button-blur: none;
}

.grey-site.glass-depth :is(
    .header-cta, .dark-command, .button:not(.read-more), .ghost-dark,
    button[type="submit"]:not(.article-action):not(.member-section-options button),
    .json-tool-action:not(.json-search-step):not(.json-tree-toggle),
    .comparer-action, .password-tool-action, .date-tool-action, .date-text-action,
    .encoder-action, .ico-tool-action, .ico-file-action, .downloader-action,
    .downloader-clear-action, .bgr-action:not(.bgr-icon), .ai-btn:not(.ai-icon),
    .ns-button:not(.ns-icon), .margin-primary, .user-access-edit,
    .google-secondary, .reference-command, .invoice-print-button,
    .process-builder-clear, .process-template-stage-add,
    [data-builder-next], .protected-note > [data-login-open],
    .project-list.tool-list > article > a
):not(:is(
    .menu-toggle, .search-toggle, .nav-dropdown-toggle, .modal-close, .scroll-top,
    .portfolio-image-trigger, .portfolio-lightbox-close, .project-image-preview-remove,
    .project-attachment-remove, .article-action, .article-code-copy,
    .json-tree-toggle, .json-search-step, .ns-icon, .ai-icon, .bgr-icon,
    .reference-icon, [role="tab"], [role="switch"], [aria-pressed],
    .article-body-toolbar *, .member-section-options *
)):focus-visible,
.grey-site.glass-depth .text-command:focus-visible {
    outline: 2px solid #950d18 !important;
    outline-offset: 4px;
}

/* Existing disabled opacity/visibility is preserved; remove only the glow. */
.grey-site.glass-depth :is(
    .button, .ghost-dark, .json-tool-action, .comparer-action, .password-tool-action,
    .date-tool-action, .encoder-action, .ico-tool-action, .downloader-action,
    .bgr-action:not(.bgr-icon), .ai-btn:not(.ai-icon), .ns-button:not(.ns-icon),
    .margin-primary, .reference-command, .user-access-edit,
    button[type="submit"]:not(.article-action):not(.member-section-options button)
):not(:is(
    .article-body-toolbar *, .member-section-options *, .project-attachment-remove,
    .project-image-preview-remove, .json-tree-toggle, .json-search-step,
    [role="tab"], [role="switch"], [aria-pressed]
)):is(:disabled, [aria-disabled="true"]) {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .48), 0 2px 3px rgba(39, 27, 31, .1) !important;
    cursor: not-allowed;
    transform: none;
}

@media (prefers-reduced-transparency: reduce) {
    .grey-site.glass-depth :is(.ghost-dark, .button.secondary, .google-secondary,
        .json-tool-action:not(.json-primary-action):not(.json-search-find),
        .comparer-action:not(.comparer-primary-action), .password-copy-action,
        .date-text-action, .encoder-action:not(.encoder-primary-action),
        .ico-tool-action:not(.ico-primary-action), .downloader-clear-action,
        .bgr-action:not(.bgr-primary), .ai-btn:not(.ai-primary),
        .ns-button:not(.ns-primary), .invoice-print-button, .process-builder-clear) {
        --photo-button-fill: #fff;
        --photo-button-hover-fill: #fff;
        --photo-button-blur: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .grey-site.glass-depth :is(.header-cta, .dark-command, .button, .ghost-dark,
        .json-tool-action, .comparer-action, .password-tool-action,
        .date-tool-action, .encoder-action, .ico-tool-action, .downloader-action,
        .bgr-action, .ai-btn, .ns-button, .margin-primary, .reference-command) {
        transition: none;
    }
}

@media (forced-colors: active) {
    .grey-site.glass-depth {
        --photo-button-fill: ButtonFace;
        --photo-button-hover-fill: Highlight;
        --photo-button-text: ButtonText;
        --photo-button-border: ButtonText;
        --photo-button-border-light: ButtonText;
        --photo-button-border-shade: ButtonText;
        --photo-button-shine: none;
        --photo-button-hover-shine: none;
        --photo-button-shadow: none;
        --photo-button-hover-shadow: none;
        --photo-button-blur: none;
    }
    .grey-site.glass-depth :is(.button, .ghost-dark, .google-secondary,
        .json-tool-action, .comparer-action, .password-tool-action,
        .date-tool-action, .date-text-action, .encoder-action, .ico-tool-action,
        .downloader-action, .downloader-clear-action, .bgr-action, .ai-btn,
        .ns-button, .margin-primary, .reference-command, .invoice-print-button,
        .process-builder-clear, .user-access-edit, .button-danger, .danger,
        [data-danger], button[type="submit"]) {
        --photo-button-fill: ButtonFace;
        --photo-button-hover-fill: Highlight;
        --photo-button-text: ButtonText;
        --photo-button-border: ButtonText;
        --photo-button-border-light: ButtonText;
        --photo-button-border-shade: ButtonText;
        --photo-button-shine: none;
        --photo-button-hover-shine: none;
        --photo-button-shadow: none;
        --photo-button-hover-shadow: none;
        --photo-button-blur: none;
    }
}

@media print {
    .grey-site.glass-depth {
        --photo-button-fill: #fff;
        --photo-button-hover-fill: #fff;
        --photo-button-text: #111;
        --photo-button-border: #aaa;
        --photo-button-border-light: #aaa;
        --photo-button-border-shade: #aaa;
        --photo-button-shine: none;
        --photo-button-hover-shine: none;
        --photo-button-shadow: none;
        --photo-button-hover-shadow: none;
        --photo-button-blur: none;
    }
    .grey-site.glass-depth :is(.button, .ghost-dark, .google-secondary,
        .json-tool-action, .comparer-action, .password-tool-action,
        .date-tool-action, .date-text-action, .encoder-action, .ico-tool-action,
        .downloader-action, .downloader-clear-action, .bgr-action, .ai-btn,
        .ns-button, .margin-primary, .reference-command, .invoice-print-button,
        .process-builder-clear, .user-access-edit, .button-danger, .danger,
        [data-danger], button[type="submit"]) {
        --photo-button-fill: #fff;
        --photo-button-hover-fill: #fff;
        --photo-button-text: #111;
        --photo-button-border: #aaa;
        --photo-button-border-light: #aaa;
        --photo-button-border-shade: #aaa;
        --photo-button-shine: none;
        --photo-button-hover-shine: none;
        --photo-button-shadow: none;
        --photo-button-hover-shadow: none;
        --photo-button-blur: none;
    }
}
