/* MS Society West Hertfordshire Group — events calendar.
   Brand (2021 guidelines): orange + white, aubergine accent, Verdana, 14pt minimum on screen,
   AAA text contrast — so text is aubergine or near-black; orange is only used for decoration. */

:root {
  --orange: #e35205;
  --aubergine: #6e2b62;
  --aubergine-dark: #4f1f47;
  --ink: #1d1d1b;
  --muted: #474747;
  --line: #6b6b6b;
  --soft: #f6f1f5;
  --soft-orange: #fdf1ea;
  --white: #fff;

  font-size: 118.75%; /* 19px = 14pt; still follows the browser's own text size and zoom */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: Verdana, Geneva, sans-serif;
  line-height: 1.5;
}

a { color: var(--aubergine); }
:focus-visible { outline: 4px solid var(--aubergine); outline-offset: 2px; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- header + footer */
.site-header { border-top: 0.5rem solid var(--orange); border-bottom: 1px solid #ddd; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.5rem; }
.logo { height: 8rem; width: auto; }
h1 { margin: 0; color: var(--aubergine); font-size: 2rem; }

main { padding: 1rem 1rem 2rem; }

.site-footer { margin-top: 3rem; border-top: 0.5rem solid var(--orange); background: var(--soft); }

/* ---------------------------------------------------------------- buttons + filters */
.btn {
  min-height: 3rem; padding: 0.5rem 1.1rem;
  border: 3px solid var(--aubergine); border-radius: 10px;
  background: var(--aubergine); color: var(--white);
  font: inherit; font-weight: bold; text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center;
}
.btn.secondary { background: var(--white); color: var(--aubergine); }

.controls { display: grid; gap: 1rem; justify-items: start; margin: 1rem 0 1.5rem; }
#filters { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.3rem 1rem 0.3rem 0.4rem;
  border: 2px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--ink); font: inherit; cursor: pointer;
}
.chip[data-filter="all"] { padding-left: 1rem; }
.chip[aria-pressed="true"] { border: 3px solid var(--aubergine); background: var(--soft); font-weight: bold; }

.notice { border: 3px solid var(--aubergine); border-radius: 10px; padding: 1rem; }

/* ---------------------------------------------------------------- calendar */
/* FullCalendar's documented theme colours, set to the brand */
#calendar {
  --fc-classic-button: var(--aubergine);
  --fc-classic-button-border: var(--aubergine);
  --fc-classic-button-strong: var(--aubergine-dark);
  --fc-classic-button-strong-border: var(--aubergine-dark);
  --fc-classic-primary: var(--aubergine);
  --fc-classic-today: var(--soft-orange);
  --fc-classic-border: var(--line);
  --fc-classic-faint: #e9dfe7; /* hover: light aubergine tint, clearly visible */
  --fc-classic-muted: #e9dfe7;
  --fc-classic-faint-foreground: var(--muted); /* days from other months: default grey is too faint to read */
}

.no-dot { display: none; }
.day-label { font-size: 1rem; font-weight: bold; color: var(--ink); }

/* Our event content (what eventContent returns) */
.ev { display: block; font-size: 1rem; line-height: 1.35; color: var(--ink); }
.ev { white-space: normal; }
.ev-title { font-weight: bold; color: var(--aubergine); }
.ev-time, .ev-where { display: block; }
.ev.cancelled .ev-title { text-decoration: line-through; }

.icon-badge {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 1.6em; height: 1.6em; border-radius: 50%; margin-right: 0.35em; vertical-align: middle;
  background: var(--cat, #474747); color: var(--white);
}
.icon-badge svg { width: 65%; height: 65%; }

.badge-cancelled { border: 2px solid var(--ink); border-radius: 999px; padding: 0 0.5rem; color: var(--ink); }

/* ---------------------------------------------------------------- details pop-up */
#event-dialog {
  width: min(38rem, calc(100vw - 2rem)); padding: 1rem 1.5rem 1.5rem;
  border: 3px solid var(--aubergine); border-top: 0.5rem solid var(--orange); border-radius: 10px;
  color: var(--ink);
}
#event-dialog::backdrop { background: rgb(0 0 0 / 0.6); }
#event-dialog .close { float: right; }
#event-dialog h2 { color: var(--aubergine); margin: 0.5rem 0; }
.dialog-cat { font-weight: bold; color: var(--muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; }
.facts dt { font-weight: bold; }
.facts dd { margin: 0; }
.description { white-space: pre-line; }

/* Windows / Mac high contrast settings */
@media (forced-colors: active) {
  .icon-badge { forced-color-adjust: none; background: Canvas; color: CanvasText; border: 2px solid CanvasText; }
}

/* Printing: just the calendar */
@media print {
  .controls, main > p, noscript { display: none; }
  .logo { height: 3cm; }
}
