/* ==========================================================
   OEJCH Upcoming Virtual Meetings
========================================================== */

.oejch-events-section {
  --oejch-events-purple: var(--purple-main, #63619d);
  --oejch-events-purple-dark: var(--purple-dark, #515086);
  --oejch-events-green: var(--green-dark, #3c6c34);
  --oejch-events-navy: var(--navy, #061c60);
  --oejch-events-text: #29313a;
  --oejch-events-muted: #59636e;
  --oejch-events-border: rgb(99 97 157 / 18%);
  --oejch-events-soft: rgb(99 97 157 / 7%);

  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding-top: 1.25rem;
  overflow: visible;
}

.oejch-events-intro {
  max-width: 100%;
  margin: 0 0 1.5rem;
  color: #3f4850;
  font-size: 1rem;
  line-height: 1.65;
}

/* ==========================================================
   Carousel
========================================================== */

.oejch-events-carousel {
  position: relative;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.oejch-events-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 1.25rem) / 2);
  grid-template-columns: none;
  gap: 1.25rem;
  align-items: stretch;

  width: 100%;
  min-width: 0;
  box-sizing: border-box;

  padding: 0.35rem 0.2rem 1rem;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0.2rem;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: thin;
  scrollbar-color:
    rgb(99 97 157 / 35%) rgb(99 97 157 / 8%);
}

.oejch-events-grid:focus-visible {
  outline: 3px solid rgb(126 186 0 / 45%);
  outline-offset: 4px;
  border-radius: 12px;
}

.oejch-events-grid::-webkit-scrollbar {
  height: 8px;
}

.oejch-events-grid::-webkit-scrollbar-track {
  background: rgb(99 97 157 / 8%);
  border-radius: 999px;
}

.oejch-events-grid::-webkit-scrollbar-thumb {
  background: rgb(99 97 157 / 35%);
  border-radius: 999px;
}

.oejch-events-grid::-webkit-scrollbar-thumb:hover {
  background: rgb(99 97 157 / 55%);
}

/* ==========================================================
   Meeting Card
========================================================== */

.oejch-event-card {
  position: relative;
  display: flex;
  flex-direction: column;

  min-width: 0;
  height: 100%;
  box-sizing: border-box;

  padding: 1.35rem;

  background:
    linear-gradient(145deg,
      #ffffff 0%,
      #fbfcff 100%);

  border: 1px solid var(--oejch-events-border);
  border-left: 5px solid var(--oejch-events-purple);
  border-radius: 16px;

  box-shadow:
    0 8px 22px rgb(81 71 187 / 10%),
    0 2px 6px rgb(6 28 96 / 5%);

  scroll-snap-align: start;
  scroll-snap-stop: always;

  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.oejch-event-card:hover {
  border-color: rgb(99 97 157 / 34%);
  /*border-left-color: var(--oejch-events-green);*/

  box-shadow:
    0 14px 30px rgb(81 71 187 / 16%),
    0 4px 10px rgb(6 28 96 / 7%);
}

.oejch-event-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 4px;

  background:
    linear-gradient(90deg,
      var(--oejch-events-purple),
      var(--green, #7eba00));

  border-radius: 0 0 999px 999px;
  opacity: 0.9;
}

/* ==========================================================
   Card Header
========================================================== */

.oejch-event-top {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;

  min-width: 0;
  margin-bottom: 1rem;
}

.oejch-event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 76px;
  min-height: 84px;
  box-sizing: border-box;

  padding: 0.65rem 0.5rem;

  background:
    linear-gradient(145deg,
      rgb(99 97 157 / 10%),
      rgb(126 186 0 / 8%));

  border: 1px solid rgb(99 97 157 / 22%);
  border-radius: 14px;

  text-align: center;
}

.oejch-event-month {
  color: var(--oejch-events-purple-dark);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.oejch-event-day {
  margin-top: 0.2rem;
  color: var(--oejch-events-navy);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.oejch-event-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;

  width: 100%;
  min-width: 0;
}

.oejch-event-format {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;

  width: fit-content;
  max-width: 100%;

  padding: 0.3rem 0.65rem;

  background: rgb(60 108 52 / 8%);
  border: 1px solid rgb(60 108 52 / 20%);
  border-radius: 999px;

  color: var(--oejch-events-green);
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.045em;
  text-transform: uppercase;

  overflow-wrap: anywhere;
}

.oejch-event-format i {
  flex: 0 0 auto;
}

.oejch-event-heading h3 {
  width: 100%;
  min-width: 0;
  max-width: 100%;

  margin: 0;

  color: var(--oejch-events-navy);
  font-size: clamp(1.05rem, 0.99rem + 0.25vw, 1.22rem);
  font-weight: 800;
  line-height: 1.35;

  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  text-wrap: balance;
}

/* ==========================================================
   Card Content
========================================================== */

.oejch-event-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.oejch-event-description {
  margin: 0 0 1rem !important;

  color: var(--oejch-events-muted);
  font-size: 0.95rem;
  line-height: 1.6;

  overflow-wrap: anywhere;
}

.oejch-event-details {
  display: grid;
  gap: 0.55rem;

  min-width: 0;
  margin: 0 0 1.2rem;
  padding: 0;

  list-style: none;
}

.oejch-event-details li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;

  min-width: 0;

  color: #48515b;
  font-size: 0.9rem;
  line-height: 1.5;

  overflow-wrap: anywhere;
}

.oejch-event-details i {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 18px;
  min-width: 18px;
  margin-top: 0.2rem;

  color: var(--oejch-events-purple);
}

/* ==========================================================
   Registration Button
========================================================== */

.oejch-event-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;

  width: 100%;
  min-height: 44px;
  padding: .7rem 1rem;
  background: linear-gradient(135deg,
      #4738b8,
      #35288d);

  color: #fff !important;
  border: 1px solid #35288d;
  border-radius: 8px;

  font-size: .9rem;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 5px 14px rgb(53 40 141 / 28%);
  transition:
    background .2s ease,
    transform .2s ease,
    box-shadow .2s ease;
}

.oejch-event-link:hover,
.oejch-event-link:focus {
  background: linear-gradient(135deg,
      #35288d,
      #241c68);

  color: #fff !important;
}

.oejch-event-link i {
  color: #fff !important;
}

/* ==========================================================
   Carousel Navigation
========================================================== */

.oejch-events-scroll-btn {
  position: absolute;
  top: 50%;
  z-index: 5;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;
  padding: 0;

  background: var(--oejch-events-purple);
  border: 3px solid #fff;
  border-radius: 50%;

  color: #fff;
  font-size: 1rem;
  line-height: 1;

  cursor: pointer;

  box-shadow:
    0 7px 18px rgb(6 28 96 / 22%);

  transform: translateY(-50%);

  transition:
    background-color 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.oejch-events-scroll-btn:hover {
  background: var(--oejch-events-purple-dark);
  transform: translateY(-50%) scale(1.07);

  box-shadow:
    0 10px 24px rgb(6 28 96 / 28%);
}

.oejch-events-scroll-btn:focus-visible {
  outline: 3px solid var(--green, #7eba00);
  outline-offset: 3px;
}

.oejch-events-scroll-prev {
  left: -20px;
}

.oejch-events-scroll-next {
  right: -20px;
}

.oejch-events-scroll-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: translateY(-50%);
  box-shadow: none;
}

.oejch-events-scroll-btn[hidden] {
  display: none !important;
}

/* ==========================================================
   Loading and Empty States
========================================================== */

.oejch-events-grid[aria-busy="true"] {
  min-height: 250px;
}

.oejch-events-loading,
.oejch-events-message {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 220px;
  box-sizing: border-box;

  padding: 1.5rem;

  background:
    linear-gradient(145deg,
      rgb(99 97 157 / 6%),
      rgb(126 186 0 / 6%));

  border: 1px dashed rgb(99 97 157 / 32%);
  border-radius: 14px;

  color: var(--oejch-events-purple-dark);
  text-align: center;
}

.oejch-events-message-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;

  max-width: 600px;
}

.oejch-events-message-content i {
  color: var(--oejch-events-purple);
  font-size: 3rem;
  opacity: 0.85;
}

.oejch-events-message-content p {
  margin: 0 !important;
  color: #4d5660;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
}

.oejch-events-grid:has(.oejch-events-message) {
  display: flex;
  overflow: visible;
}

/* Loading animation */

.oejch-events-spinner {
  width: 42px;
  height: 42px;

  border: 4px solid rgb(99 97 157 / 18%);
  border-top-color: var(--oejch-events-purple);
  border-radius: 50%;

  animation: oejch-events-spin 0.8s linear infinite;
}

@keyframes oejch-events-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================
   Tablet
========================================================== */

@media (max-width: 980px) {
  .oejch-events-grid {
    grid-auto-columns: calc((100% - 1rem) / 2);
    gap: 1rem;
  }

  .oejch-event-card {
    padding: 1.2rem;
  }

  .oejch-event-top {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 0.85rem;
  }

  .oejch-event-date {
    width: 68px;
    min-height: 78px;
  }
}

/* ==========================================================
   Mobile
========================================================== */

@media (max-width: 880px) {

  .oejch-events-grid {
    grid-auto-columns: 100%;
    gap: 1rem;
    padding: 0.35rem 0 1rem;
  }

  .oejch-event-card {
    width: 100%;
    max-width: 100%;
  }

  .oejch-events-carousel {
    padding: 0 .75rem;
  }

  .oejch-events-scroll-prev {
    left: -10px;
  }

  .oejch-events-scroll-next {
    right: -10px;
  }

  .oejch-events-grid {
    grid-auto-columns: 100%;
    gap: 1rem;
    padding: 0.35rem 0 1rem;

    scroll-padding-left: 0;
    scroll-padding-right: 0;
  }

  .oejch-event-card {
    width: 100%;
    max-width: 100%;
    scroll-snap-align: start;
  }

}

/* ==========================================================
   Small Mobile
========================================================== */

@media (max-width: 480px) {
  .oejch-events-section {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .oejch-events-carousel {
    padding: 0 0.5rem;
  }

  .oejch-event-card {
    padding: 1rem;
    border-left-width: 4px;
    border-radius: 13px;
  }

  .oejch-event-top {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .oejch-event-date {
    width: fit-content;
    min-height: 0;

    flex-direction: row;
    justify-content: flex-start;
    gap: 0.45rem;

    padding: 0.5rem 0.75rem;
    border-radius: 9px;
  }

  .oejch-event-day {
    order: -1;
    margin-top: 0;
    font-size: 1.25rem;
  }

  .oejch-event-month {
    font-size: 0.72rem;
  }

  .oejch-event-heading h3 {
    font-size: 1.05rem;
  }

  .oejch-event-description {
    font-size: 0.92rem;
  }

  .oejch-event-details li {
    font-size: 0.87rem;
  }

  .oejch-events-scroll-btn {
    width: 34px;
    height: 34px;
  }

  .oejch-events-scroll-prev {
    left: -8px;
  }

  .oejch-events-scroll-next {
    right: -8px;
  }

  .oejch-events-carousel {
    padding: 0;
  }

  .oejch-events-grid {
    padding-left: 0;
    padding-right: 0;
  }

  .oejch-events-scroll-prev {
    left: -8px;
  }

  .oejch-events-scroll-next {
    right: -8px;
  }
}

/* ==========================================================
   Reduced Motion
========================================================== */

@media (prefers-reduced-motion: reduce) {
  .oejch-events-grid {
    scroll-behavior: auto;
  }

  .oejch-event-card,
  .oejch-event-link,
  .oejch-events-scroll-btn {
    transition: none;
  }

  .oejch-events-spinner {
    animation-duration: 1.5s;
  }
}