/*========================================
  event-cards.css: Slider, Carousel, List and Grid layouts of the Event List
  block (and the restyled Month view).

  Every colour, radius and shadow is a custom property, so a theme can restyle
  the cards from its own stylesheet without overriding selectors:

    --vrc-card-bg  --vrc-card-fg  --vrc-card-border  --vrc-muted
    --vrc-badge  --vrc-badge-fg  --vrc-day-font
    --vrc-radius  --vrc-badge-radius  --vrc-shadow  --vrc-shadow-hover
    --vrc-accent  --vrc-focus  --vrc-gap
    --vrc-all-bg  --vrc-all-fg      ("Full calendar" card)
    --vrc-arrow-bg  --vrc-arrow-fg  --vrc-dot  --vrc-dot-active
========================================*/

.vr-block-event-list.vr-ev {
  --vrc-gap: 1rem;
  --vrc-card-bg: #fff;
  --vrc-card-border: rgba(0, 0, 0, 0.12);
  --vrc-muted: #5b6670;
  --vrc-badge-fg: #fff;
  --vrc-accent: var(--vr-primary, var(--wp--preset--color--primary, #1d4e89));
  --vrc-badge: var(--wp--preset--color--primary, #1d4e89);
  --vrc-focus: var(--vrc-accent);
  --vrc-dot: rgba(0, 0, 0, 0.28);
  --vrc-dot-active: var(--vrc-accent);
  --vrc-arrow-bg: #fff;
  --vrc-arrow-fg: #1d2327;
  --n: var(--vrc-cols-desktop, 4);

  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  padding: var(--vr-layout-wrapper_padding, 0);
  background: var(--vr-wrapper-bg, transparent);
}
.vr-block-event-list.vr-ev *,
.vr-block-event-list.vr-ev *::before,
.vr-block-event-list.vr-ev *::after { box-sizing: border-box; }

/* Cards per screen size (same breakpoints as the classic horizontal list) */
@media (max-width: 1366px) { .vr-block-event-list.vr-ev { --n: var(--vrc-cols-laptop, 3); } }
@media (max-width: 1024px) { .vr-block-event-list.vr-ev { --n: var(--vrc-cols-tablet, 2); } }
@media (max-width: 767px)  { .vr-block-event-list.vr-ev { --n: var(--vrc-cols-mobile, 1); } }

/* ---- Radius and shadow presets ---- */
.vr-ev--radius-none   { --vrc-radius: 0;    --vrc-badge-radius: 0; }
.vr-ev--radius-small  { --vrc-radius: 6px;  --vrc-badge-radius: 5px; }
.vr-ev--radius-medium { --vrc-radius: 12px; --vrc-badge-radius: 9px; }
.vr-ev--radius-large  { --vrc-radius: 18px; --vrc-badge-radius: 14px; }

.vr-ev--shadow-none   { --vrc-shadow: none; --vrc-shadow-hover: none; }
.vr-ev--shadow-soft   { --vrc-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);  --vrc-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.16); }
.vr-ev--shadow-strong { --vrc-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); --vrc-shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.26); }

/* ---- Track: list, grid, slider ---- */
.vr-ev-track {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.vr-ev--list .vr-ev-track {
  display: flex;
  flex-direction: column;
  gap: var(--vrc-gap);
}
.vr-ev--grid .vr-ev-track {
  display: grid;
  gap: var(--vrc-gap);
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
}

/* Each card is a size container, so on its own a slider has almost no
   preferred width (just the gaps). A parent that sizes to its content (a
   stacked Row's Section with a Left/Centre/Right position, an inline-block,
   a floated box) then squeezed the cards to ~80px and made them very tall.
   This hidden, zero-height line of spaced letters gives the slider a wide
   preferred width that can still wrap to one letter, so it fills whatever
   space it is given without forcing a minimum width on narrow columns. */
.vr-ev--slider::after,
.vr-ev--carousel::after {
  content: "x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x";
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-size: 16px;
  line-height: 0;
  white-space: normal;
}

.vr-ev-viewport { position: relative; min-width: 0; }
/* Arrows live in side gutters so they never cover a card's date badge. */
.vr-ev--slider.is-ready .vr-ev-viewport,
.vr-ev--carousel.is-ready .vr-ev-viewport,
.editor-styles-wrapper .vr-ev--slider .vr-ev-viewport,
.editor-styles-wrapper .vr-ev--carousel .vr-ev-viewport { padding-inline: 56px; }
.vr-ev--slider:not(:has(.vr-ev-arrow)) .vr-ev-viewport,
.vr-ev--carousel:not(:has(.vr-ev-arrow)) .vr-ev-viewport { padding-inline: 0 !important; }
.vr-ev--slider .vr-ev-track,
.vr-ev--carousel .vr-ev-track {
  display: flex;
  gap: var(--vrc-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* room for the hover lift and shadow, which would otherwise be clipped */
  padding: 0.5rem 0 1.25rem;
  margin: -0.5rem 0 -1.25rem;
}
.vr-ev--slider .vr-ev-track::-webkit-scrollbar,
.vr-ev--carousel .vr-ev-track::-webkit-scrollbar { display: none; }
.vr-ev--slider .vr-ev-card,
.vr-ev--carousel .vr-ev-card {
  flex: 0 0 calc((100% - (var(--n) - 1) * var(--vrc-gap)) / var(--n));
  min-width: 0;
  scroll-snap-align: start;
}
.vr-ev-track:focus-visible { outline: 3px solid var(--vrc-focus); outline-offset: 2px; border-radius: var(--vrc-radius); }

/* Carousel with fade: all cards share one cell, one is visible */
.vr-ev--fade .vr-ev-track {
  display: grid;
  overflow: hidden;
  scroll-snap-type: none;
}
.vr-ev--fade .vr-ev-card {
  grid-area: 1 / 1;
  flex: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s;
}
.vr-ev--fade .vr-ev-card.is-current,
.vr-ev--fade:not(.is-ready) .vr-ev-card:first-child { opacity: 1; visibility: visible; }

/* ---- Card ---- */
.vr-ev-card { margin: 0; padding: 0; min-width: 0; list-style: none; container-type: inline-size; }
.vr-ev-link {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  overflow: hidden;
  padding: 1rem 1.1rem;
  background: var(--vrc-card-bg);
  color: var(--vrc-card-fg, inherit);
  border: 1px solid var(--vrc-card-border);
  border-radius: var(--vrc-radius, 12px);
  box-shadow: var(--vrc-shadow, none);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
a.vr-ev-link:hover,
a.vr-ev-link:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--vrc-shadow-hover, none);
  border-color: var(--vrc-accent);
}
a.vr-ev-link:focus-visible { outline: 3px solid var(--vrc-focus); outline-offset: 2px; }
/* A card is a link, so a page builder's link colour (e.g. a Layout Blocks Row
   with a Link colour) would recolour every card. Cards keep their own colour.
   The "Full calendar" card has its own rules below. */
.vr-block-event-list.vr-ev .vr-ev-card:not(.vr-ev-card--all) a.vr-ev-link { color: var(--vrc-card-fg, inherit); }

.vr-ev-row { display: flex; gap: 1rem; align-items: center; min-width: 0; }
.vr-ev-date {
  flex: none;
  width: 66px;
  padding: 0.55rem 0 0.5rem;
  border-radius: var(--vrc-badge-radius, 10px);
  /* the fallback covers a palette colour the theme no longer defines */
  background: var(--vrc-badge, #1d4e89);
  color: var(--vrc-badge-fg);
  text-align: center;
  line-height: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.vr-ev-month { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.92; }
.vr-ev-day { font-family: var(--vrc-day-font, inherit); font-size: 2rem; font-weight: 700; }
.vr-ev-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.vr-ev-title { font-weight: 700; line-height: 1.25; overflow-wrap: break-word; }
.vr-ev-meta,
.vr-ev-venue { font-size: 0.88rem; color: var(--vrc-muted); overflow-wrap: break-word; }
.vr-ev-desc { font-size: 0.92rem; color: var(--vrc-muted); line-height: 1.45; }
.vr-ev-img { display: block; margin: -1rem -1.1rem 0; }
.vr-ev-img img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

/* A narrow card (many columns in a narrow space) puts the date above the
   text, so words are never squeezed and split. */
@container (max-width: 250px) {
  .vr-ev-row { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
}

@container (max-width: 180px) {
  .vr-ev-card:not(.vr-ev-card--all) .vr-ev-link { padding-left: 0.75rem; padding-right: 0.75rem; }
  .vr-ev-title { font-size: 0.92em; }
  .vr-ev-img { margin-left: -0.75rem; margin-right: -0.75rem; }
}

/* "Full calendar" card */
.vr-ev-card--all .vr-ev-link {
  justify-content: center;
  text-align: center;
  background: var(--vrc-all-bg, var(--vrc-accent));
  color: var(--vrc-all-fg, #fff);
  border-color: transparent;
}
.vr-ev-card--all .vr-ev-body { align-items: center; }
.vr-ev-card--all .vr-ev-meta { color: inherit; }
.vr-ev-card--all .vr-ev-title::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.5em;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  vertical-align: 0.08em;
}

/* ---- Style presets ---- */
.vr-ev--style-flat .vr-ev-link {
  --vrc-card-bg: var(--vrc-flat-bg, rgba(0, 0, 0, 0.045));
  border-color: transparent;
  box-shadow: none;
}
.vr-ev--style-flat a.vr-ev-link:hover,
.vr-ev--style-flat a.vr-ev-link:focus-visible { transform: none; box-shadow: none; border-color: transparent; background-image: linear-gradient(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05)); }

.vr-ev--style-minimal .vr-ev-link {
  padding: 0.75rem 0;
  background: transparent;
  border-width: 0 0 1px;
  border-radius: 0;
  box-shadow: none;
}
.vr-ev--style-minimal a.vr-ev-link:hover,
.vr-ev--style-minimal a.vr-ev-link:focus-visible { transform: none; box-shadow: none; border-color: var(--vrc-card-border); background-image: linear-gradient(rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.04)); }
.vr-ev--style-minimal .vr-ev-date { width: 52px; background: transparent; color: var(--vrc-badge, #1d4e89); border-radius: 0; padding: 0; }
.vr-ev--style-minimal .vr-ev-day { font-size: 1.6rem; }
.vr-ev--style-minimal .vr-ev-img { margin: 0; }
.vr-ev--style-minimal.vr-ev--list .vr-ev-track { gap: 0; }

/*========================================
  Colours picked in the sidebar (card background, title, text)
========================================*/
.vr-block-event-list.vr-ev.vr-ev--has-bg .vr-ev-card:not(.vr-ev-card--all) .vr-ev-link,
.vr-block-event-list.vr-ev.vr-ev--has-bg .vr-ev-empty { background-color: var(--vrc-pick-bg); }
.vr-block-event-list.vr-ev.vr-ev--has-bg.vr-ev--style-minimal .vr-ev-card:not(.vr-ev-card--all) .vr-ev-link { padding-left: 0.9rem; padding-right: 0.9rem; }
.vr-block-event-list.vr-ev.vr-ev--has-title .vr-ev-card:not(.vr-ev-card--all) .vr-ev-title { color: var(--vrc-pick-title); }
.vr-block-event-list.vr-ev.vr-ev--has-text .vr-ev-card:not(.vr-ev-card--all) :is(.vr-ev-meta, .vr-ev-venue, .vr-ev-desc),
.vr-block-event-list.vr-ev.vr-ev--has-text .vr-ev-empty { color: var(--vrc-pick-text); }

/*========================================
  "Full calendar" card in each layout. Slider and carousel: a filled accent
  card. Grid: the same, filling the rest of the last row. List: a dashed
  outline link under the cards.
========================================*/
.vr-block-event-list.vr-ev .vr-ev-card.vr-ev-card--all .vr-ev-link {
  padding: 1rem 1.1rem;
  background-color: var(--vrc-all-bg, var(--vrc-accent));
  color: var(--vrc-all-fg, #fff);
  border: 1px solid transparent;
  border-radius: var(--vrc-radius, 12px);
}
.vr-block-event-list.vr-ev .vr-ev-card--all .vr-ev-title { color: inherit; }
.vr-ev--grid .vr-ev-card--all { grid-column: span var(--vrc-all-desktop, 1); }
@media (max-width: 1366px) { .vr-ev--grid .vr-ev-card--all { grid-column: span var(--vrc-all-laptop, 1); } }
@media (max-width: 1024px) { .vr-ev--grid .vr-ev-card--all { grid-column: span var(--vrc-all-tablet, 1); } }
@media (max-width: 767px)  { .vr-ev--grid .vr-ev-card--all { grid-column: span var(--vrc-all-mobile, 1); } }
.vr-block-event-list.vr-ev.vr-ev--list .vr-ev-card.vr-ev-card--all .vr-ev-link {
  padding: 0.75rem 1rem;
  text-align: left;
  background-color: var(--vrc-all-bg, transparent);
  color: var(--vrc-all-fg, var(--vrc-accent));
  border: 1px dashed currentColor;
  box-shadow: none;
}
.vr-ev--list .vr-ev-card--all .vr-ev-body { align-items: flex-start; }
.vr-ev--list.vr-ev--style-minimal .vr-ev-card--all { margin-top: 0.75rem; }

/* ---- Arrows, dots, pause ---- */
.vr-ev-arrow {
  display: none;
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin: -22px 0 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--vrc-card-border);
  border-radius: 50%;
  background: var(--vrc-arrow-bg);
  color: var(--vrc-arrow-fg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.vr-ev-prev { left: 0; }
.vr-ev-next { right: 0; }
.vr-ev.is-ready .vr-ev-arrow,
.editor-styles-wrapper .vr-ev .vr-ev-arrow { display: inline-flex; }
.vr-ev-arrow:hover:not(:disabled) { transform: scale(1.06); }
.vr-ev-arrow:focus-visible,
.vr-ev-dots button:focus-visible,
.vr-ev-pause:focus-visible { outline: 3px solid var(--vrc-focus); outline-offset: 2px; }
.vr-ev-arrow:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.vr-ev-arrow .vr-arrow-icon { width: 18px; height: 18px; }

/* Arrows setting. "inside" (above) keeps side gutters in the block. "margin"
   puts the arrows outside the block, in the page margin; "overlay" sits them
   half over the first and last card. Both give the cards the full width.
   event-slider.js sets data-arrows-fit when there isn't room beside the block:
   "overlay" (margin falls back to overlay) or "inset" (just inside the edges).
   Phones keep the arrows under the cards (see the 767px rules). */
@media (min-width: 768px) {
  .vr-ev--slider.vr-ev--arrows-margin .vr-ev-viewport,
  .vr-ev--slider.vr-ev--arrows-overlay .vr-ev-viewport,
  .vr-ev--carousel.vr-ev--arrows-margin .vr-ev-viewport,
  .vr-ev--carousel.vr-ev--arrows-overlay .vr-ev-viewport { padding-inline: 0; }
  .vr-ev--arrows-margin .vr-ev-prev { left: -56px; }
  .vr-ev--arrows-margin .vr-ev-next { right: -56px; }
  .vr-ev--arrows-overlay .vr-ev-prev,
  .vr-ev--arrows-margin[data-arrows-fit="overlay"] .vr-ev-prev { left: -22px; }
  .vr-ev--arrows-overlay .vr-ev-next,
  .vr-ev--arrows-margin[data-arrows-fit="overlay"] .vr-ev-next { right: -22px; }
  .vr-ev[data-arrows-fit="inset"] .vr-ev-prev { left: 8px; }
  .vr-ev[data-arrows-fit="inset"] .vr-ev-next { right: 8px; }
}

.vr-ev-controls { display: none; align-items: center; justify-content: center; gap: 1rem; margin-top: 0.75rem; min-height: 1px; }
.vr-ev.is-ready .vr-ev-controls { display: flex; }
.vr-ev-dots { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; }
.vr-ev-dots button {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.vr-ev-dots button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--vrc-dot);
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.vr-ev-dots button[aria-current="true"]::before { background: var(--vrc-dot-active); transform: scale(1.25); }
.vr-ev-pause {
  padding: 4px 12px;
  border: 1px solid var(--vrc-card-border);
  border-radius: 99px;
  background: var(--vrc-arrow-bg);
  color: var(--vrc-arrow-fg);
  font-size: 0.85rem;
  cursor: pointer;
}

.vr-ev-empty {
  margin: 0;
  padding: 1.5rem;
  background: var(--vrc-card-bg);
  border: 1px dashed var(--vrc-card-border);
  border-radius: var(--vrc-radius, 12px);
  color: var(--vrc-muted);
}

/*========================================
  Subscribe button and menu, matched to the cards (card layouts and the
  restyled month). The button takes the block's accent colour; a theme can set
  --vrc-sub-bg, --vrc-sub-fg, --vrc-sub-radius, --vrc-menu-bg and --vrc-menu-fg.
========================================*/
.vr-ev .calendar-subscribe { margin-top: 1.25rem; text-align: center; }
.vr-ev--radius-none  { --vrc-sub-radius: 0; }
.vr-ev--radius-small { --vrc-sub-radius: 6px; }

.vr-block-event-list.vr-ev .vr-calendar-subscribe {
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}
.vr-block-event-list.vr-ev .vr-subscribe-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  margin: 0;
  padding: 0.65rem 1.4rem;
  border: 2px solid var(--vrc-sub-bg, var(--vrc-accent, #1d4e89));
  border-radius: var(--vrc-sub-radius, 999px);
  background: var(--vrc-sub-bg, var(--vrc-accent, #1d4e89));
  color: var(--vrc-sub-fg, #fff);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--vrc-shadow, none);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
/* calendar icon */
.vr-block-event-list.vr-ev .vr-subscribe-toggle::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 11h18M12 14v4M10 16h4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 11h18M12 14v4M10 16h4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.vr-block-event-list.vr-ev .vr-subscribe-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--vrc-shadow-hover, 0 8px 20px rgba(0, 0, 0, 0.16));
  filter: brightness(1.08);
}
.vr-block-event-list.vr-ev .vr-subscribe-toggle:focus-visible {
  outline: 3px solid var(--vrc-accent, #1d4e89);
  outline-offset: 3px;
}
.vr-block-event-list.vr-ev .vr-subscribe-caret { transition: transform 0.2s ease; }
.vr-block-event-list.vr-ev .vr-calendar-subscribe:hover .vr-subscribe-caret,
.vr-block-event-list.vr-ev .vr-subscribe-toggle[aria-expanded="true"] .vr-subscribe-caret { transform: rotate(180deg); }

.vr-block-event-list.vr-ev .vr-subscribe-list {
  top: calc(100% + 8px);
  width: 230px;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  text-align: left;
  background: var(--vrc-menu-bg, #fff);
  border: 1px solid var(--vrc-card-border, rgba(0, 0, 0, 0.12));
  border-radius: var(--vrc-radius, 12px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}
/* open after a click or the Enter key too, not only on hover */
.vr-block-event-list.vr-ev .vr-subscribe-list:not([hidden]) { display: block; }
/* keeps the menu open while the pointer crosses the gap below the button */
.vr-block-event-list.vr-ev .vr-subscribe-list::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}
.vr-block-event-list.vr-ev .vr-subscribe-list li { margin: 0; padding: 0; list-style: none; }
.vr-block-event-list.vr-ev .vr-subscribe-list a {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: calc(var(--vrc-radius, 12px) * 0.55);
  color: var(--vrc-menu-fg, #1d2327);
  font-size: 0.95rem;
  line-height: 1.3;
  text-decoration: none;
}
.vr-block-event-list.vr-ev .vr-subscribe-list a:hover,
.vr-block-event-list.vr-ev .vr-subscribe-list a:focus-visible {
  background: rgba(0, 0, 0, 0.06);
  color: var(--vrc-menu-fg, #1d2327);
  text-decoration: none;
}
.vr-block-event-list.vr-ev .vr-subscribe-list a:focus-visible { outline: 2px solid var(--vrc-accent, #1d4e89); outline-offset: -2px; }

@media (max-width: 767px) {
  /* Phones: no side gutters; the arrows sit side by side under the cards. */
  .vr-ev--slider.is-ready .vr-ev-viewport,
  .vr-ev--carousel.is-ready .vr-ev-viewport,
  .editor-styles-wrapper .vr-ev--slider .vr-ev-viewport,
  .editor-styles-wrapper .vr-ev--carousel .vr-ev-viewport { padding-inline: 0; padding-bottom: 52px; }
  .vr-ev-arrow { top: auto; bottom: 0; margin: 0; width: 44px; height: 44px; }
  .vr-ev-prev { left: calc(50% - 50px); }
  .vr-ev-next { right: calc(50% - 50px); }
  .vr-ev-date { width: 58px; }
  .vr-ev-day { font-size: 1.7rem; }
}

/*========================================
  Card size. Compact: smaller date badge and text, for sidebars and narrow
  columns. Auto: compact whenever a card is under 360px wide (each card is
  its own size container, see .vr-ev-card).
========================================*/
.vr-ev--size-compact { --vrc-gap: 0.65rem; }
.vr-ev--size-compact:not(.vr-ev--style-minimal) .vr-ev-card:not(.vr-ev-card--all) .vr-ev-link { padding: 0.6rem 0.7rem; }
.vr-ev--size-compact .vr-ev-link { gap: 0.5rem; }
.vr-ev--size-compact .vr-ev-row { gap: 0.75rem; }
.vr-ev--size-compact:not(.vr-ev--style-minimal) .vr-ev-date { width: 54px; padding: 0.45rem 0 0.4rem; }
.vr-ev--size-compact .vr-ev-month { font-size: 0.66rem; }
.vr-ev--size-compact .vr-ev-day { font-size: 1.5rem; }
.vr-ev--size-compact .vr-ev-title { font-size: 0.95rem; }
.vr-ev--size-compact :is(.vr-ev-meta, .vr-ev-venue) { font-size: 0.8rem; }
.vr-ev--size-compact .vr-ev-desc { font-size: 0.85rem; }
.vr-ev--size-compact:not(.vr-ev--style-minimal) .vr-ev-img { margin: -0.6rem -0.7rem 0; }

@container (max-width: 360px) {
  .vr-ev--size-auto:not(.vr-ev--style-minimal) .vr-ev-card:not(.vr-ev-card--all) .vr-ev-link { padding: 0.6rem 0.7rem; }
  .vr-ev--size-auto .vr-ev-link { gap: 0.5rem; }
  .vr-ev--size-auto .vr-ev-row { gap: 0.75rem; }
  .vr-ev--size-auto:not(.vr-ev--style-minimal) .vr-ev-date { width: 54px; padding: 0.45rem 0 0.4rem; }
  .vr-ev--size-auto .vr-ev-month { font-size: 0.66rem; }
  .vr-ev--size-auto .vr-ev-day { font-size: 1.5rem; }
  .vr-ev--size-auto .vr-ev-title { font-size: 0.95rem; }
  .vr-ev--size-auto :is(.vr-ev-meta, .vr-ev-venue) { font-size: 0.8rem; }
  .vr-ev--size-auto .vr-ev-desc { font-size: 0.85rem; }
  .vr-ev--size-auto:not(.vr-ev--style-minimal) .vr-ev-img { margin: -0.6rem -0.7rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .vr-ev *, .vr-ev *::before, .vr-ev *::after { transition: none !important; scroll-behavior: auto !important; }
  .vr-ev a.vr-ev-link:hover, .vr-ev a.vr-ev-link:focus-visible { transform: none; }
}

/*========================================
  Month view, restyled (layout "Month"): the same calendar with the cards'
  radius, shadow and colours.
========================================*/
.vr-block-event-list.vr-ev--month {
  --vrc-card-border: rgba(0, 0, 0, 0.12);
  --vrc-muted: #5b6670;
  /* the site's configured primary colour, unless the block picks a badge colour */
  --vrc-badge: var(--vr-primary, var(--wp--preset--color--primary, #1d4e89));
  --vrc-accent: var(--vr-primary, var(--vrc-badge));
  background: var(--vr-wrapper-bg, transparent);
  padding: var(--vr-layout-wrapper_padding, 0);
}
.vr-ev--month .vr-calendar-wrapper {
  background: #fff;
  border: 1px solid var(--vrc-card-border);
  border-radius: var(--vrc-radius, 12px);
  box-shadow: var(--vrc-shadow, none);
  padding: 0.75rem 1rem 1rem;
  overflow: hidden !important;
}
.vr-ev--month .vr-calendar-wrapper .calendar-grid th,
.vr-ev--month .vr-calendar-wrapper .calendar-grid td { border-color: rgba(0, 0, 0, 0.07); }
.vr-ev--month .vr-calendar-wrapper .vr-prev,
.vr-ev--month .vr-calendar-wrapper .vr-next {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--vrc-card-border) !important;
}
.vr-ev--month .vr-calendar-wrapper .vr-prev:hover,
.vr-ev--month .vr-calendar-wrapper .vr-next:hover { background: rgba(0, 0, 0, 0.06) !important; }
.vr-block-event-list.vr-ev--month .vr-calendar-wrapper .calendar-grid td.has-event > a.tooltip-link {
  display: block;
  background-color: var(--vrc-badge, #1d4e89) !important;
  border-radius: var(--vrc-badge-radius, 8px);
}
.vr-ev--month .vr-calendar-toggle button {
  border-radius: 99px;
  padding: 6px 16px;
}
.vr-ev--month .vr-calendar-toggle button.active {
  background: var(--vrc-accent) !important;
  border-color: var(--vrc-accent) !important;
}
.vr-ev--month .vr-event-item {
  background: #fff;
  border: 1px solid var(--vrc-card-border);
  border-radius: var(--vrc-radius, 12px);
  box-shadow: var(--vrc-shadow, none);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vr-ev--month .vr-event-item:hover { transform: translateY(-2px); box-shadow: var(--vrc-shadow-hover, none); }
.vr-ev--month .vr-event-item a { color: inherit; text-decoration: none; }
.vr-ev--month .vr-event-item a:focus-visible { outline: 3px solid var(--vrc-accent); outline-offset: 2px; }

/* Colours picked in the sidebar */
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-bg .vr-calendar-wrapper,
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-bg .vr-calendar-wrapper .calendar-grid,
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-bg .vr-event-item { background: var(--vrc-pick-bg); }
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-bg .vr-calendar-wrapper .calendar-grid td.current-day { background-color: var(--vrc-pick-bg) !important; }
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-title .vr-calendar-wrapper .vr-current-month,
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-title .vr-event-item .event-title,
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-title .vr-event-item .event-title a { color: var(--vrc-pick-title); }
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-text .vr-calendar-wrapper .calendar-grid th,
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-text .vr-calendar-wrapper .calendar-grid td,
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-text .vr-calendar-wrapper .vr-prev,
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-text .vr-calendar-wrapper .vr-next,
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-text .vr-event-item .event-datetime,
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-text .vr-event-item .event-date-time,
.vr-block-event-list.vr-ev.vr-ev--month.vr-ev--has-text .vr-event-item .event-venue { color: var(--vrc-pick-text); }

/*========================================
  Month "Titles" style: event names as coloured pills in each day (the
  category colour, --vr-mt-c), "+N more", category filter buttons, colour
  key, and the day list under the grid. Under 560px of grid width the pills
  become dots and tapping a day opens its list.
========================================*/
.vr-ev--titles .vr-calendar-wrapper { container-type: inline-size; }
.vr-block-event-list.vr-ev .vr-calendar-wrapper .calendar-grid.vr-mt-grid th {
  padding: 0.5em 0.6em;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--vrc-muted);
}
.vr-mt-grid abbr { text-decoration: none; border: 0; cursor: default; }
.vr-block-event-list.vr-ev .vr-calendar-wrapper .calendar-grid.vr-mt-grid td {
  height: 6.5em;
  padding: 0.35em;
  text-align: left;
  vertical-align: top;
  font-size: 0.8rem;
}
.vr-mt-day { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vr-block-event-list .vr-mt-num {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9em;
  height: 1.9em;
  margin: 0;
  padding: 0 0.3em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  line-height: 1;
}
.vr-block-event-list button.vr-mt-num { cursor: pointer; }
.vr-block-event-list button.vr-mt-num:hover { background: rgba(0, 0, 0, 0.07); }
.vr-block-event-list .current-day .vr-mt-num { background: var(--vrc-accent); color: #fff; }
.vr-mt-pills { display: flex; flex-direction: column; gap: 3px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.vr-mt-pills li { min-width: 0; margin: 0; padding: 0; }
.vr-block-event-list .vr-mt-pill {
  display: block;
  padding: 2px 6px;
  border-radius: calc(var(--vrc-badge-radius, 8px) * 0.5);
  background: var(--vr-mt-c, var(--vrc-badge, #1d4e89));
  color: var(--vr-mt-fg, #fff);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.vr-block-event-list a.vr-mt-pill:hover { filter: brightness(0.92); color: var(--vr-mt-fg, #fff); }
.vr-block-event-list .vr-mt-more {
  align-self: flex-start;
  margin: 0;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--vrc-accent);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.vr-block-event-list .vr-mt-more:hover { text-decoration: underline; }
.vr-block-event-list :is(a.vr-mt-pill, .vr-mt-open, .vr-mt-chip, .vr-mt-close, .vr-mt-panel a):focus-visible { outline: 2px solid var(--vrc-accent); outline-offset: 2px; }
.vr-mt-dots { display: none; gap: 3px; justify-content: center; }
.vr-mt-dots span,
.vr-mt-dot,
.vr-mt-key { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--vr-mt-c, var(--vrc-badge, #1d4e89)); }
.vr-mt-key { width: 10px; height: 10px; border-radius: 3px; }
.vr-mt-list[hidden] { display: none; }

/* Category filter buttons */
.vr-mt-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.75rem; }
.vr-block-event-list .vr-mt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  padding: 0.3rem 1rem;
  border: 1px solid var(--vrc-card-border);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.vr-block-event-list .vr-mt-chip:hover { background: rgba(0, 0, 0, 0.05); }
.vr-block-event-list .vr-mt-chip[aria-pressed="true"] { background: var(--vrc-accent); border-color: var(--vrc-accent); color: #fff; font-weight: 600; }

/* Colour key */
.vr-mt-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: 0.75rem 0 0; padding: 0; list-style: none; font-size: 0.8rem; color: var(--vrc-muted); }
.vr-mt-legend li { display: flex; align-items: center; gap: 6px; margin: 0; }

/* The day's list, under the grid */
.vr-mt-panel {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem 0.4rem;
  border: 1px solid var(--vrc-card-border);
  border-radius: var(--vrc-radius, 12px);
  background: var(--vrc-pick-bg, #fff);
}
.vr-mt-panel[hidden] { display: none; }
.vr-mt-panel:focus { outline: none; }
.vr-mt-panel:focus-visible { outline: 2px solid var(--vrc-accent); outline-offset: 2px; }
.vr-mt-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.vr-mt-panel-title { margin: 0; font-weight: 700; }
.vr-block-event-list .vr-mt-close {
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.vr-block-event-list .vr-mt-close:hover { background: rgba(0, 0, 0, 0.06); }
.vr-mt-panel ul { margin: 0.25rem 0 0; padding: 0; list-style: none; }
.vr-mt-panel li { margin: 0; border-top: 1px solid rgba(0, 0, 0, 0.07); }
.vr-mt-panel li:first-child { border-top: 0; }
.vr-mt-panel li > a,
.vr-mt-panel li > span { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0; color: inherit; text-decoration: none; }
.vr-mt-panel li > a:hover .vr-mt-title { text-decoration: underline; }
.vr-mt-title { flex: 1; min-width: 0; font-weight: 600; }
.vr-mt-when { font-size: 0.85rem; color: var(--vrc-muted); white-space: nowrap; }

/* Narrow grid (phones, sidebars): dots, and the whole day opens its list */
@container (max-width: 560px) {
  .vr-block-event-list.vr-ev .vr-calendar-wrapper .calendar-grid.vr-mt-grid th { padding: 0.4em 0; text-align: center; }
  .vr-block-event-list.vr-ev .vr-calendar-wrapper .calendar-grid.vr-mt-grid td { position: relative; height: 3.4em; padding: 0.2em; text-align: center; }
  .vr-mt-day { align-items: center; }
  .vr-block-event-list .vr-mt-num { align-self: center; }
  .vr-mt-pills,
  .vr-block-event-list .vr-mt-more { display: none; }
  .vr-mt-dots { display: flex; }
  .vr-mt-grid td.has-event button.vr-mt-num::after { content: ""; position: absolute; inset: 0; }
}

/* Month / List buttons beside the month name: the top ones show only
   while the List is open (the month header is hidden then). */
.vr-ev--switch-beside:not(.is-list) > .vr-calendar-toggle:not(.vr-calendar-toggle--beside) { display: none; }
.vr-block-event-list.vr-ev--switch-beside .vr-calendar-wrapper .vr-calendar-header { justify-content: flex-start; flex-wrap: wrap; gap: 0.75rem; }
.vr-ev--switch-beside .vr-calendar-toggle--beside { margin: 0 0 0 0.5rem; text-align: left; }
.vr-ev--switch-beside .vr-calendar-toggle--beside button { margin: 0 6px 0 0; }
