/* Daniel Casique CMS — layout over the gallery-editorial theme.

   Tokens (colour, type, spacing) come from the theme; this file only lays
   the editor out: a slim header, the always-visible publish bar, and the
   forms. Under 720px everything is one column so the phone works for the
   two things it is used for - uploading photos and hiding/showing a work.
   BLOCK B refines this file; the class vocabulary is the contract. */

.cms-body {
    background: var(--vfw-gallery-ivory, #f6f1e7);
    min-height: 100vh;
}

.cms-header {
    border-bottom: 1px solid var(--vfw-gallery-rule, rgba(0, 0, 0, 0.12));
}

.cms-header-inner {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 72rem;
    padding: 0.9rem 1.25rem;
}

.cms-brand {
    align-items: baseline;
    color: inherit;
    display: flex;
    gap: 0.6rem;
    text-decoration: none;
}

.cms-brand-mark {
    font-family: var(--vfw-gallery-font-display, "EB Garamond", serif);
    font-size: 1.5rem;
    letter-spacing: 0.08em;
}

.cms-brand-name {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cms-header-controls {
    align-items: center;
    display: flex;
    gap: 1rem;
}

.cms-language {
    display: flex;
    gap: 0.25rem;
}

.cms-language-button {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.5rem;
}

.cms-language-button.is-current {
    border-color: currentColor;
}

.cms-user {
    font-size: 0.85rem;
}

.cms-publish-bar {
    align-items: center;
    background: var(--vfw-gallery-paper, #fbf8f1);
    border-bottom: 1px solid var(--vfw-gallery-rule, rgba(0, 0, 0, 0.12));
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
}

.cms-publish-bar:empty {
    display: none;
}

.cms-publish-bar.is-dirty {
    background: var(--vfw-gallery-teal-soft, #e3efee);
}

.cms-publish-text {
    font-size: 0.9rem;
}

.cms-main {
    margin: 0 auto;
    max-width: 72rem;
    padding: 1.5rem 1.25rem 4rem;
}

.cms-view-head {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.cms-view-title {
    margin: 0;
}

.cms-form {
    max-width: 52rem;
}

.cms-field-label {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cms-field-note {
    font-size: 0.8rem;
    opacity: 0.75;
}

.cms-input {
    background: #fff;
    border: 1px solid var(--vfw-gallery-rule, rgba(0, 0, 0, 0.2));
    font: inherit;
    padding: 0.55rem 0.7rem;
    width: 100%;
}

.cms-input.is-readonly {
    background: transparent;
    opacity: 0.7;
}

.cms-textarea {
    min-height: 7rem;
    resize: vertical;
}

.cms-pair {
    border: 0;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr 1fr;
    margin: 0;
    padding: 0;
}

.cms-pair legend {
    grid-column: 1 / -1;
    padding: 0;
}

.cms-dimensions {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr 1fr;
}

.cms-curation {
    display: flex;
    gap: 0.5rem;
}

.cms-curation-clear {
    white-space: nowrap;
}

.cms-form-actions {
    align-items: center;
    gap: 1rem;
}

.cms-saved-at {
    font-size: 0.85rem;
    opacity: 0.75;
}

.cms-editorial {
    align-items: center;
    /* Without this the gap, the wrap and the centring below are all inert and
       the three controls render edge to edge. */
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.cms-badge {
    border: 1px solid currentColor;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.5rem;
    text-transform: uppercase;
}

.cms-images {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.cms-image-group-title {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
}

.cms-image-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.cms-image-card {
    margin: 0;
    width: 11rem;
}

.cms-image-thumb {
    background: #e9e4d8;
    cursor: zoom-in;
    display: block;
    height: auto;
    width: 100%;
}

.cms-image-caption {
    display: grid;
    font-size: 0.75rem;
    gap: 0.15rem;
    padding-top: 0.35rem;
}

.cms-image-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cms-upload-input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.cms-upload-label {
    cursor: pointer;
    display: inline-block;
}

.cms-upload-label.is-disabled {
    cursor: default;
    opacity: 0.5;
}

.cms-login {
    margin: 4rem auto 0;
    max-width: 24rem;
}

.cms-works-placeholder {
    display: grid;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}

.cms-works-head {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

.cms-works-heading {
    align-items: baseline;
    display: flex;
    gap: 0.75rem;
}

.cms-works-count {
    font-size: 0.85rem;
    opacity: 0.7;
}

.cms-works-controls {
    align-items: center;
    display: flex;
    gap: 1rem;
}

.cms-toggle-hidden {
    align-items: center;
    display: flex;
    font-size: 0.85rem;
    gap: 0.4rem;
}

.cms-works-empty {
    margin-top: 2rem;
}

.cms-works-table {
    border-collapse: collapse;
    width: 100%;
}

.cms-works-table th {
    border-bottom: 1px solid var(--vfw-gallery-rule, rgba(0, 0, 0, 0.2));
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: 0.5rem 0.6rem;
    text-align: left;
    text-transform: uppercase;
}

.cms-works-cell {
    border-bottom: 1px solid var(--vfw-gallery-rule, rgba(0, 0, 0, 0.1));
    padding: 0.6rem;
    vertical-align: middle;
}

.cms-works-cell-numeric {
    text-align: right;
}

.cms-works-cell-actions {
    text-align: right;
    white-space: nowrap;
}

.cms-works-row {
    cursor: pointer;
}

.cms-works-row:hover {
    background: var(--vfw-gallery-paper, #fbf8f1);
}

.cms-works-row.cms-row-hidden {
    opacity: 0.5;
}

.cms-order-controls {
    align-items: center;
    display: flex;
    gap: 0.35rem;
}

.cms-order-value {
    font-variant-numeric: tabular-nums;
    min-width: 1.5rem;
    text-align: right;
}

.cms-order-button {
    background: none;
    border: 1px solid var(--vfw-gallery-rule, rgba(0, 0, 0, 0.2));
    cursor: pointer;
    line-height: 1;
    padding: 0.15rem 0.4rem;
}

.cms-order-button:disabled {
    cursor: default;
    opacity: 0.3;
}

.cms-works-title {
    display: block;
    font-weight: 600;
}

.cms-working-title {
    font-style: italic;
}

.cms-works-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.3rem;
}

.cms-badge-pending {
    opacity: 0.7;
}

/* Eighteen fields in one column read as one undifferentiated list; the
   groups are what make the page scannable. */
.cms-section {
    border-top: 1px solid var(--gallery-editorial-rule, rgba(0, 0, 0, 0.1));
    margin-top: 2.5rem;
    padding-top: 1.25rem;
}

.cms-section:first-of-type {
    border-top: 0;
    margin-top: 1.5rem;
    padding-top: 0;
}

.cms-section-title {
    display: block;
    margin-bottom: 1rem;
}

.cms-section-note {
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

/* A fixed reference, not a field he can type in. */
.cms-slug-line {
    display: flex;
    gap: 0.5rem;
}

.cms-slug-value {
    font-family: var(--gallery-editorial-font-interface);
}

/* Short values do not need the full column. */
.cms-input.is-narrow {
    max-width: 10rem;
}

/* A sticky bar covers whatever scrolls under it, so the form keeps a floor
   of clearance and a focused field scrolls ABOVE the bar rather than behind
   it - otherwise he types into a textarea whose first line is hidden. */
.cms-form {
    /* Enough that the last field can clear the bar; the images section below
       supplies the rest of the scroll, so a taller floor here would only open
       a void in the middle of the page. */
    padding-bottom: 2rem;
}

.cms-form input,
.cms-form select,
.cms-form textarea {
    scroll-margin-bottom: 8rem;
}

/* Save was at the bottom of a 3200px page - the one action the page exists
   for, and the farthest thing on it. */
.cms-form-actions {
    background: var(--gallery-editorial-paper);
    border-top: 1px solid var(--gallery-editorial-rule, rgba(0, 0, 0, 0.12));
    bottom: 0;
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    padding: 0.9rem 0;
    position: sticky;
}

/* 22px was half the 44px minimum on a phone. */
.cms-image-delete {
    align-items: center;
    display: inline-flex;
    min-height: 44px;
}

/* The theme's row spacing is sized for the public page. */
.cms-works-tabs {
    margin-bottom: 1.25rem;
}

.cms-cover-panel {
    align-items: flex-start;
    border: 1px solid var(--vfw-gallery-rule, rgba(0, 0, 0, 0.12));
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.9rem;
}

.cms-cover-thumb {
    background: #e9e4d8;
    border-radius: 50%;
    height: 6rem;
    object-fit: cover;
    width: 6rem;
}

.cms-cover-copy {
    display: grid;
    gap: 0.4rem;
}

.cms-selected-input {
    padding: 0.3rem 0.4rem;
    text-align: right;
    width: 3.5rem;
}

.cms-dialog-overlay {
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1.5rem;
    position: fixed;
    z-index: 50;
}

.cms-dialog {
    background: var(--vfw-gallery-paper, #fbf8f1);
    max-height: calc(100vh - 3rem);
    max-width: 32rem;
    overflow-y: auto;
    padding: 1.5rem;
    width: 100%;
}

.cms-dialog-form {
    max-width: none;
    margin-top: 1rem;
}

@media (max-width: 720px) {
    .cms-header-inner,
    .cms-publish-bar {
        flex-wrap: wrap;
    }

    .cms-pair,
    .cms-dimensions {
        grid-template-columns: 1fr;
    }

    .cms-image-card {
        width: calc(50% - 0.375rem);
    }

    .cms-works-table,
    .cms-works-table thead,
    .cms-works-table tbody,
    .cms-works-table th,
    .cms-works-table tr {
        display: block;
    }

    .cms-works-table thead {
        display: none;
    }

    .cms-works-row {
        border-bottom: 1px solid var(--vfw-gallery-rule, rgba(0, 0, 0, 0.15));
        display: grid;
        gap: 0.3rem;
        padding: 0.75rem 0;
    }

    .cms-works-cell {
        border-bottom: 0;
        padding: 0;
    }

    .cms-works-cell-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
        text-align: left;
        white-space: normal;
    }

    .cms-works-cell-order,
    .cms-works-cell-numeric {
        text-align: left;
    }
}
/* @audited cfw style=a90e1fd7ac93 memsec=a90e1fd7ac93 test=a90e1fd7ac93 */
