/* month-grid.css — the shared month grid + phone date strip (js/monthGrid.js).
   Loaded ONLY by the pages that render one (book.html, schedule.html) — deliberately not in book.css,
   so the seven other pages that share book.css never carry these rules (Jay, 2026-09-23).
   Moved verbatim from page-book.css (spec-schedule-views § THE EXTRACTION); the additions are marked. */

/* ============================================
   MINI CALENDAR
   ============================================ */

.book-mini-cal {
    margin-bottom: 12px;
}

.book-mini-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.book-mini-cal-title {
    font-weight: bold;
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.book-mini-cal-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    color: var(--color-primary);
    transition: background 0.2s;
}

.book-mini-cal-btn:hover {
    background: var(--color-primary-lt);
}

.book-mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.book-mini-cal-dow {
    text-align: center;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 0;
    color: var(--color-text-lt);
}

.book-mini-cal-day {
    text-align: center;
    padding: 4px 2px;
    border-radius: 50%;
    font-size: var(--font-size-sm);
    cursor: pointer;
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: background 0.15s;
    color: var(--color-text);
}

.book-mini-cal-day--empty    { pointer-events: none; }
.book-mini-cal-day--past     { opacity: 0.3; pointer-events: none; }
.book-mini-cal-day--unavailable { opacity: 0.35; pointer-events: none; }

.book-mini-cal-day:hover:not(.book-mini-cal-day--empty):not(.book-mini-cal-day--past):not(.book-mini-cal-day--unavailable) {
    background: var(--color-primary-lt);
}

.book-mini-cal-day--selected {
    background: var(--color-primary);
    color: white;
    font-weight: bold;
}

.book-mini-cal-day--selected .book-mini-cal-dot {
    background: white !important;
}

.book-mini-cal-dots {
    display: flex;
    gap: 2px;
    justify-content: center;
    margin-top: 1px;
}

.book-mini-cal-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.book-mini-cal-dot--mobile { background: var(--color-slot-mobile); }
.book-mini-cal-dot--local  { background: var(--color-slot-local); }
.book-mini-cal-dot--venue  { background: var(--color-slot-venue); }
/* a venue's own colour is DATA: it arrives as an inline custom property, this class consumes it
   (spec-ui-wave § Cross-cutting rule 2 — never a raw inline property) */
.book-mini-cal-dot--venue-colored { background: var(--venue-color); }

/* ============================================
   ADDED WITH THE EXTRACTION (2026-09-23) — the staff calendar's modes
   ============================================ */

/* "greyed means NOT PLACEABLE, never NOT REACHABLE" (spec-schedule-views § Reaching the past):
   a past or fully-booked day stays clickable when the grid says so, and stays dim. */
.book-mini-cal--reach-past .book-mini-cal-day--past,
.book-mini-cal--reach-full .book-mini-cal-day--unavailable { pointer-events: auto; }
.book-mini-cal--reach-past .book-mini-cal-day--past:hover,
.book-mini-cal--reach-full .book-mini-cal-day--unavailable:hover { background: var(--color-primary-lt); }

/* the previous/next month's edge days, shown on the tail and head of the rendered month */
.book-mini-cal-day--neighbour { color: var(--color-text-lt); opacity: 0.55; }

/* today, marked without a fill so a selection still reads */
.book-mini-cal-day--today { box-shadow: inset 0 0 0 1px var(--color-primary); }

/* a desk picker with no availability marks: every day lit */
.book-mini-cal--picker .book-mini-cal-day { aspect-ratio: auto; padding: 3px 0; font-size: 0.75rem; }

/* THE LINES — per-subject runs across consecutive days (day/night). A line is a stackable mark
   over the cell: index and count are DATA (inline custom properties), the class consumes them.
   A run's first day starts mid-cell and its last day ends mid-cell, so the cell stays binary and
   the line carries the fraction (spec-schedule-views § The staff schedule, line 7). */
.book-mini-cal-lines {
    position: absolute;
    left: 0; right: 0; bottom: 2px;
    display: flex;
    flex-direction: column;
    gap: 3px;                    /* the operator's intent (2026-11-05): thin lines with space between, never a bar */
    pointer-events: none;
}
.book-mini-cal-line {
    height: 2px;
    background: var(--line-color, var(--color-primary));
    border-radius: 0;
    margin: 0 -1px;              /* bridge the grid gap so consecutive days read as one run */
    opacity: 0.85;
}
.book-mini-cal-line--from-mid { margin-left: 50%; border-radius: 2px 0 0 2px; }
.book-mini-cal-line--to-mid   { margin-right: 50%; border-radius: 0 2px 2px 0; }
.book-mini-cal-line--from-mid.book-mini-cal-line--to-mid { border-radius: 2px; }
.book-mini-cal-line--full     { background: var(--color-text-lt); opacity: 0.35; }  /* booked, not free */
.book-mini-cal-line--gap      { background: transparent; }                          /* keeps the stack aligned */
.book-mini-cal-line-count {
    position: absolute; right: 1px; bottom: -1px;
    font-size: 0.5rem; line-height: 1; color: var(--color-text-lt);
}

/* ============================================
   RENTAL DAY SKIN (book.html's range picker)
   ============================================ */
.book-rental-day { position: relative; cursor: pointer; }
.book-rental-day--inrange {
    background: var(--color-primary-lt);
    color: var(--color-primary);
}
.book-rental-day--start {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: bold;
}

/* ============================================
   DATE STRIP (phone)
   ============================================ */

.book-date-strip {
    width: 100%;
    margin: 0;
    padding: 4px 0 0 0;
}

.book-strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    margin: 0;
}

.book-strip-month-title {
    font-size: var(--font-size-sm);
    font-weight: bold;
    color: var(--color-text);
}

.book-strip-today-btn {
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--color-primary-lt);
    color: var(--color-primary);
    cursor: pointer;
}

.book-strip-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.book-strip-scroll::-webkit-scrollbar {
    display: none;
}

.book-strip-row {
    display: flex;
    align-items: flex-start;
}

.book-strip-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 36px;
}

.book-strip-month-col {
    width: 20px;
    justify-content: flex-end;
}

.book-strip-month-label {
    font-size: 0.55rem;
    font-weight: bold;
    color: var(--color-primary);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-strip-dow {
    width: 36px;
    text-align: center;
    font-size: 0.6rem;
    font-weight: bold;
    color: var(--color-text-lt);
    padding: 2px 0;
    box-sizing: border-box;
}

.book-strip-day {
    width: 36px;
    text-align: center;
    font-size: 0.75rem;
    padding: 4px 0;
    border-radius: var(--radius-block);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.15s;
    color: var(--color-text);
    box-sizing: border-box;
    position: relative;
}

.book-strip-day:hover:not(.book-mini-cal-day--unavailable) {
    background: var(--color-primary-lt);
}

.book-strip-day.book-mini-cal-day--unavailable {
    opacity: 0.3;
    pointer-events: none;
}

.book-strip-col:has(.book-mini-cal-day--selected) .book-strip-dow {
    color: white;
    background: var(--color-primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.book-strip-day.book-mini-cal-day--selected {
    background: var(--color-primary);
    color: white;
    font-weight: bold;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.book-strip-day.book-mini-cal-day--selected .book-mini-cal-dot {
    background: white !important;
}
