/* =============================================================================
 * IN-12155 brief-F — styles for <rl2-source-standdown>.
 * =============================================================================
 * A separate file for brief C's two reasons, unchanged: resource-library-2.css
 * is scoped under .rl2-page and this component never renders there, and
 * _ai-workspace/ai-workspace.css is hot for IN-12081 QA. It is also separate
 * from rl2-source-picker.css because that file's header is the stacking
 * analysis from fix1 and this component has nothing to do with stacking — see
 * the next block, which is the point.
 *
 * SCOPING RULE (brief B D8): every class is rl2- prefixed, rl2-src- specifically.
 * The ONE non-rl2 selector in this file is `.ai-upload-zone`, and it can only be
 * reached through an immediately-preceding <rl2-source-standdown> element that
 * is carrying our active class — i.e. only inside a Source Materials section
 * that holds one of OUR mounts, on a surface where the RL2 permission gate
 * passed, at a moment when the service holds a selection. Delete the three
 * mounts and this file matches nothing in the application.
 * ========================================================================== */

/* =============================================================================
 * WHY THIS IS IN-FLOW AND NOT AN OVERLAY. Read before making it position:absolute.
 * =============================================================================
 * The contract says "overlay/panel replacing or covering the dropzone". This
 * implementation REPLACES. That is a deliberate reading of fix1's finding, not
 * a shortcut:
 *
 * _ai-workspace/ai-workspace.css:50-54 animates the config panel's first five
 * .ai-form-sections with `animation-fill-mode: both`, whose 100% keyframe is
 * transform: translateX(0) — not `none`, so each of those sections is a
 * PERMANENT stacking context. Source Materials is one of them. An absolutely
 * positioned overlay with a z-index would therefore be trapped inside that
 * section's own context, exactly as the picker's menu was trapped inside ours,
 * and "raise the z-index" would not fix it any more than it fixed that. The
 * remedy fix1 had to reach for — raising the WRAPPER via :has() — would mean
 * writing a position/z-index rule onto a Lotty section that is not ours.
 *
 * An in-flow panel that takes the dropzone's place in the flow needs no
 * stacking context, no z-index and no wrapper rule, so it cannot re-introduce
 * that bug, and it cannot be mis-sized against a dropzone whose height changes
 * with its file list. THERE IS NO z-index IN THIS FILE, and that is the design.
 *
 * It also gives rule 1's "no functioning upload affordance" for free and
 * completely: the dropzone is display:none, so it takes no click, no keyboard
 * focus and no drop — rather than sitting live underneath a transparent-ish
 * cover, which is what an overlay would leave for the first z-index accident to
 * expose.
 * ========================================================================== */

rl2-source-standdown {
    /* Inert by default — an unknown element is display:inline and this one is
       empty until a selection exists. The active class below is the ONLY thing
       that makes this component visible or lets it reach the dropzone. */
    display: none;
}

rl2-source-standdown.rl2-src-standdown-on {
    display: block;
}

rl2-source-standdown.rl2-src-standdown-on + .ai-upload-zone {
    /* RULE 1, and the whole of its enforcement. The dropzone's own markup is
       untouched in all three surfaces — no wrapper, no ng-class, no attribute —
       so when this selector stops matching (chip cleared, or gate absent) the
       zone is restored exactly as it was, with its files, its drag handlers and
       its accept list all untouched because they were never changed.

       `+` rather than :has(): CSS2, universally supported. A browser that drops
       this rule would show the panel AND a live dropzone, which is the exact
       state the contract forbids, so this one selector must not depend on a
       modern feature. The class it needs is set from the directive's link().

       The adjacency holds because each mount is inserted immediately before its
       surface's .ai-upload-zone, with only text nodes between; CSS sibling
       matching ignores text and comment nodes, including the ngIf placeholder
       comment that sits in front of this element. */
    display: none;
}

.rl2-src-standdown {
    /* Declared on the panel, never on :root — brief A's rule. */
    --rl2-src-sd-red: #a20f1f;
    --rl2-src-sd-red-soft: #fbeaec;
    --rl2-src-sd-text: #333;
    --rl2-src-sd-muted: #767676;

    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border: 1px dashed var(--rl2-src-sd-red);
    border-radius: 8px;
    background: var(--rl2-src-sd-red-soft);
    box-sizing: border-box;
    text-align: left;
}

.rl2-src-standdown *,
.rl2-src-standdown *:before,
.rl2-src-standdown *:after {
    box-sizing: border-box;
}

.rl2-src-standdown-icon {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--rl2-src-sd-red);
    font-size: 14px;
}

.rl2-src-standdown-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.rl2-src-standdown-text {
    margin: 0;
    color: var(--rl2-src-sd-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
}

.rl2-src-standdown-note {
    /* Rule 3's appended sentence. Quieter than the line above it: it is
       reassurance about files that are being kept, not the reason the dropzone
       is gone. */
    margin: 4px 0 0;
    color: var(--rl2-src-sd-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 17px;
}
