/**
 * Hero — wzor Visit Finland (media.visitfinland.com)
 */

.hero-block {
    background: var(--color-hero-bg);
    color: var(--color-text-on-hero);
    overflow-x: clip;
    overflow-y: visible;
    padding-bottom: var(--hero-block-padding-bottom);
}

/* Obszar naglowka + H1 — szerokosc jak zdjecie (1612px) */
.hero-stage-inner {
    max-width: var(--hero-image-width);
    margin: 0 auto;
    padding: 0 var(--hero-gutter);
    position: relative;
}

/* ── Header — full width, od krawedzi ekranu ── */
.hero-header {
    position: relative;
    z-index: 20;
    width: 100%;
    min-height: 110px;
    overflow: hidden;
    --hero-header-pad-x: 45px;
}

.hero-header .logo {
    position: absolute;
    top: 36px;
    left: var(--hero-header-pad-x);
    z-index: 2;
}

.hero-header .logo img {
    height: 42px;
    width: auto;
    filter: brightness(0) invert(1);
    display: block;
}

.hero-header .nav-main {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.hero-header .nav-links {
    list-style: none;
    display: flex;
    gap: clamp(2.25rem, 5vw, 3.75rem);
    margin: 0;
    padding: 0;
}

.hero-header .nav-links a {
    position: relative;
    display: inline-block;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-white);
    text-decoration: none;
    opacity: 1;
    transition: opacity 0.4s ease;
    white-space: nowrap;
}

.hero-header .nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--color-white);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hero-header .nav-links a:hover {
    opacity: 0.72;
}

.hero-header .nav-links a.active {
    opacity: 1;
}

.hero-header .nav-links a:hover::after,
.hero-header .nav-links a.active::after {
    opacity: 0.85;
}

.hero-header .btn-search {
    position: absolute;
    top: 48px;
    right: var(--hero-header-pad-x);
    z-index: 2;
    display: flex;
    align-items: center;
    color: var(--color-white);
    font-size: 1.35rem;
    text-decoration: none;
    opacity: 0.95;
    line-height: 1;
    transition: opacity var(--transition-fast);
}

.hero-header .btn-search:hover {
    opacity: 1;
    color: var(--color-white);
}

.hero-header .navbar-toggler {
    position: absolute;
    top: 37px;
    right: var(--hero-header-pad-x);
    border: none;
    background: none;
    color: var(--color-white);
    padding: 0.15rem;
    z-index: 2;
    line-height: 1;
}

.hero-header .navbar-toggler i {
    font-size: 2.15rem;
    color: var(--color-white);
}

.hero-header-wave {
    position: absolute;
    left: 0;
    right: 0;
    top: 98px;
    height: 8px;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.hero-header-wave-track {
    display: flex;
    width: 200%;
    height: 100%;
    animation: hero-header-wave-scroll 28s linear infinite;
    will-change: transform;
}

.hero-header-wave-svg {
    flex: 0 0 50%;
    width: 50%;
    height: 100%;
    display: block;
}

.hero-header-wave-svg path {
    fill: none;
    stroke: var(--color-white);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    opacity: var(--hero-nav-wave-opacity);
}

@keyframes hero-header-wave-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* Wariant jasny — podstrony na bialym tle */
.hero-header--light {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
}

.hero-header--light .logo img {
    filter: none;
}

.hero-header--light .nav-links a {
    color: var(--color-text);
}

.hero-header--light .nav-links a::after {
    background: var(--color-primary);
}

.hero-header--light .nav-links a:hover {
    opacity: 1;
    color: var(--color-primary);
}

.hero-header--light .nav-links a.active {
    color: var(--color-primary);
}

.hero-header--light .btn-search {
    color: var(--color-primary);
}

.hero-header--light .btn-search:hover {
    color: var(--color-primary-hover);
}

.hero-header--light .navbar-toggler {
    color: var(--color-text);
}

.hero-header--light .navbar-toggler i {
    color: var(--color-text);
}

@media (prefers-reduced-motion: reduce) {
    .hero-header-wave-track {
        animation: none;
        width: 100%;
    }

    .hero-header-wave-track .hero-header-wave-svg:last-child {
        display: none;
    }
}

/* Offcanvas — menu mobilne z prawej */
.hero-offcanvas {
    width: min(320px, 88vw);
    border-left: none;
    background: var(--color-hero-bg);
    color: var(--color-white);
}

.hero-offcanvas .offcanvas-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-offcanvas .offcanvas-logo img {
    height: 36px;
    width: auto;
    filter: brightness(0) invert(1);
}

.hero-offcanvas-close {
    --bs-btn-close-color: #fff;
    --bs-btn-close-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
    --bs-btn-close-opacity: 1;
    opacity: 1;
    filter: none;
}

.hero-offcanvas .offcanvas-body {
    padding: 1.25rem 1.5rem 2rem;
}

.hero-offcanvas .offcanvas-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hero-offcanvas .offcanvas-nav li {
    margin-bottom: 0.25rem;
}

.hero-offcanvas .offcanvas-nav a {
    display: block;
    padding: 0.85rem 0;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-white);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: opacity var(--transition-fast);
}

.hero-offcanvas .offcanvas-nav a:hover {
    opacity: 0.85;
    color: var(--color-white);
}

.hero-offcanvas .offcanvas-nav-divider {
    height: 1rem;
    border: none;
    margin: 0.5rem 0;
}

/* ── H1 ── */
.hero-headline {
    position: relative;
    z-index: 3;
    text-align: center;
    padding-top: var(--hero-headline-spacing-top);
    padding-bottom: 0;
    margin-bottom: calc(-1 * var(--hero-headline-overlap));
}

.hero-headline h1 {
    font-family: var(--font-headline);
    font-size: var(--hero-headline-size);
    font-weight: 400;
    line-height: var(--hero-headline-line-height);
    letter-spacing: var(--hero-headline-letter-spacing);
    color: var(--color-white);
    margin: 0 auto;
    max-width: 17ch;
    -webkit-font-smoothing: antialiased;
    transform: translateY(var(--hero-headline-offset-y));
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}

.hero-headline .hero-h1-line {
    display: block;
}

/* ── Rząd ze zdjeciem — kreski na cala szerokosc ── */
.hero-media-row {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.hero-media-row::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 100%;
    min-height: var(--hero-image-height);
    background-color: var(--color-hero-bg);
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(210, 218, 255, 0.1) 0 1px,
            transparent 1px 17px,
            rgba(210, 218, 255, 0.06) 17px 18px,
            transparent 18px 39px,
            rgba(220, 228, 255, 0.14) 39px 47px,
            transparent 47px 71px,
            rgba(210, 218, 255, 0.07) 71px 73px,
            transparent 73px 104px,
            rgba(220, 228, 255, 0.12) 104px 112px,
            transparent 112px 128px,
            rgba(210, 218, 255, 0.05) 128px 129px,
            transparent 129px 156px,
            rgba(210, 218, 255, 0.09) 156px 158px,
            transparent 158px 183px,
            rgba(220, 228, 255, 0.16) 183px 192px,
            transparent 192px var(--hero-stripe-step)
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0 23px,
            rgba(210, 218, 255, 0.05) 23px 24px,
            transparent 24px 52px,
            rgba(220, 228, 255, 0.09) 52px 57px,
            transparent 57px 93px,
            rgba(210, 218, 255, 0.07) 93px 95px,
            transparent 95px 141px,
            rgba(220, 228, 255, 0.11) 141px 149px,
            transparent 149px 178px,
            rgba(210, 218, 255, 0.04) 178px 179px,
            transparent 179px 211px
        );
    background-position: 0 0, 37px 0;
    z-index: 0;
}

.hero-media-stack {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: var(--hero-image-width);
    min-width: 0;
    min-height: var(--hero-image-height);
    overflow: visible;
}

.hero-media-stack:has(.api-rez-fields.is-roundtrip) {
    padding-bottom: 1.25rem;
}

.hero-media-stack:has(.api-rez-fields.has-return-route-choice) {
    padding-bottom: 1.75rem;
}

/* Rezerwa wysokosci zdjecia w flow — formularz moze stack rozpychac w dol */
.hero-media-stack::before {
    content: '';
    display: block;
    min-height: var(--hero-image-height);
    flex: 0 0 auto;
    order: 0;
    pointer-events: none;
}

.hero-media-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-media-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hero-image-overlay);
    pointer-events: none;
}

.hero-media-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
}

/* Wyszukiwarka nalozona na zdjecie (dol) — ujemny margines; wysokosc formularza rozpycha stack w dol */
.hero-search {
    position: relative;
    left: auto;
    right: auto;
    width: var(--hero-search-width);
    max-width: calc(100% - 2rem);
    margin: calc(-1 * var(--hero-search-lift) - var(--hero-search-panel-height)) auto 0;
    top: auto;
    bottom: auto;
    z-index: 50;
    transform: none;
    padding: 0;
    overflow: visible;
    flex-shrink: 0;
    order: 1;
}

.hero-search .search-panel {
    --hero-panel-pad-y: clamp(1.35rem, 2.5vw, 2rem);
    --hero-panel-pad-x: clamp(1.25rem, 2.5vw, 2rem);
    position: relative;
    background: var(--color-surface);
    padding: var(--hero-panel-pad-y) var(--hero-panel-pad-x);
    box-shadow: 0 10px 50px rgba(15, 23, 42, 0.15), 0 4px 12px rgba(15, 23, 42, 0.08);
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    border-radius: 12px;
}

.hero-search .api-rez-compact,
.hero-search .api-rez-fields,
.hero-search .api-rez-fields-row {
    max-width: 100%;
    min-width: 0;
}


/* Najczesciej wybierane trasy pod zdjeciem */
.hero-routes {
    position: relative;
    z-index: 2;
    max-width: var(--hero-image-width);
    margin: clamp(1.75rem, 3.5vw, 2.75rem) auto 0;
    padding: 0 var(--hero-gutter) 0.35rem;
    text-align: center;
}

.hero-routes-label {
    margin: 0 0 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.hero-routes-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem 0.65rem;
}

.hero-route-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: var(--radius-pill);
    color: var(--color-white);
    font-size: 1.0625rem;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

.hero-route-tag__label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.25;
}

.hero-route-tag__city {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
}

.hero-route-tag__sep {
    opacity: 0.72;
    font-weight: 400;
}

.hero-route-tag__flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-white);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.95);
    flex-shrink: 0;
}

.hero-route-tag__flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-route-tag:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.55);
    color: var(--color-white);
    opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 991px) and (min-width: 769px) {
    .hero-header {
        --hero-header-pad-x: 32px;
    }
}

@media (max-width: 768px) {
    .hero-block {
        --hero-image-height: clamp(300px, 46vh, 400px);
        --hero-headline-spacing-top: clamp(2.25rem, 7vw, 3.5rem);
        --hero-headline-overlap: clamp(1.25rem, 3.5vw, 2rem);
        --hero-search-lift: clamp(120px, 28vw, 160px);
        --hero-search-panel-height: 9rem;
    }

    .hero-media-row {
        padding: 0;
    }

    .hero-headline .hero-h1-line {
        display: inline;
    }

    .hero-headline h1 {
        max-width: none;
    }

    .hero-stage-inner {
        padding: 0 16px;
    }

    .hero-header {
        --hero-header-pad-x: 16px;
    }

    .hero-header .navbar-toggler {
        top: 35px;
    }

    .hero-header-wave {
        top: 92px;
    }

    .hero-search {
        position: relative;
        left: auto;
        right: auto;
        width: calc(100% - 24px);
        max-width: none;
        top: auto;
        bottom: auto;
        transform: none;
        margin: calc(-1 * var(--hero-search-lift) - var(--hero-search-panel-height)) auto 0;
        z-index: 50;
    }

    .hero-media-stack {
        position: relative;
        min-height: var(--hero-image-height);
        padding-top: 0;
        padding-bottom: 1.25rem;
    }

    .hero-media-image {
        position: absolute;
        inset: 0;
        z-index: 0;
    }

    .hero-media-image img {
        width: 100%;
        height: 100%;
        min-height: var(--hero-image-height);
        object-fit: cover;
        object-position: center 35%;
    }

    .hero-search .search-panel {
        padding: 2rem 1rem 1.25rem;
    }

    .hero-search .api-rez-tabs {
        flex-direction: column;
        gap: 14px;
        margin-top: 0;
        margin-bottom: 1rem;
    }

    .hero-search .api-rez-fields,
    .hero-search .api-rez-fields.is-search-ready,
    .hero-search .api-rez-fields.is-roundtrip,
    .hero-search .api-rez-fields.is-roundtrip.is-search-ready {
        gap: 1rem;
        row-gap: 1rem;
    }

    .hero-search .api-rez-fields-row,
    .hero-search .api-rez-fields-row--top,
    .hero-search .api-rez-fields-row--bottom,
    .hero-search .api-rez-outbound-fields,
    .hero-search .api-rez-return-fields {
        gap: 1rem;
    }

    .hero-search .api-rez-field-btn {
        margin-top: 0.5rem;
    }

    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-field-return-route:not([hidden]) {
        margin-top: 0.5rem;
    }

    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-field-btn {
        margin-top: 0.75rem;
    }

    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-fields-row--top,
    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-fields-row--bottom,
    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-outbound-fields,
    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-return-fields,
    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-field-country,
    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-field-route,
    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-field-return-route,
    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-outbound-fields .api-rez-field,
    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-return-fields .api-rez-field,
    .hero-search .api-rez-fields.is-roundtrip.has-return-route-choice .api-rez-field-pax {
        flex: 0 0 auto;
    }

    .hero-routes-list {
        gap: 0.5rem;
    }

    .hero-route-tag {
        font-size: 0.975rem;
        padding: 0.5rem 0.85rem;
        white-space: normal;
    }

    .hero-route-tag__label {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Wyszukiwarka — pasek postępu + fade-in formularza */
.hero-search .search-panel {
    position: relative;
    overflow: visible;
}

.hero-search .rez-widget-shell--search {
    position: relative;
    overflow: visible;
}

.hero-search .rez-widget-shell--search.is-loading .api-rez {
    visibility: visible;
    opacity: 0;
    pointer-events: none;
}

.hero-search .rez-search-load-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 7;
    height: 5px;
    overflow: hidden;
    background: #b8c4d4;
    border-radius: 12px 12px 0 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hero-search .rez-search-load-bar__shine {
    position: absolute;
    inset: 0 auto 0 0;
    width: 55%;
    background: linear-gradient(90deg, #0a2d7a 0%, #1452cc 18%, #272fc6 42%, #1d4ed8 68%, #2563eb 100%);
    box-shadow: 0 0 10px rgba(29, 78, 216, 0.55);
    animation: rez-search-load-bar 1.15s ease-in-out infinite;
}

.hero-search .search-panel.is-widget-ready .rez-search-load-bar {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes rez-search-load-bar {
    0% { transform: translateX(-105%); }
    100% { transform: translateX(280%); }
}
