/* omer/omer.css — Counting the Omer: a Sunday-Saturday calendar of the 49 days
   (5-8 week rows, partial first/last weeks muted). Print is PORTRAIT A4 only.
   Shared print layout: /master_print.css (reads --calendar-week-rows, set inline
   by the server to the real row count). */

@media print {
    .no-print { display: none !important; }
}

/* Print + PDF download share one row (global .download-pdf-button margin-top
   would otherwise separate them by 24px). */
.page-omer .omer-print-download {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.page-omer .omer-print-download .download-pdf-button {
    margin-top: 0;
}

.calendar-grid.omer-grid {
    --calendar-week-rows: 7;
    /* The outer frame is the grid's own border on all four sides; cells draw only
       their inner (end/bottom) lines, and the last column / row drop theirs so no
       edge is doubled or lost. */
    border: 1px solid #b8b8b8;
    box-sizing: border-box;
}

.omer-grid .day-header:first-child { border-inline-start: 0; }
.omer-grid .day-header:nth-child(7) { border-inline-end: 0; }
.omer-grid .day-cell:nth-child(7n+8) { border-inline-start: 0; }
.omer-grid .day-cell:nth-child(7n+7) { border-inline-end: 0; }

.omer-banner {
    min-height: 56px;
    box-sizing: border-box;
    /* Below the legend; height is reserved (min-height + the two-line room at
       narrow widths) because omer.js rewrites the text client-side. */
    margin: 16px 0 0;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #f0d58a;
    border-radius: 6px;
    color: #5b4300;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.omer-banner.is-counting {
    background: #e8f5e9;
    border-color: #9ccc9f;
    color: #1b5e20;
}

.calendar-header {
    padding: 14px 12px 10px;
}

/* The grid's own caption is an <h2> (the page has a single <h1>). */
.calendar-header h2#calendar-title {
    margin: 14px 0 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
}

.omer-legend {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 400;
    color: #555;
    line-height: 1.4;
}

/* Fixed-height head (date, month tag, holiday) so the count block starts at the
   same offset in every cell of a row regardless of labels. */
.omer-cell {
    --omer-head-height: 56px;
    min-height: 116px;
    align-items: stretch;
}

.omer-cell-head {
    flex: 0 0 var(--omer-head-height);
    height: var(--omer-head-height);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.omer-count-block {
    flex: 1 1 0;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.omer-num {
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: #4b1d6b;
    text-align: center;
}

/* Holiday name directly under the primary date, start-aligned with it. */
.omer-cell .holiday-name,
.omer-note {
    margin-top: 3px;
    padding: 0;
    width: 100%;
    text-align: start;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
}

.omer-wd {
    font-size: 10px;
    line-height: 1.2;
    color: #4b1d6b;
    text-align: center;
}

/* From week 5 (day 29+): narrow label so long Hebrew strings wrap; block gap keeps
   wrapped lines tucked under the day number (not bottom-pinned). */
.omer-cell.omer-w5plus .omer-wd {
    max-width: 80%;
}

/* Days outside 1-49: date only, muted like out-of-month days in the month grid.
   Holiday colour (Pesach, Shavuot...) set inline still wins. */
.omer-cell.omer-pad:not([style]) .gregorian-date,
.omer-cell.omer-pad:not([style]) .hebrew-date { color: #999; }

.omer-cell.omer-lag {
    outline: 2px solid #e0a800;
    outline-offset: -2px;
}

.omer-cell.omer-tonight {
    outline: 3px solid #08e3ff;
    outline-offset: -3px;
}

@media screen and (max-width: 768px) {
    /* style.css pins .calendar-grid .day-cell to max-height:75px; omer needs room
       for the count + wrapped week label. */
    .calendar-grid.omer-grid .omer-cell {
        --omer-head-height: 42px;
        min-height: 96px;
        max-height: none;
        padding: 4px 5px 6px;
    }
    .omer-count-block {
        justify-content: flex-start;
        padding-top: 2px;
        gap: 2px;
    }
    .omer-num { font-size: 15px; }
    .omer-wd { font-size: 7px; line-height: 100%; }
    .omer-cell .holiday-name, .omer-note { font-size: 8px; }
    .hebrew-date { font-size: 8px; }
    .day-header { font-size: 10px; padding: 4px 2px; }
    .omer-banner {
        margin-top: 12px;
        font-size: 12px;
        font-weight: 500;
        min-height: 0;
        padding: 6px 8px;
        line-height: 1.25;
        border-radius: 4px;
    }
}

@media print {
    .calendar-grid.omer-grid { border-color: #777; }
    /* 3px padding let the primary date's ink touch the cell border (the
       glyph box sat at the padding edge and the head's overflow clipped it). */
    .omer-cell { --omer-head-height: 50px; min-height: 0; padding: 6px 8px; }
    .omer-cell-head { overflow: visible; }
    .omer-num { font-size: 19px; }
    .omer-wd { font-size: 8.5px; }
    .omer-cell .holiday-name, .omer-note { font-size: 8px; }
    .omer-legend { font-size: 9px; }
    .calendar-header { padding: 0 0 6px; font-size: 20px; }
    .hebrew-date { font-size: 8.5px; }
    .omer-cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
