/* KAU Roster - "What's new" screen for a 1920x1080 TV; stacks into one column on narrow screens */
/* Colours from kau_theme.css, which entrypoint.sh copies from the department's theme; CS green without it */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --ink: #212121;
    --ink-soft: #555555;
    --ink-faint: #757575;
    --paper: #f3f3f1;
    --panel: #ffffff;
    --rule: #e2e2df;
}

html { font-size: clamp(12px, 0.9vw, 40px); }  /* grows up to 4K TVs */

body {
    font-family: 'UniversLT', Arial, Helvetica, sans-serif;  /* kau.se uses Univers (licensed) */
    color: var(--ink);
    background: var(--paper);
    line-height: 1.35;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-wrap: break-word;
}

a { color: inherit; text-decoration: none; }

/* Header */
.roster-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.1rem 2.5rem;
    background: var(--panel);
    border-bottom: 0.4rem solid var(--brand, #00736b);
}
.roster-logo { height: 3.4rem; }
.roster-header h1 { font-size: 2.1rem; line-height: 1.1; }
.roster-subtitle { color: var(--ink-soft); font-size: 1.05rem; }
.roster-clock { margin-left: auto; text-align: right; display: flex; flex-direction: column; }
#clock-time { font-size: 2.4rem; font-weight: bold; font-variant-numeric: tabular-nums; line-height: 1.1; }
#clock-date { color: var(--ink-soft); }

/* Grid: colleagues and events left, publications right (as in the TV mock-up) */
.roster {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: "colleagues pubs" "events pubs";
    gap: 1.5rem;
    padding: 1.5rem 2.5rem;
}
.panel {
    background: var(--panel);
    padding: 1.5rem 1.75rem;
    min-height: 0;
    overflow: hidden;
}
.panel h2 {
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 0.2rem solid var(--brand, #00736b);
    display: inline-block;
}
.panel-colleagues { grid-area: colleagues; }
.roster.no-colleagues { grid-template-rows: 1fr; grid-template-areas: "events pubs"; }
.roster.no-colleagues .panel-colleagues { display: none; }
.panel-events { grid-area: events; }
.panel-publications { grid-area: pubs; display: flex; flex-direction: column; }
.empty { color: var(--ink-faint); font-size: 1.15rem; }

/* New colleagues */
.colleagues { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
.colleague { display: flex; flex-direction: column; align-items: center; text-align: center; }
.colleague[hidden] { display: none; }
.colleague-photo {
    width: 9rem;
    height: 9rem;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.75rem;
    background: var(--rule);
}
.colleague-name { font-weight: bold; font-size: 1.2rem; }
.colleague-title { color: var(--ink-soft); }
.colleague-since { color: var(--ink-faint); font-size: 0.9rem; margin-top: 0.25rem; }

/* Upcoming events: featured next event, then the following days in columns */
.panel-events { display: flex; flex-direction: column; }
.panel-events h2 { align-self: flex-start; }
.event-featured { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 1.5rem; }
.event-date {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 1.5rem;
    border-right: 0.15rem solid var(--rule);
    line-height: 1;
}
.event-day { font-size: 3.6rem; font-weight: bold; color: var(--brand-text, #00736b); }
.event-month { text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); }
.event-featured-title { font-size: 1.6rem; font-weight: bold; }
.event-meta { color: var(--ink-soft); font-size: 1.1rem; }
.event-description {
    flex: 1;
    margin-left: 1rem;
    padding-left: 1.5rem;
    border-left: 0.15rem solid var(--rule);
    color: var(--ink-soft);
    font-size: 1.1rem;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.event-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem 2rem; min-height: 0; }
.event-day-group h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
}
.event-day-group ul { list-style: none; }
.event-day-group li { display: flex; gap: 1rem; padding: 0.4rem 0; border-top: 1px solid var(--rule); }
.event-time { flex: 0 0 7rem; font-variant-numeric: tabular-nums; font-weight: bold; }
.event-text { display: flex; flex-direction: column; }
.event-location { color: var(--ink-faint); font-size: 0.9rem; }
.event-note {
    color: var(--ink-soft);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Recent publications */
.panel h2 a:hover { color: var(--brand-text, #00736b); }
.pubs { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; position: relative; }
.pub { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.pub:first-child { padding-top: 0; }
.pub[hidden] { display: none; }
.pub:hover .pub-title { color: var(--brand-text, #00736b); }
.pub-title { font-weight: bold; font-size: 1.2rem; line-height: 1.25; }
.pub-authors { color: var(--ink-soft); }
.pub-venue { color: var(--ink-faint); font-style: italic; }
.more { margin-top: 1rem; color: var(--brand-text, #00736b); font-weight: bold; }

/* Rooms and status page (today.html) */
.today {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem 2.5rem;
}
.today .panel { display: flex; flex-direction: column; }
.today .panel h2 { align-self: flex-start; }
#rooms, .people { flex: 1; min-height: 0; overflow: hidden; }
.room { padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.room-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.4rem; }
.room-name { font-weight: bold; font-size: 1.3rem; }
.chip { padding: 0.15rem 0.7rem; border-radius: 1rem; font-size: 0.9rem; font-weight: bold; }
.chip-free { background: #e3f4e8; color: #1b6b34; }
.chip-busy { background: #fbe4e4; color: #9b1c1c; }
.room-bookings { list-style: none; }
.room-bookings li { display: flex; gap: 1rem; padding: 0.25rem 0; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem 1.5rem; align-content: start; }
.person { display: flex; gap: 0.9rem; align-items: center; }
.person-photo { width: 3.6rem; height: 3.6rem; border-radius: 50%; object-fit: cover; background: var(--rule); flex-shrink: 0; }
.person-text { display: flex; flex-direction: column; }
.person-name { font-weight: bold; }
.person-status { color: var(--brand-text, #00736b); font-weight: bold; }
.person-where { color: var(--ink-faint); font-size: 0.9rem; }

.roster-footer { padding: 0 2.5rem 0.75rem; color: var(--ink-faint); font-size: 0.85rem; }

/* Portrait TV (1080x1920): panels stacked, still one screen without scrolling */
@media (orientation: portrait) and (min-width: 901px) {
    html { font-size: clamp(12px, 1.6vw, 40px); }
    .roster {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "colleagues" "events" "pubs";
    }
    .roster.no-colleagues { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "events" "pubs"; }
    .today { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Phones and narrow windows: one scrolling column */
@media (max-width: 900px) {
    html { font-size: 15px; }
    body { height: auto; overflow: auto; }
    .roster-header { padding: 1rem; flex-wrap: wrap; }
    .roster {
        grid-template-columns: 1fr;
        grid-template-areas: "colleagues" "events" "pubs";
        grid-template-rows: none;
        padding: 1rem;
        gap: 1rem;
    }
    .roster.no-colleagues { grid-template-areas: "events" "pubs"; grid-template-rows: none; }
    .event-featured { flex-wrap: wrap; }
    .event-description { flex-basis: 100%; margin-left: 0; padding-left: 0; border-left: none; }
    .colleagues { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
    .today { grid-template-columns: 1fr; padding: 1rem; gap: 1rem; }
    .colleague-photo { width: 7rem; height: 7rem; }
    .roster-footer { padding: 0 1rem 1rem; }
}
