.eventkoi-front {
  // Theme-proof responsive show/hide for the calendar toolbar + list
  // pagination. Some themes (e.g. Beaver Builder) ship
  // `.hidden{display:none!important}` that loads after our utilities and,
  // being equal specificity, wins on source order and kills `lg:flex`.
  // Scoping under `.eventkoi-front` raises specificity so it always wins.
  .ek-desktop-only {
    display: none !important;
  }
  .ek-mobile-only {
    display: flex !important;
  }

  @media (min-width: 1024px) {
    .ek-desktop-only {
      display: flex !important;
    }
    .ek-mobile-only {
      display: none !important;
    }
  }

  &.eventkoi-legacy {
    .wp-block-columns.is-not-stacked-on-mobile {
      gap: 20px;
      p {
        margin: 0;
      }
    }
    .wp-block-group__inner-container .wp-block-columns:last-child {
      margin-bottom: 0 !important;
    }
    figure {
      margin-top: 0;
    }
  }
  .wp-block-button__link {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .eventkoi-gmap {
    width: 100%;
    border-radius: 10px;
  }
  .eventkoi-no-underline {
    text-decoration: none;
  }
  .eventkoi-details {
    padding: 1px 0 0;
  }

  // Restore browser defaults for user-authored lists inside the event
  // description. Tailwind's scoped preflight resets ul/ol/li inside
  // .eventkoi-front, which strips bullets + indent from rich-text content.
  .eventkoi-details ul,
  .eventkoi-details ol {
    margin: 0 0 16px;
    padding-left: 1.5em;
  }
  .eventkoi-details ul {
    list-style: disc outside;
  }
  .eventkoi-details ol {
    list-style: decimal outside;
  }
  .eventkoi-details li {
    display: list-item;
    margin-bottom: 4px;
  }
  .eventkoi-details ul ul,
  .eventkoi-details ol ol,
  .eventkoi-details ul ol,
  .eventkoi-details ol ul {
    margin-top: 4px;
    margin-bottom: 0;
  }
  .eventkoi-details ul ul {
    list-style-type: circle;
  }
  .eventkoi-details ul ul ul {
    list-style-type: square;
  }

  .eventkoi-rule-summary {
    display: block;
    margin-bottom: 2px;
  }
  figure.wp-block-image img {
    width: 100%;
  }
  .eventkoi-location {
    font-style: normal;
    margin-bottom: 1.5em;
    display: block;
    white-space: pre-line;
    strong {
      font-weight: 600;
    }
    &:last-of-type {
      margin-bottom: 0;
    }
    .eventkoi-location-label {
      font-size: 0.9em;
      display: inline-block;
      font-weight: 600;
      margin-bottom: 4px;
    }
    &.physical,
    &.virtual {
      position: relative;
    }
  }
  [data-selected="true"]:not(:hover) {
    background: transparent !important;
  }
}

/* Embedded video alignment (mirrors the editor's content_style). */
.eventkoi-video-embed {
  margin: 1em auto;
}
.eventkoi-video-embed--center {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.eventkoi-video-embed--wide {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.eventkoi-video-embed--full {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}
.eventkoi-video-embed iframe {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
}
.eventkoi-video-embed video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
}

/* Thin, unobtrusive scrollbar for the scrollable body of sheet-style modals. */
.ek-modal-scroll {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--foreground) / 0.25) transparent;
}
.ek-modal-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.ek-modal-scroll::-webkit-scrollbar-thumb {
  background-color: hsl(var(--foreground) / 0.25);
  border-radius: 9999px;
}
.ek-modal-scroll::-webkit-scrollbar-track {
  background: transparent;
}

// Classic themes (e.g. Astra) wrap the content area in display:flex
// containers; a flex item with no width shrink-wraps to its intrinsic
// content width, collapsing the calendar/list wrapper to a narrow strip
// that then renders in its compact (mobile) layout. Make the injected
// calendar-page wrapper fill the row instead.
main.eventkoi-main {
  width: 100%;
  min-width: 0;
}
