/* =========================================
   VTS EVENTS PLUGIN — COMPLETE CSS
   ========================================= */

/* ---------- GRID LAYOUT ---------- */
.vts-events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
}

/* ---------- CARD CONTAINER ---------- */
.vts-event-card {
  background: #ffffff;
  border: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ---------- LINK ---------- */
.vts-event-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

/* ---------- EVENT IMAGE ---------- */
.vts-event-image {
  height: 220px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
  position: relative;
}

/* ---------- DATE & TIME OVERLAY ---------- */
.vts-event-datetime {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  z-index: 5;
  line-height: 1.2;
  font-family: 'Lato', sans-serif;
  width: auto;
  max-width: 85%;
  box-sizing: border-box;
}

/* ---------- EVENT CONTENT ---------- */
.vts-event-content {
  background: #4f2f26;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  flex-grow: 1;
  border-left: 4px solid rgba(255, 255, 255, 0.04);
  position: relative;
  padding-bottom: 60px; /* space for CTA and divider at bottom */
}
.vts-event-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 0 0; /* remove all margins */
  line-height: 1.3;
  color: #F5E6D3; /* ✅ title in light beige/off-white */
  font-family: 'Lato', sans-serif;
}

/* ---------- DIVIDER LINE (FIXED AT BOTTOM) ---------- */
.vts-event-divider {
  position: absolute;
  bottom: 35px;
  left: 24px;
  right: 24px;
  width: calc(100% - 48px);
  height: 0;
  border-top: 1px solid #F5C77A;
}

/* ---------- CTA LINK (FIXED AT BOTTOM) ---------- */
.vts-event-cta {
  position: absolute;
  bottom: 12px;
  left: 24px;
  right: 24px;
  color: #F5E6D3;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.vts-arrow {
  font-size: 18px; /* increased arrow size */
  margin-left: 5px;
  line-height: 1;
  display: inline-block;
}

/* ---------- EQUAL HEIGHT CARDS ---------- */
.vts-events-grid > .vts-event-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ---------- ACCESSIBILITY ---------- */
.vts-event-card:focus-within {
  outline: 3px solid rgba(0, 0, 0, 0.08);
}

/* ---------- FALLBACK FOR NO EVENTS ---------- */
.vts-no-events {
  padding: 20px;
  background: #f5f5f5;
  text-align: center;
}

/* ---------- FALLBACK FOR EMPTY IMAGE ---------- */
.vts-event-image[style=""] {
  background-color: #ddd;
}

/* ======================================================
   📱 MOBILE RESPONSIVE (Below 767px)
   ====================================================== */
@media (max-width: 767px) {
  .vts-events-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .vts-event-link {
    flex-direction: row;
    align-items: stretch; /* makes both containers equal height */
  }

  /* Image box for mobile - 40% width, smaller height */
  .vts-event-image {
    width: 40%;
    min-width: 40%;
    position: relative;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    min-height: 100px; /* smaller minimum height */
    max-height: 140px; /* limit maximum height */
  }

  /* Content area beside image - 60% width, separate mobile container */
  .vts-event-content {
    width: 60%;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* spread content */
    overflow: hidden; /* prevents overflow */
    min-height: auto; /* no height restriction - grows with title */
  }

  /* ---------- DATE & TIME AT BOTTOM OF IMAGE OVERLAY ---------- */
  .vts-event-datetime {
    position: absolute; /* Keep at bottom of image */
    bottom: 6px;
    left: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #000000;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 3px;
    line-height: 1.2;
    white-space: nowrap; /* keep date/time on one line */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 12px);
  }

  /* Title for mobile - at top, no margin */
  .vts-event-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0; /* no margin */
    padding-bottom: 0; /* no gap */
    color: #F5E6D3; /* ✅ light beige title */
    line-height: 1.3;
    flex-shrink: 0; /* prevents title from shrinking */
    word-wrap: break-word; /* allows long words to break */
    overflow-wrap: break-word; /* modern browsers */
    hyphens: auto; /* adds hyphens for long words */
    max-height: none; /* allows natural growth */
  }

  /* CTA for mobile - align with date/time (both at bottom: 6px) */
  .vts-event-cta {
    font-size: 10px;
    font-weight: 600;
    color: #F5E6D3;
    position: absolute;
    bottom: 6px; /* match date/time overlay position */
    left: 8px;
    right: 8px;
  }

  /* Divider hidden on mobile */
  .vts-event-divider {
    display: none !important;
  }

  .vts-arrow {
    font-size: 12px;
  }
}

/* ======================================================
   💻 TABLET RESPONSIVE (768px–1024px)
   ====================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
  .vts-events-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px; /* smaller gap */
  }

  /* Smaller image for tablet */
  .vts-event-image {
    height: 160px; /* reduced from 220px */
  }

  /* Smaller title for tablet */
  .vts-event-title {
    font-size: 18px; /* reduced from 24px */
    color: #F5E6D3;
    margin: 0 0 0 0;
  }

  /* Smaller content padding */
  .vts-event-content {
    padding: 16px; /* reduced from 24px */
    min-height: 140px; /* reduced from 160px */
  }

  /* Smaller divider for tablet */
  .vts-event-divider {
    margin: 12px 0 6px 0; /* smaller spacing */
  }

  /* Smaller date/time for tablet */
  .vts-event-datetime {
    font-size: 10px; /* smaller font */
    padding: 4px 8px;
  }

  /* Smaller CTA for tablet */
  .vts-event-cta {
    font-size: 12px; /* reduced from 14px */
    color: #F5E6D3;
  }

  .vts-arrow {
    font-size: 16px; /* slightly smaller */
  }
}

