/* The "Other days" calendar of the home page (templates/home/_calendar.html.twig, home_calendar.js, src/HomeCalendar.php).
   A popover under the button on a desktop, a sheet along the foot of the screen on a phone. Hairlines, no glow; the season
   tints come from data/seasons.json through --t (the family's pigment) and --tp (how much of it), set on each day. */
.hh-days { position: relative; }
.hh-cal { box-sizing: border-box; width: 360px; max-width: calc(100vw - 2 * var(--ts-gutter-phone));
    margin-top: 8px; padding: 12px 12px 10px; background: var(--ts-white); border: 1px solid var(--ts-border-control);
    border-radius: var(--ts-radius-card); box-shadow: var(--ts-shadow-raised); color: var(--ts-text); font-family: var(--ts-font-sans); }
.hh-days[open] > .hh-cal { position: absolute; z-index: var(--ts-z-sticky); left: 0; top: 100%; }

.cal-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px auto; align-items: center; gap: 0 2px; }
.cal-nav { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--ts-radius-pill);
    color: var(--ts-brown); font-size: 24px; line-height: 1; text-decoration: none; }
a.cal-nav:hover { background: var(--ts-surface-raised); }
.cal-title { margin: 0; text-align: center; line-height: 1.2; }
.cal-title b { display: block; font-family: var(--ts-font-display); font-weight: 400; font-size: 18px; color: var(--ts-brown); }
.cal-title span { display: block; font-size: 12.5px; color: var(--ts-text-muted); }
.cal-today { display: inline-flex; align-items: center; min-height: 36px; margin-left: 4px; padding: 0 14px; border: 1px solid var(--ts-border-control);
    border-radius: var(--ts-radius-pill); color: var(--ts-brown); font-size: 14px; font-weight: 600; text-decoration: none; }
.cal-today:hover { background: var(--ts-surface-raised); }

.cal-grid { width: 100%; margin: 8px 0 0; border-collapse: separate; border-spacing: 2px; table-layout: fixed; }
.cal-grid th { padding: 2px 0 4px; font-size: 12px; font-weight: 600; text-align: center; color: var(--ts-text-muted); }
.cal-grid td { padding: 0; }
.cd { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 46px; border: 2px solid transparent;
    border-radius: var(--ts-radius-md); text-decoration: none; color: var(--ts-ink);
    background: color-mix(in srgb, var(--t, transparent) var(--tp, 100%), var(--ts-white)); }
.cd:hover { border-color: var(--ts-border-control); }
.cd-n { font-size: 16px; font-weight: 600; line-height: 1.1; }
.cd-c { font-size: 10.5px; line-height: 1.2; color: var(--ts-text-muted); }
.cd.is-out { opacity: .5; }
.cd.is-today .cd-n { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--ts-gold); }
.cd.is-sel { border-color: var(--ts-brown); }
.cd.is-sel .cd-n { font-weight: 800; }
.cd.is-feast::after, .cd-dot { content: ""; width: var(--ts-size-dot, 6px); height: var(--ts-size-dot, 6px); border-radius: 50%; background: var(--dot, var(--ts-sienna)); }
.cd.is-feast::after { position: absolute; top: 4px; right: 5px; }
.cd:focus-visible, .cal-nav:focus-visible, .cal-today:focus-visible, .cal-foot a:focus-visible, .hh-days summary:focus-visible {
    outline: var(--ts-size-focus-ring, 2px) solid var(--ts-focus); outline-offset: 1px; }

.cal-key { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 8px 0 0; font-size: 12px; color: var(--ts-text-muted); }
.cal-k { display: inline-flex; align-items: flex-start; gap: 5px; }
.cal-k > i { flex: none; margin-top: 3px; }
.cal-k span > .cd-dot { margin: 0 4px 1px 0; vertical-align: middle; }
.cd-dot { display: inline-block; width: 6px; height: 6px; }
.cal-sw { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--ts-border); border-radius: 3px;
    background: color-mix(in srgb, var(--t) var(--tp, 100%), var(--ts-white)); }
.cal-foot { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0 0; padding-top: 4px; border-top: 1px solid var(--ts-border); font-size: 14px; }
.cal-foot a { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; color: var(--ts-sienna); font-weight: 600; text-decoration: none; }
.cal-foot a:hover { text-decoration: underline; }

/* phone: a sheet along the foot of the screen, over a pale scrim; days 44px or more */
@media (max-width: 760px) {
    .hh-days[open]::before { content: ""; position: fixed; inset: 0; z-index: calc(var(--ts-z-overlay) - 1); background: rgba(35, 27, 24, .28); }
    .hh-days[open] > summary { position: relative; z-index: var(--ts-z-overlay); }
    .hh-days[open] > .hh-cal { position: fixed; z-index: var(--ts-z-overlay); left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; max-height: 92vh; overflow-y: auto;
        margin: 0; padding: 12px var(--ts-gutter-phone) calc(12px + env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: var(--ts-radius-card) var(--ts-radius-card) 0 0; box-shadow: none; }
    .cal-grid { border-spacing: 3px; }
    .cd { height: 48px; }
    .cal-foot a { min-height: 44px; }
    .cal-today { min-height: 44px; }
}
