:root {
  --page-bg: #efeff6;
  --white: #ffffff;
  --text: #1c1f2b;
  --muted: #626a7a;
  --primary: #24388c;
  --primary-soft: #5c72db;
  --accent: #ffb200;
  --line: #d7dced;
  --radius-lg: 22px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: var(--page-bg);
  padding-top: 160px;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

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

.container--narrow {
  width: min(980px, 92%);
}

.events-section,
.detail-section {
  padding: 2.6rem 0 3.3rem;
}

.section-head {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeIn 1.4s ease both;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  color: var(--primary);
  font-weight: 800;
}

.section-line {
  display: inline-block;
  width: 90px;
  height: 5px;
  margin-top: 0.55rem;
  border-radius: 999px;
  background: var(--accent);
}

.events-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.event-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--white);
  border: 1px solid rgba(36, 56, 140, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.65s cubic-bezier(0.165, 0.84, 0.44, 1);
  animation: slideUp 1.2s ease both;
}

.event-card:nth-child(1) { animation-delay: 0.15s; }
.event-card:nth-child(2) { animation-delay: 0.35s; }
.event-card:nth-child(3) { animation-delay: 0.55s; }
.event-card:nth-child(4) { animation-delay: 0.75s; }
.event-card:nth-child(5) { animation-delay: 0.95s; }
.event-card:nth-child(6) { animation-delay: 1.15s; }

.event-card:hover,
.event-card:focus-visible {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(36, 56, 140, 0.12);
  border-color: var(--primary-soft);
}

.event-card__image {
  margin: 1rem;
  border-radius: var(--radius-md);
  width: calc(100% - 2rem);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.event-card:hover .event-card__image {
  transform: scale(1.03);
}

.event-card__content {
  padding: 0 1.1rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1; /* Ensures the content stretches to fill height */
}

.event-meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.event-card h3 {
  margin: 0 0 0.55rem;
  color: #1f2f76;
  font-size: 1.7rem;
  line-height: 1.2;
  font-weight: 800;
}

.event-card p {
  margin: 0;
  line-height: 1.72;
  font-size: 1rem;
  color: #363c4d;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.back-link:hover {
  transform: translateX(-5px);
}

.event-detail {
  background: var(--white);
  border: 2px solid var(--primary-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.event-detail__cover {
  width: 100%;
  max-height: 430px;
  object-fit: cover;
}

.event-detail__body {
  padding: clamp(1rem, 2.8vw, 2rem);
}

.event-detail__body h1 {
  margin: 0 0 0.8rem;
  color: #1f2f76;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 800;
}

.event-detail__body p {
  margin: 0 0 0.85rem;
  color: #353d50;
  line-height: 1.75;
  font-size: 1rem;
}

.gallery-title {
  margin: 1.5rem 0 0.7rem;
  color: var(--primary);
  font-size: 1.35rem;
}

/* Slideshow Gallery */
.gallery-slideshow {
  margin-top: 0.5rem;
}

.slideshow-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0a1a40;
  aspect-ratio: 16 / 9;
  cursor: grab;
  user-select: none;
}

.slideshow-container .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
  border-radius: 0;
}

.slideshow-container .slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
  z-index: 2;
}

.slide-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.slide-btn.prev {
  left: 12px;
}

.slide-btn.next {
  right: 12px;
}

.slide-counter {
  text-align: center;
  padding: 0.6rem 0 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.slide-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0.4rem 0 0.5rem;
}

.slide-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c7d0ef;
  cursor: pointer;
  transition: all 0.3s ease;
}

.slide-dots .dot.active {
  background: var(--primary);
  transform: scale(1.25);
}

.slide-dots .dot:hover {
  background: var(--primary-soft);
}

.error-box {
  background: #fff6ef;
  border: 1px solid #f0ceae;
  border-radius: 12px;
  padding: 1rem;
}

.muted {
  color: var(--muted);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Social Icons */
.event-card__meta, .event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.event-card-social {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
}

.detail-social-links {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: -4px;
  margin-bottom: 20px;
}

/* Circle button base */
a.event-social-icon,
a.detail-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  overflow: hidden;
}

a.detail-social-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  font-size: 17px;
}

a.event-social-icon i,
a.detail-social-icon i {
  display: block;
  line-height: 1;
  pointer-events: none;
}

/* Brand colours */
a.event-social-icon.linkedin,
a.detail-social-icon.linkedin {
  background: #0077b5;
  color: #fff;
  border: 2px solid #0077b5;
}

a.event-social-icon.youtube,
a.detail-social-icon.youtube {
  background: #ff0000;
  color: #fff;
  border: 2px solid #ff0000;
}

a.event-social-icon.instagram,
a.detail-social-icon.instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
  color: #fff;
  border: 2px solid #d6249f;
}

a.event-social-icon:hover,
a.detail-social-icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.28);
  filter: brightness(1.1);
}

@media (max-width: 768px) {
  .events-section,
  .detail-section {
    padding-top: 2rem;
  }

  .event-card h3 {
    font-size: 1.3rem;
  }

  .slide-btn {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .slide-btn.prev { left: 6px; }
  .slide-btn.next { right: 6px; }
}

