/* Events page — hero (pills + calendar) and the event list / event header used by the [events] shortcodes. */

.events-hero,
.events-list,
.event-header {
  --events-border: color-mix(
    in srgb,
    var(--wp--preset--color--custom-bronze-brown, #966d36) 24%,
    transparent
  );
  --events-chip: var(--wp--preset--color--custom-crisp-linen, #eae2d7);
  --events-radius: 1.75rem;
  --events-radius-sm: 1.25rem;
}

.events-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
}

/* ---------------------------------------------------------------- pills */

.events-hero__list {
  display: grid;
  gap: clamp(0.75rem, 1.5vw, 1rem);
}

.event-pill {
  position: relative;
  display: grid;
  grid-template-columns: clamp(84px, 12vw, 118px) minmax(0, 1fr) auto;
  gap: clamp(0.9rem, 2vw, 1.5rem);
  align-items: center;
  padding: clamp(0.7rem, 1.4vw, 1rem) clamp(1rem, 2vw, 1.6rem)
    clamp(0.7rem, 1.4vw, 1rem) clamp(0.7rem, 1.4vw, 1rem);
  background: var(--wp--preset--color--base, #fff);
  border: 1px solid var(--events-border);
  border-radius: var(--events-radius);
  scroll-margin-top: 2rem;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.event-pill:hover,
.event-pill:target {
  transform: translateY(-3px);
  border-color: color-mix(
    in srgb,
    var(--wp--preset--color--custom-bronze-brown, #966d36) 55%,
    transparent
  );
  box-shadow: 0 18px 34px -24px
    color-mix(
      in srgb,
      var(--wp--preset--color--custom-earthy-olive, #2c3729) 70%,
      transparent
    );
}

/* The whole card is one target: the title's anchor stretches over it, and whatever has to
   stay separately clickable (share button, category, location, "lees hier") sits above it. */
.event-pill__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.event-pill__type a,
.event-pill__where a,
.event-pill__more a,
.event-pill__actions {
  position: relative;
  z-index: 2;
}

.event-pill__media {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--events-radius-sm);
  background: var(--wp--preset--color--custom-crisp-linen, #eae2d7);
}

.event-pill__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-pill__body {
  min-width: 0;
}

.event-pill__type {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wp--preset--color--custom-bronze-brown, #966d36);
}

.event-pill__type a {
  color: inherit;
  text-decoration: none;
}

.event-pill__type a:hover {
  text-decoration: underline;
}

.event-pill__title {
  margin: 0 0 0.35rem;
  font-family: var(--wp--preset--font-family--playfair, "Playfair", serif);
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  line-height: 1.2;
}

.event-pill__title a {
  color: inherit;
  text-decoration: none;
}

.event-pill__info {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--wp--preset--color--custom-earthy-olive);
}

.event-pill__where a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.event-pill__actions {
  display: block;
  height: 100%;
  width: 100%;
  justify-content: flex-end;
}

.event-share {
  --share-icon-ios: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.6V3.6'/%3E%3Cpath d='M8.2 7.4L12 3.6l3.8 3.8'/%3E%3Cpath d='M5.6 12.6v5.8a2 2 0 0 0 2 2h8.8a2 2 0 0 0 2-2v-5.8'/%3E%3C/svg%3E");
  --share-icon-android: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.62 1.31 2.92 2.92 2.92 1.61 0 2.92-1.3 2.92-2.92s-1.31-2.92-2.92-2.92z'/%3E%3C/svg%3E");
  --share-icon-windows: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.6 4.4h6v6'/%3E%3Cpath d='M19.6 4.4L11.2 12.8'/%3E%3Cpath d='M16.6 14.4v4.8a1.4 1.4 0 0 1-1.4 1.4H6a1.4 1.4 0 0 1-1.4-1.4V10a1.4 1.4 0 0 1 1.4-1.4h4.8'/%3E%3C/svg%3E");
  --share-icon: var(--share-icon-android);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  height: 100%;
  width: 100%;
  border-radius: 0;
  border: 0;
}

.event-share.is-copied {
  background: var(--wp--preset--color--custom-tan-gold, #cbb57b);
  border-color: var(--wp--preset--color--custom-tan-gold, #cbb57b);
  color: var(--wp--preset--color--contrast, #111);
}

/* The glyph is masked so it takes the button's colour (hover, copied state). */
.event-share__icon {
  width: 1.15rem;
  height: 1.15rem;
  background-color: currentColor;
  -webkit-mask: var(--share-icon) center / contain no-repeat;
  mask: var(--share-icon) center / contain no-repeat;
}

.event-share[data-share-icon="ios"] {
  --share-icon: var(--share-icon-ios);
}

.event-share[data-share-icon="windows"] {
  --share-icon: var(--share-icon-windows);
}

/* Kept for screen readers and for the "Gekopieerd" swap; the button's aria-label names it. */
.event-share__label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------- calendar */

.events-hero__side {
  display: grid;
  gap: clamp(0.75rem, 1.5vw, 1rem);
  position: sticky;
  top: 2rem;
}

.events-cal {
  padding: clamp(1rem, 2vw, 1.4rem);
  background: var(--wp--preset--color--base, #fff);
  border: 1px solid var(--events-border);
  border-radius: var(--events-radius);
}

.events-cal__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.events-cal__month {
  margin: 0;
  font-family: var(--wp--preset--font-family--playfair, "Playfair", serif);
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  line-height: 1.1;
  text-transform: capitalize;
}

.events-cal__count {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--custom-earthy-olive);
}

.events-cal__weekdays,
.events-cal__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.events-cal__weekdays {
  margin-bottom: 0.35rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--wp--preset--color--custom-earthy-olive);
}

.events-cal__day {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  font-size: 0.82rem;
  line-height: 1;
  color: var(--wp--preset--color--custom-earthy-olive, #2c3729);
  text-decoration: none;
}

.events-cal__day.is-today:not(.has-event) {
  border: 1px solid var(--events-border);
}

/* The flagged day carries the event photo, so it turns from a dot into a small tile. */
.events-cal__day.has-event {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background-color: var(--wp--preset--color--custom-earthy-olive, #2c3729);
  background-position: center;
  background-size: cover;
  color: #fff;
}

.events-cal__day.has-event::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(44, 55, 41, 0.12) 10%,
    rgba(44, 55, 41, 0.86) 100%
  );
  pointer-events: none;
}

.events-cal__day.has-event:hover,
.events-cal__day.has-event:focus-visible {
  filter: brightness(1.06);
}

/* Absolute so the caption cannot outgrow the square and turn the other days into ovals. */
.events-cal__day-stack {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  padding: 0.2rem;
  text-align: center;
  line-height: 1.15;
  text-shadow: 0 1px 6px rgba(17, 17, 17, 0.5);
}

.events-cal__day-num {
  font-weight: 700;
}

.events-cal__day-type {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.events-cal__day-time {
  font-size: 0.48rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.82);
}

.events-cal__nav {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--events-border);
}

.events-cal:not(.is-enhanced) .events-cal__nav {
  display: none;
}

.events-cal__step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--wp--preset--color--custom-earthy-olive, #2c3729);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.events-cal__step:hover:not(:disabled),
.events-cal__step:focus-visible:not(:disabled) {
  background: var(--wp--preset--color--custom-crisp-linen, #eae2d7);
  border-color: var(--events-border);
}

.events-cal__step:disabled {
  opacity: 0.35;
  cursor: default;
}

.events-hero__empty {
  margin-block: 2rem;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .events-hero {
    display: flex;
    flex-flow: column-reverse;
    > * {
      width: 100%;
    }
  }

  .events-hero__side {
    position: static;
  }
  span.events-cal__day-stack span:not(.events-cal__day-num) {
    display: none;
  }
}

@media (max-width: 620px) {
  .event-pill {
    grid-template-columns: 72px minmax(0, 1fr);
    row-gap: 0.75rem;
    padding: 0.75rem;
  }

  .event-pill__actions {
    grid-column: 1 / -1;
  }

  .event-share {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .event-pill,
  .event-pill:hover,
  .event-pill:target {
    transform: none;
    transition: none;
  }
}

/* --------------------------------------- past events list & single event header */

.events-list,
.events-visible,
.events-hidden {
  display: grid;
  gap: clamp(0.75rem, 1.5vw, 1rem);
}

.events-list .event {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40%;
  gap: clamp(0.9rem, 2vw, 1.5rem);
  padding: clamp(0.9rem, 1.6vw, 1.2rem) clamp(1rem, 2vw, 1.6rem);
  background: var(--wp--preset--color--base, #fff);
  border: 1px solid var(--events-border);
  border-radius: var(--events-radius);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.events-list .event:hover {
  transform: translateY(-3px);
  border-color: color-mix(
    in srgb,
    var(--wp--preset--color--custom-bronze-brown, #966d36) 55%,
    transparent
  );
  box-shadow: 0 18px 34px -24px
    color-mix(
      in srgb,
      var(--wp--preset--color--custom-earthy-olive, #2c3729) 70%,
      transparent
    );
}

/* The text column is padded, so the photo runs a little taller than the body next to it. */
.events-list .event-pill__body {
  padding-block: clamp(0.5rem, 1.2vw, 0.9rem);
}

/* The thumbnail fills the right column instead of the hero's square tile. */
.events-list .event-pill__media {
  position: relative;
  aspect-ratio: auto;
  height: 100%;
  max-height: 100%;
}

/* The <img> fills that box instead of sizing it: a replaced element always feeds its
   intrinsic height into the grid row, which would let the photo stretch the card. */
.events-list .event-pill__media img {
  position: absolute;
  inset: 0;
}

.events-list .event-pill__text,
.events-list .event-pill__more {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--wp--preset--color--custom-earthy-olive);
}

.events-list .event-pill__more a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.event-header {
  position: relative;
}

.event-header p strong {
  font-weight: 700;
}

.event-header .event-category {
  margin: 0;
}

.event-header p.event-category ~ p {
  margin: 0.5em 0;
}

.event-header .event-category a {
  display: inline-block;
  width: fit-content;
  padding: 0.2rem 0.5rem;
  background: var(--events-chip);
  border-radius: calc(var(--events-radius-sm) / 2);
  color: var(--wp--preset--color--custom-earthy-olive, #2c3729);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.event-header .img img {
  position: absolute;
  top: 0;
  right: 0;
  width: 80%;
  height: 100%;
  border-radius: var(--events-radius-sm);
  object-fit: cover;
}

@media (max-width: 800px) {
  .event-header .img img {
    width: 70vw;
  }
}

@media (max-width: 700px) {
  .events-list .event {
    grid-template-columns: minmax(0, 1fr);
  }

  .events-list .event-pill__media {
    order: -1;
    width: 100%;
    height: 200px;
  }
}

@media (max-width: 600px) {
  .event-header .img img {
    width: 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .events-list .event,
  .events-list .event:hover {
    transform: none;
    transition: none;
  }
}

button.events-meer-btn {
  display: flex;
  margin: 1rem auto 0;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--events-border);
  border-radius: 999px;
  outline: unset;
  color: var(--wp--preset--color--custom-earthy-olive, #2c3729);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

button.events-meer-btn:hover {
  background: var(--events-chip);
}
