/* Base */
.eventsfb {
  --gap: 16px;
  --cols: 3;          /* default columns */
  --card-w: 300px;    /* used only in horizontal layout */
  --ratio: 16/9;      /* 1/1, 4/3, 3/2 etc */
  width: 100%;
}

/* GRID (default) */
.eventsfb.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  justify-items: start;
}

/* HORIZONTAL SCROLL */
.eventsfb.horizontal {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.eventsfb.horizontal .card {
  flex: 0 0 var(--card-w);
  scroll-snap-align: start;
}

/* Card Link */
.eventsfb .card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease;
}

.eventsfb .card-link:hover {
  transform: translateY(-2px);
}

/* Card */
.eventsfb .card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.eventsfb .media {
  border-radius: 8px 8px 0 0;
}
.eventsfb .card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

/* Media + ratio */
.eventsfb .media {
  aspect-ratio: var(--ratio);
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
}
.eventsfb .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .2s ease;
  position: absolute;
  top: 0;
  left: 0;
}
.eventsfb .card:hover .media img { transform: scale(1.03); }

/* Content */
.eventsfb .content {
  padding: 16px;
  display: grid;
  gap: 8px;
}
.eventsfb .title { font-size: 18px; font-weight: 600; line-height: 1.3; color: #333; }
.eventsfb .meta  { font-size: 14px; color: #666; }
.eventsfb .desc  {
  font-size: 14px; color: #666; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Error (keep simple) */
.eventsfb .error {
  margin: 16px 0; padding: 12px 16px;
  background:#f8d7da; color:#721c24; border:1px solid #f5c6cb; border-radius:6px;
}

/* Responsive – only change columns and padding */
@media (max-width: 900px)  { .eventsfb { --cols: 2; } }
@media (max-width: 600px)  { 
  .eventsfb { --cols: 1 !important; } 
  .eventsfb .content { padding: 12px; }
  .eventsfb .title { font-size: 16px; }
  .eventsfb .card { width: 100% !important; max-width: 100% !important; }
}
