/*
 * The post (#897): concept A of #877 - folders, a list, a reading pane - and the tabs the post,
 * the calendar and the tasks share. The colours are the calendar's (home-calendar.css), so the
 * section reads as one.
 */

/* ── the tabs ─────────────────────────────────────────────────────────────── */
.pm-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid #d9d6cd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 8px;
}
.pm-tab {
    padding: 7px 14px;
    color: #4a4b4b;
    font-size: 14px;
    border-right: 1px solid #d9d6cd;
    white-space: nowrap;
}
.pm-tab:last-child { border-right: 0; }
.pm-tab:hover { background: #faf9f5; color: #2d2e2e; text-decoration: none; }
.pm-tab-on, .pm-tab-on:hover { background: #efe8fb; color: #5b3e8e; font-weight: 500; }
.pm-tab-count {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    margin-left: 4px;
    border-radius: 10px;
    background: #5b3e8e;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

/* ── three panes ──────────────────────────────────────────────────────────── */
/* .card is display:flex in the theme; two classes so the grid wins */
.card.pm-panes {
    display: grid;
    grid-template-columns: 210px minmax(0, 380px) minmax(0, 1fr);
    min-height: 560px;
    overflow: hidden;
}
.pm-folders {
    padding: 12px 8px;
    border-right: 1px solid #ece9e1;
    background: #fbfaf7;
}
.pm-group {
    padding: 12px 10px 4px;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8a8b8b;
}
.pm-folder {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-radius: 6px;
    color: #2d2e2e;
    font-size: 14px;
}
.pm-folder i { width: 18px; color: #8a8b8b; }
.pm-folder:hover { background: #f1efe9; color: #2d2e2e; text-decoration: none; }
.pm-folder-on, .pm-folder-on:hover { background: #efe8fb; color: #5b3e8e; font-weight: 500; }
.pm-folder-on i { color: #5b3e8e; }
.pm-count { font-size: 12px; font-weight: 500; color: #5b3e8e; }
.pm-count-all { color: #8a8b8b; font-weight: 400; }

.pm-list {
    border-right: 1px solid #ece9e1;
    min-width: 0;
    max-height: 78vh;
    overflow-y: auto;
}
.pm-list-head, .pm-search {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #ece9e1;
}
.pm-search .ui-inputfield { flex: 1; min-width: 0; }
.pm-chip.pm-chip, .pm-search .ui-button.pm-chip {
    display: inline-block;
    padding: 3px 11px;
    border: 1px solid #d9d6cd;
    border-radius: 999px;
    background: #fff;
    background-image: none;
    color: #4a4b4b;
    font-size: 13px;
    box-shadow: none;
}
.pm-search .ui-button.pm-chip .ui-button-text { padding: 0; }
.pm-chip.pm-chip:hover { border-color: #b9b4a7; color: #2d2e2e; text-decoration: none; }
.pm-chip.pm-chip-on { background: #5b3e8e; border-color: #5b3e8e; color: #fff; }
.pm-chip.pm-chip-on:hover { color: #fff; }
.pm-more { margin: 12px; }

.pm-day {
    padding: 10px 12px 4px;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8a8b8b;
}
.pm-msg {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1efe9;
    color: #2d2e2e;
}
.pm-msg:hover { background: #faf9f5; color: #2d2e2e; text-decoration: none; }
.pm-msg.pm-sel { background: #f5f1fb; box-shadow: inset 3px 0 #5b3e8e; }
.pm-msg .pm-icon { grid-row: span 4; }
.pm-from {
    font-size: 12px;
    color: #8a8b8b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pm-time { font-size: 12px; color: #8a8b8b; text-align: right; }
.pm-subject {
    grid-column: 2 / 4;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pm-subject, .pm-msg:hover .pm-subject { color: #2d2e2e; }
.pm-unread .pm-subject { font-weight: 700; }
.pm-group-name { text-transform: capitalize; }
.pm-unread .pm-from { color: #2d2e2e; }
.pm-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    background: #5b3e8e;
    vertical-align: 1px;
}
/* a letter's first summary line, under its title - the Parent Post page's summary, here (#901) */
.pm-preview {
    grid-column: 2 / 4;
    font-size: 12.5px;
    line-height: 1.35;
    color: #5f6060;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pm-tags { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 4px; }
.pm-tags:empty { display: none; }
.pm-tag {
    display: inline-block;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 18px;
    font-weight: 500;
}
.pm-tag-school { background: #efe8fb; color: #5b3e8e; }
.pm-tag-warn { background: #fdf3d8; color: #8a6400; }
.pm-tag-ok { background: #e5f5ec; color: #1f7a42; }
.pm-tag-bad { background: #fbe5e8; color: #b42335; }
.pm-tag-muted { background: #f1efe9; color: #6b6c6c; }

.pm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
}
.pm-activity { padding: 8px 12px 10px; font-size: 13px; }
.pm-activity a { color: #6b6c6c; }
.pm-empty, .pm-none { padding: 40px 20px; text-align: center; color: #8a8b8b; }
.pm-none i { font-size: 32px; color: #d9d6cd; margin-bottom: 8px; }

/* ── the open message ─────────────────────────────────────────────────────── */
.pm-read { padding: 18px 22px; min-width: 0; max-height: 78vh; overflow-y: auto; }
.pm-read-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.pm-read-title { font-size: 19px; margin: 0 0 2px; overflow-wrap: anywhere; }
.pm-read-meta { font-size: 13px; color: #8a8b8b; overflow-wrap: anywhere; }
.pm-box {
    border: 1px solid #ece9e1;
    border-radius: var(--card-radius);
    padding: 12px 14px;
    margin-top: 10px;
}
.pm-box h4 { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.pm-line { padding: 2px 0; }
.pm-muted { color: #8a8b8b; }
.pm-reason { font-size: 13px; }
.pm-dates { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pm-letter { white-space: pre-wrap; font-size: 13px; color: #4a4b4b; }
.pm-mail { width: 100%; height: 520px; margin-top: 10px; border: 1px solid #ece9e1; border-radius: 8px; background: #fff; }
.pm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pm-actions .btn { font-size: 13px; line-height: 1.5; padding: 4px 12px; }
.pp-done .pp-todo-text { text-decoration: line-through; color: #8a8b8b; }

/* the bell's way into the post */
.bell-post a { display: block; padding: 10px 14px; text-align: center; font-weight: 500; }

/* narrow screens: the panes stack, the folders become a row */
@media (max-width: 991px) {
    .card.pm-panes { grid-template-columns: 1fr; }
    .pm-folders { display: flex; flex-wrap: wrap; gap: 4px; border-right: 0; border-bottom: 1px solid #ece9e1; }
    .pm-group { display: none; }
    .pm-folder { gap: 6px; }
    .pm-list { border-right: 0; border-bottom: 1px solid #ece9e1; max-height: 50vh; }
    .pm-read { max-height: none; }
    .pm-none { display: none; }
}

/* the Spond folder (#1267) */
.pm-spond-read { padding: 6px 14px; font-size: 12px; color: #8a8b8b; }
.pm-spond-facts { display: flex; flex-wrap: wrap; gap: 18px; }
.pm-spond-facts > div { display: flex; flex-direction: column; gap: 2px; }
.pm-spond-failed { background: #fdecec; color: #8c1d1d; }
