/* CSR Authoring, Publish: the renditions of the version shown, each with its status, files and actions, and its
   publications to the destinations. */
.csr-publish {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 0;
}

.csr-publish-message {
    padding: 1rem;
    color: var(--cai-muted);
}

.csr-publish-content[hidden],
.csr-publish-message[hidden],
.csr-authoring-workspace-publish[hidden] {
    display: none;
}

.csr-publish-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.csr-publish-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.csr-publish-item-title {
    font-weight: 600;
}

.csr-publish-muted {
    color: var(--cai-muted);
    font-size: 0.875rem;
}

.csr-publish-warning {
    color: var(--cai-warn);
    font-size: 0.875rem;
}

.csr-publish-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.csr-publish-actions {
    display: flex;
    gap: 0.5rem;
}

/* The Publish card: one tile per publish-only destination of the study's environment, its action at the bottom. */
.csr-publish-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.csr-publish-top {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

@media (max-width: 980px) {
    .csr-publish-top {
        grid-template-columns: minmax(0, 1fr);
    }
}

.csr-publish-section-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.csr-publish-grid,
.csr-publish-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
    gap: 0.875rem;
}

.csr-publish-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.csr-publish-check-copy {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.csr-publish-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Its own frame, not nphase-wc Card, whose actions sit in its header and whose body does not grow, so a stretched
   tile could not keep its action at the foot, in line with its neighbours (CsrPublishSurface.tile). */
.csr-publish-tile {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-width: 0;
    padding: 0.875rem 1rem;
    border: 0.0625rem solid var(--nwc-ui-border);
    border-radius: 0.5rem;
    background: var(--nwc-ui-surface);
}

.csr-publish-tile-head,
.csr-publish-tile-actions {
    display: flex;
}

.csr-publish-tile-actions {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    min-width: 0;
    max-width: 100%;
}

/* nph-button's inner control is width 100%. In this row that stretches each button to the card,
   so Download plus DOCX and PDF run past the card edge. */
.csr-publish-tile-actions > nph-button {
    width: auto;
    max-width: 100%;
    flex: 0 1 auto;
}

.csr-publish-tile-actions > .csr-publish-muted {
    flex: 1 0 100%;
}

.csr-publish-tile-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.csr-publish-target-who,
.csr-publish-target-status {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.csr-publish-target-status-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.csr-publish-target-name {
    font-weight: 600;
}

.csr-publish-target-endpoint {
    color: var(--cai-muted);
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

.csr-publish-target-open {
    color: var(--nwc-accent-on-light, var(--nwc-accent));
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

.csr-publish-target-open:hover {
    text-decoration: underline;
}
