/* H2BH Events shortcode - CSS aligned with current JavaScript */

.h2bh-events-shortcode {
  --h2bh-ev-green: #0f3f2e;
  --h2bh-ev-green-2: #1f6b4a;
  --h2bh-ev-light-green: #edf6ef;
  --h2bh-ev-text: #25342e;
  --h2bh-ev-muted: #66756e;
  --h2bh-ev-border: rgba(15, 63, 46, .12);

  width: 100%;
  color: var(--h2bh-ev-text);
  font-family: "Quicksand", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.h2bh-events-shortcode *,
.h2bh-events-shortcode *::before,
.h2bh-events-shortcode *::after {
  box-sizing: border-box;
}

.h2bh-events-shortcode .h2bh-events-container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

/* ===== SEARCH / TOOLBAR ===== */

.h2bh-events-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 22px;
}

.h2bh-events-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--h2bh-ev-border);
  border-radius: 16px;
  background: #f4f5f4;
  color: var(--h2bh-ev-muted);
}

.h2bh-events-search:focus-within {
  border-color: rgba(15, 63, 46, .35);
  box-shadow: 0 0 0 3px rgba(15, 63, 46, .08);
}

.h2bh-events-search-input {
  width: 100% !important;
  min-width: 0;
  min-height: 52px;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--h2bh-ev-text);
  font: inherit;
  font-size: 16px;
}

.h2bh-events-search-input::placeholder {
  color: #8a968f;
}

.h2bh-events-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 6px;
  border: 0;
  background: transparent;
  color: var(--h2bh-ev-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.h2bh-events-clear:hover {
  color: var(--h2bh-ev-green);
  background: transparent !important;
}

.h2bh-events-clear[hidden] {
  display: none !important;
}

/* ===== FILTERS ===== */

.h2bh-events-filterbar {
  margin: 0 0 30px;
}

.h2bh-events-dropdown-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.h2bh-events-select {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 0 42px 0 14px;
  border: 1px solid rgba(15, 63, 46, .14);
  border-radius: 14px;
  background: #fff;
  color: var(--h2bh-ev-green);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.h2bh-events-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.h2bh-events-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(15, 63, 46, .14);
  border-radius: 999px;
  background: #fff;
  color: var(--h2bh-ev-green);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition:
    border-color .2s ease,
    background .2s ease,
    color .2s ease,
    transform .2s ease;
}

.h2bh-events-category:hover {
  border-color: rgba(15, 63, 46, .28);
  background: var(--h2bh-ev-green);
  color: #fff !important;
  transform: translateY(-1px);
}

.h2bh-events-category.is-active {
  background: var(--h2bh-ev-green);
  border-color: var(--h2bh-ev-green);
  color: #fff;
}

/* ===== EVENT GRID ===== */

.h2bh-events-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.h2bh-event-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 63, 46, .08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 63, 46, .05);
  transition: transform .25s ease, box-shadow .25s ease;
}

.h2bh-event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 63, 46, .10);
}

.h2bh-event-card.is-hidden {
  display: none !important;
}

.h2bh-event-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f4ecdf;
  text-decoration: none !important;
}

.h2bh-event-media img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  transition: transform .4s ease;
}

.h2bh-event-card:hover .h2bh-event-media img {
  transform: scale(1.04);
}

.h2bh-event-image-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--h2bh-ev-light-green);
  color: var(--h2bh-ev-green);
  font-size: 48px;
}

.h2bh-event-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--h2bh-ev-green);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.h2bh-event-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px 18px 20px;
}

.h2bh-event-body h3 {
  margin: 0;
  color: var(--h2bh-ev-green);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.h2bh-event-body h3 a {
  color: inherit !important;
  text-decoration: none !important;
}

.h2bh-event-body h3 a:hover {
  color: var(--h2bh-ev-green-2) !important;
}

.h2bh-event-body p {
  margin: 0;
  color: var(--h2bh-ev-muted);
  font-size: 14px;
  line-height: 1.55;
}

.h2bh-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--h2bh-ev-muted);
  font-size: 13px;
  font-weight: 600;
}

.h2bh-event-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.h2bh-event-meta i {
  color: var(--h2bh-ev-green-2);
}

/* ===== EMPTY STATE ===== */

.h2bh-events-empty {
  margin: 28px 0 0;
  text-align: center;
  color: var(--h2bh-ev-muted);
  font-weight: 600;
}

.h2bh-events-empty[hidden] {
  display: none !important;
}

/* ===== SHOW MORE ===== */

.h2bh-events-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.h2bh-events-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: min(420px, 100%);
  min-height: 50px;
  padding: 12px 24px;
  border: 1px solid rgba(15, 63, 46, .10);
  border-radius: 14px;
  background: #f1f3f1;
  color: var(--h2bh-ev-green);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.h2bh-events-more:hover {
  background: #e7ebe8;
  transform: translateY(-1px);
}

.h2bh-events-more[hidden] {
  display: none !important;
}

/* ===== TABLET ===== */

@media (max-width: 980px) {
  .h2bh-events-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .h2bh-events-dropdown-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== MOBILE ===== */

@media (max-width: 620px) {
  .h2bh-events-shortcode .h2bh-events-container {
    width: calc(100% - 24px);
    max-width: none;
    margin: 0 auto;
  }

  .h2bh-events-toolbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }

  .h2bh-events-search {
    min-height: 50px;
    padding: 0 14px;
    border-radius: 14px;
  }

  .h2bh-events-search-input {
    min-height: 48px;
    font-size: 16px;
  }

  .h2bh-events-clear {
    justify-self: end;
    min-height: auto;
    padding: 2px 0;
    font-size: 13px;
  }

  .h2bh-events-filterbar {
    margin-bottom: 24px;
  }

  .h2bh-events-dropdown-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .h2bh-events-select {
    min-height: 48px;
    font-size: 14px;
  }

  .h2bh-events-category-row {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 12px;
    padding: 1px 0 7px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .h2bh-events-category-row::-webkit-scrollbar {
    display: none;
  }

  .h2bh-events-category {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 13px;
    white-space: nowrap;
    font-size: 13px;
  }

  .h2bh-events-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .h2bh-event-card {
    width: 100%;
    min-width: 0;
    border-radius: 16px;
  }

  .h2bh-event-media {
    aspect-ratio: 16 / 9;
  }

  .h2bh-event-body {
    padding: 16px;
    gap: 11px;
  }

  .h2bh-event-body h3 {
    font-size: 18px;
    line-height: 1.3;
  }

  .h2bh-event-body p {
    font-size: 14px;
    line-height: 1.5;
  }

  .h2bh-event-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    font-size: 13px;
  }

  .h2bh-event-meta span {
    width: 100%;
  }

  .h2bh-events-more {
    width: 100%;
    min-width: 0;
  }
}

/* ===== SMALL MOBILE ===== */

@media (max-width: 390px) {
  .h2bh-events-shortcode .h2bh-events-container {
    width: calc(100% - 18px);
  }

  .h2bh-event-body {
    padding: 14px;
  }

  .h2bh-event-body h3 {
    font-size: 17px;
  }
}
