/* ==========================================================================
   InsideFlow Events – Search / Archive Page (Layout B)
   ========================================================================== */

/* ── Outer container ─────────────────────────────────────────────────────── */

.iy-event-search {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 20px 0;
}

/* ── Filter bar ──────────────────────────────────────────────────────────── */

/* Header title + subheadline now use the shared .iy-search-head class (custom.css). */

/* White filter box wrapping the filter bar + toolbar (matches Studios/Teachers) */
.iy-event-search__filters {
  background: var(--iy-card, #fff);
  border: 1px solid var(--iy-line, #e4e4e4);
  border-radius: 16px; /* matches result cards */
  padding: 20px 24px;
  margin-bottom: 20px;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.iy-event-search__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
}

.iy-event-search__field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Select / input shared style ─────────────────────────────────────────── */

.iy-event-search__select,
.iy-event-search__input {
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--bb-body-text-color, #1c2b2c);
  background: var(--bb-content-background-color, #fff);
  box-sizing: border-box;
  white-space: nowrap;
}

.iy-event-search__select:focus,
.iy-event-search__input:focus {
  outline: none;
  border-color: var(--iy-teal, #3b6063);
  box-shadow: 0 0 0 2px rgba(59, 96, 99, 0.15);
}

/* Custom arrow for selects */
.iy-event-search__select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-color: var(--bb-content-background-color, #fff);
  padding-right: 34px;
  cursor: pointer;
}

.iy-event-search__select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Month select (highlighted teal) ─────────────────────────────────────── */

/* Highlighted teal ONLY when a specific month is chosen (added via .is-active by JS);
   the default "All upcoming" looks like a normal select, not permanently focused. */
.iy-event-search__select--month.is-active {
  font-weight: 700;
  border-color: var(--iy-teal, #3b6063);
  color: var(--iy-teal, #3b6063);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233b6063' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.iy-event-search__select--month.is-active:focus {
  box-shadow: 0 0 0 2px rgba(59, 96, 99, 0.2);
}

/* ── Location field (icon inside input) ──────────────────────────────────── */

.iy-event-search__location-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.iy-event-search__location-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  opacity: 0.55;
  pointer-events: none;
  flex-shrink: 0;
}

.iy-event-search__location-wrap .iy-event-search__input {
  padding-left: 30px;
  width: 100%;
}

/* ── Add Event pill button ───────────────────────────────────────────────── */

a.iy-event-search__add-btn,
.iy-event-search__add-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 100px;
  background: var(--iy-teal, #3b6063);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease;
  margin-left: auto;
  cursor: pointer;
}

a.iy-event-search__add-btn:hover,
.iy-event-search__add-btn:hover {
  background: color-mix(
    in srgb,
    var(--iy-teal, #3b6063) 85%,
    #000
  );
  color: #fff;
  text-decoration: none;
}

.iy-event-search__add-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ── Clear filters (subtle ghost text button, light-red → red on hover) ─── */

.iy-event-search__clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: none;
  border-radius: 100px;
  background: transparent !important;
  box-shadow: none;
  color: #d94040;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease;
}

.iy-event-search__clear:hover,
.iy-event-search__clear:focus {
  color: #b52e2e;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.iy-event-search__clear:focus {
  outline: none;
}

.iy-event-search__clear svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.iy-event-search__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--bb-content-border-color, #e4e4e4);
  padding-top: 16px;
}

.iy-event-search__toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.iy-event-search__count {
  font-size: 13px;
  color: var(--bb-alternate-text-color, #6b6b6b);
}

.iy-event-search__divider {
  width: 1px;
  height: 16px;
  background: #00000022;
  display: inline-block;
  flex: none;
}

.iy-event-search__sort {
  appearance: none;
  -webkit-appearance: none;
  font-size: 13px;
  color: var(--bb-alternate-text-color, #6b6b6b);
  background: transparent !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 4px center !important;
  border: none !important;
  border-radius: 0;
  box-shadow: none !important;
  padding: 2px 20px 2px 0;
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.iy-event-search__sort:hover {
  color: #1c2b2c;
}

.iy-event-search__sort:focus {
  outline: none;
  color: #1c2b2c;
}

/* ── Split layout (Layout B): list left, map right ───────────────────────── */

/* Toolbar right group: map toggle + clear filters */
.iy-event-search__toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Map toggle button */
/* Solid teal button — matches the Studios/Teachers "Open Map" toggle. */
.iy-event-search__map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: none;
  border-radius: 100px;
  background-color: var(--iy-teal, #3b6063);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.iy-event-search__map-toggle svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.iy-event-search__map-toggle:hover,
.iy-event-search__map-toggle.is-active {
  background-color: color-mix(in srgb, var(--iy-teal, #3b6063) 85%, #000);
}

/* Map container: full-width, between filter bar and cards (Studios/Teachers pattern) */
.iy-event-search__map-container {
  margin: 16px 0;
}

/* Results: full-width flex column of cards */
.iy-event-search__results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.iy-event-search__map {
  height: 420px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--bb-content-border-color, #e4e4e4);
  background: linear-gradient(135deg, #e8edec, #dfe6e4);
}

/* ── Loading / empty states ──────────────────────────────────────────────── */

.iy-events-loading,
.iy-events-empty {
  text-align: center;
  padding: 48px 20px;
  font-size: 14px;
  color: var(--bb-alternate-text-color, #888);
  background: var(--bb-content-background-color, #fff);
  border: 1px solid var(--bb-content-border-color, #e4e4e4);
  border-radius: 14px;
}

/* ── Map popup ───────────────────────────────────────────────────────────── */

.iy-event-popup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.iy-event-popup__title,
.leaflet-popup-content .iy-event-popup__title,
.leaflet-popup-content a.iy-event-popup__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--iy-gold, #a77637) !important;
  text-decoration: none !important;
  line-height: 1.3;
}

.iy-event-popup__title:hover,
.leaflet-popup-content a.iy-event-popup__title:hover {
  text-decoration: underline !important;
}

.iy-event-popup__date {
  font-size: 11px;
  color: var(--bb-alternate-text-color, #888);
}

.iy-event-popup__type {
  font-size: 11px;
  font-weight: 600;
  color: var(--bb-alternate-text-color, #888);
}

/* Gold pin icon */
.iy-event-marker {
  background: none !important;
  border: none !important;
}

/* ── Event card ──────────────────────────────────────────────────────────── */

a.iy-event-card {
  display: flex;
  gap: 16px;
  background: var(--bb-content-background-color, #fff);
  border: 1px solid var(--bb-content-border-color, #ececec);
  border-radius: 16px;
  padding: 14px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition:
    transform 0.2s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.2s ease;
}

a.iy-event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(28, 43, 44, 0.1);
  text-decoration: none;
  color: inherit;
}

/* Image tile */
.iy-event-card__img {
  width: 120px;
  height: 92px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

/* Online: gradient + laptop icon centered */
.iy-event-card__img--online {
  background: linear-gradient(135deg, #3b6063, #2c494b);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Placeholder (no image, not online) */
.iy-event-card__img--placeholder {
  background: var(--bb-body-background-color, #f0f0f0);
}

/* Body */
.iy-event-card__body {
  flex: 1;
  min-width: 0;
}

/* Title */
.iy-event-card__title {
  color: var(--bb-headings-color, #1c2b2c);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  margin: 0 0 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.iy-event-card:hover .iy-event-card__title {
  color: var(--iy-teal, #3b6063);
}

/* Meta line (date + location) */
.iy-event-card__meta {
  color: var(--bb-alternate-text-color, #6b6b6b);
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.iy-event-card__meta span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.iy-event-card__meta svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* Right column: tag + chevron */
.iy-event-card__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding-left: 8px;
}

/* Type tag base */
.iy-event-card__tag {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  /* default (unrecognised type) */
  color: var(--bb-alternate-text-color, #555);
  background: var(--bb-body-background-color, #f0f0f0);
}

/* ── Type tag colour modifiers ───────────────────────────────────────────── */

/* Teacher Training – blue */
.iy-event-card__tag--teacher-training {
  color: #4d80ec;
  background: #edf2fd;
}

/* Workshop – amber */
.iy-event-card__tag--workshop {
  color: #e5a200;
  background: #fef9ec;
}

/* Masterclass – purple */
.iy-event-card__tag--masterclass {
  color: #838cf1;
  background: #f2f3fe;
}

/* Inside Flow Retreat – teal/forest */
.iy-event-card__tag--inside-flow-retreat {
  color: var(--iy-teal, #3B6063);
  background: #e6f0f0;
}

/* Festival Class – coral/warm */
.iy-event-card__tag--festival-class {
  color: #d96b3e;
  background: #fdf0ea;
}

/* Concert – rose */
.iy-event-card__tag--concert {
  color: #c44f7a;
  background: #fce8f1;
}

/* Summit – gold */
.iy-event-card__tag--summit {
  color: var(--iy-gold, #a77637);
  background: color-mix(
    in srgb,
    var(--iy-gold, #a77637) 12%,
    transparent
  );
}

/* Chevron */
.iy-event-card__chev {
  color: #c2c2c2;
  display: flex;
  transition:
    transform 0.2s cubic-bezier(0.23, 1, 0.32, 1),
    color 0.2s ease;
}

.iy-event-card__chev svg {
  width: 22px;
  height: 22px;
}

a.iy-event-card:hover .iy-event-card__chev {
  transform: translateX(3px);
  color: var(--iy-teal, #3b6063);
}

/* ── Responsive: Tablet (≤ 1024px) ───────────────────────────────────────── */

@media (max-width: 1024px) {
  .iy-event-card__img {
    width: 96px;
    height: 74px;
  }

  .iy-event-card__title {
    font-size: 14px;
  }
}

/* ── Responsive: Mobile (≤ 768px) ────────────────────────────────────────── */

@media (max-width: 768px) {
  .iy-event-search__bar {
    flex-direction: column;
    align-items: stretch;
    border-radius: 12px;
    padding: 14px;
  }

  .iy-event-search__field {
    flex: 1 1 100%;
  }

  a.iy-event-search__add-btn {
    margin-left: 0;
    justify-content: center;
  }

  .iy-event-search__clear {
    flex-shrink: 0;
  }

  .iy-event-search__map {
    height: 300px;
    border-radius: 10px;
  }

  .iy-event-card__img {
    width: 80px;
    height: 64px;
    border-radius: 10px;
  }

  .iy-event-card__title {
    font-size: 14px;
    white-space: normal;
  }

  .iy-event-card__right {
    gap: 8px;
    padding-left: 4px;
  }

  .iy-event-card__tag {
    font-size: 11px;
    padding: 4px 9px;
  }
}

/* ── Responsive: Small mobile (≤ 480px) ──────────────────────────────────── */

@media (max-width: 480px) {
  .iy-event-search__bar {
    padding: 12px;
    gap: 8px;
  }

  .iy-event-search__select,
  .iy-event-search__input {
    height: 38px;
    font-size: 12px;
  }

  a.iy-event-card {
    padding: 12px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .iy-event-card__img {
    width: 72px;
    height: 58px;
    border-radius: 8px;
  }

  .iy-event-card__body {
    flex: 1 1 calc(100% - 84px);
  }

  .iy-event-card__right {
    flex: 0 0 100%;
    padding-left: 0;
    justify-content: space-between;
  }

  .iy-event-card__chev {
    display: none;
  }

  .iy-event-search__map {
    height: 260px;
    border-radius: 8px;
  }

  .iy-events-loading,
  .iy-events-empty {
    padding: 32px 16px;
    font-size: 13px;
  }
}

/* ── System pills row (All / Inside Flow / Inside Yoga) — twin of the
      Studios level row (.iy-sdir-filter-row--levels) ──────────────────── */

.iy-event-search__row--system {
	display: flex;
	gap: 12px;
	align-items: center;
	border-top: 1px solid var(--bb-content-border-color, #e4e4e4);
	padding-top: 16px;
}

.iy-event-search__system-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--bb-headings-color, #1a1a1a);
	white-space: nowrap;
}

.iy-event-search__system-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

@media (max-width: 600px) {
	.iy-event-search__row--system {
		padding-top: 12px;
	}
	.iy-event-search__system-pills {
		gap: 6px;
	}
}
