/* IntelliClerk — Upload Case Documents / Upload Discovery.
   A layer over dashboard-v3.css and form.css, in that order. Both pages are the
   new-matter leaf carrying a written field and a chooser instead of a set of
   entries, so this file adds only the tabs, the description area, the chooser,
   and the list of what has been chosen. */

/* Where the paper came from is what parts these two pages, so each takes the
   tab its own section wears elsewhere on the docket. */
.tab--intake    { background: var(--ink); }
.tab--discovery { background: var(--steel); }

/* ---------- the written field ---------- */

/* The description is read by the summarizer, not filed with the court, so it is
   given the paragraph's width rather than the entry's line. */
.field__textarea {
    display: block;
    width: 100%;
    max-width: 42rem;
    min-height: 8rem;
    resize: vertical;
    font-family: var(--body);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--plate);
    border: 1px solid var(--rule);
    border-radius: var(--radius-control);
    padding: 0.8rem 0.95rem;
}

.field__textarea::placeholder {
    color: rgba(110, 97, 83, 0.55);
    font-style: italic;
}

.field__textarea:hover {
    border-color: var(--steel);
}

/* ---------- the chooser ---------- */

/* The file input is laid over the whole plate rather than sat beside it: the
   plate is the control, so a click anywhere on it opens the picker and a file
   dropped anywhere on it lands in the input itself — no script required for
   either. */
.dropzone {
    position: relative;
    max-width: 42rem;
    text-align: center;
    background: var(--plate);
    border: 1px dashed var(--rule);
    border-radius: var(--radius-control);
    padding: 2.1rem 1.5rem 1.9rem;
    transition: background 140ms ease, border-color 140ms ease;
}

.dropzone__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone:hover,
.dropzone.is-dragging {
    border-color: var(--steel);
    background: var(--vellum);
}

/* Dragging over it is the one moment the plate is a target rather than a
   surface, so the outline goes solid under the cursor. */
.dropzone.is-dragging {
    border-style: solid;
}

.dropzone__input:focus-visible {
    outline: none;
}

.dropzone:has(.dropzone__input:focus-visible) {
    outline: 2px solid var(--ochre);
    outline-offset: 3px;
}

.dropzone__mark {
    width: 1.9rem;
    height: 1.9rem;
    color: var(--steel);
    margin-bottom: 0.6rem;
}

.dropzone__lede {
    font-family: var(--body);
    font-size: 1.0625rem;
    color: var(--text);
}

.dropzone__link {
    color: var(--ochre);
    border-bottom: 1px solid var(--rule);
}

.dropzone:hover .dropzone__link {
    border-bottom-color: var(--ochre);
}

.dropzone__note {
    margin-top: 0.35rem;
    font-family: var(--data);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

/* ---------- what has been chosen ---------- */

/* Chosen files are set as a numbered list in the docket's own hand, so what is
   about to be filed reads the way it will read once it is on file. */
.filed {
    max-width: 42rem;
    list-style: none;
    margin: 1.1rem 0 0;
    padding: 0;
    border-top: 1px solid var(--rule-soft);
}

.filed__item {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    padding: 0.65rem 0.2rem;
    border-bottom: 1px solid var(--rule-soft);
}

.filed__entry {
    flex: 0 0 1.5rem;
    font-family: var(--data);
    font-size: 0.75rem;
    color: var(--muted);
    text-align: right;
}

.filed__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.0625rem;
    overflow-wrap: anywhere;
}

.filed__size {
    font-family: var(--data);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    white-space: nowrap;
}

.filed__drop {
    flex: 0 0 auto;
    font-family: var(--data);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    background: none;
    border: 0;
    padding: 0.15rem 0.2rem;
    cursor: pointer;
}

.filed__drop:hover {
    color: var(--ochre-deep);
}

/* The tally closes the list the way a certificate closes a filing. */
.filed__tally {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    max-width: 42rem;
    margin-top: 0.6rem;
    font-family: var(--data);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.filed__clear {
    font-family: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    text-transform: uppercase;
    color: var(--muted);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.filed__clear:hover {
    color: var(--ochre-deep);
}

/* The chooser is the last thing on the leaf, so its rule is the foot's. */
.upload .field:last-of-type {
    border-bottom: 0;
}

.upload .field__hint {
    max-width: 42rem;
}

/* ---------- narrow screens ---------- */

@media (max-width: 40rem) {
    .dropzone {
        padding: 1.6rem 1rem 1.4rem;
    }

    .filed__item {
        flex-wrap: wrap;
        row-gap: 0.2rem;
    }

    .filed__name {
        flex: 1 1 100%;
        order: 1;
    }

    .filed__entry {
        order: 0;
        text-align: left;
    }

    .filed__size,
    .filed__drop {
        order: 2;
    }
}
