/* Events module (inc/mods/events.php): the event rows, the bar of view/span/category controls, and the month calendar.
   Loaded only on pages with an "events" block. Colours are the site's tokens; the few in-between shades are set here. */
.ev { --ev-muted: #7C868D; --ev-line2: #DED8C6; --ev-deep: #A87C08; --ev-soft: #E9C46A; font-family: var(--bff, inherit); }

/* ---------- event rows ---------- */
.ev-list { display: flex; flex-direction: column; gap: 14px; }
.ev-row {
  display: flex; align-items: center; gap: 26px; background: var(--white, #fff);
  padding: 18px 24px; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.ev-row:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(13,58,73,.10); }
.ev-row__date {
  display: flex; flex-direction: column; align-items: center; flex: none;
  min-width: 58px; padding-right: 22px; border-right: 1px solid var(--light-grey);
}
.ev-row__mon { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--yellow); }
.ev-row__day { font-family: var(--hff, inherit); font-size: 26px; font-weight: 500; color: var(--dark-blue); line-height: 1.2; }
.ev-row__body { flex: 1 1 auto; }
.ev-row__body h3 { margin: 0; font-family: var(--bff, inherit); font-size: 17px; font-weight: 700; line-height: 1.22; color: var(--heading); }
.ev-row__body p { margin: 3px 0 0; font-size: 14px; font-weight: 300; color: var(--ev-muted); }
.ev-row__thumb {
  width: 92px; height: 62px; object-fit: cover; display: block; flex: none;
  transition: transform .5s cubic-bezier(.2, .6, .25, 1);
}
.ev-row:hover .ev-row__thumb { transform: scale(1.09); }
.ev-row__body .ev-row__link { margin-top: 5px; }
.ev-row__link a { font-size: 13px; font-weight: 700; color: var(--on-yellow); letter-spacing: .02em; border-bottom: 1px solid var(--ev-soft); text-decoration: none; }
.ev-row__link a:hover { color: var(--dark-blue); border-color: var(--dark-blue); }

/* One colour per category, written once: the tag on a row, the filter chip and the calendar entry all read it. */
.ev-c-fellowship     { --cat-bg: #F6EDD6; --cat-ink: #7A5E08; }
.ev-c-youth          { --cat-bg: #E9F0E2; --cat-ink: #3F5B2E; }
.ev-c-worship        { --cat-bg: #E8EEF0; --cat-ink: #134C5F; }
.ev-c-bible-study    { --cat-bg: #EFE6F5; --cat-ink: #5B3E82; }
.ev-c-camp-meeting   { --cat-bg: #DCEFEA; --cat-ink: #12695A; }
.ev-c-memorial       { --cat-bg: #EDEBE7; --cat-ink: #5C5347; }
.ev-c-health         { --cat-bg: #F7E3DE; --cat-ink: #8A3B24; }
.ev-c-administration { --cat-bg: #E6EAF0; --cat-ink: #33475B; }
.ev-c-outreach       { --cat-bg: #FBEAD9; --cat-ink: #9A5B12; }

.ev-tag {
  flex: none; padding: 6px 13px; font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  background: var(--cat-bg, var(--lighter-grey)); color: var(--cat-ink, var(--dark-blue));
}
.ev-tag--off { background: #9A2C2C; color: var(--white, #fff); }

/* A cancelled event still shows, but can never be mistaken for one going ahead. */
.ev-row--off { background: #FBF7F6; }
.ev-row--off .ev-row__day, .ev-row--off .ev-row__mon { color: #9A7A78; }
.ev-row--off .ev-row__body h3 { color: var(--ev-muted); font-weight: 400; }
.ev-row--off .ev-row__body h3 s { text-decoration-thickness: 2px; }
.ev-row--off .ev-row__thumb { filter: grayscale(1); opacity: .55; }

.ev-empty { margin: 0 0 18px; padding: 14px 18px; border-left: 3px solid var(--yellow); background: var(--lighter-grey); font-size: 15px; }
.ev-note { margin-top: 46px; max-width: 760px; }
.ev-note h2 { font-family: var(--hff, inherit); font-size: 28px; margin: 0 0 12px; }
.ev-note p { font-size: 17px; font-weight: 300; line-height: 1.8; }

/* ---------- the bar: view, span and count ---------- */
.ev-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  padding-bottom: 18px; border-bottom: 1px solid var(--light-grey); margin-bottom: 18px;
}
.ev-seg { display: flex; border: 1px solid var(--ev-line2); border-radius: 4px; overflow: hidden; }
.ev-seg a {
  display: flex; align-items: center; gap: 8px; padding: 9px 17px;
  background: var(--white, #fff); font-size: 13px; font-weight: 700; letter-spacing: .05em;
  color: var(--dark-blue); white-space: nowrap; text-decoration: none;
  transition: background .18s ease, color .18s ease;
}
.ev-seg a + a { border-left: 1px solid var(--ev-line2); }
.ev-seg a:hover { background: var(--lighter-grey); }
.ev-seg a.is-on { background: var(--dark-blue); color: var(--white, #fff); --link: var(--white, #fff); }
.ev-seg svg { width: 16px; height: 16px; flex: none; }
.ev-bar__count {
  margin: 0 0 0 auto; font-size: 12px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ev-muted);
}

/* ---------- year and category chips ---------- */
.ev-cbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 26px; }
.ev-cbar__label { margin: 0 5px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ev-muted); }
.ev-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border: 1px solid var(--light-grey); border-radius: 100px;
  background: var(--white, #fff); font-size: 12px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--dark-blue); white-space: nowrap; text-decoration: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.ev-chip__n { font-weight: 400; opacity: .55; }
.ev-chip__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--cat-ink, var(--dark-blue)); }
.ev-chip:hover { border-color: var(--cat-ink, var(--dark-blue)); color: var(--cat-ink, var(--dark-blue)); }
.ev-chip.is-on { background: var(--cat-bg, var(--dark-blue)); border-color: var(--cat-ink, var(--dark-blue)); color: var(--cat-ink, var(--white, #fff)); --link: var(--cat-ink, var(--white, #fff)); }
.ev-chip--all.is-on { background: var(--dark-blue); border-color: var(--dark-blue); color: var(--white, #fff); --link: var(--white, #fff); }

/* ---------- month calendar ---------- */
.ev-calbar { display: flex; align-items: center; gap: 16px; margin: 0 0 18px; }
.ev-calbar__month { font-family: var(--hff, inherit); font-size: 26px; font-weight: 500; color: var(--dark-blue); margin: 0; min-width: 210px; }
.ev-calbar__arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: none; border: 1px solid var(--ev-line2);
  background: var(--lighter-grey); color: var(--dark-blue); font-size: 16px; border-radius: 2px; text-decoration: none;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.ev-calbar__arrow:hover { background: var(--dark-blue); border-color: var(--dark-blue); color: var(--white, #fff); transform: translateY(-1px); }
.ev-calbar__today { margin-left: auto; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dark-blue); }

.ev-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--light-grey); border: 1px solid var(--light-grey); }
.ev-cal__dow {
  background: var(--dark-blue); color: var(--white, #fff); text-align: center; padding: 9px 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.ev-cal__cell { background: var(--white, #fff); min-height: 112px; padding: 7px 8px 9px; }
.ev-cal__cell--blank { background: #FBFAF6; }
.ev-cal__cell--sabbath { background: #FCFAF3; }
.ev-cal__cell--today { box-shadow: inset 0 0 0 2px var(--yellow); }
.ev-cal__num { display: block; font-size: 12px; font-weight: 700; color: var(--ev-muted); margin-bottom: 5px; }
.ev-cal__full { display: none; }
.ev-cal__ev {
  display: block; margin-bottom: 4px; padding: 5px 7px; border-radius: 2px;
  border-left: 3px solid var(--cat-ink, #1D7A97); background: var(--cat-bg, var(--lighter-grey));
  font-size: 12px; line-height: 1.35; color: var(--heading); text-decoration: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
a.ev-cal__ev:hover { background: var(--dark-blue); border-left-color: var(--yellow); color: var(--white, #fff); }
a.ev-cal__ev:hover .ev-cal__time { color: rgba(255,255,255,.8); }
.ev-cal__time { display: block; font-size: 11px; color: var(--ev-muted); }
.ev-cal__title { display: block; font-weight: 700; }
.ev-cal__ev--off { opacity: .6; }
.ev-cal__ev--off .ev-cal__title { text-decoration: line-through; }
.ev-cal__off { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #9A4B3B; }

@media (max-width: 860px) {
  .ev-row { flex-wrap: wrap; gap: 16px; }
  .ev-row__thumb, .ev-row .ev-tag { display: none; }
  .ev-row .ev-tag--off { display: block; }      /* the one tag that must survive the narrow layout */
}
@media (max-width: 700px) {
  .ev-bar { gap: 10px; }
  .ev-bar__count { margin-left: 0; flex: 1 0 100%; }
  .ev-seg a { padding: 9px 13px; font-size: 12px; }
  .ev-cbar { gap: 7px; }
  .ev-chip { padding: 6px 12px; font-size: 11px; }
  .ev-calbar { flex-wrap: wrap; gap: 10px 12px; }
  .ev-calbar__month { order: -1; flex: 1 0 100%; font-size: 21px; min-width: 0; }
  .ev-calbar__today { margin-left: 4px; }
  /* the grid becomes a day-by-day list: no weekday heads, no empty days */
  .ev-cal { grid-template-columns: 1fr; border: 0; gap: 0; background: none; }
  .ev-cal__dow, .ev-cal__cell--blank, .ev-cal__cell--empty { display: none; }
  .ev-cal__cell { min-height: 0; padding: 14px 0; border-bottom: 1px solid var(--light-grey); box-shadow: none; }
  .ev-cal__cell--sabbath { background: none; }
  .ev-cal__cell--today .ev-cal__full { color: var(--ev-deep); }
  .ev-cal__num { display: none; }
  .ev-cal__full { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--heading); margin-bottom: 8px; }
  .ev-cal__ev { font-size: 14px; padding: 9px 11px; }
}
