/*
 * The home calendar's agenda and the parent post's task list.
 *
 * Both pages answer the same question - what do the next few days ask of this household - and both
 * used to answer it with a PrimeFaces table whose every column was filterable="false"
 * sortable="false". The rules here are what a list of days and a list of tasks need and no more:
 * the template's cards, spacing and type stay as they are.
 *
 * The four kinds of thing on the calendar are told apart by a word as well as a colour. Roughly a
 * twelfth of men cannot tell the school's purple from the waste collection's green, and a legend
 * that reads "the green ones are the bin days" is no help to them at all.
 */

/* ---------------------------------------------------------------- the search row and its chips */

.hc-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

.hc-search input[type="text"] {
    flex: 1 1 260px;
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #d9d6cd;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
}

/* The search field grows; PrimeFaces gives .ui-inputtext a width of its own, which a bare
   element selector does not beat. */
.hc-search .ui-inputtext,
.hc-search input[type="text"] {
    flex: 1 1 320px;
    min-width: 0;
    width: auto;
}

/*
 * A chip is a button, not a span with a click handler: it has to be reachable with the keyboard.
 *
 * Doubled selectors on purpose. These are PrimeFaces command buttons, and the saga theme's
 * .ui-button rule carries the same specificity as a single class - so a chip written as .hc-chip
 * alone came out as a row of the theme's blue buttons.
 */
.hc-chip.hc-chip,
.hc-search .ui-button.hc-chip {
    height: 42px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid #d9d6cd;
    background: #fff;
    background-image: none;
    color: #2d2e2e;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
}

.hc-chip.hc-chip:hover,
.hc-search .ui-button.hc-chip:hover {
    border-color: #b9b4a7;
    background: #faf9f5;
    color: #2d2e2e;
}

.hc-chip.hc-chip-on,
.hc-search .ui-button.hc-chip-on,
.hc-chip.hc-chip-on:hover,
.hc-search .ui-button.hc-chip-on:hover {
    background: #5b3e8e;
    border-color: #5b3e8e;
    color: #fff;
}

/* The tick is a command link, so the theme's anchor colours reach it. */
.pp-tick.pp-tick,
a.pp-tick {
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

/* ------------------------------------------------------------------ the next graded work, above */

.hc-banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 18px;
    margin-bottom: 16px;
    border: 1px solid #e6c9c6;
    border-radius: 10px;
    background: #fdf1f0;
}

.hc-banner-mark {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #a3231b;
}

.hc-banner-title {
    margin-top: 2px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    color: #1a1917;
}

.hc-banner-when {
    margin-top: 2px;
    font-size: 14px;
    color: #5c5953;
}

/* ------------------------------------------------------------------------------- the agenda list */

.hc-day {
    display: flex;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid #efece3;
}

.hc-day:last-child {
    border-bottom: none;
}

.hc-day-date {
    width: 76px;
    flex: 0 0 76px;
    text-align: left;
}

.hc-day-dow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #7a766e;
}

.hc-day-num {
    font-family: Poppins, sans-serif;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.1;
    color: #151d2e;
}

.hc-day-month {
    font-size: 12px;
    color: #7a766e;
}

/* Today is the one day that is named rather than numbered - it is where the list starts. */
.hc-day-today .hc-day-dow,
.hc-day-today .hc-day-num {
    color: #5b3e8e;
}

.hc-day-events {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hc-event {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* The bar is the colour; the tag beside the title is the word for it. */
.hc-event-bar {
    flex: 0 0 4px;
    width: 4px;
    align-self: stretch;
    min-height: 34px;
    border-radius: 2px;
    background: #5b3e8e;
}

.hc-event-time {
    flex: 0 0 106px;
    width: 106px;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: #5c5953;
}

.hc-event-body {
    flex: 1 1 auto;
    min-width: 0;
}

.hc-event-title {
    font-size: 15px;
    line-height: 1.35;
    color: #2d2e2e;
}

.hc-event-tags {
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hc-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: #f0eee6;
    color: #5c5953;
}

/* The kinds. Each pairs a fill with text dark enough to read on it - a 4.5:1 contrast at this
   size - because a pale tag with pale text is a decoration, not a label. */
.hc-kind-graded { background: #fbe9e7; color: #8e1f18; }
.hc-kind-school { background: #efeaf7; color: #4a3178; }
.hc-kind-waste  { background: #e4f0ea; color: #245840; }
.hc-kind-holiday{ background: #f0eee6; color: #5c5953; }
.hc-kind-drive  { background: #e6f0f4; color: #17576f; }
.hc-kind-event  { background: #f0eee6; color: #5c5953; }

.hc-bar-graded { background: #a3231b; }
.hc-bar-school { background: #5b3e8e; }
.hc-bar-waste  { background: #2e6b4f; }
.hc-bar-holiday{ background: #9a958a; }
.hc-bar-drive  { background: #1f6f8b; }
.hc-bar-event  { background: #9a958a; }

.hc-empty {
    padding: 28px 8px;
    text-align: center;
    color: #7a766e;
    font-size: 15px;
}

/* -------------------------------------------------------------------------------- the legend */

.hc-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hc-legend-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: #5c5953;
}

.hc-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
}

/* ----------------------------------------------------------------------------- the task lists */

.pp-todo {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 11px 0;
    border-bottom: 1px solid #f3f1ea;
}

.pp-todo:last-child {
    border-bottom: none;
}

/* The box is a real button with a real accessible name, so it can be reached and read out. */
.pp-tick {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    padding: 0;
    border: 1.5px solid #b9b4a7;
    border-radius: 5px;
    background: #fff;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.pp-tick:hover {
    border-color: #5b3e8e;
}

.pp-tick-on {
    background: #5b3e8e;
    border-color: #5b3e8e;
}

.pp-todo-body {
    flex: 1 1 auto;
    min-width: 0;
}

.pp-todo-text {
    font-size: 15px;
    line-height: 1.4;
    color: #2d2e2e;
}

.pp-todo-done .pp-todo-text {
    color: #8b877e;
    text-decoration: line-through;
}

.pp-todo-meta {
    margin-top: 3px;
    font-size: 12.5px;
    color: #7a766e;
}

.pp-todo-meta a {
    font-weight: 600;
}

.pp-due {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #5c5953;
    white-space: nowrap;
}

.pp-due-overdue {
    color: #a3231b;
}

/* A group heading carries its own tone, which is the only thing that distinguishes "this week"
   from "later" at a glance. */
.pp-group-head {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 9px 14px;
    margin: 0 -14px 6px -14px;
    border-radius: 8px;
    background: #faf9f5;
}

.pp-group-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #5c5953;
}

.pp-group-sub {
    font-size: 13px;
    color: #7a766e;
}

.pp-group-OVERDUE { background: #fdf1f0; }
.pp-group-OVERDUE .pp-group-title { color: #a3231b; }
.pp-group-SOON { background: #fbf0dc; }
.pp-group-SOON .pp-group-title { color: #7a4e00; }
.pp-group-DONE { background: #e9f2ec; }
.pp-group-DONE .pp-group-title { color: #245840; }


/* The template resets every list to no marker and no indent, so an ordered list of steps comes
   out as four unnumbered lines - which is not a sequence. */
.pp-steps {
    margin: 0;
    padding-left: 22px;
    list-style: decimal outside;
}

.pp-steps li {
    margin-bottom: 6px;
    font-size: 13.5px;
    line-height: 1.45;
    color: #5c5953;
}

/* ------------------------------------------------------------------------------ the stat tiles */

.pp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.pp-stat {
    flex: 1 1 180px;
    padding: 14px 18px;
    border: 1px solid #e4e0d6;
    border-radius: 10px;
    background: #fff;
}

.pp-stat-n {
    font-family: Poppins, sans-serif;
    font-size: 30px;
    font-weight: 600;
    line-height: 1;
    color: #151d2e;
}

.pp-stat-label {
    margin-top: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: #2d2e2e;
}

.pp-stat-sub {
    margin-top: 2px;
    font-size: 13px;
    color: #7a766e;
}

.pp-stat-soon { background: #fbf0dc; border-color: #e8d5ac; }
.pp-stat-soon .pp-stat-n, .pp-stat-soon .pp-stat-label { color: #7a4e00; }
.pp-stat-done { background: #e9f2ec; border-color: #c5dcce; }
.pp-stat-done .pp-stat-n, .pp-stat-done .pp-stat-label { color: #245840; }

/* ------------------------------------------------------------------------------- one letter */

/* The template resets ul to no marker, so the summary needs its own back. */
ul.pp-letter-summary {
    margin: 0;
    padding-left: 20px;
    list-style: disc outside;
}

.pp-letter-summary li {
    font-size: 14.5px;
    line-height: 1.45;
    color: #2d2e2e;
}

/* the letter a summary mail linked to (asg.xhtml?letter=<id>, issue #684); as specific as the
   template's own ".forms-sec .card", which would otherwise keep its grey border */
.forms-sec .card.pp-letter-open,
.card.pp-letter-open {
    border: 2px solid #7c3aed;
    background: #faf7ff;
    scroll-margin-top: 90px;
}

.pp-pending {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #fbf0dc;
    color: #7a4e00;
}

/* On a phone the date column and the times would leave nothing for the title. */
@media (max-width: 576px) {
    .hc-day {
        gap: 12px;
    }

    .hc-day-date {
        width: 56px;
        flex-basis: 56px;
    }

    .hc-event {
        flex-wrap: wrap;
    }

    .hc-event-time {
        flex-basis: 100%;
        width: auto;
        order: 3;
        padding-left: 16px;
    }
}
