/*
 * Fleamapket — Scroll Banner
 * stylesheet: assets/css/scroll-banner.css
 *
 * Loaded only on single job_listing pages for logged-out users
 * via wp_enqueue_style() in class-fmk-scroll-banner.php.
 */

/* ==========================================================================
   1. Banner wrapper  (visibility controlled by JS class toggling)
   ========================================================================== */

.fmk-scroll-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 999999;
  pointer-events: none;

  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.45s ease, transform 0.45s ease;

  /* v1.1.4 fix: banner invisible ne bloque plus les clics */
  visibility: hidden;
}

.fmk-scroll-banner.is-visible,
.fmk-scroll-banner.is-hiding {
  visibility: visible;
}

.fmk-scroll-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fmk-scroll-banner.is-hiding {
  opacity: 0;
  transform: translateY(30px);
}


/* ==========================================================================
   2. Card shell
   ========================================================================== */

.fmk-scroll-banner__card {
  pointer-events: auto;
  margin: 0 auto;
  max-width: 980px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 16px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  overflow: hidden;
  position: relative;
}


/* ==========================================================================
   3. Inner grid (text | media)
   ========================================================================== */

.fmk-scroll-banner__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
}


/* ==========================================================================
   4. Content column
   ========================================================================== */

.fmk-scroll-banner__content {
  padding: 14px 14px 14px 16px;
}

.fmk-scroll-banner__title {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
}

.fmk-scroll-banner__text {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  opacity: 0.9;
}

.fmk-scroll-banner__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}


/* ==========================================================================
   5. Buttons
   ========================================================================== */

.fmk-scroll-banner__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}

/* Primary */
.fmk-scroll-banner__btn--primary {
  background: #111;
  color: #fff;
  border-color: #111;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.fmk-scroll-banner__btn--primary:hover {
  background: #333;
  border-color: #333;
  color: #fff !important;
  transform: translateY(-1px);
}

/* Ghost */
.fmk-scroll-banner__btn--ghost {
  background: transparent;
  color: #111;
  transition: background 0.2s ease, transform 0.2s ease;
}

.fmk-scroll-banner__btn--ghost:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}


/* ==========================================================================
   6. Media column  (GIF / image on the right)
   ========================================================================== */

.fmk-scroll-banner__media {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;  /* ← réduis le padding pour compacter le bloc */
}

.fmk-scroll-banner__media img {
  position: relative;
  z-index: 0;
  width: auto;
  max-height: 140px;  /* ← réduis cette valeur, ex: 120px */
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Soft left-edge gradient so the image blends into the card */
.fmk-scroll-banner__media::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 55%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: 1;
}


/* ==========================================================================
   7. Close button
   ========================================================================== */

.fmk-scroll-banner__close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 18px;
  line-height: 32px;
  text-align: center;
  z-index: 5;
  transition: background 0.15s ease;
}

.fmk-scroll-banner__close:hover {
  background: rgba(0, 0, 0, 0.06);
}


/* ==========================================================================
   8. Responsive — mobile  (≤ 720 px)
   ========================================================================== */

@media (max-width: 720px) {

  /* Switch to vertical flex: media on top, content below */
  .fmk-scroll-banner__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .fmk-scroll-banner__media {
    order: -1;
    height: 140px;
    padding: 10px 16px 0;  /* ← réduis le padding pour compacter le bloc */
  }

  .fmk-scroll-banner__media img {
    max-height: 160px;  /* ← réduis aussi ici, ex: 80px */
    width: auto;
    height: auto;
  }

  .fmk-scroll-banner__content {
    order: 1;
    padding: 16px 16px 18px;
  }

  .fmk-scroll-banner__title {
    font-size: 22px;
    line-height: 1.25;
    font-weight: 900;
    margin-right: 44px; /* clearance for the × button */
    overflow-wrap: anywhere;
  }

  .fmk-scroll-banner__text {
    font-size: 16px;
    line-height: 1.35;
  }
}

