@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;600&family=Barlow+Condensed:wght@700;800&display=swap');

/* ── wrapper ── */
.fmg-grid-wrapper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  height: var(--fmg-grid-height, 600px);
  overflow: hidden;
  background: transparent;
  font-family: 'Barlow', sans-serif;
}

/* ── fade top / bottom edges ── */
.fmg-fade-top,
.fmg-fade-bot {
  position: absolute;
  left: 0; right: 0;
  height: 80px;
  pointer-events: none;
  z-index: 0;
}
.fmg-fade-top { top: 0;    background: linear-gradient(to bottom, #0e0e0e 0%, transparent 100%); }
.fmg-fade-bot { bottom: 0; background: linear-gradient(to top,    #0e0e0e 0%, transparent 100%); }

/* ── column ── */
.fmg-col {
  overflow: hidden;
  position: relative;
}

/* inner strip — scrolled via JS transform */
.fmg-col-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  will-change: transform;
}

/* pause on column hover */
.fmg-col:hover .fmg-col-inner {
  animation-play-state: paused !important;
}

/* ── card ── */
.fmg-card {
  display: block;
  flex-shrink: 0;
  height: var(--fmg-card-height, 340px);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  color: #fff;
  background: #111;
  cursor: pointer;
}

/* bg image */
.fmg-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(.75) saturate(1.1);
  transition: filter .4s ease, transform .5s ease;
}
.fmg-card:hover .fmg-card-bg {
  filter: brightness(.55) saturate(1.2);
  transform: scale(1.05);
}

/* gradient overlay */
.fmg-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.85) 0%,
    rgba(0,0,0,.2)  50%,
    transparent     100%
  );
}

/* content */
.fmg-card-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 18px 18px 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.fmg-card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin: 0;
  color: #fff;
  line-height: 1.2;
  flex: 1;
}

/* arrow circle */
.fmg-card-arrow {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s, transform .3s, background .25s, border-color .25s;
}
.fmg-card-arrow svg { width: 14px; height: 14px; }
.fmg-card:hover .fmg-card-arrow {
  opacity: 1;
  transform: translateY(0);
  background: #c81e1e;
  border-color: #c81e1e;
}

/* ── red top-border accent on hover ── */
.fmg-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #c81e1e;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
  z-index: 3;
}
.fmg-card:hover::before { transform: scaleX(1); }

/* ── responsive ── */
@media (max-width: 768px) {
  /* Keep 3 columns, show all — override old hide */
  .fmg-grid-wrapper {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    /* Shrink grid height to a scrollable window on mobile */
    height: var(--fmg-mobile-grid-height, 320px);
  }

  .fmg-col:nth-child(3) { display: block; } /* was hidden — show it */

  .fmg-col-inner {
    gap: 6px;
  }

  /* Mobile card height: cap at 130px */
  .fmg-card {
    height: var(--fmg-mobile-card-height, 130px);
    border-radius: 6px;
  }

  /* Tighter content padding on small cards */
  .fmg-card-content {
    padding: 8px 8px 10px;
    gap: 6px;
  }

  .fmg-card-title {
    font-size: 11px;
    line-height: 1.2;
    /* Clamp to 2 lines max so it fits in small cards */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Arrow too big for 130px card — shrink it */
  .fmg-card-arrow {
    width: 24px;
    height: 24px;
  }
  .fmg-card-arrow svg { width: 10px; height: 10px; }

  /* Shorter fades so they don't eat the small cards */
  .fmg-fade-top,
  .fmg-fade-bot {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .fmg-grid-wrapper {
    gap: 5px;
  }
  .fmg-card-title { font-size: 10px; }
}
