/* Events calendar: the month grid, event rows, the list and the detail page.
   Uses the colour and spacing tokens defined in css/site.css. */

/* One colour per type, used by chips, dots, date tiles and badges. */
.ev--meeting { --ev: #7c3aed; }
.ev--sports { --ev: #2457f5; }
.ev--training { --ev: #0d9488; }
.ev--welfare { --ev: #db2777; }
.ev--celebration { --ev: #ea6a0c; }
.ev--other { --ev: #64748b; }

.ev-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.ev-bar + .chips { margin-bottom: 1.75rem; }

/* --- month grid -------------------------------------------------------------------------- */
.cal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.cal__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.cal__title { font-size: 1.4rem; margin: 0; }
.cal__nav { display: flex; align-items: center; gap: .5rem; }
.cal__nav .icon-btn { width: 40px; height: 40px; font-size: 1rem; }
.cal__nav .btn.disabled { opacity: .45; pointer-events: none; }

.cal__table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.cal__table th { padding: .65rem .25rem; text-align: center; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: #fafbfe; border-bottom: 1px solid var(--line); }
.cal__cell { height: 118px; vertical-align: top; padding: .35rem .4rem .45rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.cal__table tr:last-child .cal__cell { border-bottom: 0; }
.cal__cell:last-child { border-right: 0; }
.cal__cell--out { background: #fafbfd; }
.cal__cell--out .cal__num { color: #a2acbf; }
.cal__cell--selected { background: var(--brand-50); box-shadow: inset 0 0 0 2px var(--brand); }
.cal__num { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: .85rem; color: var(--ink); }
.cal__num:hover { background: var(--brand-50); color: var(--brand); }
.cal__cell--today .cal__num { background: var(--brand); color: #fff; }

.cal__chips { display: grid; gap: .2rem; margin-top: .2rem; }
.ev-chip {
  display: block; padding: .15rem .4rem; border-radius: 6px; border-left: 3px solid var(--ev); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .72rem; font-weight: 600; line-height: 1.3; color: color-mix(in srgb, var(--ev) 72%, black);
  background: color-mix(in srgb, var(--ev) 13%, white); transition: background .15s;
}
.ev-chip b { font-weight: 800; }
.ev-chip:hover { background: color-mix(in srgb, var(--ev) 24%, white); color: color-mix(in srgb, var(--ev) 72%, black); }
.ev-chip--cont { border-left-color: transparent; border-radius: 0 6px 6px 0; margin-left: -.4rem; padding-left: .8rem; }
.cal__more { font-size: .72rem; font-weight: 700; color: var(--muted); padding-left: .3rem; }
.cal__more:hover { color: var(--brand); }
.cal__dots { display: none; justify-content: center; gap: 3px; margin-top: 2px; }
.cal__dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--ev); }

/* Small screens: dots instead of written-out events; tap a day to read them below. */
@media (max-width: 767.98px) {
  .cal__head { padding: .8rem .9rem; }
  .cal__title { font-size: 1.15rem; }
  .cal__cell { height: 62px; padding: .25rem .1rem; text-align: center; }
  .cal__chips { display: none; }
  .cal__dots { display: flex; }
  .cal__num { min-width: 30px; height: 30px; }
}

/* --- picked day, next up -------------------------------------------------------------------- */
.dayview { margin-top: 1.5rem; }
.dayview__title { font-size: 1.1rem; margin-bottom: 1rem; }
.dayview__none, .dayview__hint { display: flex; align-items: center; gap: .6rem; margin: 1.25rem 0 0; color: var(--muted); font-weight: 600; }
.dayview__none { padding: 1rem 1.25rem; border: 2px dashed var(--line); border-radius: var(--radius-sm); margin-top: 0; }
.dayview .evrow + .evrow, .nextup .evrow + .evrow, .evlist .evrow + .evrow { margin-top: .75rem; }

.nextup { padding: 1.4rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.nextup__title { font-size: 1.1rem; margin-bottom: 1rem; }
.nextup__all { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1rem; font-weight: 700; }

/* --- one event as a row ------------------------------------------------------------------------ */
.evrow {
  display: flex; gap: .95rem; align-items: stretch; padding: .85rem 1rem .85rem .85rem; background: #fff; color: var(--ink-soft);
  border: 1px solid var(--line); border-left: 4px solid var(--ev); border-radius: var(--radius-sm); transition: transform .2s, box-shadow .2s;
}
.evrow:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--ink-soft); }
.evrow__date { flex: none; display: grid; place-content: center; width: 52px; text-align: center; border-radius: 12px; background: color-mix(in srgb, var(--ev) 12%, white); color: color-mix(in srgb, var(--ev) 75%, black); line-height: 1.1; }
.evrow__date b { font-size: 1.35rem; font-weight: 800; }
.evrow__date small { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.evrow__body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.evrow__top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.evrow__cat { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ev); }
.evrow__now { font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .1rem .5rem; border-radius: 999px; background: var(--accent-50); color: var(--accent-600); }
.evrow__title { color: var(--ink); font-size: 1rem; line-height: 1.35; }
.evrow__meta { display: flex; flex-wrap: wrap; gap: .15rem 1rem; font-size: .82rem; font-weight: 600; color: var(--muted); }
.evrow__meta i { margin-right: .25rem; }

/* --- list view ------------------------------------------------------------------------------ */
.evlist__month { font-size: 1.15rem; margin: 2rem 0 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.evlist__month:first-child { margin-top: 0; }
.ev-when { margin-bottom: 1.25rem; }
.ev-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.75rem; font-size: .9rem; font-weight: 600; color: var(--muted); }

/* --- detail ---------------------------------------------------------------------------------- */
.ev-facts { padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.ev-facts dl { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: 0; }
.ev-facts dt { font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.ev-facts dd { margin: .1rem 0 0; font-weight: 700; color: var(--ink); }
.ev-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.ev-hidden-note { display: flex; gap: .6rem; align-items: center; padding: .8rem 1.1rem; margin-bottom: 1.25rem; border-radius: var(--radius-sm); background: #fff8e1; color: #6b4e00; border: 1px solid #f3dc8a; font-weight: 600; }

@media (max-width: 575.98px) {
  .ev-actions .btn { flex: 1 1 100%; }
  .evrow { gap: .75rem; padding-right: .75rem; }
  .evrow__date { width: 46px; }
}
