/* =========================================================
   HOMEPAGE HERO (scoped to .home-page)
   Video background + left hero copy + centred search
   ========================================================= */

.home-page .home-hero{
  position: relative;
  overflow: hidden;
  color: #fff;

  min-height: clamp(620px, 72vh, 780px);
  padding: 34px 0 18px;
  background: #2d3292;

  display: flex;
  align-items: flex-start;
}

.home-page .home-shell{
  width: min(1600px, 92%);
  margin: 0 auto;

  position: relative;
  z-index: 1;
}

/* =========================
   Hero background video
   ========================= */

.home-page .hero-video-bg{
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-page .hero-video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Darken overlay (NO gradient) */
.home-page .hero-video-overlay{
  position: absolute;
  inset: 0;
  background: rgba(45,50,146,0.70);
}

/* =========================
   Header: logo left, nav right
   ========================= */

.home-page .site-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;

  margin-bottom: 34px;
  position: relative;
}

.home-page .logo{
  display: flex;
  align-items: center;
  text-decoration: none;
}

.home-page .logo:link,
.home-page .logo:visited,
.home-page .logo:hover,
.home-page .logo:active{
  text-decoration: none;
}

.home-page .logo-img{
  display: block;
  height: 64px;
  width: auto;
}

.home-page .site-nav{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
}

.home-page .site-nav .nav-link{
  font-family: 'Roboto Slab', serif;
  font-size: 18px;
  font-weight: 300;
  color: #fff;
  text-decoration: none;
}

.home-page .site-nav .nav-link:link,
.home-page .site-nav .nav-link:visited,
.home-page .site-nav .nav-link:hover,
.home-page .site-nav .nav-link:active{
  color: #fff;
}

.home-page .site-nav .nav-link:hover{
  text-decoration: underline;
}

/* =========================
   Mobile hamburger (default hidden)
   ========================= */

.home-page .nav-toggle{
  display: none;
}

/* Optional screen width debugger */
.home-page .screen-width-debug{
  color: rgba(255,255,255,0.85);
  margin: 0 0 12px;
  font-size: 14px;
  display: none;
}

/* =========================
   Hero layout (left copy + breathing room)
   ========================= */

.home-page .hero-grid{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 44px;
  align-items: start;
  text-align: left;
  margin-top: 10px;
}

.home-page .hero-copy{
  max-width: 780px;
}

.home-page .hero-title{
  margin: 0 0 22px;
  font-family: 'Roboto Slab', serif;
  font-size: 52px;
  font-weight: 500;
  line-height: 1.20;
  color: #fff;
}

.home-page .hero-subtitle{
  margin: 0 0 34px;
  font-family: 'Roboto Slab', serif;
  font-size: 18px;
  font-weight: 300;
  color: rgba(255,255,255,0.92);
}

.home-page .hero-cta{
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

/* =========================
   CTA buttons (opaque)
   ========================= */

.home-page .hero-btn{
  display: inline-block;
  border-radius: 25px;
  padding: 12px 22px;

  border: 2px solid rgba(255,255,255,0.95);
  font-family: 'Roboto Slab', serif;
  font-size: 18px;
  font-weight: 400;
  text-decoration: none;
}

.home-page .hero-btn:link,
.home-page .hero-btn:visited,
.home-page .hero-btn:hover,
.home-page .hero-btn:active{
  color: #fff;
}

.home-page .hero-btn-primary{
  background: #4169e1;
  border-color: #4169e1;
}

.home-page .hero-btn-secondary{
  background: #2d3292;
}

.home-page .hero-btn:hover{
  filter: brightness(1.08);
}

/* =========================
   Search band (centred)
   ========================= */

.home-page .home-search-band{
  margin-top: 22px;
  padding-bottom: 8px;

  display: flex;
  justify-content: center;

  width: 100%;
  align-self: stretch;
}

.home-page .home-search-band .search-container{
  background: transparent;

  width: 100%;
  display: flex;
  justify-content: center;
}

.home-page .home-search-band .search-box{
  width: min(980px, 100%);
  margin: 0 auto;

  border-radius: 25px;
  padding: 6px 0 2px;
}

/* =========================================================
   ADVANCED SEARCH (outside hero, below hero)
   ========================================================= */

.home-page #advancedFiltersWrap,
.home-page #advancedOptionsWrap{
  display: none;
  width: min(980px, 100%);
  margin: 28px auto 14px;
  box-sizing: border-box;

  background: #2d3292;
  border-radius: 25px;
  overflow: hidden;

  padding: 14px 18px 10px;
  border: 2px solid rgba(255,255,255,0.14);
}

.home-page #advancedFiltersWrap #filtersContainer,
.home-page #advancedOptionsWrap #filtersContainer{
  width: 100%;
  box-sizing: border-box;
}

/* =========================
   Main (white) area below hero
   ========================= */

.home-page .home-main{
  background: #fff;
  padding-top: 12px;
}

.home-page .site-footer{
  background: #fff;
  padding: 30px 0 40px;
}

.home-page .footer-text{
  margin: 0;
  font-family: 'Roboto Slab', serif;
  font-size: 14px;
  color: #000;
  text-align: center;
}

/* =========================
   Responsive breakpoints
   ========================= */

@media (max-width: 1399px){
  .home-page .hero-title{ font-size: 46px; }
  .home-page .hero-grid{ gap: 34px; }
  .home-page .logo-img{ height: 60px; }
}

@media (min-width: 900px){
  .home-page .home-search-band{
    margin-top: 54px;
    padding-bottom: 0;
  }

  .home-page #searchMessage{
    margin-bottom: 0;
  }

  .home-page #advancedFiltersWrap,
  .home-page #advancedOptionsWrap{
    margin-bottom: 18px;
  }
}

/* =========================================================
   MOBILE NAV (≤899px): hamburger + dropdown panel
   ========================================================= */

@media (max-width: 899px){

  .home-page .homepage-stats{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-page .site-header{
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  html.js .home-page .site-nav{
    display: none;
  }

  .home-page .nav-toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 56px;
    height: 46px;

    border: 2px solid rgba(255,255,255,0.80);
    border-radius: 14px;

    background-color: transparent;
    cursor: pointer;

    padding: 0;
    -webkit-tap-highlight-color: transparent;

    font-size: 0;
    line-height: 0;

    background-image: linear-gradient(#fff 0 0);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 2px;

    position: relative;
  }

  .home-page .nav-toggle::before,
  .home-page .nav-toggle::after{
    content: "";
    position: absolute;
    left: 50%;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;

    transform: translateX(-50%);
  }

  .home-page .nav-toggle::before{ top: 14px; }
  .home-page .nav-toggle::after{ bottom: 14px; }

  .home-page .nav-toggle .nav-toggle-bars{
    display: none;
  }

  .home-page .nav-toggle.is-open{
    background-image: none;
  }

  .home-page .nav-toggle.is-open::before{
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .home-page .nav-toggle.is-open::after{
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  html.js .home-page .site-nav.is-open{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;

    position: absolute;
    z-index: 20;

    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);

    width: min(420px, calc(100vw - 32px));
    box-sizing: border-box;

    padding: 18px 18px;

    border-radius: 18px;
    border: 2px solid rgba(255,255,255,0.35);

    background: rgba(45,50,146,0.88);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  html.js .home-page .site-nav.is-open .nav-link{
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 0;
  }

  .home-page .hero-grid{
    grid-template-columns: 1fr;
    text-align: center;
    margin-top: 6px;
  }

  .home-page .hero-copy{
    max-width: 860px;
    margin: 0 auto;
  }

  .home-page .hero-cta{
    justify-content: center;
  }

  .home-page .home-search-band .search-box{
    width: 100%;
  }

  .home-page .logo-img{
    height: 56px;
  }

  .home-page #advancedFiltersWrap,
  .home-page #advancedOptionsWrap{
    padding: 12px 14px 8px;
  }
}

@media (prefers-reduced-motion: reduce){
  .home-page .hero-video-bg{ display: none; }
}

@media (max-width: 538px){
  .home-page .hero-video-bg{ display: none; }

  .home-page .home-shell{ width: min(1523px, 94%); }

  .home-page .home-hero{
    min-height: auto;
    padding: 22px 0 18px;
  }

  .home-page .logo-img{
    height: 48px;
  }

  .home-page .hero-title{
    font-size: 34px;
    line-height: 1.16;
  }

  .home-page .hero-subtitle{ font-size: 16px; }

  .home-page .hero-btn{
    width: 100%;
    max-width: 360px;
    text-align: center;
  }

  .home-page .home-search-band{
    margin-top: 18px;
    padding-bottom: 6px;
  }
}

/* =========================================================
   HOMEPAGE STATS / COUNTERS
   ========================================================= */

.home-page .homepage-stats{
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin: 0 auto 18px;
  padding: 0 28px;
  box-sizing: border-box;
}

.home-page .homepage-stat-box{
  background: #f5f7ff;
  border: 2px solid rgba(45,50,146,0.14);
  border-radius: 25px;
  padding: 28px 20px 24px;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
}

.home-page .homepage-stat-number{
  margin: 0 0 8px;
  font-family: 'Roboto Slab', serif;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.05;
  color: #2d3292;
}

/* Hide server-rendered totals briefly when JS is enabled,
   then reveal them once the counter script is ready */
html.js .home-page .homepage-stat-number{
  visibility: hidden;
}

html.js .home-page .homepage-stat-number.counter-ready{
  visibility: visible;
}

.home-page .homepage-stat-label{
  font-family: 'Roboto Slab', serif;
  font-size: 18px;
  font-weight: 400;
  color: #000;
}

.home-page .homepage-stats-note{
  margin: 0 0 18px;
  font-family: 'Roboto Slab', serif;
  font-size: 14px;
  font-weight: 300;
  color: #444;
  text-align: center;
}

/* =========================================================
   CATEGORY GRID (bottom of homepage)
   ========================================================= */

.home-page .home-categories{
  background: #fff;
  padding: 34px 0 44px;
}

.home-page .categories-title{
  margin: 0 0 18px;
  font-family: 'Roboto Slab', serif;
  font-size: 24px;
  font-weight: 500;
  color: #000;
  text-align: center;
}

.home-page .category-grid{
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 50px;
}

.home-page .category-card{
  border-radius: 25px;
  overflow: hidden;
  background: #2d3292;
  border: 2px solid rgba(45,50,146,0.12);

  box-shadow: 0 8px 22px rgba(0,0,0,0.12);

  transform: translateZ(0);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;

  cursor: default;

  display: flex;
  flex-direction: column;
  min-height: 360px;

  /* ---- Enhancement (1): enables glow ring + shine overlay ---- */
  position: relative;
  will-change: transform;
}

.home-page .category-card-top,
.home-page .category-card-link{
  cursor: pointer;
}

/* ---- Enhancement (3): tiny shine gradient ---- */
.home-page .category-card::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0) 45%);
}

/* =========================================================
   Category card top link (wraps title + thumbnail)
   ========================================================= */

.home-page .category-card-link{
  display: block;
  color: inherit;
  text-decoration: none;
}

.home-page .category-card-link:link,
.home-page .category-card-link:visited,
.home-page .category-card-link:hover,
.home-page .category-card-link:active{
  color: inherit;
  text-decoration: none; /* override global underline rules */
}

.home-page .category-card-top{
  background: #2a31a1;
  display: flex;
  flex-direction: column;
}

.home-page .category-card-header{
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: center;

  padding: 14px 16px 10px;
}

.home-page .category-icon{
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  margin-left: 6px;
}

.home-page .category-title{
  margin: 0;
  font-family: 'Roboto Slab', serif;
  font-size: 22px;
  font-weight: 500;
  color: #fff;
  line-height: 1.15;
  text-align: left;
}

/* Thumbnail area (CSP-safe): default placeholder, overridden per category below */
.home-page .category-thumb{
  position: relative;
  width: 100%;
  height: 250px;

  background-color: #0b0d2d;
  background-image: url('/images/home/category-thumbnails/placeholder.jpg');

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  filter: saturate(1.05) contrast(1.05);

  /* ---- Enhancement (2): subtle zoom transition ---- */
  transition: transform 240ms ease, filter 240ms ease;
  transform: scale(1);
}

/* =========================
   Per-category thumbnail images
   Put these files in: /images/home/category-thumbnails/
   ========================= */

.home-page .cat-ai-robotics .category-thumb{
  background-image: url('/images/home/category-thumbnails/ai-robotics-conferences-thumbnail.jpg');
}

.home-page .cat-biology-medicine .category-thumb{
  background-image: url('/images/home/category-thumbnails/biology-medicine-conferences-thumbnail.jpg');
}

.home-page .cat-business-governance .category-thumb{
  background-image: url('/images/home/category-thumbnails/business-politics-conferences-thumbnail.jpg');
}

.home-page .cat-computers-internet .category-thumb{
  background-image: url('/images/home/category-thumbnails/computers-internet-conferences-thumbnail.jpg');
}

.home-page .cat-energy-environment .category-thumb{
  background-image: url('/images/home/category-thumbnails/energy-environment-conferences-thumbnail.jpg');
}

.home-page .cat-home-leisure .category-thumb{
  background-image: url('/images/home/category-thumbnails/home-leisure-conferences-thumbnail.jpg');
}

.home-page .cat-military-security .category-thumb{
  background-image: url('/images/home/category-thumbnails/military-security-conferences-thumbnail.jpg');
}

.home-page .cat-nanotechnology .category-thumb{
  background-image: url('/images/home/category-thumbnails/nanotechnology-conferences-thumbnail.jpg');
}

.home-page .cat-physics-chemistry .category-thumb{
  background-image: url('/images/home/category-thumbnails/physics-chemistry-conferences-thumbnail.jpg');
}

.home-page .cat-society-demographics .category-thumb{
  background-image: url('/images/home/category-thumbnails/society-demographics-conferences-thumbnail.jpg');
}

.home-page .cat-space .category-thumb{
  background-image: url('/images/home/category-thumbnails/space-conferences-thumbnail.jpg');
}

.home-page .cat-transport-infrastructure .category-thumb{
  background-image: url('/images/home/category-thumbnails/transport-infrastructure-conferences-thumbnail.jpg');
}

/* Bottom half (light) */
.home-page .category-card-bottom{
  background: #4169e1;
  position: relative;
  padding: 24px 16px 18px;
  flex: 1;
}

/* =========================
   Category mini listings (homepage)
   ========================= */

.home-page .category-card-bottom{
  display: flex;
  flex-direction: column;
}

.home-page .category-mini-list{
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}

.home-page .category-mini-item{
  margin: 0 0 15px;
}

.home-page .category-mini-link{
  text-decoration: none;
}

.home-page .category-mini-title{
  display: block;
  font-family: 'Roboto Slab', serif;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  line-height: 1.25;
}

.home-page .category-mini-link:hover .category-mini-title{
  text-decoration: underline;
}

.home-page .category-mini-meta{
  display: block;
  font-family: 'Roboto Slab', serif;
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.90);
  margin-top: 4px;
}

.home-page .category-mini-empty{
  font-family: 'Roboto Slab', serif;
  font-size: 13px;
  font-weight: 300;
  color: rgba(255,255,255,0.90);
  margin: 0 0 8px;
}

.home-page .category-viewall{
  align-self: center;
  width: fit-content;
  max-width: 33%;
  margin-top: auto;         /* keeps button toward bottom */
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 18px;
  border-color: rgba(255,255,255,0.95);
}

/* Kept for later "Browse categories" page (and any other use) */
.home-page .category-subcats{
  position: relative;
  margin: 0;

  font-family: 'Roboto Slab', serif;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.45;
  color: rgba(255,255,255,0.92);
  text-align: left;
}

/* =========================================================
   Hover / pressed state (JS toggles .is-hover / .is-press)
   Enhancements (1) + (2) + (3)
   ========================================================= */

.home-page .category-card.is-hover{
  transform: scale(1.012);
  box-shadow:
    0 18px 36px rgba(0,0,0,0.18),
    0 0 0 2px rgba(255,255,255,0.22); /* subtle border ring without layout change */
  filter: brightness(1.03);
}

.home-page .category-card.is-hover::after{
  opacity: 1; /* tiny shine gradient */
}

.home-page .category-card.is-hover .category-thumb{
  transform: scale(1.03);
  filter: saturate(1.08) contrast(1.08);
}

.home-page .category-card.is-press{
  transform: scale(1.006);
  box-shadow:
    0 12px 26px rgba(0,0,0,0.16),
    0 0 0 2px rgba(255,255,255,0.14);
  filter: brightness(1.01);
}

/* (Optional) remove thumb zoom during press to avoid "wobble" */
.home-page .category-card.is-press .category-thumb{
  transform: scale(1.02);
}

@media (max-width: 1100px){
  .home-page .category-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px){
  .home-page .categories-title{
    font-size: 20px;
  }

  .home-page .category-grid{
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .home-page .category-card{
    min-height: 330px;
  }

  .home-page .category-title{
    font-size: 20px;
    text-align: left;
  }

  .home-page .category-thumb{
    height: 200px;
  }
  
    .home-page .homepage-stats{
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 0 18px;
  }

  .home-page .homepage-stat-box{
    padding: 24px 18px 20px;
  }

  .home-page .homepage-stat-number{
    font-size: 36px;
  }
  
}