/**
 * Admin styles for the content calendar.
 */

.swcc-field {
	margin: 0 0 1em;
}

.swcc-field:last-child {
	margin-bottom: 0;
}

.swcc-field label {
	display: block;
	font-weight: 600;
	margin: 0 0 0.35em;
}

.swcc-field input[type="text"],
.swcc-field input[type="date"],
.swcc-field input[type="number"],
.swcc-field select,
.swcc-field textarea {
	width: 100%;
	max-width: 100%;
}

.swcc-field .description {
	margin: 0.35em 0 0;
}

.swcc-status {
	border-radius: 3px;
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.6;
	padding: 0 8px;
	white-space: nowrap;
}

.swcc-status-planned {
	background: #f0f0f1;
	color: #3c434a;
}

.swcc-status-queued {
	background: #e5f3ff;
	color: #135e96;
}

.swcc-status-drafted {
	background: #fcf0d8;
	color: #7a5c14;
}

/*
 * A deeper indigo than .swcc-status-queued's pale cyan-blue, which is right beside it in the
 * workflow - two near-identical blues in one column would be unreadable at a glance.
 */
.swcc-status-scheduled {
	background: #e0e7ff;
	color: #1d4ed8;
	font-weight: 700;
}

.swcc-status-published {
	background: #ddf3e0;
	color: #14562a;
}

/*
 * Violet rather than another blue: `private` is a terminal state like `published`, and the two
 * blues are already spoken for by `queued` and `scheduled`.
 */
.swcc-status-private {
	background: #f3e8ff;
	color: #6b21a8;
}

.column-swcc_scheduled,
.column-swcc_status {
	width: 12%;
}

.column-swcc_category {
	width: 12%;
}

/*
 * The core Status control does not belong on a topic.
 *
 * A topic's workflow status is derived from its generated post (MMBC-75); the control here
 * edits the topic row's own `post_status`, which is a different thing and one an operator has
 * no reason to set. Worse, the dispatch query treats `publish`, `draft`, `pending` and
 * `private` as eligible but not `future`, so bulk-setting topics to "Scheduled" would quietly
 * make every one of them undispatchable. The value is also stripped server-side in
 * SWCC_Topic_Bulk_Edit::neutralize_status(), so this rule is presentation, not enforcement.
 */
#bulk-edit .inline-edit-status,
#inline-edit .inline-edit-status,
.inline-editor .inline-edit-status {
	display: none;
}

/*
 * Core's date editor does not belong on a topic either.
 *
 * Quick Edit offers month/day/year/hour/minute boxes for the topic row's own publish date. That
 * is not the article's schedule - the article is dated from the topic's Scheduled draft date at
 * the Default publish time (MMBC-89) - and setting it does nothing an operator would expect.
 * The replacement is the date field SWCC_Topic_Quick_Edit renders, which edits the meta that
 * actually drives dispatch and delivery.
 *
 * `.inline-editor` is matched as well as `#inline-edit` because Quick Edit clones the template
 * row: the clone is what the operator sees, and core gives it that class.
 */
#inline-edit fieldset.inline-edit-date,
.inline-editor fieldset.inline-edit-date {
	display: none;
}

/*
 * Nor do Password and Private (MMBC-135).
 *
 * A topic is an internal calendar entry and is never rendered on the front end, so protecting
 * one with a password or marking it private describes nothing an operator can observe. Less
 * dangerous than Status - `private` is dispatch-eligible, so neither can strand a topic - but
 * a control that does nothing is its own kind of confusing.
 *
 * Matched through `:has()` because core gives this row no class of its own; the group is
 * identified by the private checkbox inside it. The values are also stripped server-side in
 * neutralize_inapplicable_fields(), so this rule is presentation, not enforcement.
 */
#inline-edit .inline-edit-group:has( .inline-edit-private ),
.inline-editor .inline-edit-group:has( .inline-edit-private ) {
	display: none;
}

/*
 * The Publish box on a topic keeps its action button and nothing else.
 *
 * Status, Visibility and "Publish on" describe the topic row rather than the article, and
 * setting them does nothing an operator would expect - the article's own schedule comes from
 * the topic's Scheduled date field and the Default publish time. Hidden rather than replaced
 * with a custom meta box on purpose: core's hidden inputs (`hidden_post_status`,
 * `original_publish`, and friends) must keep posting, or the save path stops behaving the way
 * every other WordPress screen does.
 */
.post-type-swcc_topic #submitdiv #minor-publishing-actions,
.post-type-swcc_topic #submitdiv #misc-publishing-actions {
	display: none;
}

/*
 * Core sizes inline-edit labels at 6em, which fits its own one-word labels ("Status",
 * "Format") and wraps "Article author" onto two lines. Widened for this fieldset only, so
 * our labels still align with each other.
 *
 * 11em rather than 9em because Quick Edit's "Scheduled draft date" is longer than Bulk Edit's
 * two labels and wrapped at 9em - the same defect MMBC-116 fixed for "Article author", found
 * the same way, in a browser. The wording matches the topic editor's own field rather than
 * being shortened to fit: two names for one field is the worse trade.
 */
#bulk-edit .inline-edit-col-bottom label span.title,
#inline-edit .inline-edit-col-bottom label span.title,
.inline-editor .inline-edit-col-bottom label span.title {
	width: 11em;
}

/*
 * The date input is core's own text-input width rather than the browser default, which is
 * narrower than the field beside it and reads as a different kind of control.
 */
.swcc-quick-edit input.swcc-quick-scheduled {
	width: 14em;
}

/* A disabled author dropdown needs to look disabled, not merely be disabled. */
.swcc-quick-edit select.swcc-quick-author:disabled {
	opacity: 0.6;
}

/*
 * A held article (P3): the status badge's shape in a warning colour, because a hold is the one
 * state that needs the operator's hand before anything publishes.
 */
.swcc-hold {
	background: #fde8e8;
	border-radius: 3px;
	color: #8a1c1c;
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.6;
	padding: 0 8px;
	white-space: nowrap;
}

.swcc-lock {
	color: #646970;
	font-size: 16px;
	height: 16px;
	vertical-align: text-bottom;
	width: 16px;
}

/*
 * A topic the weekly run will skip. Deliberately quiet rather than an error colour: an
 * unfinished topic is a normal state on a calendar being sketched out, not a fault.
 */
.swcc-not-ready {
	color: #8a6d3b;
	font-style: italic;
}

/* Branding list fields: the live entry counter, red once a limit is passed (1.0.3). */
.swcc-list-count.swcc-over {
	color: #d63638;
	font-weight: 600;
}

textarea.swcc-over {
	border-color: #d63638;
}
