/* =========================================================
   Listings page overrides / additions (scoped)
   ========================================================= */

/* =========================================================
   Listings hero: allow category background images + dark overlay
   ========================================================= */

/* Let the background image show through */
.listings-page .home-hero{
  background-color: transparent;
  position: relative; /* needed for ::before overlay */
  overflow: hidden;
}

/* Keep the hero's internal bg transparent too */
.listings-page .hero-video-bg{
  background: transparent;
}

/* Stronger overlay (darken + tame brightness) */
.listings-page .home-hero::before{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(45, 50, 146, 0.65); /* navy tint (acts like "50% opacity") */
  pointer-events: none;
  z-index: 0;
}

/* Make sure the hero content sits above the overlay */
.listings-page .home-hero .home-shell{
  position: relative;
  z-index: 1;
}

/* If you're keeping the existing overlay div, make it transparent so it doesn't double-darken */
.listings-page .hero-video-overlay{
  background: transparent;
}

/* Keep the hero a bit tighter on Listings */
.listings-page .hero-title{
  margin-bottom: 18px;
}


/* =========================================
   Dynamic hero backgrounds per subject
   ========================================= */

.listings-page .listings-hero{
  background-image:
    radial-gradient(circle at 30% 40%, rgba(120,170,255,0.24), rgba(0,0,0,0) 55%),
    linear-gradient(rgba(0,0,0,0.40), rgba(0,0,0,0.40)),
    url('/images/home/listings-default-hero.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* AI */
.listings-page .hero-ai-robotics{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/ai-robotics-conferences.jpg');
}

/* Biology */
.listings-page .hero-biology-medicine{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/biology-medicine-conferences.jpg');
}

/* Business (note filename difference) */
.listings-page .hero-business-governance{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/business-governance-conferences.jpg');
}

/* Continue pattern for remaining subjects */

.listings-page .hero-computers-internet{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/computers-internet-conferences.jpg');
}

.listings-page .hero-energy-environment{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/energy-environment-conferences.jpg');
}

.listings-page .hero-home-leisure{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/home-leisure-conferences.jpg');
}

.listings-page .hero-military-security{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/military-security-conferences.jpg');
}

.listings-page .hero-nanotechnology{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/nanotechnology-conferences.jpg');
}

.listings-page .hero-physics-chemistry{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/physics-chemistry-conferences.jpg');
}

.listings-page .hero-society-demographics{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/society-demographics-conferences.jpg');
}

.listings-page .hero-space{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/space-conferences.jpg');
}

.listings-page .hero-transport-infrastructure{
  background-image:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    url('/images/listings/transport-infrastructure-conferences.jpg');
}


/* =========================================================
   Subject icon bar (sticky, compact, matches your buttons)
   ========================================================= */

/* =========================================================
   Subject icon bar (sticky) + hide modes + close button
   ========================================================= */

.listings-page .subject-bar-wrap{
  position: sticky;
  top: 0;
  z-index: 50;

  background: rgba(45, 50, 146, 0.96);
  border-bottom: 1px solid rgba(255,255,255,0.12);

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  /* NEW: allow smooth collapse + fade */
  overflow: hidden;
  max-height: 245px; /* safely above the bar's real height */
  opacity: 1;
  transform: translateY(0);

  transition: max-height 220ms ease, opacity 200ms ease, transform 200ms ease;
}

/* NEW: hidden state (auto-hide on scroll down, or X closed) */
.listings-page .subject-bar-wrap.is-hidden{
  max-height: 0;                 /* IMPORTANT: collapses height (offsetHeight ~ 0) */
  opacity: 0;
  transform: translateY(-10px);  /* small "slide up" feel */
  border-bottom-color: transparent;
  pointer-events: none;
}

/* Needed to position the close button relative to the shell */
.listings-page .subject-bar-wrap .home-shell{
  position: relative;
}

/* NEW: close (X) button — appears only when scrolled */
.listings-page .subjectbar-close{
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;

  width: 34px;
  height: 34px;
  border-radius: 12px;

  border: 2px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.18);
  color: #fff;

  font-family: 'Roboto Slab', serif;
  font-size: 22px;
  line-height: 0;
  cursor: pointer;

  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease, filter 160ms ease;
}

.listings-page .subject-bar-wrap.is-scrolled .subjectbar-close{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.listings-page .subjectbar-close:hover{
  filter: brightness(1.1);
}

.listings-page .subjectbar-close:focus{
  outline: 2px solid rgba(255,255,255,0.65);
  outline-offset: 2px;
}

/* Bar layout */
.listings-page .subject-bar{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;

  gap: 15px;
  padding: 12px 56px; /* NEW: leaves breathing room for the X button */
}

/* Smooth hide/show without layout shift */
.listings-page .subject-bar-wrap{
  transition: transform 220ms ease, opacity 220ms ease;
  will-change: transform, opacity;
}

/* Hidden state: slide up + disable clicks */
.listings-page .subject-bar-wrap.is-hidden{
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

.listings-page .listings-subtitle[hidden]{
  display: none !important;
}

/* Tighten on small screens */
@media (max-width: 900px){
  .listings-page .subjectbar-close{
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 11px;
    font-size: 20px;
  }

  .listings-page .subject-bar{
    padding: 10px 52px;
  }
}

/* IMPORTANT: override your global A:link/A:hover rules */
.listings-page a.subject-chip:link,
.listings-page a.subject-chip:visited,
.listings-page a.subject-chip:hover,
.listings-page a.subject-chip:active{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 8px;              /* was 10px */
  padding: 8px 12px;     /* was 10px 15px */

  border-radius: 25px;
  background-color: #4169e1;
  border: 2px solid #ffffff;

  text-decoration: none;
  color: #fff;

  font-family: 'Roboto Slab', serif;
  font-size: 16px;       /* was 18px */
  font-weight: 300;
  line-height: normal;

  cursor: pointer;
  transition: background-color 0.3s;
}

/* Icon inside the chip */
.listings-page .subject-chip img{
  vertical-align: middle;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: block;
}

/* Text label (kept simple) */
.listings-page .subject-chip-text{
  color: #fff;
  white-space: nowrap;
}

/* Hover: match your blue-button hover */
.listings-page a.subject-chip:hover{
  background-color: #2d3292;
  text-decoration: none; /* overrides your global underline-on-hover */
}

/* Active chip state */
.listings-page a.subject-chip.is-active{
  background-color: #1f46bf;
}

/* =========================================================
   Responsive behaviour (match your existing approach)
   ========================================================= */

/* Hide labels earlier to keep it tidy (like your ≤538 category-label hide) */
@media (max-width: 900px){
  .listings-page .subject-chip-text{
    display: none;
  }

  .listings-page a.subject-chip:link,
  .listings-page a.subject-chip:visited,
  .listings-page a.subject-chip:hover,
  .listings-page a.subject-chip:active{
    padding: 8px;
    gap: 0;
  }
}

/* If you want icon-only specifically at ≤538px, this keeps it consistent */
@media (max-width: 538px){
  .listings-page .subject-chip-text{
    display: none;
  }
}