/* ================================================
   ITS Education Asia — Events Listing Page
   css/style.css
   ================================================ */

/* ── Design tokens ── */
:root {
  --blue:        #0092c8;
  --blue-dark:   #003760;
  --blue-mid:    #085c7b;
  --blue-light:  #ffffff;
  --ink:         #004c69;
  --ink-mid:     #2d5a72;
  --ink-soft:    #6a8fa0;
  --line:        #b8dff0;
  --white:       #ffffff;
  --off-white:   #f8f9fa;
  --radius:      5px;
  --ease:        cubic-bezier(.4, 0, .2, 1);
  --shadow-sm:   0 2px 12px rgba(0, 80, 140, .10), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md:   0 6px 24px rgba(0, 80, 140, .16), 0 2px 6px rgba(0,0,0,.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--off-white);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#events img    { display: block; width: 100%; height: auto; object-fit: cover; }
#events a      { color: inherit; text-decoration: none; }
#events button { font: inherit; cursor: pointer; border: none; background: none; }
#events button:focus {outline: none;}
/* ── Centered content wrapper ── */
.page-featured-title {
    background-color: #003760;
    color: #2e96db;
    line-height: 30px;
    padding: 30px 10px;
    text-align: center;
    text-transform: uppercase;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ================================================
   HERO BANNER
   ================================================ */
.hero {
  background: var(--blue-dark);
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}
.hero__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}
.hero__eyebrow {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}
.hero__title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -.02em;
  margin-bottom: 18px;
}
.hero__sub {
  font-size: .95rem;
  color: rgba(255,255,255,.72);
  max-width: 560px;
  line-height: 1.75;
}
.hero__rule {
  height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, transparent 80%);
  margin-top: 40px;
  opacity: .5;
}

/* ================================================
   EVENTS SECTION
   ================================================ */
.events-section {
  padding: 40px 0 80px;
}

/* ── Tab bar ── */
.tabs {
  display: flex;
  margin-bottom: 40px;
  border-bottom: 2px solid var(--line);
}
.tabs__btn {
  font-family: 'Poppins', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 10px 0;
  margin-right: 36px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color .2s;
  white-space: nowrap;
}
/* Active underline indicator */
.tabs__btn::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: var(--blue);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform .25s var(--ease);
}
.tabs__btn:hover           { color: var(--ink); }
.tabs__btn.is-active       { color: var(--blue); }
.tabs__btn.is-active::after { transform: scaleX(1); }

/* Tab panels — only the active panel is visible */
.tab-panel          { display: none; }
.tab-panel.is-active { display: block; }

/* ================================================
   CARDS GRID  (2 columns, collapses to 1 on mobile)
   ================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

/* ── Individual card ── */
.card {
  position: relative;
  display: inline-block;
  width: 100%;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* Upcoming cards wrap their content in an anchor tag */
.card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* ── Card image ── */
.card__media {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.card__media img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--ease);
}
.card:hover .card__media img { transform: scale(1.04); }

/* Past / expired cards: desaturate the image */
.card--past .card__media img {
  filter: grayscale(1) brightness(.85);
}

/* ── Card body ── */
.card__body {
  padding: 10px 15px 56px; /* bottom padding leaves room for the type label */
}

/* ── Event title ── */
.card__title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  min-height: 60px;
  margin: 12px 0 14px;
}

/* ── Meta row: date and location ── */
.card__meta {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.8;
}
.card__meta li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.card__meta li i {
  margin-top: 4px;
  color: var(--blue);
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}
.card__meta .meta-date strong { font-weight: 600; }
.card__meta .meta-loc em      { font-style: italic; }

/* ── Short event description ── */
.card__desc {
  font-size: .84rem;
  color: var(--ink-mid);
  line-height: 1.65;
  margin-top: 10px;
}

/* ── "Event Completed" note shown on past cards ── */
.card__completed {
  display: block;
  margin-top: 10px;
  font-size: .8rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ── Event type label — pinned to bottom-right of card ── */
.event-type {
  position: absolute;
  right: 0;
  bottom: 10px;
  min-width: 130px;
  border-radius: 3px 0 0 3px;
  color: #ffffff;
  font-weight: 400;
  font-family: 'Poppins', sans-serif;
  padding: 0 12px;
  text-align: center;
  background: var(--blue-mid); /* fallback colour */
}
.event-type span {
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .05em;
  line-height: 30px;
  display: block;
}

/* Colour-coded type labels (semi-transparent) */
.event-type[data-type="Seminar"]      { background: rgba( 20,  80, 185, 0.82); } /* blue   */
.event-type[data-type="Workshop"]     { background: rgba(  4, 110,  70, 0.82); } /* green  */
.event-type[data-type="Webinar"]      { background: rgba( 88,  38, 168, 0.82); } /* purple */
.event-type[data-type="Taster Class"] { background: rgba(175,  28,  88, 0.82); } /* rose   */

/* Past cards: grey out the type label to match the desaturated image */
.card--past .event-type { background: rgba(90, 115, 130, 0.75) !important; }

/* ── Empty state message ── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.9;
}

/* ================================================
   SCROLL REVEAL
   Cards fade + slide up as they enter the viewport
   ================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Slight stagger for the second card in each row */
.grid .card:nth-child(2) { transition-delay: 80ms; }

/* ================================================
   RESPONSIVE BREAKPOINTS
   ================================================ */
@media (max-width: 780px) {
  .events-section { padding: 28px 0 60px; }
  .tabs           { margin-bottom: 28px; }
  .hero__title    { font-size: 1.7rem; }
}

@media (max-width: 560px) {
  .container { padding: 0 16px; }

  /* Single-column grid on small screens */
  .grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }
  .grid .card:nth-child(2) { transition-delay: 0ms; }
  .card__title             { font-size: 1.05rem; }
}
