/* ==================================================
   PAGE
================================================== */

.timetable-page {
    max-width: 1200px;

    margin: 0 auto;

    padding: 55px 30px 100px;
}


.timetable-page-heading {
    padding-bottom: 55px;
}


.timetable-eyebrow {
    margin: 0 0 15px;

    font-size: 10px;
    font-weight: bold;

    letter-spacing: 2px;
}


.timetable-page-heading h1 {
    margin: 0;

    font-size: clamp(45px, 7vw, 80px);

    line-height: 0.95;

    letter-spacing: -4px;
}


.timetable-description {
    margin: 25px 0 0;

    font-size: 13px;

    line-height: 1.5;
}


/* ==================================================
   TOOLBAR
================================================== */

.timetable-toolbar {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 30px;

    margin-bottom: 20px;
}


.timetable-navigation {
    display: flex;

    border: 1px solid #171717;
}


.timetable-navigation button {
    min-width: 42px;

    padding: 10px 13px;

    border: 0;
    border-right: 1px solid #171717;

    background: transparent;
    color: #171717;

    font-family: inherit;
    font-size: 10px;
    font-weight: bold;

    cursor: pointer;
}


.timetable-navigation button:last-child {
    border-right: 0;
}


.timetable-navigation button:hover {
    background: #171717;
    color: #f2efe7;
}


#weekLabel {
    font-size: 11px;

    letter-spacing: 1px;

    text-align: right;
}


/* ==================================================
   CALENDAR
================================================== */

.timetable-calendar-section {
    width: 100%;
}


.timetable-scroll {
    width: 100%;

    overflow-x: auto;

    border: 1px solid #171717;
}


.timetable-calendar {
    --timetable-hour-height: 64px;

    position: relative;

    min-width: 1000px;

    background: #f2efe7;
}


/* ==================================================
   DAY HEADERS
================================================== */

.timetable-days-header {
    position: sticky;
    top: 0;

    z-index: 20;

    display: grid;

    grid-template-columns:
        70px repeat(7, minmax(125px, 1fr));

    border-bottom: 1px solid #171717;

    background: #f2efe7;
}


.timetable-header-spacer {
    border-right: 1px solid #171717;
}


.timetable-day-header {
    min-width: 0;

    padding: 13px 8px;

    border-right: 1px solid #171717;

    text-align: center;
}


.timetable-day-header:last-child {
    border-right: 0;
}


.timetable-day-name {
    display: block;

    margin-bottom: 5px;

    font-size: 9px;
    font-weight: bold;

    letter-spacing: 1px;
}


.timetable-day-number {
    display: block;

    font-size: 18px;
    font-weight: bold;
}


.timetable-day-header.today {
    background: #171717;
    color: #f2efe7;
}


/* ==================================================
   WEEK GRID
================================================== */

.timetable-week-grid {
    display: grid;

    grid-template-columns:
        70px repeat(7, minmax(125px, 1fr));
}


.timetable-time-column {
    position: relative;

    height: calc(
        var(--timetable-hour-height) * 16
    );

    border-right: 1px solid #171717;
}


.timetable-time-label {
    position: absolute;

    right: 10px;

    transform: translateY(-50%);

    font-size: 9px;

    opacity: 0.65;
}


.timetable-day-column {
    position: relative;

    height: calc(
        var(--timetable-hour-height) * 16
    );

    border-right: 1px solid #171717;

    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(
                var(--timetable-hour-height) - 1px
            ),
            rgba(23, 23, 23, 0.18)
                calc(
                    var(--timetable-hour-height) - 1px
                ),
            rgba(23, 23, 23, 0.18)
                var(--timetable-hour-height)
        );
}


.timetable-day-column:last-child {
    border-right: 0;
}


/* ==================================================
   EVENTS
================================================== */

.timetable-event {
    position: absolute;

    right: 5px;
    left: 5px;

    z-index: 5;

    min-height: 28px;

    padding: 7px 8px;

    border: 1px solid #171717;

    overflow: hidden;

    color: #171717;

    font-family: inherit;

    text-align: left;

    cursor: pointer;
}


.timetable-event:hover {
    outline: 2px solid #171717;

    z-index: 10;
}


.timetable-event-title {
    display: block;

    margin-bottom: 4px;

    font-size: 10px;
    font-weight: bold;

    line-height: 1.2;
}


.timetable-event-project {
    display: block;

    margin-bottom: 5px;

    font-size: 9px;
    font-weight: bold;

    line-height: 1.2;

    opacity: 0.65;
}


.timetable-event-time {
    display: block;

    font-size: 9px;

    line-height: 1.2;
}


.timetable-event-location {
    display: block;

    margin-top: 5px;

    font-size: 9px;

    line-height: 1.2;

    opacity: 0.7;
}


/* ==================================================
   PROJECT / COLLABORATOR COLOURS
================================================== */

.timetable-collaborator-dots {
    display: flex;

    gap: 3px;

    margin-top: 6px;
}


.timetable-collaborator-dot {
    width: 7px;
    height: 7px;

    border: 1px solid #171717;

    border-radius: 50%;
}


.timetable-color-0 {
    background: #d7a9a0;
}


.timetable-color-1 {
    background: #a8bfd1;
}


.timetable-color-2 {
    background: #b8c9a4;
}


.timetable-color-3 {
    background: #d8c38e;
}


.timetable-color-4 {
    background: #b9add0;
}


.timetable-color-5 {
    background: #d3aaa9;
}


.timetable-color-6 {
    background: #9fc9c0;
}


.timetable-color-7 {
    background: #c8b39d;
}


/* ==================================================
   EMPTY STATE
================================================== */

.timetable-empty {
    padding: 55px 20px;

    border-right: 1px solid #171717;
    border-bottom: 1px solid #171717;
    border-left: 1px solid #171717;

    text-align: center;
}


.timetable-empty p {
    margin: 0;

    font-size: 11px;

    letter-spacing: 2px;

    opacity: 0.5;
}


/* ==================================================
   EVENT MODAL
================================================== */

.timetable-modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 400;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 30px;

    background: rgba(0, 0, 0, 0.55);
}


.timetable-modal-overlay.open {
    display: flex;
}


.timetable-modal {
    width: min(600px, 100%);

    max-height: calc(100vh - 60px);

    overflow-y: auto;

    padding: 35px;

    border: 2px solid #171717;

    background: #f2efe7;
    color: #171717;
}


.timetable-modal-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 30px;

    padding-bottom: 25px;

    border-bottom: 1px solid #171717;
}


.timetable-modal-header h2 {
    margin: 0;

    font-size: 30px;

    letter-spacing: -1px;
}


.timetable-modal-close {
    padding: 0;

    border: 0;

    background: transparent;
    color: #171717;

    font-family: inherit;
    font-size: 28px;

    cursor: pointer;
}


/* ==================================================
   EVENT DETAILS
================================================== */

.timetable-event-details {
    padding-top: 10px;
}


.timetable-detail {
    display: grid;

    grid-template-columns:
        130px minmax(0, 1fr);

    gap: 25px;

    padding: 20px 0;

    border-bottom: 1px solid #171717;
}


.timetable-detail > span {
    font-size: 9px;
    font-weight: bold;

    letter-spacing: 1px;

    opacity: 0.6;
}


.timetable-detail strong,
.timetable-detail a,
.timetable-detail p {
    margin: 0;

    color: #171717;

    font-size: 12px;

    line-height: 1.5;

    overflow-wrap: anywhere;
}


.timetable-detail a {
    font-weight: bold;
}


.timetable-detail a:hover {
    text-decoration: none;
}


.timetable-notes p {
    white-space: pre-wrap;
}


/* ==================================================
   EVENT COLLABORATORS
================================================== */

.event-collaborators {
    display: flex;

    flex-direction: column;

    gap: 8px;
}


.event-collaborator {
    display: flex;

    align-items: center;

    gap: 9px;
}


.event-collaborator-color {
    flex: 0 0 auto;

    width: 9px;
    height: 9px;

    border: 1px solid #171717;

    border-radius: 50%;
}


.event-collaborator a,
.event-collaborator span {
    font-size: 11px;
}


/* ==================================================
   MOBILE
================================================== */

@media (max-width: 800px) {

    .timetable-page {
        padding-top: 40px;
    }


    .timetable-page-heading {
        padding-bottom: 45px;
    }


    .timetable-page-heading h1 {
        letter-spacing: -2px;
    }


    .timetable-toolbar {
        align-items: flex-start;

        flex-direction: column;
    }


    #weekLabel {
        text-align: left;
    }

}


@media (max-width: 550px) {

    .timetable-page {
        padding-right: 20px;
        padding-left: 20px;
    }


    .timetable-modal-overlay {
        padding: 15px;
    }


    .timetable-modal {
        padding: 25px 20px;
    }


    .timetable-detail {
        grid-template-columns: 1fr;

        gap: 8px;
    }

}