/**
 * Homepage "Trending Destinations" bento mosaic
 * (Views/Home/_TrendingDestinations.cshtml).
 *
 * Plain CSS - no Tailwind build step. Phones: two columns. Desktop: four
 * columns by three rows, with a 2x2 feature tile, a tall tile and a wide
 * tile. Each tile: photo, a dark fade at the bottom, the place name, and an
 * "Explore packages" line that slides up on hover/focus. Logical properties
 * keep it correct in RTL; motion stops under prefers-reduced-motion.
 */

.trending {
    --trending-red: #8B2225;
    --trending-gold: #E3B95F;
    --trending-ink: #1F1A17;
    --trending-muted: #6B625C;

    padding-block: 48px 56px;
}

.trending .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

/* ---- Heading row ------------------------------------------------------- */

.trending-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 22px;
}

.trending-title {
    margin: 0;
    color: var(--trending-ink);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.trending-subtitle {
    margin: 8px 0 0;
    color: var(--trending-muted);
    font-size: 15px;
    line-height: 1.55;
}

.trending-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--trending-red);
    font-size: 14.5px;
    font-weight: 800;
    text-decoration: none;
}

.trending-all-icon {
    transition: transform 0.25s ease;
}

.trending-all:hover .trending-all-icon {
    transform: translateX(3px);
}

/* ---- Mosaic ------------------------------------------------------------ */

.trending-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 170px;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.trending-tile-feature,
.trending-tile-wide {
    grid-column: span 2;
}

.trending-tile-feature {
    grid-row: span 2;
}

.trending-tile-tall {
    grid-row: span 2;
}

.trending-link {
    position: relative;
    display: block;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
    background: #E9E3DD;
    color: #FFFFFF;
    text-decoration: none;
    isolation: isolate;
    box-shadow: 0 14px 30px -22px rgba(20, 12, 8, 0.6);
}

.trending-image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.trending-shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(10, 8, 6, 0.78) 0%, rgba(10, 8, 6, 0.25) 45%, rgba(10, 8, 6, 0) 70%);
    transition: background 0.4s ease;
}

.trending-chip {
    position: absolute;
    inset-block-start: 16px;
    inset-inline-start: 16px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px 6px 9px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(14, 10, 8, 0.45);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.trending-chip .material-symbols-outlined {
    color: var(--trending-gold);
    font-size: 17px;
}

.trending-text {
    position: absolute;
    inset-inline: 16px;
    inset-block-end: 14px;
    display: flex;
    flex-direction: column;
}

.trending-country {
    color: rgba(255, 255, 255, 0.85);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.trending-name {
    font-size: 20px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* Hidden below the name until hover/focus, then slides up. */
.trending-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    color: var(--trending-gold);
    font-size: 13.5px;
    font-weight: 800;
    opacity: 0;
    transform: translateY(8px);
    transition: max-height 0.35s ease, margin-top 0.35s ease, opacity 0.3s ease, transform 0.35s ease;
}

.trending-link:hover .trending-image,
.trending-link:focus-visible .trending-image {
    transform: scale(1.07);
}

.trending-link:hover .trending-shade,
.trending-link:focus-visible .trending-shade {
    background: linear-gradient(to top, rgba(10, 8, 6, 0.85) 0%, rgba(10, 8, 6, 0.35) 55%, rgba(10, 8, 6, 0.05) 80%);
}

.trending-link:hover .trending-cta,
.trending-link:focus-visible .trending-cta {
    max-height: 24px;
    margin-top: 6px;
    opacity: 1;
    transform: none;
}

.trending-link:focus-visible,
.trending-all:focus-visible {
    outline: 3px solid var(--trending-red);
    outline-offset: 3px;
}

/* ---- RTL --------------------------------------------------------------- */

[dir="rtl"] .trending-all-icon,
[dir="rtl"] .trending-cta .material-symbols-outlined {
    transform: scaleX(-1);
}

[dir="rtl"] .trending-all:hover .trending-all-icon {
    transform: scaleX(-1) translateX(3px);
}

/* ---- Desktop ----------------------------------------------------------- */
/* 900px = the site's compact breakpoint. */
@media (min-width: 900px) {
    .trending {
        padding-block: 72px 80px;
    }

    .trending-head {
        margin-bottom: 30px;
    }

    .trending-title {
        font-size: 40px;
    }

    .trending-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: 210px;
        gap: 16px;
    }

    .trending-name {
        font-size: 24px;
    }

    .trending-tile-feature .trending-text {
        inset-inline: 26px;
        inset-block-end: 24px;
    }

    .trending-tile-feature .trending-name {
        font-size: 40px;
    }

    .trending-tile-feature .trending-country {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .trending-image,
    .trending-shade,
    .trending-cta,
    .trending-all-icon {
        transition: none;
    }

    .trending-link:hover .trending-image,
    .trending-link:focus-visible .trending-image {
        transform: none;
    }
}
