/* ==========================================================================
   Club Events: the list (templates/club_events/list.html) and an event's
   page (templates/club_events/details.html). Built on pages.css; only what
   those two pages need on top of it lives here.
   ========================================================================== */

/* Font Awesome swaps each <i> for an <svg class="svg-inline--fa">, so the
   pages.css rules written for "i" miss the icons. The same rules for the svg: */
.ev-page .vp-card__meta .svg-inline--fa { flex: none; width: 0.95rem; color: var(--vh-orange); font-size: 0.78rem; }
.ev-page .vp-checks .svg-inline--fa { flex: none; margin-top: 0.3rem; color: var(--vh-orange); }
.ev-page .vp-panel__title > .svg-inline--fa { color: var(--vh-orange); }
.ev-page .vp-more .svg-inline--fa { transition: transform 0.15s ease; }
.ev-page .vp-more:hover .svg-inline--fa { transform: translateX(3px); }
.ev-page .vp-field > .ev-search__icon {
  position: absolute;
  top: 50%;
  left: 0.95rem;
  color: var(--vh-muted);
  font-size: 0.85rem;
  transform: translateY(-50%);
  pointer-events: none;
}

/* pages.css's ".vp-page section { padding: 0 }" (it undoes Phoenix's section
   padding) outranks .vp-panel and .vp-hero, so a panel or hero written as a
   <section> lost its padding. Put it back for these pages (the list hero's
   own padding is set below). */
.ev-page section.vp-panel { padding: 1.15rem; }

/* ------------------------------------------------------------ list hero */
/* The Viwawa group photo on the right. The people stand across the whole
   picture, so it fades in over a short edge only, and the scripture card
   sits low on the right, below everyone's face. */

.ev-hero .vp-hero__media { object-position: center 38%; }

@media (min-width: 1200px) {
  .ev-page section.ev-hero { min-height: 22rem; padding: 2.25rem 2.5rem; }
  .ev-hero .vp-hero__media {
    width: 62%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.6) 7%, #000 16%);
            mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.6) 7%, #000 16%);
  }
  .ev-hero .vp-hero__body { max-width: min(34rem, 38%); }
  .ev-hero .vp-hero__title { font-size: clamp(2rem, 3vw, 2.8rem); }
  .ev-hero__aside { position: absolute; right: 1.25rem; bottom: 1.1rem; width: 15.5rem; }
  .ev-hero .vp-quote-card { padding: 0.85rem 1rem 0.75rem; }
  .ev-hero .vp-quote-card p { font-size: 0.88rem; }
  .ev-hero .vp-quote-card figcaption { margin-top: 0.4rem; font-size: 0.76rem; }
}

/* Tablets and phones: the photo is a band across the top, the words below. */
@media (max-width: 1199.98px) {
  .ev-page section.ev-hero { display: block; min-height: 0; padding: 0; }
  .ev-hero .vp-hero__media {
    position: relative;
    display: block;
    width: 100%;
    height: clamp(11rem, 34vw, 17rem);
    -webkit-mask-image: none;
            mask-image: none;
  }
  .ev-hero .vp-hero__body { max-width: none; padding: 1.35rem 1.6rem 1.5rem; }
  .ev-hero__aside { display: none; }
}

/* ------------------------------------------------- tabs, search, filters */

.ev-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.ev-tabs { flex: 0 1 auto; min-width: 0; }
.ev-search { flex: 1 1 22rem; max-width: 30rem; margin-left: auto; flex-wrap: nowrap; }
.ev-search .vh-btn { flex: none; }

.ev-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin: -0.35rem 0 0; }
.ev-filters__label { color: var(--vh-muted); font-size: 0.8rem; font-weight: 700; }
.ev-filters .vp-chip .svg-inline--fa, .ev-filters .vp-chip i { font-size: 0.75rem; }

/* The category row: arrows over its ends when it scrolls. */
.ev-cats { position: relative; min-width: 0; }
.ev-cats .vp-cats { padding-right: 0.2rem; padding-left: 0.2rem; }
.ev-cats__arrow {
  position: absolute;
  top: calc(50% - 0.2rem);
  z-index: 3;
  box-shadow: 0 6px 16px -8px rgba(60, 30, 20, 0.5);
  transform: translateY(-50%);
}
.ev-cats__arrow--prev { left: -0.6rem; }
.ev-cats__arrow--next { right: -0.6rem; }
.ev-cats__arrow[hidden] { display: none; }

/* --------------------------------------------------------------- cards */

.ev-grid { --vp-min: 17.5rem; }
.ev-page .vp-card__media > img { object-position: center 25%; }
.ev-page .vp-card__media > video { width: 100%; height: 100%; object-fit: cover; }
.ev-page .vp-card__media > .vp-card__media--empty { position: absolute; inset: 0; }
.ev-page .vp-card__media--empty[class*="vp-tone-"] {
  background: radial-gradient(circle at 75% 25%, rgba(255, 255, 255, 0.65), transparent 60%), var(--vp-tone-bg);
  color: var(--vp-tone);
}
[data-bs-theme="dark"] .ev-page .vp-card__media--empty[class*="vp-tone-"] { background: var(--vp-tone-bg); }

.ev-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(20, 10, 6, 0.6);
  color: #fff;
  transform: translate(-50%, -50%);
}
.ev-card .vp-card__body { gap: 0.5rem; }
.ev-card__excerpt { -webkit-line-clamp: 2; font-size: 0.84rem; }
.ev-card__pills { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.1rem 0 0; }
.ev-page .vp-card .vp-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ev-live { box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.45); }
.vp-card__tag .ev-live { background: #e7f6ed; }
[data-bs-theme="dark"] .vp-card__tag .ev-live { background: #183526; }

/* The whole card is the link (its title); the button only shows it. */
.ev-card__actions { pointer-events: none; }
.ev-card__go { width: 100%; }
.ev-card:hover .ev-card__go, .ev-card:focus-within .ev-card__go {
  border-color: var(--vh-brown);
  background: var(--vh-brown);
  color: #fff !important;
}
.ev-card__go .svg-inline--fa { font-size: 0.8em; }

/* Small cards: past events and "More Club Events". */
.ev-minis { --vp-min: 13.5rem; }
.ev-mini .vp-card__media { aspect-ratio: 16 / 9; }
.ev-mini .vp-card__badge { top: 0.6rem; left: 0.6rem; }
.ev-mini .vp-date { min-width: 2.75rem; padding: 0.3rem 0.45rem; border-radius: 10px; }
.ev-mini .vp-date__d { font-size: 1.15rem; }
.ev-mini .vp-date__m { font-size: 0.6rem; }
.ev-mini__body { flex-direction: row; align-items: center; gap: 0.65rem; padding: 0.75rem 0.85rem 0.85rem; }
.ev-mini__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 10px;
  background: var(--vp-tone-bg, rgba(200, 97, 45, 0.1));
  color: var(--vp-tone, var(--vh-orange));
  font-size: 0.95rem;
}
.ev-mini__text { flex: 1; min-width: 0; }
.ev-mini__title { font-size: 0.9rem; }
.ev-mini__sub { margin: 0.1rem 0 0; overflow: hidden; color: var(--vh-muted); font-size: 0.76rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

/* A row of (at most) four small cards: four across, or two by two. */
.ev-minis--row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 992px) {
  .ev-minis--row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.ev-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 0.2rem 0 0; }
.ev-pager__gap { border-color: transparent !important; background: transparent !important; }

/* ---------------------------------------------------------- event page */

.ev-progress {
  position: fixed;
  top: var(--phoenix-navbar-top-height, 4rem);
  right: 0;
  left: 0;
  z-index: 1029;
  height: 3px;
  pointer-events: none;
}
.ev-progress__fill { height: 100%; background: var(--vh-grad); transform: scaleX(0); transform-origin: 0 50%; }

/* The hero: a photo fills it; a tall poster stands whole on the right, over
   a blur of itself (set by the picture's onload); no picture, a warm wash. */
.ev-dhero { min-height: clamp(17rem, 33vw, 26rem); }
.ev-dhero::before {
  background: linear-gradient(180deg, rgba(20, 10, 6, 0.18) 0%, rgba(20, 10, 6, 0) 26%, rgba(20, 10, 6, 0.5) 56%, rgba(20, 10, 6, 0.9) 100%);
}
.ev-dhero .vp-detail-hero__title, .ev-dhero .vp-detail-hero__lead { text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45); }
.ev-dhero__img { object-position: center 30%; }
.ev-dhero__backdrop {
  position: absolute;
  top: -2rem;
  left: -2rem;
  z-index: -3;
  width: calc(100% + 4rem);
  height: calc(100% + 4rem);
  max-width: none !important;
  object-fit: cover;
  opacity: 0;
  filter: blur(26px) saturate(1.2);
}
.ev-dhero.is-poster .ev-dhero__backdrop { opacity: 0.9; }
.ev-dhero.is-poster::before {
  background: linear-gradient(90deg, rgba(24, 12, 7, 0.92) 0%, rgba(24, 12, 7, 0.72) 55%, rgba(24, 12, 7, 0.45) 100%);
}
.ev-dhero.is-poster .ev-dhero__img {
  inset: 4.25rem 1.5rem 1.5rem auto;
  z-index: 0;
  width: auto;
  height: calc(100% - 5.75rem);
  max-width: 40%;
  object-fit: contain;
  object-position: right bottom;
  border-radius: 10px;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.55));
}
.ev-dhero.is-poster .vp-detail-hero__body { max-width: calc(60% - 2rem); }
.ev-dhero.is-poster { min-height: clamp(20rem, 36vw, 28rem); }

.ev-dhero--plain {
  min-height: clamp(15rem, 26vw, 20rem);
  background:
    radial-gradient(circle at 82% 18%, rgba(244, 194, 90, 0.32), transparent 42%),
    linear-gradient(120deg, #3d1d13 0%, #6f3527 55%, #b0562a 100%);
}
.ev-dhero--plain::before { background: linear-gradient(180deg, rgba(20, 10, 6, 0) 40%, rgba(20, 10, 6, 0.35) 100%); }
.ev-dhero__mark {
  position: absolute;
  top: 50%;
  right: 6%;
  z-index: -1;
  color: rgba(255, 255, 255, 0.1);
  font-size: clamp(6rem, 14vw, 10rem);
  line-height: 1;
  transform: translateY(-50%);
}
.ev-dhero__pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.ev-dhero .vp-date__y { margin-top: 0.1rem; }

/* Organiser, then the facts. */
.ev-org { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; padding: 0.85rem 1.15rem; }
.ev-org__who { min-width: 0; }
.ev-org__crest { background: #fff; box-shadow: 0 0 0 1px var(--vh-line); }
.ev-org__text { display: flex; flex-direction: column; min-width: 0; }
.ev-org .vp-person__name { font-size: 0.98rem; white-space: normal; overflow-wrap: anywhere; }
.ev-org__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.ev-facts .vp-fact { box-shadow: var(--vp-shadow); }
.ev-fact__tone { background: var(--vp-tone-bg); color: var(--vp-tone); }
.ev-fact__link { color: var(--vh-ink); text-decoration: none; }
.ev-fact__link:hover { color: var(--vh-orange); text-decoration: underline; }

/* The page's blocks. */
.ev-block__title { font-family: var(--vp-serif); font-size: clamp(1.15rem, 1.5vw, 1.35rem); font-weight: 700; }
.ev-block__title .vp-section__icon { width: 2rem; height: 2rem; font-size: 0.85rem; }
.ev-block__sub { margin: 1.35rem 0 0.6rem; color: var(--vh-ink); font-size: 0.95rem; font-weight: 800; }
.ev-prose { font-size: 0.96rem; line-height: 1.7; }
.ev-prose .vp-checks { margin: 0 0 1em; padding: 0; }
.ev-prose .vp-checks:last-child { margin-bottom: 0; }
.ev-prose .vp-checks > li { margin: 0; padding-left: 0; }
.ev-prose .vp-checks > li::before { content: none; }
.ev-block .vp-chips { margin: 0; }
.ev-block .vp-chip .svg-inline--fa, .ev-block .vp-chip i { color: var(--vh-orange); font-size: 0.72rem; }

/* The programme: numbered steps that open and close. */
.ev-steps { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.ev-step { overflow: hidden; border: 1px solid var(--vh-line); border-radius: 14px; background: var(--vh-surface); }
.ev-step__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  color: var(--vh-ink);
  font-size: 0.95rem;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}
.ev-step__head::-webkit-details-marker { display: none; }
.ev-step__head::marker { content: ""; }
.ev-step__head:hover { background: rgba(111, 53, 39, 0.04); }
.ev-step__head:focus-visible { outline: 3px solid var(--vh-focus); outline-offset: -3px; }
.ev-step__num {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: rgba(200, 97, 45, 0.12);
  color: var(--vh-orange);
  font-size: 0.8rem;
  font-weight: 900;
}
.ev-step[open] .ev-step__num { background: var(--vh-grad); color: #fff; }
.ev-step__title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ev-step__chev { flex: none; color: var(--vh-muted); font-size: 0.8rem; transition: transform 0.2s ease; }
.ev-step[open] .ev-step__chev { transform: rotate(180deg); }
.ev-step__body { padding: 0 1rem 1rem 3.65rem; }
.ev-step__media { display: block; width: 100%; max-height: 28rem; margin-top: 0.8rem; border-radius: 12px; background: var(--vh-field); object-fit: cover; }
img.ev-step__media { height: auto; aspect-ratio: 16 / 9; }
.ev-step__body .vh-btn { margin-top: 0.8rem; }

/* Funding. */
.ev-fund__note { margin-bottom: 1rem; }
.ev-fund__figures { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; margin: 0 0 0.45rem; font-size: 0.9rem; }
.ev-fund__figures strong { color: var(--vh-brown); font-weight: 900; }
.ev-meter { height: 0.7rem; overflow: hidden; border-radius: 999px; background: var(--vh-field); }
.ev-meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f9a5b 0%, #5cc184 100%); }
.ev-fund__meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; margin: 0.8rem 0 1rem; color: var(--vh-muted); font-size: 0.84rem; font-weight: 600; }
.ev-fund__meta .svg-inline--fa, .ev-fund__meta i { margin-right: 0.3rem; color: var(--vh-orange); }
.ev-fund__form { padding: 1.1rem; border: 1px solid var(--vh-line); border-radius: 14px; background: var(--vh-cream); }
.ev-fund__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: 0.8rem 1rem; }
.ev-field { min-width: 0; }
.ev-field--wide { grid-column: 1 / -1; }
.ev-fund .mb-2 { margin-bottom: 0 !important; }
.ev-fund .form-label { margin-bottom: 0.3rem; padding: 0; color: var(--vh-ink); font-size: 0.82rem; font-weight: 800; letter-spacing: 0; text-transform: none; }
.ev-fund .form-control {
  min-height: 2.75rem;
  border: 1px solid var(--vh-line);
  border-radius: var(--vp-radius-sm);
  background-color: var(--vh-surface);
  color: var(--vh-ink);
  font-size: 0.9rem;
}
.ev-fund .form-control:focus { border-color: rgba(200, 97, 45, 0.55); box-shadow: 0 0 0 4px rgba(200, 97, 45, 0.12); }
.ev-fund .form-control[readonly] { background-color: var(--vh-field); }
.ev-fund .form-check { margin-top: 0.35rem; }
.ev-fund .form-check-input:checked { border-color: #a84d1c; background-color: #a84d1c; }
.ev-fund__submit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; margin-top: 1rem; }
.ev-fund__hint { margin: 0.75rem 0 0; color: var(--vh-muted); font-size: 0.78rem; }
.ev-fund__closed {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--vh-field);
  color: var(--vh-body);
  font-size: 0.88rem;
  font-weight: 700;
}
.ev-givers .vp-row { padding: 0.55rem 0.2rem; }
.ev-giver__amount { flex: none; color: var(--vh-brown); font-size: 0.86rem; font-weight: 900; }

/* The Gallery's photos from these days. */
.ev-gallery__note { margin: -0.35rem 0 0.8rem; }
.ev-thumbs { grid-template-columns: repeat(auto-fill, minmax(min(9rem, 45%), 1fr)); }
.ev-gallery__more { margin-top: 0.8rem; }
.ev-gallery__more a { color: var(--vh-orange); font-weight: 700; }

/* The column beside: details, sharing, the place. */
.ev-side .vp-kv dd a { color: var(--vh-orange); text-decoration: none; }
.ev-side .vp-kv dd a:hover { text-decoration: underline; }
.ev-side__primary { margin-top: 1rem; }
.ev-share { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--vh-line); }
.ev-share__label { margin: 0 0 0.55rem; color: var(--vh-muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.ev-share__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ev-share__wa { flex: 1 1 auto; }
.ev-where__place { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1rem; color: var(--vh-ink); font-size: 0.92rem; font-weight: 700; overflow-wrap: anywhere; }
.ev-where__pin {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  background: rgba(200, 97, 45, 0.1);
  color: var(--vh-orange);
  font-size: 1.05rem;
}

.ev-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 1080;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: #2b1d16;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 1rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ev-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ev-toast .svg-inline--fa, .ev-toast i { color: #6fd39a; }

/* Tablets: the side column's panels side by side under the main column. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .ev-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* ---------------------------------------------------------------- phones */

@media (max-width: 991.98px) {
  .ev-search { flex-basis: 100%; max-width: none; margin-left: 0; }
  .ev-step__head { min-height: 2.75rem; }
  .ev-page .vp-pager > a, .ev-page .vp-pager > span { min-width: 2.75rem; height: 2.75rem; }
}

@media (max-width: 767.98px) {
  .ev-page section.vp-panel { padding: 1rem; }
  .ev-hero .vp-hero__media { height: 11rem; }
  .ev-cats__arrow { display: none !important; }
  .ev-tabs { margin-right: -1rem; padding-right: 1rem; }

  .ev-dhero { min-height: 15rem; }
  .ev-dhero.is-poster { flex-direction: column; align-items: stretch; min-height: 0; }
  .ev-dhero.is-poster::before { background: linear-gradient(180deg, rgba(24, 12, 7, 0.55) 0%, rgba(24, 12, 7, 0.88) 70%); }
  .ev-dhero.is-poster .ev-dhero__img {
    position: relative;
    inset: auto;
    display: block;
    width: auto;
    max-width: calc(100% - 2rem);
    height: auto;
    max-height: 21rem;
    margin: 5.4rem auto 0;
  }
  .ev-dhero.is-poster .vp-detail-hero__body { max-width: none; }
  .ev-dhero .vp-date--lg { min-width: 3.6rem; padding: 0.45rem 0.55rem; }
  .ev-dhero .vp-date--lg .vp-date__d { font-size: 1.6rem; }

  .ev-org { padding: 0.8rem 0.95rem; }
  .ev-org__actions, .ev-org__actions .vh-btn { width: 100%; }
  .ev-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .ev-facts .vp-fact { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 0.75rem 0.8rem; }
  .ev-facts .vp-fact__icon { width: 2.1rem; height: 2.1rem; font-size: 0.85rem; }
  .ev-step__body { padding: 0 0.9rem 0.9rem; }
  .ev-fund__form { padding: 0.9rem; }
  .ev-fund__submit .vh-btn { width: 100%; }
  .ev-toast { right: 1rem; left: 1rem; justify-content: center; transform: translateY(1rem); }
  .ev-toast.is-on { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ev-step__chev, .ev-toast, .ev-page .vp-more .svg-inline--fa { transition: none; }
}

/* pages.css's WhatsApp button keeps its dark green text in the dark theme,
   where it is hard to read on the dark panel. */
[data-bs-theme="dark"] .ev-page .vh-btn--wa { border-color: #2fae64; color: #7ddba3 !important; }
[data-bs-theme="dark"] .ev-page .vh-btn--wa:hover { background: #25a85a; color: #fff !important; }
