/* ==========================================================================
   RBT Bank — Events page sections
   Requires style.css to be loaded first (design tokens).
   ========================================================================== */

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.events-hero {
  background: var(--color-white);
  padding-block: 0;
}

.events-hero__banner-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

/* ── Shared section heading (lines + blue accent bar) ─────────────────────── */

.events-section-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  max-width: 72rem;
  margin-inline: auto;
  margin-bottom: var(--space-10);
}

.events-section-heading__title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 0.4rem;
}

.events-section-heading h2 {
  font-size: var(--font-size-xl);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-navy);
  line-height: 1.2;
  margin: 0;
}

.events-section-heading__accent {
  display: block;
  width: 3.5rem;
  height: 3px;
  background: var(--color-blue);
  border-radius: 2px;
}

.events-section-heading__rule {
  flex: 1;
  height: 1px;
  background: var(--color-border);
  min-width: 2rem;
}

/* ── Event Highlights carousel ────────────────────────────────────────────── */

.events-highlights {
  background: var(--color-white);
  padding-block: var(--space-16) var(--space-16);
}

.events-highlights__carousel {
  padding-inline: 3.5rem;
}

.events-highlights__carousel-inner {
  position: relative;
}

.events-highlights__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-navy);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.events-highlights__arrow:hover {
  color: var(--color-blue);
  border-color: var(--color-blue);
  box-shadow: var(--shadow-md);
}

.events-highlights__arrow.swiper-button-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.events-highlights__arrow--prev {
  left: -3.5rem;
}

.events-highlights__arrow--next {
  right: -3.5rem;
}

.events-highlights .swiper-slide {
  height: auto;
  display: flex;
}

/* ── Highlight card ───────────────────────────────────────────────────────── */

.events-highlight-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* keeps image flush to card edges */
  box-shadow: 0 4px 20px rgba(7, 26, 47, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.07);
  transition:
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}

.events-highlight-card:hover {
  box-shadow: 0 8px 32px rgba(7, 26, 47, 0.16);
  transform: translateY(-4px);
}

/* Title — inside card, blue, centred, with its own padding */
.events-highlight-card h3 {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-blue);
  text-align: center;
  padding: var(--space-5) var(--space-4) var(--space-4);
  line-height: 1.4;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image — flush to card sides, no padding, below title */
.events-highlight-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-section-tint);
  flex-shrink: 0;
}

.events-highlight-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Description — padded, below image, fills remaining card height */
.events-highlight-card p {
  font-size: var(--font-size-2xs, 0.75rem);
  color: var(--color-text-muted);
  line-height: 1.5;
  flex: 1;
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
}

/* ── Timeline ─────────────────────────────────────────────────────────────── */

.events-timeline {
  background: var(--color-white);
  padding-block: var(--space-16) var(--space-20);
}

/* Description paragraph below Timeline heading */
.events-timeline__desc {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: 1.75;
  max-width: 64rem;
  margin-inline: auto;
  margin-bottom: var(--space-10);
  text-align: center;
  background-color: white;
  /* Using the light cyan/blue shade */
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 119, 182, 0.08);
  /* subtle blue shadow */
}


/* ── Album carousel (coverflow) ────────────────────────────────────────────
   Social-post cards on a 3D carousel: the centre album faces the viewer,
   its neighbours are pushed back along Z and angled inward. JS sets only
   --offset / --abs per slide; all the geometry lives here. */

.events-albums {
  --album-w: clamp(15rem, 21vw, 19rem);
  /* 4:5 rather than a taller portrait — these are landscape group photos,
     and anything narrower crops the people out of frame. */
  --album-h: calc(var(--album-w) * 1.25);
  /* Sideways step between neighbours, before perspective foreshortening. */
  --album-gap: calc(var(--album-w) * 0.98);

  background: var(--color-section-tint);
  border-radius: var(--radius-lg);
  padding: var(--space-8) 0 var(--space-6);
  overflow: hidden;
}

.events-albums__stage {
  position: relative;
  height: calc(var(--album-h) + var(--space-4));
}

.events-albums__track {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  perspective: 1400px;
  transform-style: preserve-3d;
}

.events-albums__slide {
  --offset: 0;
  --abs: 0;

  position: absolute;
  top: 0;
  left: 50%;
  width: var(--album-w);
  height: var(--album-h);
  transform:
    translateX(-50%)
    translateX(calc(var(--offset) * var(--album-gap)))
    translateZ(calc(var(--abs) * -11rem))
    rotateY(calc(var(--offset) * -13deg));
  /* Nearer the centre = nearer the front. */
  z-index: calc(10 - var(--abs));
  opacity: calc(1 - var(--abs) * 0.12);
  transition:
    transform var(--duration-slow) var(--ease-out),
    opacity var(--duration-slow) var(--ease-out);
}

/* Far enough out to be irrelevant — keep it out of the way and untabbable. */
.events-albums__slide.is-far {
  opacity: 0;
  pointer-events: none;
}

.events-albums__slide:not(.is-active) {
  cursor: pointer;
}

/* ── Album card ───────────────────────────────────────────────────────────── */

.album-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-navy);
  box-shadow: 0 6px 20px rgba(7, 26, 47, 0.16);
  transition: box-shadow var(--duration-base) var(--ease-out);
}

.events-albums__slide.is-active .album-card {
  box-shadow: 0 18px 44px rgba(7, 26, 47, 0.3);
}

.album-card__media {
  position: absolute;
  inset: 0;
}

.album-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Brand pill, top-left — the "posted by" line of a social card. */
.album-card__badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100% - 4.25rem);
  padding: 0.3rem 0.75rem 0.3rem 0.3rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(7, 26, 47, 0.18);
}

.album-card__avatar {
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: contain;
  background: var(--color-white);
}

.album-card__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.album-card__brand {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.album-card__when {
  font-size: 0.625rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Platform mark, top-right — mirrors the source feed. */
.album-card__platform {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 2;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(7, 26, 47, 0.35));
}

/* Frosted caption panel over the foot of the photo. */
.album-card__panel {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  left: var(--space-3);
  z-index: 2;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(7, 26, 47, 0.18);
}

.album-card__desc {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-2xs);
  color: var(--color-text);
  line-height: 1.5;
  /* Three lines then trail off, like the reference feed. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.album-card__more {
  display: block;
  width: 100%;
  /* 44px keeps it a comfortable touch target. */
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(0, 119, 182, 0.1);
  color: var(--color-blue);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-align: center;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.album-card__more:hover {
  background: var(--color-blue);
  color: var(--color-white);
}

.album-card__more:active {
  transform: scale(0.98);
}

/* ── Carousel arrows ──────────────────────────────────────────────────────── */

.events-albums__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  /* Above every card, including the centre one. */
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--color-white);
  color: var(--color-navy);
  box-shadow: 0 4px 14px rgba(7, 26, 47, 0.2);
  transition:
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.events-albums__arrow:hover:not(:disabled) {
  color: var(--color-blue);
  box-shadow: 0 6px 20px rgba(7, 26, 47, 0.28);
}

.events-albums__arrow:active:not(:disabled) {
  transform: translateY(-50%) scale(0.94);
}

.events-albums__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.events-albums__arrow--prev {
  left: var(--space-6);
}

.events-albums__arrow--next {
  right: var(--space-6);
}

/* ── Year pills (also the carousel's position indicator) ──────────────────── */

.events-albums__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  padding-inline: var(--space-4);
}

.events-albums__dot {
  padding: 0.3rem var(--space-4);
  border: 1.5px solid transparent;
  border-radius: var(--radius-full);
  background: var(--color-white);
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: var(--font-size-2xs);
  font-weight: 600;
  transition:
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.events-albums__dot:hover {
  color: var(--color-blue);
  border-color: var(--color-blue);
}

.events-albums__dot.is-active {
  background: var(--color-blue);
  color: var(--color-white);
}

/* ── Album Social-Post Popup ─────────────────────────────────────────────────
   Matches the EmbedSocial / Instagram-style card design:
   Left half = full photo  |  Right half = avatar · name · year · description
   Opens when "Learn more" is clicked on a Timeline card.                     */

body.has-album-open { overflow: hidden; }

/* ── Outer wrapper (viewport overlay) ── */
.album-popup {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.album-popup[hidden] { display: none; }

.album-popup.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Dark blurred backdrop */
.album-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 24, 0.80);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
}

/* ── Floating × dismiss button (outside the card, top-right corner) ── */
.album-popup__dismiss {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease, transform 0.15s ease;
}

.album-popup__dismiss:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.1);
}

/* ── The white card ── */
.album-popup__card {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(88vw, 820px);
  height: min(85vh, 560px);
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.50),
    0 6px 20px rgba(0, 0, 0, 0.25);
  transform: scale(0.92) translateY(14px);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.album-popup.is-open .album-popup__card {
  transform: scale(1) translateY(0);
}

/* ════════════════════════════════════════
   LEFT — Photo side
   ════════════════════════════════════════ */
.album-popup__photo-side {
  position: relative;
  flex: 0 0 55%;
  background: #111;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Thin vertical separator between photo and panel */
.album-popup__photo-side::after {
  content: "";
  position: absolute;
  inset-block: 0;
  right: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.12);
}

.album-popup__figure {
  margin: 0;
  width: 100%;
  height: 100%;
}

.album-popup__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.album-popup__img.is-loaded { opacity: 1; }

/* Prev/Next arrows — shown only with multiple photos */
.album-popup__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.90);
  color: #111;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.album-popup__nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}

.album-popup__nav[hidden] { display: none; }
.album-popup__nav--prev  { left: 10px; }
.album-popup__nav--next  { right: 10px; }

/* Dot indicators at bottom of photo */
.album-popup__dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  pointer-events: none;
}

.album-popup__dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: background 0.2s ease, transform 0.2s ease;
}

.album-popup__dots .dot.is-active {
  background: #fff;
  transform: scale(1.3);
}

/* ════════════════════════════════════════
   RIGHT — Post detail panel
   ════════════════════════════════════════ */
.album-popup__panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

/* ── Header: avatar · name/year · brand icon ── */
.album-popup__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  flex-shrink: 0;
}

/* Circular avatar with a gradient ring (mirrors Instagram story ring) */
.album-popup__avatar-ring {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #1a3a6e 0%, #0077b6 60%, #48cae4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-popup__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  display: block;
}

/* Name + year stacked */
.album-popup__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.album-popup__name {
  font-size: 0.825rem;
  font-weight: 700;
  color: #0d1b2e;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.album-popup__year {
  font-size: 0.7rem;
  color: #8c96a2;
  display: block;
}

/* Brand icon — top-right, styled like the Instagram icon mark */
.album-popup__brand-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a3a6e 0%, #0077b6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 119, 182, 0.35);
}

.album-popup__brand-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(10);
}

/* ── Thin horizontal rule ── */
.album-popup__rule {
  height: 1px;
  background: #eff2f5;
  flex-shrink: 0;
  margin: 0;
}

/* ── Scrollable description body ── */
.album-popup__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: #d8dde3 transparent;
}

.album-popup__dest {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0d1b2e;
  line-height: 1.35;
}

.album-popup__desc {
  margin: 0;
  font-size: 0.8125rem;
  color: #3d4a57;
  line-height: 1.7;
}

/* ── Footer: photo counter · "View original post →" ── */
.album-popup__footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 12px;
  border-top: 1px solid #eff2f5;
}

.album-popup__counter {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: #8c96a2;
  text-transform: uppercase;
}

.album-popup__view-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.775rem;
  font-weight: 600;
  color: #0077b6;
  text-decoration: none;
  transition: color 0.15s ease, gap 0.15s ease;
}

.album-popup__view-link:hover {
  color: #005f8e;
  gap: 7px;
  text-decoration: underline;
}

/* ── Responsive: stack on narrow screens ── */
@media (max-width: 640px) {
  .album-popup { padding: 10px; }

  .album-popup__card {
    flex-direction: column;
    width: 96vw;
    height: 90vh;
    border-radius: 12px;
  }

  .album-popup__photo-side {
    flex: 0 0 46%;
  }

  .album-popup__photo-side::after { display: none; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .events-albums__slide,
  .album-card,
  .album-popup,
  .album-popup__card,
  .album-popup__img {
    transition: none;
  }

  .album-popup__img { opacity: 1; }
}


