/* Scheduled posts (scheduled-posts-checklist.md Phase C)
 * -------------------------------------------------------
 *  1. .pst_sched_*  — the composers' schedule control (home popup and the
 *     community composer), wired by features/posts/schedule.js.
 *  2. .sched_*      — the /scheduled-posts page, filled by
 *     features/posts/scheduled_page.js.
 */

/* ---------- 1. The composer control ------------------------------- */
.pst_submit_grp {
    align-items: center;
    flex: none;
    margin-left: auto;
}

/* The clock joined Post at the end of the home composer's tool row, and on
 * a phone the tools and that group no longer fit one line: the row wraps
 * instead of pushing Post off the screen. Nothing moves where they fit. */
.new_post_wid .pldr_opt_row {
    flex-wrap: wrap;
    row-gap: 10px;
}

.pst_sched_btn {
    color: var(--text-secondary);
}

.pst_sched_btn.is_on {
    color: var(--blue);
}

.pst_sched_row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 8px 0 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border-color);
}

.pst_sched_row[hidden] {
    display: none;
}

.pst_sched_field {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.pst_sched_field[hidden] {
    display: none;
}

.pst_sched_field i {
    color: var(--blue);
}

.pst_sched_input {
    background: var(--field-fill);
    color: var(--text-primary);
    border: 1px solid var(--border-highlight);
    border-radius: 8px;
    padding: 6px 8px;
    font: inherit;
    color-scheme: light dark;
    max-width: 100%;
}

.pst_sched_summary {
    color: var(--blue);
    font-weight: 600;
    font-size: 14px;
}

.pst_sched_clear {
    margin-left: auto;
    background: none;
    border: 0;
    padding: 4px 0;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.pst_sched_clear:hover {
    color: var(--text-primary);
}

.pst_sched_err,
.pst_sched_hint {
    flex-basis: 100%;
    margin: 0;
    font-size: 12px;
}

.pst_sched_err {
    color: var(--text-error);
    font-weight: 600;
}

.pst_sched_err[hidden] {
    display: none;
}

.pst_sched_hint {
    color: var(--text-tertiary);
}

/* ---------- 2. The page ------------------------------------------ */
.sched_page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0 32px;
}

.sched_hdr {
    padding: 0 4px;
}

.sched_title {
    margin: 0 0 4px;
    font-size: 22px;
}

.sched_sub,
.sched_count {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.sched_count {
    margin-top: 8px;
    font-weight: 600;
}

.sched_status {
    padding: 24px 16px;
    border-radius: 16px;
    background: var(--container);
    color: var(--text-secondary);
    text-align: center;
}

.sched_status[hidden] {
    display: none;
}

.sched_list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sched_card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--container);
    border: 1px solid var(--border-color);
}

.sched_card.is_focus {
    border-color: var(--blue);
}

.sched_card [hidden] {
    display: none !important;
}

.sched_card_hdr {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sched_pill {
    flex: none;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 14%, transparent);
}

.sched_pill_publishing {
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 14%, transparent);
}

.sched_pill_failed {
    color: var(--error);
    background: color-mix(in srgb, var(--error) 14%, transparent);
}

.sched_pill_published {
    color: var(--green);
    background: color-mix(in srgb, var(--green) 14%, transparent);
}

.sched_when {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    color: var(--text-primary);
}

/* A failed row's time is the one it missed. */
.sched_when.is_missed {
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.sched_failure {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--error-muted);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.sched_failure i {
    color: var(--error);
}

.sched_card_title {
    margin: 0;
    font-size: 17px;
}

.sched_card_text {
    margin: 0;
    color: var(--text-intermediate);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sched_card_meta,
.sched_note {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 13px;
}

.sched_thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sched_thumb {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background-color: var(--surface);
    background-size: cover;
    background-position: center;
}

.sched_thumb.is_video::after {
    content: "\25B6";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-shadow: 0 1px 4px #00000099;
}

.sched_thumb_rm {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 1;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: #000000a0;
    color: #ffffff;
    line-height: 20px;
    padding: 0;
    cursor: pointer;
}

.sched_published {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    color: var(--text-secondary);
}

.sched_card_actions,
.sched_confirm,
.sched_form_btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.sched_confirm span {
    flex-basis: 100%;
    color: var(--text-primary);
    font-weight: 600;
}

.sched_danger,
.sched_danger .btn_txt {
    color: var(--error);
}

.sched_danger_fill {
    background: var(--error);
}

.sched_form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sched_edit_title,
.sched_edit_text {
    width: 100%;
    box-sizing: border-box;
    background: var(--field-fill);
    color: var(--text-primary);
    border: 1px solid var(--border-highlight);
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
}

.sched_edit_text {
    resize: vertical;
}

.sched_card_err {
    margin: 0;
    color: var(--text-error);
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 639px) {
    .sched_page {
        padding: 8px 0 24px;
    }

    .sched_card {
        padding: 12px;
    }

    .pst_sched_clear {
        margin-left: 0;
    }
}
