/**
 * Travel Custom 1.0.1 — Tour card text-flow and price overlap repair.
 *
 * Background: the parent has two-line -webkit-line-clamped titles. Legacy
 * child patches made .nazv-tur overflow:visible!important, allowing the
 * visually hidden third line to paint over the price. Restore overflow:hidden
 * for clamped titles; keep the price in normal layout flow for all tour cards.
 *
 * Shared markup: home + single related Slick carousel, category/all tours
 * grids, and [global_tours] grids. No HTML, text, colors or images changed.
 */

/* Keep the card's familiar appearance, but allow its contents to grow. */
body .bl-tur a.on-tur,
body .bl-all-post a.on-tur,
body .bl-tur-grid a.on-tur {
    height: auto !important;
    min-height: 354px !important;
    min-width: 0;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden;
}

body .bl-tur a.on-tur .top-kart-tur,
body .bl-all-post a.on-tur .top-kart-tur,
body .bl-tur-grid a.on-tur .top-kart-tur {
    flex: 0 0 auto;
}

body .bl-tur a.on-tur .niz-kart-tur,
body .bl-all-post a.on-tur .niz-kart-tur,
body .bl-tur-grid a.on-tur .niz-kart-tur {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    height: auto !important;
    min-width: 0;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box;
    overflow: visible;
}

/* Long locations may wrap to another line; do not crush the location icon. */
body .bl-tur a.on-tur .loc,
body .bl-all-post a.on-tur .loc,
body .bl-tur-grid a.on-tur .loc {
    min-width: 0;
    height: auto !important;
    max-height: none !important;
    flex: 0 0 auto;
}

body .bl-tur a.on-tur .loc span,
body .bl-all-post a.on-tur .loc span,
body .bl-tur-grid a.on-tur .loc span {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Crucial fix: a clamped title MUST hide overflow, or 'hidden' lines
   still paint in the next (price) row. Two lines match the existing design. */
body .bl-tur a.on-tur .nazv-tur,
body .bl-all-post a.on-tur .nazv-tur,
body .bl-tur-grid a.on-tur .nazv-tur {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2;
    overflow: hidden !important;
    white-space: normal !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto;
    overflow-wrap: anywhere;
}

/* The older single-post repair has a very specific overflow:visible rule.
   Override it explicitly so no third/fourth line can bleed into the price. */
body.single-post section.tur.pag-tur .bl-tur a.on-tur .nazv-tur {
    overflow: hidden !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2;
}

/* The custom [global_tours] grid intentionally used three title lines. */
body .bl-tur-grid a.on-tur .nazv-tur {
    -webkit-line-clamp: 3 !important;
    line-clamp: 3;
}

/* Keep original price typography; reserve separation and let long values
   wrap instead of colliding with the title or leaving the card box. */
body .bl-tur a.on-tur .cena,
body .bl-all-post a.on-tur .cena,
body .bl-tur-grid a.on-tur .cena {
    position: static !important;
    display: block !important;
    flex: 0 0 auto;
    margin-top: auto !important;
    padding-top: 8px;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

/* Slick's slide height must follow the card, not a previously cached height.
   This is layout only; slider settings/navigation stay exactly the same. */
body .bl-tur.slick-initialized .slick-track {
    display: flex !important;
    align-items: stretch !important;
    height: auto !important;
}
body .bl-tur.slick-initialized .slick-slide {
    float: none !important;
    height: auto !important;
}

/* Original parent theme uses shorter cards and images on tablet/mobile. */
@media (max-width: 992px) {
    body .bl-tur a.on-tur,
    body .bl-all-post a.on-tur,
    body .bl-tur-grid a.on-tur {
        min-height: 0 !important;
    }
    body .bl-tur a.on-tur { min-height: 269px !important; }
    body .bl-all-post a.on-tur,
    body .bl-tur-grid a.on-tur { min-height: 234px !important; }
}

/* Very narrow grids have too little room for long translated tour prices
   in two columns. Switch only grids (not the existing Slick carousel) to one. */
@media (max-width: 380px) {
    body .bl-all-post a.on-tur,
    body .bl-tur-grid a.on-tur,
    body .bl-tur-grid a.on-tur:nth-child(4n),
    body .bl-tur-grid a.on-tur:nth-child(2n) {
        width: 100% !important;
        margin-right: 0 !important;
    }
}
