/* Committee show editor. Scoped under the theme content wrapper. */

.cp-postcontent .cp-show-editor {
    max-width: 760px;
    margin: 0 auto;
    color: #3d2314;
}

.cp-postcontent .cp-show-editor--edit {
    max-width: none;
}

.cp-postcontent .cp-show-editor__top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 0 0 0.85rem;
}

.cp-postcontent .cp-show-editor__top .cp-shows-breadcrumbs {
    margin-bottom: 0;
}

.cp-postcontent .cp-show-editor__top .cp-show-editor__message {
    margin-top: 0.65rem;
}

.cp-postcontent .cp-show-editor__top .cp-show-editor__message:first-child {
    margin-top: 0;
}

.cp-postcontent .cp-show-editor__message {
    padding: 0.8rem 1rem;
    background: #f7f3ee;
    border-radius: 6px;
    margin: 0 0 1rem;
}

.cp-postcontent .cp-show-editor__message--success {
    background: #eef5e8;
    border: 1px solid #c4d4bc;
}

.cp-postcontent .cp-show-editor__message--warning {
    background: #fff6e6;
    border: 1px solid #e8c88a;
}

.cp-postcontent .cp-show-editor__section-notice {
    margin: 0 0 0.55rem;
    padding: 0.55rem 0.75rem;
    background: #fff;
    border: 1px solid #c4d4bc;
    border-radius: 6px;
    color: #3d2314;
}

.cp-postcontent .cp-show-editor__section-notice[hidden] {
    display: none !important;
}

/* THEME OVERRIDE: .cp-show-editor__programme-filename { display: block } wins over [hidden] otherwise. */
.cp-postcontent .cp-show-editor [hidden] {
    display: none !important;
}

.cp-postcontent .cp-show-editor__section-notice.is-error {
    background: #fde8e4;
    border-color: #e4b8b0;
}

.cp-postcontent .cp-show-editor__section--details > .cp-show-editor__section-notice {
    margin-top: 0.35rem;
}

.cp-postcontent .cp-show-editor__section {
    margin: 0 0 1.25rem;
    padding: 1rem 1.1rem 1.15rem;
    background: linear-gradient(135deg, #faf6f1 0%, #f3ebe2 50%, #ebe3d8 100%);
    border: 1px solid #d9cbbd;
    border-left: 4px solid #812312;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(61, 35, 20, 0.1);
    box-sizing: border-box;
}

.cp-postcontent .cp-show-editor__section > h2 {
    margin: 0 0 0.75rem !important;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid #d4c4b4;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #500000 !important;
    letter-spacing: 0.01em;
}

.cp-postcontent .cp-show-editor__toolbar {
    margin-bottom: 1rem;
}

.cp-postcontent .cp-show-editor__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cp-postcontent .cp-show-editor__list li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #e4d8cc;
}

.cp-postcontent .cp-show-editor__list a {
    color: #7a2e2e !important;
    font-weight: 700;
    text-decoration: none !important;
}

.cp-postcontent .cp-show-editor__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    margin: 0 0 0.85rem;
}

/* THEME OVERRIDE: nav uses link-styled controls; keep them compact (not full-height chrome). */
.cp-postcontent .cp-show-editor__nav a.cp-show-editor__button {
    display: inline-flex !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0.35rem 0.85rem !important;
    line-height: 1.3 !important;
    font-size: 0.95rem !important;
    box-sizing: border-box !important;
    flex: 0 0 auto;
    align-self: center;
}

.cp-postcontent .cp-show-editor__list span {
    color: #5c5148;
}

.cp-postcontent .cp-show-editor .cp-form-group {
    margin: 0 0 0.75rem;
}

.cp-postcontent .cp-show-editor__title-author-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin: 0 0 0.75rem;
}

.cp-postcontent .cp-show-editor__title-author-row .cp-show-editor__title-author-cell {
    margin: 0;
    min-width: 0;
}

.cp-postcontent .cp-show-editor__title-author-row .cp-show-editor__title-author-cell input[type="text"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.cp-postcontent .cp-show-editor__title-author-row--title-only {
    grid-template-columns: minmax(0, 1fr);
}

.cp-postcontent .cp-show-editor .cp-form-group label {
    display: block;
    margin: 0 0 0.35rem;
    font-weight: 700;
}

.cp-postcontent .cp-show-editor__hint {
    margin: 0.35rem 0 0;
    color: #5c5148;
    font-size: 0.92rem;
}

.cp-postcontent .cp-show-editor__section--media .cp-show-editor__poster-block {
    margin: 0 0 0.5rem;
}

.cp-postcontent .cp-show-editor__section--media .cp-show-editor__poster-block .cp-show-editor__programme-label {
    margin-bottom: 0.35rem;
}

.cp-postcontent .cp-show-editor__section--media .cp-show-editor__programme {
    margin-top: 0.75rem;
}

.cp-postcontent .cp-show-editor__section--media .cp-show-editor__gallery {
    margin-top: 0.75rem;
}

.cp-postcontent .cp-show-editor__programme-label {
    display: block;
    margin: 0 0 0.35rem;
    font-weight: 700;
}

.cp-postcontent .cp-show-editor__field-sublabel {
    display: block;
    margin: 0.55rem 0 0.35rem;
    font-weight: 600;
    color: #5c5148;
}

.cp-postcontent .cp-show-editor__gallery .cp-show-editor__programme-filename {
    margin-top: 0.45rem;
}

.cp-postcontent .cp-show-editor__programme-filename {
    display: block;
    margin: 0 0 0.45rem;
    font-weight: 700;
    word-break: break-word;
    color: #7a2e2e !important;
    text-decoration: none !important;
}

.cp-postcontent .cp-show-editor__programme-filename:hover {
    text-decoration: underline !important;
}

.cp-postcontent .cp-show-editor__programme-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
}

.cp-postcontent .cp-show-editor__required {
    color: #9b2c2c;
}

.cp-postcontent .cp-show-editor__section--team .cp-show-editor__role {
    display: grid;
    grid-template-columns: minmax(6.5rem, 9.5rem) minmax(0, 1fr);
    gap: 0.25rem 0.55rem;
    align-items: start;
    margin: 0 0 0.35rem !important;
    padding: 0 0 0.3rem;
    border-bottom: 1px solid rgba(228, 216, 204, 0.7);
    background: transparent;
    border-radius: 0;
}

.cp-postcontent .cp-show-editor__section--team .cp-show-editor__role:last-of-type {
    border-bottom: 0;
    padding-bottom: 0;
}

.cp-postcontent .cp-show-editor__section--team .cp-show-editor__role > h3 {
    grid-column: 1;
    grid-row: 1;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0.55rem 0 0 !important;
    font-size: 0.92rem !important;
    line-height: 1.25 !important;
    align-self: start;
}

.cp-postcontent .cp-show-editor__section--team .cp-show-editor__people {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    max-width: none;
    margin: 0 !important;
    padding: 0 !important;
    align-self: start;
}

.cp-postcontent .cp-show-editor__team-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.cp-postcontent .cp-show-editor__team-row-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.cp-postcontent .cp-show-editor__section--team .cp-show-editor__team-row-actions .cp-show-editor__button {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto;
}

.cp-postcontent .cp-show-editor__team-other {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e4d8cc;
}

.cp-postcontent .cp-show-editor__team-other-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.cp-postcontent .cp-show-editor__team-other-role {
    margin: 0 !important;
    flex: 0 1 auto;
    min-width: 0;
}

.cp-postcontent .cp-show-editor__team-other-row select {
    width: auto !important;
    min-width: 11rem;
    max-width: min(100%, 20rem) !important;
    min-height: 44px;
    box-sizing: border-box;
}

.cp-postcontent .cp-show-editor__team-other-row .js-team-other-add {
    flex-shrink: 0;
}

.cp-postcontent .cp-show-editor__add,
.cp-postcontent .cp-show-editor__performance,
.cp-postcontent .cp-show-editor__auditions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin: 0.2rem 0 !important;
    padding: 0 !important;
}

.cp-postcontent .cp-show-editor__poster-preview img {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 0 0.5rem !important;
}

.cp-postcontent .cp-show-editor__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.45rem 1rem;
    background: #7a2e2e !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    background-image: none !important;
    box-shadow: none !important;
}

.cp-postcontent .cp-show-editor__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.cp-postcontent .cp-show-editor__button-secondary {
    background: #fff !important;
    color: #7a2e2e !important;
    border: 1px solid #c4aa9a !important;
}

.cp-postcontent .cp-show-editor__button-danger {
    background: #fff !important;
    color: #9b2c2c !important;
    border: 1px solid #9b2c2c !important;
}

/* THEME OVERRIDE — inputs, headings, buttons, and list markers */
.cp-postcontent .cp-show-editor h2,
.cp-postcontent .cp-show-editor h3 {
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
    color: #3d2314 !important;
    font-weight: 700 !important;
}

.cp-postcontent .cp-show-editor h2 {
    font-size: 1.2rem !important;
    margin-bottom: 0.55rem !important;
}

.cp-postcontent .cp-show-editor__section--details > h2 {
    font-size: 1.65rem !important;
    border-bottom-width: 2px;
    border-bottom-color: #c4aa9a;
    margin-bottom: 0.85rem !important;
}

.cp-postcontent .cp-show-editor h3 {
    font-size: 0.95rem !important;
    margin-bottom: 0.3rem !important;
}

.cp-postcontent .cp-show-editor .cp-show-editor__section--team .cp-show-editor__role > h3 {
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.cp-postcontent .cp-show-editor p {
    margin-top: 0;
}

.cp-postcontent .cp-show-editor input[type="text"],
.cp-postcontent .cp-show-editor input[type="url"],
.cp-postcontent .cp-show-editor input[type="date"],
.cp-postcontent .cp-show-editor input[type="time"],
.cp-postcontent .cp-show-editor select,
.cp-postcontent .cp-show-editor textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px !important;
    padding: 0.55rem 0.7rem !important;
    color: #3d2314 !important;
    background: #fff !important;
    border: 1px solid #d9cbbd !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    font-size: 1rem !important;
}

.cp-postcontent .cp-show-editor__add select,
.cp-postcontent .cp-show-editor__add input,
.cp-postcontent .cp-show-editor__performance input,
.cp-postcontent .cp-show-editor__auditions input,
.cp-postcontent .cp-show-editor__team-row select,
.cp-postcontent .cp-show-editor__add .cp-person-combobox-mount,
.cp-postcontent .cp-show-editor__team-row .cp-person-combobox-mount {
    flex: 1 1 180px;
    width: auto !important;
    max-width: 22rem !important;
    min-width: 0;
}

/* Tom Select wrapper fills the mount, not the full team/cast row */
.cp-postcontent .cp-show-editor__add .cp-person-combobox-mount .cp-person-combobox.ts-wrapper,
.cp-postcontent .cp-show-editor__team-row .cp-person-combobox-mount .cp-person-combobox.ts-wrapper {
    width: 100% !important;
    max-width: 100% !important;
}

.cp-postcontent .cp-show-editor button,
.cp-postcontent .cp-show-editor input[type="submit"] {
    background-image: none !important;
}

.cp-postcontent .cp-show-editor ul > li:before,
.cp-postcontent .cp-show-editor__list > li:before,
.cp-postcontent .cp-show-editor__people > li:before {
    content: none !important;
    display: none !important;
}

@media screen and (max-width: 640px) {
    .cp-postcontent .cp-show-editor__title-author-row:not(.cp-show-editor__title-author-row--title-only) {
        grid-template-columns: minmax(0, 1fr);
    }

    .cp-postcontent .cp-show-editor__add,
    .cp-postcontent .cp-show-editor__performance {
        align-items: stretch;
    }

    .cp-postcontent .cp-show-editor__add .cp-show-editor__button,
    .cp-postcontent .cp-show-editor__performance .cp-show-editor__button {
        width: 100%;
    }
}

/* Edit page: use the content width instead of one long column. */
.cp-postcontent .cp-show-editor--edit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.85rem 1rem;
    align-items: start;
}

.cp-postcontent .cp-show-editor--edit > .cp-show-editor__nav,
.cp-postcontent .cp-show-editor--edit > .cp-show-editor__form,
.cp-postcontent .cp-show-editor--edit > .cp-show-editor__section--team,
.cp-postcontent .cp-show-editor--edit > .cp-show-editor__section--cast {
    grid-column: 1 / -1;
}

.cp-postcontent .cp-show-editor__form:has(.cp-show-editor__side) {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.8fr);
    gap: 0.85rem 1rem;
    align-items: start;
}

.cp-postcontent .cp-show-editor__side {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.cp-postcontent .cp-show-editor__side .cp-show-editor__section {
    margin: 0;
}

.cp-postcontent .cp-show-editor__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.cp-postcontent .cp-show-editor__facts .cp-form-group {
    margin: 0;
}

.cp-postcontent .cp-show-editor__status-group .cp-show-editor__field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #500000;
}

.cp-postcontent .cp-show-editor__status {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    min-height: 44px !important;
    padding: 0.55rem 0.7rem !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    font-weight: 700;
    font-size: 1rem !important;
    line-height: 1.25 !important;
    border: 1px solid transparent;
}

.cp-postcontent .cp-show-editor__status[data-variant="placeholder"] {
    background: #fff4e0 !important;
    color: #7a4a00 !important;
    border-color: #e8c878 !important;
}

.cp-postcontent .cp-show-editor__status[data-variant="confirmed"] {
    background: #eef4fb !important;
    color: #1e4a7a !important;
    border-color: #b8cfe8 !important;
}

.cp-postcontent .cp-show-editor__status[data-variant="in-production"] {
    background: #e8f5ec !important;
    color: #1f5c32 !important;
    border-color: #8ec9a0 !important;
}

.cp-postcontent .cp-show-editor__status[data-variant="archived"] {
    background: #f0eeec !important;
    color: #5c534c !important;
    border-color: #cfc7bf !important;
}

.cp-postcontent .cp-show-editor__fold {
    margin: 0.2rem 0 0.85rem;
    border-top: 1px solid #e4d8cc;
    padding-top: 0.35rem;
}

.cp-postcontent .cp-show-editor__fold summary {
    cursor: pointer;
    font-weight: 700;
    color: #500000;
    font-size: 1.05rem;
}

.cp-postcontent .cp-show-editor__fold summary:hover {
    color: #741F11;
}

.cp-postcontent .cp-show-editor__section--details .cp-show-editor__fold[open] > summary {
    margin-bottom: 0.75rem;
}

.cp-postcontent .cp-show-editor__cast {
    list-style: none;
    margin: 0 0 0.6rem !important;
    padding: 0 !important;
}

.cp-postcontent .cp-show-editor__cast-row {
    display: grid;
    grid-template-columns: 44px minmax(8rem, 0.8fr) minmax(8rem, 1.2fr) auto;
    gap: 0.4rem;
    align-items: center;
    margin: 0 0 0.35rem !important;
    padding: 0.15rem 0.35rem !important;
    background: #fff;
    border: 1px solid #e4d8cc;
    border-radius: 6px;
    overflow: visible !important;
}

.cp-postcontent .cp-show-editor__handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.cp-postcontent .cp-show-editor__cast-row.is-dragging .cp-show-editor__handle {
    cursor: grabbing;
}

.cp-postcontent .cp-show-editor__handle::before {
    content: "⋮⋮";
    color: #5c5148;
    font-size: 1.05rem;
    letter-spacing: -0.12em;
}

.cp-postcontent .cp-show-editor__cast-name {
    font-weight: 700;
}

.cp-postcontent .cp-show-editor__cast-placeholder {
    height: 48px;
    margin: 0 0 0.35rem;
    border: 1px dashed #c4aa9a;
    border-radius: 6px;
    background: #fff;
}

.cp-postcontent .cp-show-editor__cast-row.is-dragging {
    opacity: 0.55;
    border-style: dashed;
    border-color: #741F11;
}

.cp-postcontent .cp-show-editor__folder-status {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.55rem 0 0;
    color: #5c5148;
}

.cp-postcontent .cp-show-editor__folder-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #999;
    flex-shrink: 0;
}

.cp-postcontent .cp-show-editor__folder-status[data-status="current"] .cp-show-editor__folder-dot {
    background: #2e7d32;
}

.cp-postcontent .cp-show-editor__folder-status[data-status="past"] .cp-show-editor__folder-dot {
    background: #0e7490;
}

.cp-postcontent .cp-show-editor__folder-status[data-status="not_found"] .cp-show-editor__folder-dot {
    background: #9b2c2c;
}

.cp-postcontent .cp-show-editor__folder-link a {
    color: #741F11 !important;
    font-weight: 700;
}

.cp-postcontent .cp-show-editor__section--team > .cp-show-editor__fold,
.cp-postcontent .cp-show-editor__section--cast > .cp-show-editor__fold,
.cp-postcontent .cp-show-editor__section--performances > .cp-show-editor__fold {
    margin: 0;
    border-top: 0;
    padding-top: 0;
}

.cp-postcontent .cp-show-editor__section--team > .cp-show-editor__fold > summary,
.cp-postcontent .cp-show-editor__section--cast > .cp-show-editor__fold > summary,
.cp-postcontent .cp-show-editor__section--performances > .cp-show-editor__fold > summary {
    font-size: 1.25rem !important;
    margin: 0 0 0.55rem !important;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid #d4c4b4;
    list-style: none;
    color: #500000 !important;
}

.cp-postcontent .cp-show-editor__section--team > .cp-show-editor__fold > summary.cp-show-editor__fold-summary--with-actions,
.cp-postcontent .cp-show-editor__section--cast > .cp-show-editor__fold > summary.cp-show-editor__fold-summary--with-actions {
    list-style: none;
}

.cp-postcontent .cp-show-editor__section--team > .cp-show-editor__fold[open] > summary,
.cp-postcontent .cp-show-editor__section--cast > .cp-show-editor__fold[open] > summary,
.cp-postcontent .cp-show-editor__section--performances > .cp-show-editor__fold[open] > summary {
    margin-bottom: 0.75rem !important;
}

.cp-postcontent .cp-show-editor__section > .cp-show-editor__fold:first-child {
    margin-top: 0;
}

@media screen and (max-width: 860px) {
    .cp-postcontent .cp-show-editor--edit,
    .cp-postcontent .cp-show-editor__form:has(.cp-show-editor__side) {
        display: block;
    }

    .cp-postcontent .cp-show-editor__section--team .cp-show-editor__role {
        grid-template-columns: minmax(5.25rem, 7rem) minmax(0, 1fr);
        align-items: start;
        gap: 0.35rem 0.45rem;
    }

    .cp-postcontent .cp-show-editor__section--team .cp-show-editor__role > h3 {
        grid-row: 1;
        align-self: start;
        padding-top: 0.55rem !important;
    }

    .cp-postcontent .cp-show-editor__section--team .cp-show-editor__role > .cp-show-editor__people {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
        width: 100%;
        min-width: 0;
    }

    .cp-postcontent .cp-show-editor__section--team .cp-show-editor__team-row {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .cp-postcontent .cp-show-editor__section--team .cp-show-editor__team-row select,
    .cp-postcontent .cp-show-editor__section--team .cp-show-editor__team-row .cp-person-combobox-mount {
        flex: 1 1 100%;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .cp-postcontent .cp-show-editor__section--team .cp-show-editor__team-row-actions {
        flex: 0 0 auto;
    }

    .cp-postcontent .cp-show-editor--edit > .cp-show-editor__section,
    .cp-postcontent .cp-show-editor__form > .cp-show-editor__section {
        margin-bottom: 0.85rem;
    }
}
