/* Tour grid card — used by /tours (tours/index) and by any Page's [tours]
   shortcode (see App\Support\PageShortcodes). */

.tour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1.25rem;
}

/* auto-fill's 16rem minimum only ever fits 1 column on a phone —
   force 2 up instead, with the cards themselves scaled down to match
   (the desktop card's padding/image height look cramped at half width). */
@media (max-width: 40rem) {
    .tour-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .tour-card-body {
        padding: 0.75rem;
    }

    .tour-card h2 {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }

    .tour-price {
        font-size: 0.875rem;
    }
}

.tour-show-more {
    display: block;
    margin: 1.5rem auto 0;
    border: none;
    cursor: pointer;
}

.tour-show-more:disabled {
    opacity: 0.6;
    cursor: default;
}

.tour-card {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    /* Grid's default align-items:stretch makes every card in a row
       match the tallest one — a card with a shorter (1-line) title
       ended up taller than its own content, leaving a gap at the
       bottom that showed this element's own gray background as a
       stray strip. flex + flex:1 on the body (below) fills that gap
       with the body's own white background instead. */
    display: flex;
    flex-direction: column;
}

.tour-card img {
    width: 100%;
    /* The <img> tag also carries width="320" height="160" HTML
       attributes (a layout-shift guard for before this CSS loads) —
       those act as low-specificity presentational hints, but a definite
       height from ANY source (attribute or CSS) makes aspect-ratio get
       ignored entirely per the CSS sizing spec, since both dimensions
       already have a definite value. height:auto here is what actually
       lets aspect-ratio take over. */
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #e2e8f0;
}

.tour-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
}

.favorite-like-card {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
}

.tour-card-bottom {
    /* Pins region + rating/price together to the card's bottom edge,
       regardless of how many lines the title above wraps to — so both
       the region line and the price row land on the same horizontal
       line across every card, not just the price row on its own. */
    margin-top: auto;
}

.tour-card-region {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.tour-card-region svg {
    flex-shrink: 0;
}

.tour-card-duration {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.tour-card-duration svg {
    flex-shrink: 0;
}

.tour-card h2 {
    font-size: 0.9375rem;
    /* Browser default h2 weight is 700 — noticeably heavy at this size
       with Inter specifically. 600 (already self-hosted) reads as a
       clear title without looking as dense. */
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.5rem;
    /* .tour-section h2 (tour.css) sets padding-top:0.5rem and has the
       exact same selector specificity as this rule — on pages where a
       .tour-grid lives inside a .tour-section (e.g. /tours), that
       padding-top leaked onto card titles too since this rule never
       overrode it. Explicit 0 here, unconditionally. */
    padding-top: 0;
}

.tour-card-footer {
    display: flex;
    /* flex-end, not center — .tour-price is two lines ("From" label +
       amount) while .tour-card-rating is one, so centering left the
       rating floating above the price's actual amount instead of level
       with it. flex-end lines both up on the amount's own baseline. */
    align-items: flex-end;
    /* Bottom-pinning itself now lives on the parent .tour-card-bottom
       (so the region line above moves down together with this row
       instead of staying wherever the title happened to end) — just the
       small gap below the region line here. */
    padding-top: 0.5rem;
}

.tour-card-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.tour-card-star {
    color: #f59e0b;
}

.tour-card-review-count {
    color: #64748b;
    font-weight: 400;
}

.tour-price {
    /* Sits on the right whether or not .tour-card-rating is present —
       relying on justify-content:space-between instead would collapse
       to the left edge on a card with no reviews yet (only one flex
       child, nothing to space between). */
    margin-left: auto;
    text-align: right;
    font-weight: 600;
    font-size: 1.0625rem;
}

.tour-price-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 400;
    color: #64748b;
}

.tour-price .tour-cost {
    color: #64748b;
    font-weight: 400;
    font-size: 0.8125rem;
    text-decoration: line-through;
    margin-right: 0.375rem;
}
