/* ===== TEN/MET FORUM SECTION ===== */
.forum-section {
  background: #f7f5f0;          /* off white, calm background */
  padding: 4rem 1.5rem;
  overflow: hidden;
}

.forum-inner {
  max-width: 1120px;
  margin: 0 auto;
}

/* Header */
.forum-header {
  text-align: center;
  margin-bottom: 2.3rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.forum-title {
  font-size: clamp(2rem, 3vw, 2.4rem);
  font-weight: 800;
  color: #155b3c;
  margin-bottom: 0.6rem;
}

.forum-text {
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.96rem;
  color: #495c53;
  line-height: 1.7;
}

/* Grid */
.forum-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Cards: rectangular, left image (full height) / right content */
.forum-card {
  display: flex;
  align-items: stretch;
  background: #ffffff;
  text-decoration: none;
  color: inherit;

  border-radius: 0.4rem;
  border: 1px solid rgba(14, 117, 194, 0.08);

  min-height: 140px; /* controls card height; increase if needed */
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);

  transform: translateY(18px);
  opacity: 0;

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    opacity 0.3s ease;
}

/* Left image – 100% of card height, no padding/margin */
.forum-card-image {
  flex: 0 0 30%;    /* ~30% width for image */
  position: relative;
}

.forum-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;   /* keeps proportions while filling area */
}

/* Right body */
.forum-card-body {
  flex: 1;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
}

.forum-card-title {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0e75c2;
  margin-bottom: 0.1rem;
}

.forum-card-desc {
  font-size: 0.86rem;
  color: #4a5e56;
  line-height: 1.5;
}

/* CTA button inside card */
.forum-card-cta {
  display: inline-block;
  margin-top: 0.4rem;
  align-self: flex-start;

  padding: 0.45rem 1rem;
  border-radius: 999px;

  background: #0e75c2;
  color: #ffffff;

  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  transition:
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* Hover effects */
.forum-card:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  border-color: rgba(14, 117, 194, 0.35);
  transform: translateY(-3px);
}

.forum-card:hover .forum-card-cta {
  background: #0b5ea0;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
}

/* ===== IN-VIEW / OUT-OF-VIEW ANIMATIONS ===== */
.forum-section.in-view .forum-header {
  opacity: 1;
  transform: translateY(0);
}

.forum-section.in-view .forum-grid {
  opacity: 1;
  transform: translateY(0);
}

.forum-section.in-view .forum-card {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger entrance of cards */
.forum-section.in-view .forum-card:nth-child(1) {
  transition-delay: 0.06s;
}

.forum-section.in-view .forum-card:nth-child(2) {
  transition-delay: 0.12s;
}

.forum-section.in-view .forum-card:nth-child(3) {
  transition-delay: 0.18s;
}

/* When leaving viewport */
.forum-section.out-of-view .forum-header,
.forum-section.out-of-view .forum-grid,
.forum-section.out-of-view .forum-card {
  opacity: 0;
  transform: translateY(30px);
}

/* ===== IMAGE BOUNCE (only while in view) ===== */
@keyframes forumImageBounce {
  0% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(0);
  }
}

/* Apply bounce animation when section is in view */
.forum-section.in-view .forum-card-image img {
  animation: forumImageBounce 3s ease-in-out infinite;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .forum-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .forum-section {
    padding: 3rem 1.2rem;
  }

  .forum-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .forum-card {
    min-height: 130px;
  }

  .forum-card-image {
    flex: 0 0 35%;
  }

  .forum-card-title {
    font-size: 0.95rem;
    letter-spacing: 0.05em;
  }
}
