/*
 * Room board — a wall display, not a web page. Read from several metres away:
 * large type, few colours, strong contrast, no decoration that costs legibility.
 */

.ces-board {
    --b-bg: #ffffff;
    --b-fg: #1d2530;
    --b-muted: #63707f;
    --b-line: #dde3ea;
    --b-card: #f6f8fa;
    --b-accent: #3d7ebd;
    --b-cancel: #b3261e;

    background: var(--b-bg);
    color: var(--b-fg);
    padding: 1.5rem 1.75rem;
    font-size: clamp(16px, 1.35vw, 26px);
    line-height: 1.3;
    min-height: 100%;
}

.ces-board--dark {
    --b-bg: #141a21;
    --b-fg: #f2f5f8;
    --b-muted: #9fb0c0;
    --b-line: #2a3440;
    --b-card: #1c242d;
    --b-accent: #7db3e8;
    --b-cancel: #ff8a80;
}

/* --- Head ---------------------------------------------------------------- */
.ces-board-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    border-bottom: 3px solid var(--b-accent);
    padding-bottom: .6rem;
    margin-bottom: 1.1rem;
}
.ces-board-title { margin: 0; font-size: 1.9em; font-weight: 700; letter-spacing: -.01em; }
.ces-board-sub { margin: .2rem 0 0; color: var(--b-muted); font-size: .8em; }
.ces-board-clock { font-size: 2.1em; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }

/* --- Rooms --------------------------------------------------------------- */
.ces-board-rooms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: 1rem;
}
.ces-board-room { border: 1px solid var(--b-line); border-radius: 8px; overflow: hidden; background: var(--b-card); }
.ces-board-room-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem .8rem;
    background: var(--b-accent);
    color: #fff;
}
.ces-board-room-name { font-size: 1.15em; font-weight: 700; }
.ces-board-room-floor { font-size: .75em; opacity: .9; }

/* --- Entries ------------------------------------------------------------- */
.ces-board-list { display: flex; flex-direction: column; }
.ces-board-entry {
    display: flex;
    gap: 1rem;
    padding: .7rem .8rem;
    border-top: 1px solid var(--b-line);
}
.ces-board-room .ces-board-entry:first-of-type,
.ces-board-list .ces-board-entry:first-of-type { border-top: 0; }
.ces-board-list .ces-board-entry { border-top: 1px solid var(--b-line); }

.ces-board-time {
    flex: 0 0 5.5rem;
    display: flex;
    flex-direction: column;
    font-variant-numeric: tabular-nums;
}
.ces-board-time strong { font-size: 1.25em; }
.ces-board-time span { color: var(--b-muted); font-size: .8em; }

.ces-board-body { min-width: 0; }
.ces-board-course { margin: 0; font-size: 1.05em; font-weight: 600; }
.ces-board-link { color: inherit; text-decoration: none; }
.ces-board-link:hover, .ces-board-link:focus-visible { text-decoration: underline; }
.ces-board-meta { margin: .15rem 0 0; color: var(--b-muted); font-size: .78em; display: flex; flex-wrap: wrap; gap: .1rem .7rem; }
.ces-board-code { font-variant-numeric: tabular-nums; }
.ces-board-inline-room { color: var(--b-accent); font-weight: 600; }
.ces-board-lecturers { margin: .15rem 0 0; font-size: .8em; }

.ces-board-entry.is-cancelled { opacity: .65; }
.ces-board-entry.is-cancelled .ces-board-course { text-decoration: line-through; }
.ces-board-badge {
    display: inline-block;
    margin-left: .5rem;
    padding: 0 .4rem;
    border-radius: 3px;
    background: var(--b-cancel);
    color: #fff;
    font-size: .7em;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    vertical-align: middle;
}

.ces-board-empty { color: var(--b-muted); font-size: 1.1em; padding: 2rem 0; text-align: center; }

/* Narrow screens fall back to a single column. */
@media (max-width: 700px) {
    .ces-board { padding: 1rem; }
    .ces-board-head { flex-direction: column; }
    .ces-board-rooms { grid-template-columns: 1fr; }
}

/* --- Kiosk page (type 1768) --------------------------------------------- */
/*
 * The standalone page brings no site stylesheet, so the document-level rules the
 * board relies on are set here.
 */
html, body.ces-board-page { height: 100%; }
body.ces-board-page {
    margin: 0;
    background: #fff;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body.ces-board-page .ces-board--dark { min-height: 100vh; }
