/* Мероприятия ДеМарк - афиша для сотрудников (Telegram Mini App + тизер в браузере).
   Токены, шапка, кнопки, шторка и состояния - в /hub/ui.css; здесь афиша, календарь и карточка события. */

:root {
    --accent: var(--events);            /* афишный красный: дата и главное действие */
    --accent-soft: var(--events-soft);
    --accent-ink: var(--events-ink);
}

/* Месяц и вид */
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.month-switch { display: flex; align-items: center; gap: 6px; }
.month-switch h2 { font-family: var(--display); font-weight: 500; font-size: 17px; min-width: 9.5em; text-align: center; text-transform: capitalize; }

/* Афиша */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { transition: transform 160ms ease-out, border-color 160ms; }
.card:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.card.is-past { opacity: 0.6; }
.card-media.no-image { aspect-ratio: 16 / 6; }
.card-media.no-image::after { content: attr(data-initial); font-family: var(--display); font-weight: 700; font-size: 56px; color: var(--accent); opacity: 0.35; }
.date-badge { position: absolute; left: 12px; top: 12px; display: grid; justify-items: center; min-width: 58px; padding: 7px 10px 8px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); line-height: 1; }
.date-badge b { font-family: var(--display); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; }
.date-badge span { margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.card-meta { display: flex; flex-direction: column; gap: 3px; color: var(--ink-2); font-size: 13.5px; }
.card-meta span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.card-meta span > em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta svg.i { width: 15px; height: 15px; color: var(--ink-3); }

/* Календарь */
.calendar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { padding: 10px 4px; text-align: center; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 92px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: var(--ground); }
.cal-day .num { font-size: 12.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cal-day.today .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--ground); }
.cal-event { display: block; width: 100%; text-align: left; padding: 3px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.mine { background: var(--ok-soft); color: var(--ok); }
.cal-event.past { background: var(--ground); color: var(--ink-3); }

/* Карточка события */
.ev-status { align-self: flex-start; }
.ev-facts { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ev-facts li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.ev-facts svg.i { margin-top: 2px; color: var(--ink-3); }
.ev-facts a { color: var(--accent); text-underline-offset: 3px; }
.ev-description { white-space: pre-wrap; word-break: break-word; max-width: 62ch; }
.ev-description a { color: var(--accent); text-underline-offset: 3px; }
.ev-description:empty { display: none; }
.ev-seats-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.ev-seats-line span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.ev-seats-bar { height: 8px; border-radius: 999px; background: var(--ground); overflow: hidden; }
.ev-seats-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 300ms ease-out; }
.ev-people h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; margin: 4px 0 10px; }
.ev-people h3 svg.i { color: var(--ink-3); }
.ev-people ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin-bottom: 14px; }
.ev-people li { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* Тизер события для тех, кто пришёл не из Telegram */
.gate-poster { margin: -22px -22px 4px; border-radius: 22px 22px 0 0; overflow: hidden; background: var(--accent); color: var(--accent-ink); }
.gate-poster img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.gate-poster-body { padding: 18px 22px 20px; }
.gate-poster h1 { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.12; text-wrap: balance; }
.gate-date { font-weight: 600; margin-bottom: 6px; color: inherit !important; opacity: 0.9; }

@media (max-width: 560px) {
    .controls { justify-content: center; }
    .month-switch { width: 100%; justify-content: space-between; }
    .seg { width: 100%; }
    .seg button { flex: 1; justify-content: center; }
    .cal-day { min-height: 64px; padding: 4px; }
    .cal-event { font-size: 10.5px; padding: 2px 4px; }
}
