/* weekly/weekly.css — single-week planner grid, sized to give handwriting room
 * and to fill the whole printable page. Builds on the shared .day-cell/
 * .calendar-grid styles from style.css. */

.weekly-calendar-container {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.week-nav-header {
    margin-top: 30px;
    padding-top: 12px;
    padding-bottom: 50px;
}

.weekly-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(var(--week-days, 7), 1fr);
    grid-template-rows: auto repeat(1, 1fr);
    grid-auto-rows: 1fr;
}

.weekly-grid .day-cell {
    min-height: 16vh;
}

.weekly-grid .holiday-name {
    font-size: 11px;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 8mm 8mm 20mm 8mm;
    }

    html, body {
        height: 100%;
    }

    .weekly-container {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        padding-top: 40px;
        padding-bottom: 20px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }

    .weekly-calendar-container {
        width: 100%;
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }

    .weekly-grid {
        height: auto;
        min-height: 0;
        flex: 1 1 auto;
        grid-template-rows: auto 1fr;
    }

    .weekly-grid .day-cell {
        min-height: 0;
        height: 100%;
    }

    .calendar-header {
        margin-top: 0;
    }

    html[data-print-orientation="portrait"] .weekly-container {
        width: 190mm;
        max-width: 100%;
        margin: 0 auto;
    }

    html[data-print-orientation="portrait"] .weekly-calendar-container {
        width: 190mm;
        max-width: 100%;
        margin: 0 auto;
        padding-right: 0;
        padding-left: 0;
    }

    html[data-print-orientation="portrait"] .weekly-grid {
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(var(--week-days, 7), minmax(0, 1fr));
    }

    html[data-print-orientation="portrait"] .day-cell,
    html[data-print-orientation="portrait"] .day-header {
        width: auto;
        min-width: 0;
        padding-right: 3px;
        padding-left: 3px;
    }

    html[data-print-orientation="landscape"] .weekly-calendar-container {
        height: 175mm;
        min-height: 0;
        max-height: 175mm;
        overflow: hidden;
    }

    html[data-print-orientation="landscape"] .calendar-header {
        flex: 0 0 auto;
        padding-top: 2mm;
        padding-bottom: 3mm;
    }

    html[data-print-orientation="landscape"] .weekly-grid {
        height: auto;
        max-height: none;
        min-height: 0;
        flex: 1 1 0;
    }

    html[data-print-orientation="landscape"] .day-cell {
        min-height: 0;
        padding-top: 3px;
        padding-bottom: 3px;
    }
}

@media (max-width: 768px) {
    .week-nav-header {
        margin-top: 6px;
        padding: 8px 0 10px;
    }

    .month-title-subline,
    [dir="rtl"] .month-title-subline,
    [dir="ltr"] .month-title-subline {
        padding-inline: 0;
        padding-left: 0;
        padding-right: 0;
        justify-content: center;
    }

    .month-title-nav {
        width: 100%;
        align-items: center;
    }
}
