/* =========================================================
   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);

  /* More breathing room overall (but less wasted space at bottom) */
  padding: 34px 0 18px;

  /* Fallback colour if video can't play */
  background: #2d3292;

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

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

  /* content must sit above video */
  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 + apply your house-style gradient feel on top of the video */
.home-page .hero-video-overlay{
  position: absolute;
  inset: 0;

  background: linear-gradient(
    180deg,
    rgba(45,50,146,0.84) 0%,
    rgba(45,50,146,0.66) 30%,
    rgba(56,80,200,0.58) 65%,
    rgba(65,105,225,0.58) 100%
  );
}

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

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

  margin-bottom: 34px;

  /* Needed so the mobile dropdown can anchor to the header */
  position: relative;
}

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

/* Override global A rules */
.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; /* shown only at ≤899px */
}

/* 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)
   Markup:
   <div class="home-shell">
     <div id="advancedFiltersWrap" class="advanced-filters-wrap">
       <div id="filtersContainer">...</div>
     </div>
   </div>

   Goals:
   - EXACT same width as .search-box (min(980px, 100%))
   - Centred
   - Dark blue background (#2d3292)
   - Rounded corners
   - Small gap above recordsInfo
   ========================================================= */

.home-page #advancedFiltersWrap,
.home-page #advancedOptionsWrap{
  display: none;                 /* JS uses slideDown/slideUp */
  width: min(980px, 100%);       /* MATCHES .search-box */
  margin: 28px auto 14px;        /* centred + breathing room */
  box-sizing: border-box;        /* keep visible width consistent */

  background: #2d3292;
  border-radius: 25px;
  overflow: hidden;              /* clip to rounded corners */

  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
   ========================= */

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

/* Desktop: increase CTA → search gap and remove phantom bottom space */
@media (min-width: 900px){
  .home-page .home-search-band{
    margin-top: 54px;
    padding-bottom: 0;
  }

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

  /* Slightly more breathing room above recordsInfo on desktop */
  .home-page #advancedFiltersWrap,
  .home-page #advancedOptionsWrap{
    margin-bottom: 18px;
  }
}

/* =========================================================
   MOBILE NAV (≤899px): hamburger + dropdown panel
   Key change: hamburger icon is CSS-drawn (not dependent on inner spans)
   ========================================================= */

@media (max-width: 899px){

  /* Header stays row layout so logo left + burger right */
  .home-page .site-header{
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  /* Only hide the nav on mobile if JS is present */
  html.js .home-page .site-nav{
    display: none;
  }

  /* Show hamburger button */
  .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;

    /* Prevent any stray text glyphs */
    font-size: 0;
    line-height: 0;

    /* Middle line (closed state) */
    background-image: linear-gradient(#fff 0 0);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 2px;

    position: relative;
  }

  /* Top + bottom lines (closed state) */
  .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; }

  /* Optional: hide the inner spans so they can't be affected by other code */
  .home-page .nav-toggle .nav-toggle-bars{
    display: none;
  }

  /* OPEN state: draw an X with the pseudo-elements */
  .home-page .nav-toggle.is-open{
    background-image: none; /* hide middle line */
  }

  .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);
  }

  /* Dropdown panel (nav) when open */
  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: linear-gradient(
      180deg,
      rgba(45,50,146,0.78) 0%,
      rgba(65,105,225,0.45) 100%
    );

    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;
  }

  /* Centre hero copy like before */
  .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;
  }

  /* Advanced panel padding slightly tighter on mobile */
  .home-page #advancedFiltersWrap,
  .home-page #advancedOptionsWrap{
    padding: 12px 14px 8px;
  }
}

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

/* ≤538px (mobile) */
@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;
  }
}
