/**
 * Static Events (TEC Views v2) UI fixes.
 * Restores Subscribe dropdown look/behavior without TEC JS variables/setup.
 */

/* Always show subscribe container (TEC hides it at medium+ via JS breakpoints). */
.tribe-events .tribe-events-c-subscribe-dropdown__container,
.tribe-events.tribe-common--breakpoint-medium .tribe-events-c-subscribe-dropdown__container,
.tribe-events.tribe-common--breakpoint-full .tribe-events-c-subscribe-dropdown__container {
  display: flex !important;
  flex-flow: column;
  justify-content: flex-end;
  width: 100%;
  margin: 1.25rem 0 0.5rem;
  position: relative;
  z-index: 40;
}

.tribe-events .tribe-events-c-subscribe-dropdown {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.tribe-events .tribe-events-c-subscribe-dropdown__button {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 48px;
  min-width: 200px;
  padding: 0.65rem 1rem;
  border: 1px solid #334aff !important;
  border-radius: 4px;
  background: #fff !important;
  color: #334aff !important;
  cursor: pointer;
  box-sizing: border-box;
}

.tribe-events .tribe-events-c-subscribe-dropdown__button:hover,
.tribe-events .tribe-events-c-subscribe-dropdown__button--active {
  background: #334aff !important;
  color: #fff !important;
  border-color: #334aff !important;
}

.tribe-events .tribe-events-c-subscribe-dropdown__button button,
.tribe-events .tribe-events-c-subscribe-dropdown__button-text {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
  cursor: pointer !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  pointer-events: auto !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.tribe-events .tribe-events-c-subscribe-dropdown__button button:focus,
.tribe-events .tribe-events-c-subscribe-dropdown__button-text:focus,
.tribe-events .tribe-events-c-subscribe-dropdown__button:focus {
  outline: none !important;
  box-shadow: none !important;
}

.tribe-events .tribe-events-c-subscribe-dropdown__button-icon {
  display: inline-block !important;
  width: 10px;
  height: 6px;
  margin-left: 0.35rem;
  color: currentColor !important;
  stroke: currentColor !important;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.tribe-events .tribe-events-c-subscribe-dropdown__button-icon path {
  fill: currentColor !important;
}

.tribe-events .tribe-events-c-subscribe-dropdown__button-icon--rotate {
  transform: rotate(180deg);
}

/* Closed by default; open with TEC classes or our static class. */
.tribe-events .tribe-events-c-subscribe-dropdown__content {
  display: none !important;
  position: absolute !important;
  left: 0;
  right: 0;
  top: calc(100% + 6px) !important;
  width: 100% !important;
  z-index: 100 !important;
  margin: 0;
  padding: 0;
}

.tribe-events .tribe-events-c-subscribe-dropdown__content.tribe-events-c-subscribe-dropdown__content--show,
.tribe-events .tribe-events-c-subscribe-dropdown__button--active + .tribe-events-c-subscribe-dropdown__content {
  display: block !important;
}

.tribe-events .tribe-events-c-subscribe-dropdown__list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0.5rem 0 !important;
  background: #fff !important;
  border: 1px solid #e4e4e4 !important;
  border-radius: 6px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  overflow: hidden;
}

/* Force all export options visible on static site (TEC hides some by UA). */
.tribe-events .tribe-events-c-subscribe-dropdown__list-item,
.tribe-events .tribe-events-c-subscribe-dropdown__list-item--ical,
.tribe-events .tribe-events-c-subscribe-dropdown__list-item--gcal,
.tec-is-android .tribe-events-c-subscribe-dropdown__list-item--ical {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left;
}

.tribe-events .tribe-events-c-subscribe-dropdown__list-item a,
.tribe-events .tribe-events-c-subscribe-dropdown__list-item-link {
  display: block !important;
  width: 100% !important;
  padding: 0.75rem 1.1rem !important;
  color: #141827 !important;
  text-decoration: none !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
  box-sizing: border-box;
}

.tribe-events .tribe-events-c-subscribe-dropdown__list-item a:hover,
.tribe-events .tribe-events-c-subscribe-dropdown__list-item-link:hover {
  background: #f3f4ff !important;
  color: #334aff !important;
}

/* Search container when expanded via static fallback */
.tribe-events .tribe-events-c-events-bar__search-container.innova-events-search-open,
.tribe-events .tribe-events-c-events-bar__search-button--active + .tribe-events-c-events-bar__search-container,
.tribe-events .innova-events-search-open {
  display: block !important;
  width: 100%;
  margin-top: 0.75rem;
}

/* Clickable event cards affordance */
.tribe-events .tribe-events-calendar-list__event-title-link,
.tribe-events .tribe-events-calendar-list__event-featured-image-link {
  cursor: pointer;
}

/*
 * Events list (static export) — spacing relative to the date line
 * (e.g. "March 3 - March 5"), without shrinking DUPHAT / HCE / Hi-Fi assets.
 *
 * - modest logo-area height so small logos keep a little air before the date
 * - margin-bottom: gap before datetime text
 * - cap Expo West / Healthplex; SupplySide a bit larger
 */
.tribe-events .tribe-events-calendar-list__event-featured-image-wrapper {
  min-height: 200px;
  display: flex !important;
  align-items: center;
  /* left-align logos (do not center — avoids empty left gutter) */
  justify-content: flex-start;
  margin-bottom: 1.5rem !important;
  box-sizing: border-box;
}

.tribe-events img.tribe-events-calendar-list__event-featured-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
}

/* Expo West / Healthplex */
.tribe-events img.tribe-events-calendar-list__event-featured-image[src*="natural-products-expo-west"],
.tribe-events img.tribe-events-calendar-list__event-featured-image[src*="healthplex-expo"] {
  width: auto !important;
  max-width: min(460px, 100%);
  height: auto !important;
  max-height: 200px;
  object-fit: contain;
}

/* Natural Products Expo West: a little air before the date line */
.tribe-events img.tribe-events-calendar-list__event-featured-image[src*="natural-products-expo-west"] {
  margin-bottom: 1.35rem;
}

/* SupplySide (not DUPHAT/Asia China) */
.tribe-events img.tribe-events-calendar-list__event-featured-image[src*="supplyside-global"] {
  width: auto !important;
  max-width: min(600px, 100%);
  height: auto !important;
  max-height: 280px;
  object-fit: contain;
  margin-left: 2.5rem;
}

/* Guangzhou HCE (not DUPHAT/Asia China) */
.tribe-events img.tribe-events-calendar-list__event-featured-image[src*="1-23042G9422cE"] {
  width: 170px !important;
  height: 170px !important;
  max-width: min(170px, 100%);
  object-fit: contain;
  margin-left: 2.5rem;
}

/* Detail page heroes */
.tribe-events-event-image img[src*="natural-products-expo-west"],
.tribe-events-event-image img[src*="healthplex-expo"] {
  display: block;
  max-width: min(460px, 100%);
  width: auto !important;
  height: auto !important;
  max-height: 200px;
  object-fit: contain;
  margin: 0.5rem 0 1.25rem 0;
}

.tribe-events-event-image img[src*="supplyside-global"] {
  display: block;
  max-width: min(600px, 100%);
  width: auto !important;
  height: auto !important;
  max-height: 280px;
  object-fit: contain;
  margin: 0.5rem 0 1.25rem 0;
}

/* Bottom nav: don't look broken when disabled */
.tribe-events .tribe-events-c-nav__next[disabled],
.tribe-events .tribe-events-c-top-bar__nav-link--next[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Ensure top-bar previous/today remain usable when a11y-hidden was left on from export */
.tribe-events .tribe-events-c-top-bar__nav.tribe-common-a11y-hidden,
.tribe-events .tribe-events-c-top-bar__today-button.tribe-common-a11y-hidden {
  /* keep TEC mobile/desktop rules; do not force-show if intentionally hidden */
}

@media (max-width: 767px) {
  .tribe-events .tribe-events-c-subscribe-dropdown__button {
    min-height: 44px;
  }
}
