/* =========================================================================
   AIDH Campus Events — front-end styles
   -------------------------------------------------------------------------
   Colours/fonts come from the theme's design tokens (alduffa-tokens.css)
   with sensible fallbacks, so the calendar follows the site branding and
   still looks right if the tokens aren't there.
========================================================================= */

.aev-cal,
.aev-upcoming,
.aev-single,
.aev-reg,
.aev-standalone {
  --aev-ink: var(--c-ink, #092434);
  --aev-ink-soft: var(--c-ink-soft, #1D597C);
  --aev-gold: var(--c-teal, #D4A73A);
  --aev-gold-deep: var(--c-teal-dark, #9C7A1E);
  --aev-gold-soft: var(--c-teal-light, #F5E9C6);
  --aev-body: var(--c-body, #5C6B80);
  --aev-line: var(--c-line, #DCE2EA);
  --aev-surface: var(--c-surface, #F7F4EE);
  --aev-ok: #2E7D5B;
  --aev-warn: #9C6A00;
  --aev-radius: var(--radius, 6px);
  font-family: var(--f-body, "DM Sans", "Segoe UI", Arial, sans-serif);
  color: var(--aev-ink);
}
.aev-cal *, .aev-cal *::before, .aev-cal *::after,
.aev-upcoming *, .aev-single *, .aev-reg *, .aev-standalone * { box-sizing: border-box; }

.aev-cal .screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Page-level wrappers: same centred, padded column the theme's own
   sections use (the theme's page.php adds no container of its own). */
.aev-cal, .aev-upcoming {
  width: 100%;
  max-width: var(--wrap-max, 1280px);
  margin-inline: auto;
  padding: 40px var(--wrap-pad, 20px);
}

/* The theme's single-post header prints the *publish* date and author,
   which is misleading on an event (the event date is in the panel below). */
.single-aidh_event .blog-meta { display: none; }

/* ------------------------------------------------------------ Buttons */
.aev-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: var(--aev-radius);
  border: 1.5px solid var(--aev-ink); background: transparent; color: var(--aev-ink);
  font: 600 0.9rem/1.2 var(--f-body, inherit); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.aev-btn:hover, .aev-btn:focus-visible { background: var(--aev-ink); color: #fff; }
.aev-btn--primary { background: var(--aev-gold); border-color: var(--aev-gold); color: var(--aev-ink); }
.aev-btn--primary:hover, .aev-btn--primary:focus-visible { background: var(--aev-gold-deep); border-color: var(--aev-gold-deep); color: #fff; }
.aev-btn[disabled] { opacity: .6; cursor: progress; }
.aev-link { color: var(--aev-ink-soft); font-weight: 600; text-decoration: none; }
.aev-link:hover { text-decoration: underline; }

.aev-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
  background: var(--aev-surface); color: var(--aev-body);
}
.aev-badge.is-ok { background: #E3F3EA; color: var(--aev-ok); }
.aev-badge.is-warn { background: #FBF0D5; color: var(--aev-warn); }
.aev-badge.is-muted { background: #ECEFF3; color: #5C6B80; }

/* ------------------------------------------------------------ Toolbar */
.aev-cal__bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 14px;
}
.aev-cal__nav, .aev-cal__views { display: flex; gap: 6px; }
.aev-cal .aev-cal__title {
  margin: 0; font-family: var(--f-heading, Georgia, serif); font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.15; color: var(--aev-ink);
  flex: 1 1 auto; text-align: center;
}
.aev-cal__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px;
  border: 1.5px solid var(--aev-line); border-radius: var(--aev-radius);
  background: #fff; color: var(--aev-ink); text-decoration: none;
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.aev-cal__btn--text { font-size: .88rem; font-weight: 600; }
.aev-cal__btn:hover, .aev-cal__btn:focus-visible { border-color: var(--aev-ink); }
.aev-cal__btn.is-active { background: var(--aev-ink); border-color: var(--aev-ink); color: #fff; }

.aev-cal__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.aev-chipbtn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--aev-line);
  background: #fff; color: var(--aev-ink); font-size: .85rem; font-weight: 600; text-decoration: none;
}
.aev-chipbtn i { width: 9px; height: 9px; border-radius: 50%; background: var(--aev-chip, var(--aev-ink)); }
.aev-chipbtn:hover { border-color: var(--aev-ink); }
.aev-chipbtn.is-active { background: var(--aev-ink); border-color: var(--aev-ink); color: #fff; }

.aev-cal__body { transition: opacity .15s; }
.aev-cal[aria-busy="true"] .aev-cal__body { opacity: .45; pointer-events: none; }

/* --------------------------------------------------------- Month grid */
.aev-cal__table {
  width: 100%; table-layout: fixed; border-collapse: collapse;
  border: 1px solid var(--aev-line); background: #fff;
}
.aev-cal__table th {
  padding: 10px 6px; background: var(--aev-ink); color: #fff;
  font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.aev-cal__table abbr { text-decoration: none; }
.aev-cal__day {
  height: 118px; vertical-align: top; padding: 6px;
  border: 1px solid var(--aev-line); overflow: hidden;
}
.aev-cal__day.is-other { background: #FAFBFC; }
.aev-cal__day.is-other .aev-cal__num { color: #A5AFBC; }
.aev-cal__day time { display: flex; justify-content: flex-end; }
.aev-cal__dow { display: none; }
.aev-cal__num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; border-radius: 50%;
  font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.aev-cal__day.is-today .aev-cal__num { background: var(--aev-gold); color: var(--aev-ink); }
.aev-cal__events { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; }
.aev-cal__events li { margin: 0; padding: 0; list-style: none; }

.aev-cal__chip {
  display: block; padding: 2px 6px; border-radius: 4px;
  border-left: 3px solid var(--aev-chip, var(--aev-ink-soft));
  background: #EEF2F5;
  background: color-mix(in srgb, var(--aev-chip, #1D597C) 13%, #fff);
  color: var(--aev-ink); font-size: .74rem; line-height: 1.35; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aev-cal__chip:hover, .aev-cal__chip:focus-visible {
  background: var(--aev-chip, var(--aev-ink-soft)); color: #fff;
}
.aev-cal__chip.is-cont { opacity: .8; border-left-style: dashed; }
.aev-cal__chip-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.aev-cal__more { font-size: .72rem; font-weight: 700; color: var(--aev-ink-soft); text-decoration: none; padding-left: 4px; }
.aev-cal__more:hover { text-decoration: underline; }
.aev-cal__foot { margin: 14px 0 0; font-size: .88rem; }
.aev-empty { padding: 18px 0; color: var(--aev-body); }
.aev-empty--month { text-align: center; margin: 0; }

/* ------------------------------------------- Event rows (list / cards) */
.aev-ev-list { display: flex; flex-direction: column; }
.aev-ev {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 18px; align-items: center;
  padding: 18px 0; border-top: 1px solid var(--aev-line);
}
.aev-ev:last-child { border-bottom: 1px solid var(--aev-line); }
.aev-ev__date {
  display: flex; flex-direction: column; justify-content: center; text-align: center;
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--aev-ink); color: #fff; text-decoration: none;
  font-variant-numeric: tabular-nums; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--aev-chip, var(--aev-gold));
}
.aev-ev__day { font: 400 1.6rem/1 var(--f-heading, Georgia, serif); }
.aev-ev__mon { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; margin-top: 3px; color: var(--aev-gold-soft); }
.aev-ev__type { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--aev-chip, var(--aev-gold-deep)); }
.aev-ev .aev-ev__title { margin: 2px 0 4px; font: 400 1.25rem/1.25 var(--f-heading, Georgia, serif); }
.aev-ev__title a { color: var(--aev-ink); text-decoration: none; }
.aev-ev__title a:hover { color: var(--aev-ink-soft); text-decoration: underline; }
.aev-ev__meta { margin: 0; color: var(--aev-body); font-size: .92rem; }
.aev-ev__cta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.aev-upcoming .aev-upcoming__title {
  margin: 0 0 8px; font: 400 clamp(1.6rem, 3vw, 2.4rem)/1.15 var(--f-heading, Georgia, serif); color: var(--aev-ink);
}
.aev-upcoming__more { margin: 14px 0 0; }

.aev-upcoming--cards .aev-ev-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.aev-upcoming--cards .aev-ev {
  grid-template-columns: 1fr; gap: 12px; padding: 20px; align-content: start;
  border: 1px solid var(--aev-line); border-top: 4px solid var(--aev-chip, var(--aev-gold)); border-radius: var(--aev-radius); background: #fff;
}
.aev-upcoming--cards .aev-ev:last-child { border-bottom: 1px solid var(--aev-line); }
.aev-upcoming--cards .aev-ev__date { width: 60px; height: 60px; }
.aev-upcoming--cards .aev-ev__day { font-size: 1.35rem; }
.aev-upcoming--cards .aev-ev__cta { flex-direction: row; justify-content: space-between; align-items: center; }

/* --------------------------------------------------- Single event page */
.aev-single { margin: 0 0 28px; padding: 20px 22px; border: 1px solid var(--aev-line); border-left: 5px solid var(--aev-chip, var(--aev-gold)); border-radius: var(--aev-radius); background: var(--aev-surface); }
.aev-single__facts { display: grid; gap: 10px; margin: 0; }
.aev-single__facts > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: baseline; }
.aev-single__facts dt { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--aev-body); }
.aev-single__facts dd { margin: 0; font-weight: 500; }
.aev-single__cal { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }

.aev-reg { margin: 32px 0 0; padding: 24px; border: 1px solid var(--aev-line); border-radius: var(--aev-radius); background: #fff; }
.aev-reg .aev-reg__title { margin: 0 0 12px; font: 400 1.6rem/1.2 var(--f-heading, Georgia, serif); }
.aev-reg__notice { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--aev-radius); background: var(--aev-surface); font-weight: 500; }
.aev-reg__notice.is-ok { background: #E3F3EA; color: var(--aev-ok); }
.aev-reg__notice.is-warn { background: #FBF0D5; color: var(--aev-warn); }
.aev-reg__notice.is-error { background: #FBE4E1; color: #A32A1D; }
.aev-reg__notice.is-closed { color: var(--aev-body); }
.aev-reg__form { display: grid; gap: 14px; max-width: 460px; }
.aev-reg__form p { margin: 0; }
.aev-field label { display: block; margin-bottom: 5px; font-size: .88rem; font-weight: 600; }
.aev-field input {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--aev-line); border-radius: var(--aev-radius);
  background: #fff; color: var(--aev-ink); font: inherit;
}
.aev-field input:focus { outline: none; border-color: var(--aev-ink-soft); box-shadow: 0 0 0 3px rgba(29, 89, 124, .18); }
.aev-field input.is-invalid { border-color: #A32A1D; }
/* Honeypot: off-screen (not display:none, which some bots detect). */
.aev-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.aev-reg__status { min-height: 1.4em; font-weight: 600; }
.aev-reg__status.is-ok { color: var(--aev-ok); }
.aev-reg__status.is-error { color: #A32A1D; }

.aev-standalone { max-width: 620px; margin: 60px auto; padding: 0 20px; }
.aev-standalone__box { padding: 32px; border: 1px solid var(--aev-line); border-radius: var(--aev-radius); background: #fff; }
.aev-standalone h1 { margin: 0 0 16px; font: 400 1.9rem/1.2 var(--f-heading, Georgia, serif); }

/* --------------------------------------------------------- Responsive */
@media (max-width: 760px) {
  .aev-cal__bar { display: grid; grid-template-columns: 1fr auto; }
  .aev-cal .aev-cal__title { grid-column: 1 / -1; order: -1; text-align: left; }

  /* Month grid becomes an agenda: only days that have events, one per row. */
  .aev-cal__table, .aev-cal__table tbody, .aev-cal__table tr, .aev-cal__table td { display: block; width: 100%; }
  .aev-cal__table thead { display: none; }
  .aev-cal__table { border: 0; background: transparent; }
  .aev-cal__day.is-empty { display: none; }
  .aev-cal__day { height: auto; padding: 12px 0; border: 0; border-bottom: 1px solid var(--aev-line); overflow: visible; }
  .aev-cal__day time { justify-content: flex-start; gap: 6px; align-items: center; margin-bottom: 6px; }
  .aev-cal__dow { display: inline; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--aev-body); }
  .aev-cal__day.is-other { display: none; }
  .aev-cal__chip { white-space: normal; font-size: .88rem; padding: 6px 10px; }

  .aev-ev { grid-template-columns: 60px 1fr; gap: 14px; }
  .aev-ev__date { width: 60px; height: 60px; }
  .aev-ev__day { font-size: 1.35rem; }
  .aev-ev__cta { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .aev-single__facts > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .aev-cal__body, .aev-btn { transition: none; }
}
