:root {
  --brand: #bf023f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f7f7f5;
}

.event-detail-section {
  padding: clamp(24px, 4vw, 50px) clamp(12px, 2vw, 15px);
}

.container {
  max-width: min(92%, 700px);
  margin: 0 auto;
}

/* Banner */
.event-detail-banner {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: clamp(16px, 2.5vw, 24px);
  background: #fff;
  border: 1px solid #eee;
}

.event-detail-banner img {
  width: 100%;
  height: clamp(180px, 32vw, 90%);
  object-fit: cover;
  display: block;
  background: #f0f0ee;
}

/* Badge */
.event-badge {
  display: inline-block !important;
  font-size: clamp(0.68rem, 0.9vw, 0.75rem) !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  padding: 5px 14px !important;
  border-radius: 20px !important;
  color: #fff !important;
  background: #6b7280 !important;  /* fallback grey so it's never invisible */
  margin-bottom: 12px !important;
  border: none !important;
  line-height: 1.4 !important;
}
.event-badge.upcoming { background: #16a34a !important; }
.event-badge.completed { background: #6b7280 !important; }
.event-badge.ongoing { background: #f59e0b !important; }
.event-badge.cancelled { background: #dc2626 !important; }

/* Title & meta */
.event-detail-title {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 800;
  margin: 0 0 8px;
  color: #1a1a1a;
}

.event-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 1.6vw, 18px);
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  color: #666;
  margin: 0 0 18px;
  list-style: none;
  padding: 0;
}

.event-detail-desc {
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  color: #444;
  line-height: 1.7;
  margin-bottom: 24px;
}

.event-register-cta {
  display: inline-block;
  background: var(--brand);
  color: #fff !important;
  text-decoration: none !important;
  padding: clamp(9px, 1.2vw, 11px) clamp(20px, 2.5vw, 26px);
  border-radius: 8px;
  font-weight: 700;
  font-size: clamp(0.82rem, 1vw, 0.9rem);
  margin-bottom: 30px;
  transition: background 0.18s, transform 0.15s;
}

.event-register-cta:hover {
  background: #8f0230;
  transform: translateY(-1px);
  color: #fff !important;
}

/* Divider */
.event-divider {
  border: none;
  border-top: 1px solid #e5e5e3;
  margin: 24px 0;
}

/* Gallery */
.event-gallery-section h3 {
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  font-weight: 700;
  color: #222;
  margin: 0 0 16px;
}

.event-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 1.2vw, 12px);
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item.hidden-item {
  display: none;
}

.gallery-item.more-count img {
  filter: brightness(0.45);
}

.gallery-item.more-count .more-count-label {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

.gallery-empty {
  font-size: 0.9rem;
  color: #999;
  padding: 20px 0;
}

.gallery-hint {
  font-size: clamp(0.75rem, 0.9vw, 0.8rem);
  color: #999;
  margin-top: 12px;
}

/* Lightbox */
.gallery-lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: zoom-out;
}
.gallery-lightbox.active { display: flex; }
.gallery-lightbox img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 30px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  padding: 10px 16px;
  user-select: none;
}
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

/* Back link */
.back-link {
  display: inline-block;
  margin-top: 20px;
  padding: clamp(8px, 1.1vw, 10px) clamp(16px, 2.2vw, 22px);
  background: #fff;
  border: 2px solid var(--brand);
  color: var(--brand);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(0.82rem, 1vw, 0.9rem);
}
@media (max-width: 576px) {
  .event-gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .event-detail-banner img { height: auto; }
  .event-detail-section{ padding: 20px 10px;}
  .event-detail-banner{ margin-bottom: 10px; }
}
@media (min-width: 992px) and (max-width: 1512px) {
  main {
    zoom: 0.8;
  }
}