/*
 * EventPrime Categories - Cards fallback CSS
 * Loaded only when EventPrime base styles are not present.
 * Minimal, scoped rules to render cards (images, sizing, flex/grid basics).
 */

.emagic.ep-events-by-category { margin: 20px 0; position: relative; }

.emagic.ep-events-by-category .ep-events.ep-events-grid { 
    display: grid; 
    gap: var(--ep-categories-grid-gap, 20px); 
    margin: 0; 
    padding: 0; 
    list-style: none; 
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--ep-categories-column-width)), 1fr));
}

/* Card container basics */
.emagic.ep-events-by-category .ep-event-card { width: 100%; max-width: 100%; display: flex; flex-direction: column; height: 100%; margin: 0; }
.emagic.ep-events-by-category .ep-event-card .ep-card-wrapper,
.emagic.ep-events-by-category .ep-event-card .ep-card-container { width: 100%; max-width: 100%; flex: 1; }

/* Thumb / image handling */
.ep-box-card-thumb { overflow: hidden; position: relative; }
.ep-box-card-thumb img, .ep-event-cover { display: block; width: 100%; height: auto; max-width: 100%; object-fit: cover; }
.ep-box-w-100 { width: 100% !important; }
.ep-box-h-100 { height: 100% !important; }
.img-fluid { max-width: 100%; height: auto; display: block; }

/* Card inner layout */
.ep-card-content { display: flex; flex-direction: column; height: 100%; }
.ep-card-body { flex: 1; }
.ep-card-footer { margin-top: auto; }

@media (max-width: 768px) {
  .emagic.ep-events-by-category .ep-events.ep-events-grid {
    gap: calc(var(--ep-categories-grid-gap, 20px) * 0.75);
  }
}

@media (max-width: 480px) {
  .emagic.ep-events-by-category .ep-events.ep-events-grid {
    gap: calc(var(--ep-categories-grid-gap, 20px) * 0.5);
  }
}

/* Image transitions and hover scale to mimic EventPrime frontend behaviour */
.emagic .ep-events .ep-box-card-item .ep-box-card-thumb img.ep-event-cover,
.ep-events .ep-box-card-item .ep-box-card-thumb img.ep-event-cover {
  transform: scale(1, 1);
  transition: 2s;
  object-fit: cover;
  width: 100%;
  height: auto;
  height: var(--ep-imageCardHeight, var(--ep-categories-image-height));
  display: block;
}

.emagic .ep-events .ep-box-card-item:hover .ep-box-card-thumb img.ep-event-cover,
.ep-events .ep-box-card-item:hover .ep-box-card-thumb img.ep-event-cover {
  transform: scale(1.02, 1.02);
}

.ep-events .ep-box-card-item .ep-box-card-thumb {
  max-height: var(--ep-imageCardHeight, var(--ep-categories-image-height));
  height: 100%;
  overflow: hidden;
  background-color: rgba(0,0,0,0.03);
}

/* Minimal button styles to approximate EventPrime buttons used on cards */
.emagic .ep-btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  background-color: transparent;
  color: inherit;
  text-align: center;
  cursor: pointer;
  transition: background-color .15s ease-in-out, color .15s ease-in-out, border-color .15s ease-in-out;
}

.emagic .ep-btn:hover {
  opacity: 0.95;
}

.emagic .ep-btn-primary {
  background-color: #0b74d1; /* reasonable default when --themeColor not defined */
  color: #fff !important;
  border-color: #0b74d1;
}

.emagic .ep-btn-primary:hover {
  background-color: #095fa8;
  border-color: #095fa8;
}

/* Ensure footer button alignment */
.ep-card-footer .ep-btn {
  margin-right: 8px;
}

/* Card footer / link basics to mimic EventPrime */
.ep-card-footer {
  padding: 0.5rem 1rem;
  bottom: 0px;
  width: 100%;
  box-sizing: border-box;
}

.ep-card-footer a {
  text-decoration: none !important;
  color: inherit;
}

.ep-card-footer .ep-img-link {
  display: inline-block;
}

/* Footer wrapper absolute positioning fallback used in some EP templates */
.ep-card-footer-wrap {
  position: relative;
}

.ep-card-footer.ep-border-top {
  border-top: 1px solid rgba(0,0,0,0.06);
}
