/*
 * Visit Struga — bigger nav text, centered nav, and a proper centered
 * header layout (logo left / nav centered / button right) via CSS grid.
 *
 * This whole block only activates at 1400px and up. Why: the site's JS
 * (mobMenuInit in scripts.js) switches to the mobile hamburger menu below
 * 1064px, implying the desktop nav is meant to work from ~1065px up — but
 * with this site's actual number of nav items (10, several with dropdown
 * carets), the nav alone needs ~866px at the ORIGINAL 13px size, and
 * logo (~211px) + button (~159px) + gaps push the true minimum needed
 * width to about 1380px. A `minmax(max-content, 1fr)` grid column
 * guarantees the nav is never compressed into wrapping, but that means
 * when there isn't enough room, the whole row overflows past the viewport
 * edge instead (which is how the "List your business" button ended up
 * pushed off-screen at 1280–1366px). Below 1400px this block simply
 * doesn't apply, so the theme's original float-based nav (unmodified)
 * handles that range exactly as it did before any of this — not a range
 * we can safely make bigger AND guarantee never overflows.
 *
 * Font-size tiers and the grid's center column are calibrated from actual
 * measured nav widths at each size (866/918/971/1024/1077px for
 * 13–17px), each tier's breakpoint set well past the width where it's
 * needed, with margin for scrollbars/rounding.
 *
 * Below 1400px (see the 1065–1399px block further down): since the
 * desktop nav genuinely needs ~1380px to fit on one line, that range is
 * switched to the same hamburger menu the theme already uses below
 * 1064px, instead of leaving the too-narrow desktop nav in place (where
 * it wrapped onto a second line and overlapped the "List your business"
 * button — e.g. at the common 1366px laptop width). visit-topbar.js
 * carries the matching JS change (same breakpoint) so the hamburger's
 * dropdown is actually populated in that range too.
 */
@media only screen and (min-width: 1400px) {
    /*
     * .nav-holder nav li has a fixed height:70px (style.css) so the
     * dropdown's top:50px offset keeps working, but its <a> is
     * float:left, which sticks to the top of that box instead of
     * centering — leaving the link text ~12px above the row's true
     * center, out of sync with the logo/button which sit centered via
     * .header-inner's align-items:center below. Flexing the li instead
     * centers the <a> inside its 70px box without touching the box's
     * height (so the dropdown offset is untouched).
     */
    .nav-holder nav li {
        margin-left: 2px;
        display: flex;
        align-items: center;
    }

    .nav-holder nav li a {
        padding: 10px 7px;
        font-size: 14px;
    }

    .nav-holder nav li a i {
        padding-left: 3px;
    }

    .add-list {
        padding: 13px 22px;
    }
}

@media only screen and (min-width: 1500px) {
    .nav-holder nav li a {
        font-size: 15px;
    }
}

@media only screen and (min-width: 1600px) {
    .nav-holder nav li a {
        font-size: 16px;
    }
}

@media only screen and (min-width: 1700px) {
    .nav-holder nav li a {
        font-size: 17px;
    }
}

@media only screen and (min-width: 1920px) {
    .nav-holder nav li a {
        font-size: 18px;
    }
}

@media only screen and (min-width: 1400px) {
    .header-inner {
        display: grid;
        grid-template-columns: auto minmax(max-content, 1fr) auto;
        align-items: center;
        column-gap: 12px;
    }

    /*
     * grid-row: 1 on all three items below is load-bearing, not decoration.
     * Their source order is logo, add-list, nav-holder — add-list's column
     * (3) comes before nav-holder's column (2) in that order, and CSS
     * Grid's auto-placement wraps an item to a new implicit row when its
     * column is "behind" the auto-placement cursor's current column.
     * Without pinning grid-row explicitly, that wrapped nav-holder onto
     * its own row, making it sit lower than (and out of vertical sync
     * with) the logo and button.
     */

    .logo-holder {
        float: none;
        position: static;
        grid-column: 1;
        grid-row: 1;
    }

    .nav-holder {
        float: none;
        position: static;
        margin-right: 0;
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
    }

    .add-list {
        float: none;
        position: static;
        grid-column: 3;
        grid-row: 1;
        white-space: nowrap;
    }
}

/*
 * Closes the 1065–1399px gap: same "switch to mobile hamburger menu"
 * rules the theme applies at max-width:1064px (see style.css), just
 * copied here so they also apply up to 1399px. Only the rules that
 * control the nav/hamburger itself are duplicated — unrelated fixes
 * bundled into the theme's original 1064px block (footer, video
 * background, etc.) are left alone since they're not part of this gap.
 */
@media only screen and (min-width: 1065px) and (max-width: 1399px) {
    .nav-button-wrap,
    .mob-bg {
        display: block;
    }

    .main-menu nav ul {
        display: none;
    }

    .main-menu {
        position: absolute;
        top: 80px;
        right: -20px;
        width: 300px;
        z-index: 50;
        padding: 15px 10px;
        background: #fff;
        border-bottom-left-radius: 6px;
        border-left: 1px solid #eee;
        border-bottom: 1px solid #eee;
        visibility: hidden;
        opacity: 0;
        -webkit-transition: all 0.4s ease-in-out;
        transition: all 0.4s ease-in-out;
    }

    .vismobmenu {
        opacity: 1;
        right: 0;
        visibility: visible;
    }

    .menusb {
        display: block;
        float: left;
        position: relative;
        width: 100%;
        overflow: hidden;
    }

    .main-menu .menusb ul {
        display: block;
        float: left;
        position: relative;
        width: 100%;
    }

    .menusb li {
        margin: 0;
        float: left;
        width: 100%;
        position: relative;
        overflow: hidden;
        padding: 0 20px;
    }

    .menusb li i {
        position: absolute;
        right: 18px;
        top: 12px;
    }

    .menusb a {
        float: left;
        width: 100%;
        padding: 8px 5px;
        position: relative;
        font-weight: 700;
        font-size: 14px;
        color: #566985;
        line-height: 20px;
        text-align: left;
    }

    .menusb a i {
        transform: rotate(-90deg);
    }

    .menusb a.back {
        padding-left: 24px;
    }

    .menusb a.back:before {
        font-family: FontAwesome;
        font-style: normal;
        font-weight: normal;
        text-decoration: inherit;
        content: "\f177";
        font-size: 14px;
    }
}

/* Remove the underline bar the theme draws under the active nav link. */
.nav-holder nav li a.act-link:before {
    display: none;
}

/*
 * Shared scroll fix for every navbar dropdown (Discover, Things To Do, Eats
 * & Drinks, Plan Your Stay, Travel info, Your business, ...). One rule per
 * layout mode — not per category — because header.blade.php gives every
 * top-level nav item with a submenu the same markup (li > ul, no per-item
 * class), so these selectors already match all of them automatically; a
 * newly added nav dropdown is covered without touching this file again.
 *
 * style.css's own .nav-holder nav li ul / .main-menu rules have no height
 * cap, so a dropdown with more items than fit between the header and the
 * bottom of the screen used to run off-screen with no way to reach the
 * rest. Both are position:absolute, so capping their own height and
 * scrolling internally (rather than the page) also means opening one never
 * makes the page itself taller/scrollable.
 */

/* Desktop hover dropdown (>=1400px). Scoped to the top-level menu only
   (nav > ul > li > ul), not the nested flyout (nav li ul li ul), so a
   third-level submenu isn't forced into the same box. measured top offset
   of the dropdown from the viewport is a constant ~125px here (topbar +
   header + the theme's 50px gap) regardless of nav width, so a fixed
   pixel offset is safe across breakpoints — only the *available* space
   changes with viewport height, which 100vh accounts for. */
/* Dropdown sizes itself to its longest title (no fixed width, no height cap,
   no overflow) so ordinary menus never get a scrollbar or wrapped titles.
   Only the desktop hover dropdown uses this; below 1400px the nav is the
   slide-in panel and the desktop <ul>s are display:none. */
@media only screen and (min-width: 1400px) {
    .nav-holder nav > ul > li > ul {
        width: max-content;
        min-width: 150px;
        max-width: calc(100vw - 40px);
        overflow: visible;
    }

    /* Floated 100%-wide items resolve against an unsized parent, which
       made max-content far wider than the text; plain blocks size to text. */
    .nav-holder nav li ul li {
        float: none;
        width: auto;
    }

    .nav-holder nav li ul a {
        float: none;
        display: block;
        width: auto;
        white-space: nowrap;
    }

    /* Keep wide dropdowns of the right-most items inside the viewport. */
    .nav-holder nav > ul > li:nth-last-child(-n+2) > ul {
        left: auto;
        right: 0;
    }

    /* Nested flyout: grow with content, open to the left of its parent. */
    .nav-holder nav li ul li ul {
        width: max-content;
        max-width: none;
        left: auto;
        right: 100%;
        margin-left: 0;
        margin-right: 25px;
    }

    .nav-holder nav li ul li:hover > ul {
        margin-right: 0;
    }
}

/*
 * Mobile/tablet slide-in panel — toggled via .vismobmenu, only actually
 * used as a panel below 1400px (style.css switches the nav to this mode
 * at max-width:1064px, and this file's own block above duplicates that
 * for 1065–1399px). IMPORTANT: `.main-menu` is not a separate element —
 * header.blade.php puts both `nav-holder` and `main-menu` on the SAME
 * <div> that wraps the ENTIRE nav at every width (`<div class="nav-holder
 * main-menu">`). Below 1400px JS/CSS repurpose it into the slide-in panel,
 * but at >=1400px it's still the classic horizontal nav bar's own
 * container — capping ITS height unconditionally (as an earlier version
 * of this rule did) breaks the desktop nav by making the whole bar
 * scroll/clip. Gating this behind the same breakpoint that turns it into
 * a panel keeps it from ever touching the desktop nav.
 */
@media only screen and (max-width: 1399px) {
    .main-menu {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .main-menu::-webkit-scrollbar {
        width: 6px;
    }

    .main-menu::-webkit-scrollbar-track {
        background: transparent;
    }

    .main-menu::-webkit-scrollbar-thumb {
        background-color: rgba(77, 183, 254, 0.45);
        border-radius: 4px;
    }

    .main-menu::-webkit-scrollbar-thumb:hover {
        background-color: rgba(77, 183, 254, 0.7);
    }
}

/* Subtle themed scrollbar (matches the site's #4DB7FE accent) instead of
   the browser default, for the desktop dropdown above. Kept unscoped since
   `.nav-holder nav > ul > li > ul` only ever matches the dropdown lists,
   never the nav's own wrapper. */
.nav-holder nav > ul > li > ul {
    scrollbar-width: thin;
    scrollbar-color: rgba(77, 183, 254, 0.45) transparent;
}

.nav-holder nav > ul > li > ul::-webkit-scrollbar {
    width: 6px;
}

.nav-holder nav > ul > li > ul::-webkit-scrollbar-track {
    background: transparent;
}

.nav-holder nav > ul > li > ul::-webkit-scrollbar-thumb {
    background-color: rgba(77, 183, 254, 0.45);
    border-radius: 4px;
}

.nav-holder nav > ul > li > ul::-webkit-scrollbar-thumb:hover {
    background-color: rgba(77, 183, 254, 0.7);
}

/* Firefox scrollbar theming for the mobile/tablet panel, scoped the same
   way as the -webkit rules above. */
@media only screen and (max-width: 1399px) {
    .main-menu {
        scrollbar-width: thin;
        scrollbar-color: rgba(77, 183, 254, 0.45) transparent;
    }
}

/* Visit Struga — topbar utility cluster (search + language) with accent shape */
.visit-navbar-tools {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    padding: 0 26px 0 20px;
    margin-right: -50px;
}

.visit-navbar-tools__shape {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background: -webkit-linear-gradient(left, #3EAAFD, #49CEFF);
    background: linear-gradient(90deg, #3EAAFD, #49CEFF);
    clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%);
}

.visit-navbar-search {
    position: relative;
    display: flex;
    align-items: center;
}

.visit-navbar-search__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.visit-navbar-search input {
    order: 1;
    width: 108px;
    height: 22px;
    padding: 0 2px;
    color: #fff;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
    outline: 0;
    font-family: 'Quicksand', sans-serif;
    font-size: 12px;
    font-weight: 600;
    transition: border-color 160ms ease;
}

.visit-navbar-search input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.visit-navbar-search input:focus {
    border-bottom-color: #fff;
}

.visit-navbar-search button {
    order: 2;
    flex: none;
    width: 22px;
    height: 22px;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 13px;
    transition: transform 160ms ease;
}

.visit-navbar-search button:hover,
.visit-navbar-search button:focus-visible {
    transform: scale(1.1);
}

.visit-navbar-search__results {
    position: absolute;
    z-index: 500;
    top: 32px;
    right: 0;
    width: 320px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 8px 0;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 150ms ease, transform 150ms ease;
}

.visit-navbar-search__results.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.visit-navbar-search__group + .visit-navbar-search__group {
    border-top: 1px solid #f1f1f1;
    margin-top: 6px;
    padding-top: 6px;
}

.visit-navbar-search__group-label {
    padding: 4px 15px;
    color: #9aa5b5;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.visit-navbar-search__item {
    display: block;
    padding: 7px 15px;
    color: #566985;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    white-space: normal;
    transition: background-color 120ms ease, color 120ms ease;
}

.visit-navbar-search__item:hover,
.visit-navbar-search__item:focus-visible {
    color: #16293d;
    background: #f4f8fc;
}

.visit-navbar-search__empty,
.visit-navbar-search__hint {
    padding: 8px 15px;
    color: #9aa5b5;
    font-size: 12px;
}

.visit-topbar a.visit-navbar-lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-left: 12px;
    color: #fff;
    font-family: 'Quicksand', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    transition: opacity 160ms ease;
}

.visit-navbar-lang:hover,
.visit-navbar-lang:focus-visible {
    opacity: 0.72;
}

.visit-navbar-lang .fa-globe {
    font-size: 14px;
}

@media only screen and (max-width: 1480px) {
    .visit-navbar-tools {
        padding-right: 18px;
    }

    .visit-navbar-search input {
        width: 84px;
    }
}

@media only screen and (max-width: 1180px) {
    .visit-navbar-tools {
        padding-left: 0;
    }
}

@media only screen and (max-width: 600px) {
    .visit-navbar-tools {
        gap: 8px;
        padding: 0 16px 0 14px;
    }

    .visit-navbar-search input {
        width: 64px;
    }

    .visit-navbar-search__results {
        width: 90vw;
        max-width: 320px;
        right: -14px;
    }

    .visit-navbar-lang span:last-child {
        display: none;
    }
}
