:root {
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
}

h1 {
    font-size: 1.5rem;
}
h2 {
    font-size: 1.2rem;
}

#outer {
    display: flex;
    flex-wrap: wrap;
    padding: 8px;
    gap: 16px;
}

#control {
    flex: 4 1 500px;
}

.calendarGrid {
    display: inline-grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin: 16px 0;
    > * {
        text-align: center;
        width: 48px;
        height: 38px;
        border-radius: 2px;
    }
    .calendarDay {
        display: flex;
        justify-content: center;
        align-items: center;
        border: none;
        transition: none;
        position: relative;
        &:hover {
            filter: brightness(1.4);
        }
        &:disabled {
            opacity: 0.6;
        }

        /* Marker */
        &::before {
            position: absolute;
            right: 2px;
            top: 2px;
            line-height: 1;
            font-size: 12px;
        }
        &.holiday::before {
            content: "F";
        }
        &.vacation::before {
            content: "U";
        }
        &.sick::before {
            content: "K";
        }
        &.parentalLeave::before {
            content: "P";
        }
    }
}

@media (prefers-color-scheme: dark) {
    .calendarDay {
        background: #333;
    }
    .calendarDay.holiday {
        border-bottom: 3px solid #494;
    }
    .calendarDay.vacation {
        border-bottom: 6px solid #4b4;
    }
    .calendarDay.sick {
        border-bottom: 6px solid #b22;
    }
    .calendarDay.parentalLeave {
        border-bottom: 6px solid #84e;
    }
}

@media (prefers-color-scheme: light) {
    .calendarDay {
        color: black;
        background: #ddd;
    }
    .calendarDay.holiday {
        border-bottom: 3px solid #080;
    }
    .calendarDay.vacation {
        border-bottom: 6px solid #4c4;
    }
    .calendarDay.sick {
        border-bottom: 6px solid #f53;
    }
    .calendarDay.parentalLeave {
        border-bottom: 6px solid #72d;
    }
}

#preview {
    flex: 3 1 400px;
    container-type: size;

    & > div {
        aspect-ratio: 1 / 1.4142136;
        border: 1px solid #888;
        padding: 7cqw;
        font-size: 1.7cqw;
    }
    h3 {
        font-size: 120%;
        margin-bottom: 1.3cqw;
    }
    table {
        font-size: 88%;
        td, th {
            padding: 0.13cqw 1cqw;
        }
    }
    .signatures {
        display: flex;
        margin-top: 9cqw;
        justify-content: space-between;
        margin-right: 4cqw;
        hr {
            border-color: var(--pico-color);
            margin-bottom: 0.6cqw;
            margin-top: 1.4cqw;
        }
    }
}


@media (prefers-color-scheme: dark) {
    img {
        filter: invert(1) hue-rotate(180deg);
    }
}


/* ===== Print styling ================================================== */

@media print {
    #control {
        display: none !important;
    }
    #preview > div {
        border: none;
    }
}

/* Optional: force A4 page size */
@page {
    size: A4;
    margin: 1cm;
}
