/* Monthly calendar: shared by the in-app pop-up and the wall kiosk page. */
.cal { --cal-bg: #fff; --cal-ink: #1d1d1d; --cal-muted: #8a8a8a; --cal-cell: #f6f3ee;
       --cal-accent: #c0392b; --cal-gold: #c9a227; color: var(--cal-ink); }

/* ---------- Desktop / kiosk grid: full width, no borders, Sunday first ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(var(--rows), minmax(0, 1fr));
            gap: 4px; width: 100%; height: 100%; }
.cal-dow { text-align: center; font-weight: 700; font-size: clamp(11px, 1.2vw, 18px); padding: 6px 0; color: #555; text-transform: uppercase; letter-spacing: .04em; }
.cal-cell { position: relative; background: var(--cal-cell); border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 0; }
.cal-cell.blank { background: transparent; }
.cal-num { font-size: clamp(16px, 2.6vw, 44px); font-weight: 300; color: #444; }
.cal-cell.today { box-shadow: inset 0 0 0 4px var(--cal-accent); background: #fff3ef; }
.cal-cell.today .cal-num { font-weight: 800; color: var(--cal-accent); }
.cal-today-tag { position: absolute; top: 4px; left: 6px; font-size: clamp(9px, .8vw, 13px); font-weight: 800; color: var(--cal-accent); text-transform: uppercase; z-index: 2; }

/* Events in a cell: photos sized to share the space */
.cal-items { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 3px; width: 100%; height: 100%; padding: 4px; align-items: center; justify-items: center; }
.cal-item { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 0; width: 100%; height: 100%; }
.cal-pics { display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; flex: 1; min-height: 0; container-type: size; }
/* Round photos sized to the space available (stay circles however many share the box) */
.cal-av { width: min(100cqw, 100cqh); height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: #ddd; flex: none;
          box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.25); }
.cal-pics.pair .cal-av { width: min(42cqw, 100cqh); }
/* Blank avatar: grey circle with a person outline */
.cal-blank { display: block; background: #d9d4cc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='38' r='17' fill='%23a39b8f'/%3E%3Cpath d='M18 88c3-18 17-28 32-28s29 10 32 28z' fill='%23a39b8f'/%3E%3C/svg%3E") center / cover no-repeat; }
.cal-link { font-size: clamp(10px, 1.1vw, 20px); flex: none; line-height: 1; }
.cal-cap { font-size: clamp(9px, .95vw, 16px); font-weight: 700; text-align: center; line-height: 1.15; padding-top: 2px; max-width: 100%;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }

/* Celebration: today is a birthday or anniversary */
.cal-cell.celebrate { box-shadow: inset 0 0 0 4px var(--cal-gold); background: #fff8e1; }
.cal-cell.celebrate::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background-image:
    radial-gradient(circle, #e74c3c 1.6px, transparent 2px), radial-gradient(circle, #3498db 1.6px, transparent 2px),
    radial-gradient(circle, #f1c40f 1.8px, transparent 2.2px), radial-gradient(circle, #2ecc71 1.6px, transparent 2px),
    radial-gradient(circle, #9b59b6 1.6px, transparent 2px);
  background-size: 38px 34px, 46px 40px, 30px 44px, 52px 36px, 42px 48px;
  background-position: 3px 5px, 17px 21px, 9px 31px, 29px 12px, 23px 2px;
  -webkit-mask: linear-gradient(#000 0 18%, transparent 30% 70%, #000 82%); mask: linear-gradient(#000 0 18%, transparent 30% 70%, #000 82%); }
.cal-banner { position: absolute; top: 0; left: 0; right: 0; z-index: 3; text-align: center; font-weight: 800; font-size: clamp(9px, .9vw, 15px);
              color: #fff; background: linear-gradient(90deg, #c0392b, #e67e22, #c0392b); padding: 2px 0; letter-spacing: .03em; }
.cal-cell.celebrate .cal-items { padding-top: clamp(14px, 1.4vw, 22px); }

/* ---------- Compact grid for phones: same look, fixed-height rows, page scrolls ---------- */
.cal-grid.compact { height: auto; gap: 2px; grid-template-rows: 26px repeat(var(--rows), max(88px, calc((100dvh - 130px) / var(--rows)))); align-content: start; }
.cal-grid.compact .cal-dow { font-size: 11px; padding: 6px 0 4px; letter-spacing: 0; }
.cal-grid.compact .cal-cell { border-radius: 5px; }
.cal-grid.compact .cal-num { font-size: 17px; }
.cal-grid.compact .cal-items { padding: 2px; gap: 1px; }
.cal-grid.compact .cal-cap { font-size: 8.5px; padding-top: 1px; }
.cal-grid.compact .cal-av { box-shadow: 0 0 0 1px #fff, 0 1px 2px rgba(0,0,0,.25); }
.cal-grid.compact .cal-link { font-size: 8px; }
.cal-grid.compact .cal-banner { font-size: 8px; padding: 1px 0; }
.cal-grid.compact .cal-today-tag { font-size: 8px; top: 2px; left: 3px; }
.cal-grid.compact .cal-cell.celebrate .cal-items { padding-top: 12px; }
.cal-grid.compact .cal-cell.today { box-shadow: inset 0 0 0 3px var(--cal-accent); }
