/* =======================================================
   HG Hero Search Bar
   css/hghero.css — loaded on front page via functions.php
   ======================================================= */

/* -------------------------------------------------------
   Remove GoodLayers default top margin on first section — homepage only
   ------------------------------------------------------- */
body.home .gdlr-core-pbf-section:first-child,
body.page-template-template-homepage .gdlr-core-pbf-section:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* -------------------------------------------------------
   Full-bleed hero section wrapper
   Breaks out of GoodLayers' boxed container via negative-margin technique.
   This is the position:relative root that contains the background layers —
   no reliance on position:fixed (which can be trapped by ancestor transforms).
   ------------------------------------------------------- */
.hg-hero-section-wrap {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
}

/* -------------------------------------------------------
   Position context (required for .hg-hero-bg layer)
   ------------------------------------------------------- */
.hg-home-tour-search-bar {
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

/* -------------------------------------------------------
   Hero Background Layer
   position:absolute fills the full-bleed .hg-hero-section-wrap.
   ------------------------------------------------------- */
.hg-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Parallax bg needs extra height so translateY doesn't expose bare edges */
.hg-hero-bg--parallax {
    top: -15%;
    bottom: -15%;
    height: auto;
}

/* -------------------------------------------------------
   Inner content container — constrains headings + search bar to Bootstrap grid width
   while the background layer fills the full-bleed wrapper behind it
   ------------------------------------------------------- */
.hg-hero-content-container {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Desktop: video fills the fixed full-viewport container */
.hg-hero-bg__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Mobile fallback: image fills the fixed full-viewport container */
.hg-hero-bg__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: none;
}

/* Ensure individual content blocks sit above bg (z-index already set by .hg-hero-content-container) */
.hg-home-tour-search-bar__headings,
.hg-home-tour-search-bar__surface {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Parallax speed = 1: no extra JS needed — bg is already contained by .hg-hero-section-wrap. */
.hg-home-tour-search-bar.hg-hero--parallax-fixed {
    /* retained for back-compat; no-op with absolute bg */
}

/* -------------------------------------------------------
   Vertical centering layout
   ------------------------------------------------------- */

/*
 * Vertical centering: use <div id="hghomesearch"> wrapping .hg-homepage-tour-search
 * (no Goodlayers column selectors needed).
 */
#hghomesearch {
    min-height: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}
#hghomesearch .hg-homepage-tour-search-shortcode,
#hghomesearch .hg-homepage-tour-search.hg-home-tour-search-bar {
    min-height: 0;
    flex: 0 0 auto;
}
.hg-homepage-tour-search-shortcode {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100dvh;
    box-sizing: border-box;
}
.hg-homepage-tour-search.hg-home-tour-search-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100dvh;
    margin-inline: auto;
    box-sizing: border-box;
    margin-top: 0;
}
.hg-homepage-tour-search.hg-home-tour-search-bar .hg-home-tour-search-bar__surface {
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
}

/* -------------------------------------------------------
   Headings block
   ------------------------------------------------------- */
.hg-home-tour-search-bar__headings {
    box-sizing: border-box;
    width: 100%;
    padding: 0 clamp(12px, 3vw, 20px);
    text-align: center;
    color: #ffffff;
    background: transparent;
    box-shadow: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}
.hg-home-tour-search-bar__headings .hg-home-tour-search-bar__eyebrow {
    display: inline-block;
    margin: 0 0 12px 0;
    font-size: var(--hg-hts-hero-h6-size, 14px);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: none;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 4px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.hg-home-tour-search-bar__headings .hg-home-tour-search-bar__title {
    margin: 0;
    font-size: 40px;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: 0.04em;
    color: #ffffff;
    background: transparent;
}
.hg-home-tour-search-bar__headings .hg-home-tour-search-bar__subtitle {
    margin: 0 0 15px 0;
    font-size: 25px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0.01em;
    color: #ffffff;
    background: transparent;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* -------------------------------------------------------
   Search surface (bar container)
   ------------------------------------------------------- */
.hg-home-tour-search-bar__surface {
    box-sizing: border-box;
    width: 100%;
    background: var(--hg-hts-bg, #1a2744);
    border-radius: var(--hg-hts-radius, 18px);
    padding: clamp(12px, 2vw, 16px) clamp(14px, 2.5vw, 20px);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}
.hg-home-tour-search-bar__form {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: clamp(10px, 1.8vw, 14px);
    flex-wrap: nowrap;
}
.hg-home-tour-search-bar__field {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    background: var(--hg-hts-field-bg, #fff);
    border-radius: var(--hg-hts-field-radius, 12px);
    padding: 0 12px 0 14px;
    min-height: 52px;
    position: relative;
    box-sizing: border-box;
}
.hg-home-tour-search-bar__control {
    flex: 1 1 auto;
    min-width: 0;
}
.hg-hts-select-wrap { position: relative; width: 100%; }
.hg-hts-select,
.hg-hts-input {
    width: 100%;
    margin: 0;
    padding: 12px 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: rgba(15, 23, 42, 0.72);
    outline: none;
    box-shadow: none;
}
.hg-hts-input {
    -webkit-appearance: none;
    appearance: none;
}
.hg-hts-select { cursor: pointer; }
.hg-hts-input::placeholder { color: rgba(15, 23, 42, 0.45); }

/* -------------------------------------------------------
   Select2 overrides (scoped to homepage search)
   ------------------------------------------------------- */
.hg-homepage-tour-search .hg-hts-select-wrap--dd .select2-container {
    margin: 0;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100%;
}
.hg-homepage-tour-search .select2-container .select2-selection--single {
    height: auto;
    min-height: 44px;
    border: none !important;
    border-radius: var(--hg-hts-field-radius, 12px);
    background: transparent !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
}
.hg-homepage-tour-search .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 10px 36px 10px 0;
    line-height: 1.35;
    color: rgba(15, 23, 42, 0.88);
    font-size: 16px;
}
.hg-homepage-tour-search .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: rgba(15, 23, 42, 0.45);
}
.hg-homepage-tour-search .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 2px;
    top: 0;
    width: 28px;
}
.hg-homepage-tour-search .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: rgba(15, 23, 42, 0.45) transparent transparent transparent;
    border-width: 6px 5px 0 5px;
    margin-top: -3px;
}
.hg-homepage-tour-search .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent rgba(15, 23, 42, 0.45) transparent;
    border-width: 0 5px 6px 5px;
    margin-top: -4px;
}
.hg-homepage-tour-search .select2-container--default.select2-container--focus .select2-selection--single,
.hg-homepage-tour-search .select2-container--default.select2-container--open .select2-selection--single {
    outline: 2px solid rgba(2, 96, 192, 0.35);
    outline-offset: 1px;
}
.hg-homepage-tour-search .select2-container--open {
    z-index: 100091;
}
.hg-hts-select2-dropdown.select2-dropdown {
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    margin-top: 6px;
}
.hg-hts-select2-dropdown .select2-results > .select2-results__options {
    max-height: min(52vh, 380px);
}
.hg-hts-select2-dropdown .select2-results__option {
    padding: 12px 16px;
    font-size: 16px;
    line-height: 1.35;
    color: rgba(15, 23, 42, 0.88);
}
.hg-hts-select2-dropdown .select2-results__option--highlighted[aria-selected] {
    background: rgba(2, 96, 192, 0.12) !important;
    color: rgba(15, 23, 42, 0.95) !important;
}
.hg-hts-select2-dropdown .select2-results__option[aria-selected="true"] {
    background: rgba(2, 96, 192, 0.08);
    font-weight: 600;
}
.hg-hts-select2-dropdown .select2-search--dropdown {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.hg-hts-select2-dropdown .select2-search--dropdown .select2-search__field {
    font-size: 16px !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(15, 23, 42, 0.15) !important;
    margin: 0;
}

/* -------------------------------------------------------
   Submit button
   ------------------------------------------------------- */
.hg-home-tour-search-bar__submit {
    flex: 0 0 auto;
    align-self: stretch;
    margin: 0;
    padding: 0 clamp(18px, 3vw, 28px);
    border: none;
    border-radius: var(--hg-hts-field-radius, 12px);
    background: var(--hg-hts-btn-bg, #f7a932);
    color: var(--hg-hts-btn-color, #fff);
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.2s ease, transform 0.15s ease;
}
.hg-home-tour-search-bar__submit:hover { filter: brightness(1.05); }
.hg-home-tour-search-bar__submit:active { transform: scale(0.98); }
.hg-hts-datepicker .tourmaster-datepicker { width: 100%; }

/* -------------------------------------------------------
   Trust pillbar
   ------------------------------------------------------- */
.hg-home-tour-search-bar__pillbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 22px;
    padding: 0;
}
.hg-hts-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 10px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.40);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    white-space: nowrap;
    letter-spacing: 0.015em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.hg-hts-pill::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f29c06;
    flex-shrink: 0;
}

/* -------------------------------------------------------
   Mobile overrides  (≤ 782px)
   ------------------------------------------------------- */
@media (max-width: 782px) {
    /* Swap background: hide video, show static image */
    .hg-hero-bg__video { display: none; }
    .hg-hero-bg__img   { display: block; }

    /* Hide subtitle and search form */
    .hg-home-tour-search-bar__subtitle { display: none; }
    .hg-home-tour-search-bar__surface  { display: none; }

    /* Anchor hero content to the bottom */
    #hghomesearch {
        justify-content: flex-end;
        padding-bottom: 0;
    }
    .hg-homepage-tour-search-shortcode {
        min-height: 70dvh;
        justify-content: flex-end;
        align-items: stretch;
    }
    .hg-homepage-tour-search.hg-home-tour-search-bar {
        flex: 1;
        align-self: stretch;
        min-height: 100dvh;
        margin-top: 0;
        justify-content: flex-end;
        align-items: flex-start;
        padding: 0 1.25rem 2.5rem;
    }

    /* Headings: left-aligned column at bottom */
    .hg-home-tour-search-bar__headings {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 0;
        width: 100%;
    }
    .hg-home-tour-search-bar__eyebrow {
        display: none;
    }
    .hg-home-tour-search-bar__title {
        margin: 0 0 0.75rem !important;
        font-size: clamp(1.75rem, 7.5vw, 2.75rem) !important;
        line-height: 1.15;
    }

    /* Pills: left-aligned */
    .hg-home-tour-search-bar__pillbar {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin: 0.75rem 0 0;
    }
}
