/* Top Destination Section - Server-side Continuous Scroll After 4 Cards */
.top-destination-section {
    width: 100%;
    background: var(--td-bg);
    color: var(--td-text);
    padding: 34px 0 70px;
    overflow: visible;
}

.td-container {
    width: min(1480px, calc(100% - 64px));
    margin: 0 auto;
    overflow: visible;
}

.td-top-grid {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 80px;
    align-items: start;
}

.td-heading-wrap h2 {
    margin: 0;
    font-size: clamp(46px, 4.4vw, 78px);
    line-height: 1.18;
    letter-spacing: -.045em;
    font-weight: 400;
    color: var(--td-text);
    font-family: var(--lumana-header-font);
}

.td-heading-wrap em {
    font-style: italic;
    color: var(--td-muted);
}

.td-intro-wrap {
    padding-top: 10px;
}

.td-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 22px 10px 12px;
    border-radius: 999px;
    background: #f1f1f1;
    color: var(--td-text);
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 66px;
    box-shadow: inset 0 0 0 1px rgba(2, 6, 23, .02);
}

.td-badge span {
    width: 18px;
    height: 18px;
    display: block;
    border-radius: 50%;
    background: var(--td-dot);
    box-shadow: 0 0 0 14px rgba(2, 6, 23, .04);
}

.td-intro-wrap p {
    max-width: 720px;
    margin: 0;
    color: var(--td-muted);
    font-size: 20px;
    line-height: 1.45;
    font-weight: 500;
}

/* Static layout: 4 cards or less */
.td-card-grid {
    margin-top: 92px;
    padding-top: 36px;
    padding-bottom: 36px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 44px;
    align-items: stretch;
    overflow: visible;
}

/* Scrolling layout: 5 cards or more */
.td-card-grid.td-scroll-enabled {
    display: block;
    overflow: hidden;
    width: 100%;
    padding: 76px 0 76px;
    margin-top: 54px;
}

.td-scroll-track {
    display: flex;
    gap: 44px;
    width: max-content;
    align-items: stretch;
    animation: tdDestinationAutoScroll var(--td-scroll-speed, 34s) linear infinite;
    will-change: transform;
    padding: 0;
}

.td-scroll-enabled .td-card {
    flex: 0 0 calc((min(1480px, calc(100vw - 64px)) - 132px) / 4);
    width: calc((min(1480px, calc(100vw - 64px)) - 132px) / 4);
}

@keyframes tdDestinationAutoScroll {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.td-card,
.td-card:nth-child(2) {
    position: relative;
    height: 540px;
    border-radius: var(--td-radius);
    overflow: hidden;
    background: #e5e7eb;
    box-shadow: 0 18px 38px rgba(15, 23, 42, .08);
    transition: transform .35s ease, box-shadow .35s ease, z-index .35s ease;
    z-index: 1;
    transform: none;
    transform-origin: center center;
}

.td-card:hover,
.td-card.td-hovered,
.td-card:nth-child(2):hover,
.td-card:nth-child(2).td-hovered {
    transform: scale(1.06);
    box-shadow: 0 36px 80px rgba(15, 23, 42, .24);
    z-index: 20;
}

.td-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .45s ease, filter .45s ease;
}

.td-card:hover img,
.td-card.td-hovered img {
    transform: scale(1.07);
    filter: brightness(.78) contrast(1.06);
}

.td-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, .04) 15%, rgba(2, 6, 23, .48) 100%);
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
    z-index: 2;
}

.td-card:hover::after,
.td-card.td-hovered::after {
    opacity: 1;
}

.td-location-pill {
    position: absolute;
    top: 28px;
    left: 24px;
    z-index: 5;
    min-width: 130px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border-radius: 999px;
    background: #ffffff;
    color: #020617;
    font-size: 20px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}

.td-pin {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: #020617;
}

.td-pin svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Glass overlay hidden by default; appears only on hover */
.td-glass-card {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 28px;
    min-height: 160px;
    border-radius: 18px;
    padding: 26px 28px;
    background: rgba(31, 41, 55, .38);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 18px 36px rgba(0,0,0,.22);
    color: #ffffff;
    z-index: 6;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(24px);
    transition: opacity .35s ease, transform .35s ease, visibility .35s ease;
}

.td-card:hover .td-glass-card,
.td-card.td-hovered .td-glass-card {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.td-rating-row {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 24px;
}

.td-stars {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    color: #ffc928 !important;
    line-height: 1 !important;
}

.td-rating-star {
    width: 19px !important;
    height: 19px !important;
    display: inline-block !important;
    flex: 0 0 auto !important;
}

.td-rating-star-full path {
    fill: #ffc928 !important;
}

.td-rating-star-empty path {
    fill: rgba(255, 255, 255, .72) !important;
}

.td-rating-row strong {
    font-size: 20px;
    font-weight: 700;
}

.td-arrow-btn {
    position: absolute;
    right: 28px;
    top: 28px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.92);
    color: #0f172a;
    text-decoration: none;
    font-size: 24px;
    font-weight: 500;
}

.td-glass-card h3 {
    margin: 0 0 14px;
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
}

.td-glass-card p {
    margin: 0;
    max-width: 310px;
    font-size: 18px;
    line-height: 1.45;
    font-weight: 500;
}

.td-bottom-row {
    margin-top: 88px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 50px;
}

.td-bottom-text {
    color: #020617;
    font-size: 18px;
    font-weight: 500;
}

.td-bottom-line {
    height: 1px;
    background: rgba(15, 23, 42, .26);
}

.td-read-more {
    min-width: 188px;
    height: 58px;
    border-radius: 999px;
    background: #020f1f;
    color: #ffffff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    font-size: 16px;
    font-weight: 700;
}

.td-read-more span {
    font-size: 18px;
}

@media (max-width: 1200px) {
    .td-top-grid {
        gap: 40px;
    }

    .td-card-grid {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 56px;
        padding-top: 28px;
        padding-bottom: 28px;
    }

    .td-scroll-enabled .td-card {
        flex: 0 0 calc((100vw - 108px) / 2);
        width: calc((100vw - 108px) / 2);
    }

    .td-card,
    .td-card:nth-child(2) {
        height: 520px;
        transform: none;
    }

    .td-card:hover,
    .td-card.td-hovered,
    .td-card:nth-child(2):hover,
    .td-card:nth-child(2).td-hovered {
        transform: scale(1.04);
    }
}

@media (max-width: 760px) {
    .top-destination-section {
        padding: 28px 0 48px;
    }

    .td-container {
        width: calc(100% - 32px);
    }

    .td-top-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .td-heading-wrap h2 {
        font-size: 42px;
    }

    .td-badge {
        margin-bottom: 28px;
        font-size: 16px;
    }

    .td-intro-wrap p {
        font-size: 16px;
    }

    .td-card-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-top: 34px;
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .td-scroll-track {
        gap: 24px;
    }

    .td-scroll-enabled .td-card {
        flex: 0 0 82vw;
        width: 82vw;
    }

    .td-card,
    .td-card:nth-child(2) {
        height: 480px;
    }

    .td-card:hover,
    .td-card.td-hovered,
    .td-card:nth-child(2):hover,
    .td-card:nth-child(2).td-hovered {
        transform: none;
    }

    .td-bottom-row {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-top: 44px;
    }
}


/* Final hover top-cut protection */
.top-destination-section,
.top-destination-section .td-container {
    overflow: visible !important;
}

.top-destination-section .td-card-grid {
    overflow: visible !important;
}

.top-destination-section .td-card-grid.td-scroll-enabled {
    overflow: hidden !important;
    padding-top: 76px !important;
    padding-bottom: 76px !important;
    margin-top: 54px !important;
}

.top-destination-section .td-card,
.top-destination-section .td-card:nth-child(2) {
    transform-origin: center center !important;
}

.top-destination-section .td-card:hover,
.top-destination-section .td-card.td-hovered,
.top-destination-section .td-card:nth-child(2):hover,
.top-destination-section .td-card:nth-child(2).td-hovered {
    transform: scale(1.06) !important;
}
