/* Table calendar view (alternative to the day-columns view): table, rows and their responsive tweaks.
   Loaded after calendar.css. */

/* Table calendar view (alternative to the day-columns view) */

.table_calendar_container {
    display: none; /* toggled from JS based on the "use table calendar" setting */
    width: 90%;
    margin: 2vh auto;
    border-collapse: collapse;
}

.table_calendar_container th,
.table_calendar_container td {
    border: 1px solid var(--secondary_color_transparency);
    padding: 1vh 1.5vh;
    text-align: left;
}

.table_calendar_container th {
    background-color: var(--primary_color);
    color: white;
    position: sticky;
    top: 0;
}

.table_cell_day {
    white-space: nowrap;
    font-size: small;
}

.table_row_behind {
    background-color: rgba(255, 62, 62, 0.15);
}

.table_row_aired {
    opacity: 0.55;
}

@media only screen and (max-width: 1024px) {
    /* Fixed layout + wrapping instead of content-driven auto-width: this is what stops the whole
           page from stretching sideways and forcing a horizontal scroll on narrower screens. */

    .table_calendar_container {
            width: 96vw;
            table-layout: fixed;
            font-size: clamp(0.75rem, 1.8vw, 0.95rem);
        }

    .table_calendar_container th,
        .table_calendar_container td {
            padding: 0.8vh 0.8vw;
            word-break: break-word;
            overflow-wrap: anywhere;
        }

    .table_cell_day {
            white-space: normal;
            width: 20%;
        }

    .table_cell_title {
            width: 42%;
        }

    .table_cell_episodes {
            width: 19%;
        }

    .table_cell_behind {
            width: 19%;
        }
}

@media only screen and (max-width: 768px) {
    /* Fixed layout + wrapping instead of content-driven auto-width: this is what stops the whole
           page from stretching sideways and forcing a horizontal scroll on phone screens. */

    .table_calendar_container {
            width: 100%;
            max-width: 100vw;
            table-layout: fixed;
            font-size: clamp(0.65rem, 2.8vw, 0.8rem);
        }

    .table_calendar_container th,
        .table_calendar_container td {
            padding: 0.6vh 0.6vw;
            word-break: break-word;
            overflow-wrap: anywhere;
        }

    .table_cell_day {
            white-space: normal;
            width: 22%;
        }

    .table_cell_title {
            width: 40%;
        }

    .table_cell_episodes {
            width: 19%;
        }

    .table_cell_behind {
            width: 19%;
        }
}
