/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* container query */

.activity-finder {
    container-type: inline-size;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

.activity-finder {
    padding: 60px 0;
}

.activity-finder__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}

/* Fields share the row and grow to fill the full container width; they shrink
   (min-width: 0) so the search + both selects + Clear all fit on one line. */
.activity-finder__filter {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

.activity-finder__select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-width: 0;
    padding: 12px 44px 12px 20px;
    border: none;
    border-radius: var(--btn-border-radius-lg);
    background-color: var(--gray-lt);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14"><polygon points="2,4 12,4 7,11" fill="%23231f20"/></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    color: var(--black);
    font-size: 16px;
    cursor: pointer;
}

.activity-finder__clear {
    flex: 0 0 auto;
    white-space: nowrap;
    border: none;
    background: none;
    padding: 0;
    color: var(--purple-md);
    font-family: "Cachet";
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.2px;
    cursor: pointer;

    transition: all 0.2s ease;
}

.activity-finder__clear:hover {
    color: var(--blue-dk);
    text-decoration: underline;
}

@container (max-width: 760px) {
    .activity-finder__filters {
        flex-direction: column;
        align-items: stretch;
    }

    .activity-finder__select {
        width: 100%;
        min-width: 0;
    }

    .activity-finder__search {
        min-width: 0;
    }

    .activity-finder__clear {
        align-self: center;
    }
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* SEARCH BAR — inline in the filters row, sized/colored to match the selects. */

.activity-finder__search {
    display: flex;
    align-items: stretch;
    flex: 1 1 0;
    min-width: 0;
    background-color: var(--gray-lt);
    border-radius: var(--btn-border-radius-lg);
    overflow: hidden;
}

/* Ring the whole control (its input is border-less) when focused. */
.activity-finder__search:focus-within {
    outline: 2px solid var(--blue-lt);
    outline-offset: 2px;
}

.activity-finder__search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 12px 8px 12px 20px; /* matches the select's left padding + height */
    color: var(--black);
    font-size: 16px;
}

.activity-finder__search-input::placeholder {
    color: var(--black);
    opacity: 0.55;
}

.activity-finder__search-input:focus {
    outline: none;
}

/* Icon-only submit (no "Search" text) — blends into the gray field. */
.activity-finder__search-submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: none;
    background: transparent;
    color: var(--blue-dk);
    cursor: pointer;
    transition: color 0.2s ease;
}

.activity-finder__search-submit:hover {
    color: var(--purple-md);
}

.activity-finder__search-submit .icon {
    font-size: 18px;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* RESULTS / CARDS */

.activity-finder__results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
}

/* Empty state — a panel rather than a bare line of text, so a search that finds
   nothing still lands on something branded with a way back out. Cloned from the
   <template> in activity_finder.php; reuses the card entrance animation. */
.activity-finder__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 56px 32px;
    background: var(--blue-tint);
    border-radius: var(--box-border-radius-lg);
    animation: activity-finder-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.activity-finder__empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    border-radius: 50%;
    background: var(--white);
    color: var(--blue-dk);
}

.activity-finder__empty-icon .icon {
    font-size: 26px;
}

.activity-finder__empty-title {
    margin: 0 0 12px;
    color: var(--blue-dk);
}

.activity-finder__empty-text {
    max-width: 46ch;
    margin: 0 0 28px;
    color: var(--gray-dk);
}

@container (max-width: 620px) {
    .activity-finder__empty {
        padding: 40px 20px;
    }
}

.activity-finder__card {
    display: flex;
    align-items: stretch;
    min-height: 162px;
    background: var(--white);
    border-radius: var(--box-border-radius-sm);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

/*override default link hover color*/
.activity-finder__card:hover {
    color: var(--black);
}

.activity-finder__card.is-hidden {
    display: none;
}

/* Pre-animation rest state: card sits invisible-and-translated-down while the
   IntersectionObserver waits for it to scroll into frame. */
.activity-finder__card.is-pending {
    opacity: 0;
    transform: translateY(16px);
}

/* Staggered fade-up — JS swaps is-pending → is-entering when the card
   intersects the viewport, and sets --enter-i so cards entering in the same
   IO tick cascade in 80ms apart. */
.activity-finder__card.is-entering {
    animation: activity-finder-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--enter-i, 0) * 80ms);
}

@keyframes activity-finder-card-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .activity-finder__card.is-pending {
        opacity: 1;
        transform: none;
    }
    .activity-finder__card.is-entering,
    .activity-finder__empty,
    .activity-finder__price-skeleton,
    .activity-finder__skeleton-line {
        animation: none;
    }
}

.activity-finder__date {
    flex: 0 0 auto;
    width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--blue-dk);
    color: var(--white);
    padding: 20px 12px;
}

.activity-finder__date-month {
    font-family: "Cachet";
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: -0.2px;
    line-height: 1;
    margin-bottom: 4px;
}

.activity-finder__date-day {
    font-family: "Cachet";
    font-size: 48px;
    font-weight: bold;
    letter-spacing: -3px;
    line-height: 1;
}

.activity-finder__info {
    flex: 1 1 auto;
    min-width: 0;
    padding: 20px 28px;
    border-top: 1px solid var(--gray);
    border-bottom: 1px solid var(--gray);
}

.activity-finder__name {
    margin: 0 0 12px;
    color: var(--blue-dk);
    text-transform: uppercase;
    font-size: 24px;
}

.activity-finder__meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-finder__meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-finder__meta-icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: var(--blue-dk);
    display: inline-flex;
}

.activity-finder__meta-icon svg {
    width: 100%;
    height: 100%;
}

.activity-finder__pricing {
    flex: 0 0 auto;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 20px 28px;
    position: relative;
    border-top: 1px solid var(--gray);
    border-bottom: 1px solid var(--gray);
}

/* Vertical divider — solid 1px line, inset from the top/bottom of the
   pricing column so it starts and stops abruptly with white space on each end. */
.activity-finder__pricing::before {
    content: "";
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.18);
}

.activity-finder__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.activity-finder__price-amt {
    color: var(--blue-dk);
    font-family: "Cachet";
    font-weight: bold;
    font-size: 22px;
    letter-spacing: -1.75px;
}

.activity-finder__spots {
    margin-top: 6px;
    color: var(--blue-lt);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 13px;
}

/* Two stacked shimmer bars hint at the member / non-member price layout
   that fillCard() drops in once enrich resolves. */
.activity-finder__price-skeleton {
    display: block;
    width: 140px;
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--gray) 0%, var(--gray) 35%, rgba(255, 255, 255, 0.85) 50%, var(--gray) 65%, var(--gray) 100%);
    background-size: 200% 100%;
    animation: activity-finder-shimmer 1.4s linear infinite;
}

.activity-finder__price-skeleton + .activity-finder__price-skeleton {
    width: 100px;
    margin-top: 10px;
    animation-delay: 0.2s;
}

/* Seamless loop: the travel (100% -> -100% at background-size 200%) is exactly one
   gradient tile, so the end state is pixel-identical to the start — the highlight
   glides continuously instead of parking and snapping back on each iteration. */
@keyframes activity-finder-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* full-card loading skeleton — shown while a fetch is in flight, swapped for
   real cards on resolve. Reuses the card frame (blue date block, purple arrow)
   so the silhouette matches; the info + price rows shimmer via the gray gradient. */

.activity-finder__card--skeleton {
    cursor: default;
    pointer-events: none;
}

.activity-finder__card--skeleton:hover {
    box-shadow: none;
}

.activity-finder__skeleton-line {
    display: block;
    width: 85%;
    height: 13px;
    margin-bottom: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--gray) 0%, var(--gray) 35%, rgba(255, 255, 255, 0.85) 50%, var(--gray) 65%, var(--gray) 100%);
    background-size: 200% 100%;
    animation: activity-finder-shimmer 1.4s linear infinite;
}

.activity-finder__skeleton-line--title {
    width: 60%;
    height: 20px;
    margin-bottom: 16px;
}

.activity-finder__skeleton-line--short {
    width: 45%;
    margin-bottom: 0;
}

.activity-finder__register {
    flex: 0 0 auto;
    width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--purple-md);
    color: var(--white);

    transition: all 0.2s ease;
}

.activity-finder__register svg {
    width: 22px;
    height: 22px;

    transition: all 0.2s ease;
}

/* The whole card is the hover unit — the arrow darkens when you're anywhere on it.
   The hover deliberately does NOT change the register column's width: growing it
   takes those pixels from the text beside it, which re-wraps the card's copy onto
   another line mid-hover. Colour and the arrow scale carry the feedback instead. */
.activity-finder__card:hover .activity-finder__register {
    background: var(--purple-dk);
}
.activity-finder__card:hover .activity-finder__register svg {
    transform: scale(1.2);
}

.activity-finder__loadmore-wrap {
    margin-top: 32px;
    text-align: left;
}

.activity-finder__load-more .btn-text .icon {
    font-size: 18px;
}
.activity-finder__load-more .btn-text .icon svg {
    height: 1em;
    width: auto;
}

.activity-finder__status {
    margin-top: 16px;
    text-align: center;
}

@container (max-width: 760px) {
    /* Sections stack here, so the blue/purple end blocks no longer cap the sides.
       Draw the outline on the card itself and drop the per-section edge borders
       (they only formed the desktop top/bottom edge) so nothing doubles up. */
    .activity-finder__card {
        flex-wrap: wrap;
        height: auto;
        border: 1px solid var(--gray);
    }

    .activity-finder__date {
        width: 84px;
    }

    .activity-finder__info {
        flex: 0 0 calc(65% - 84px);

        border-top: none;
        border-bottom: none;
    }

    .activity-finder__pricing {
        width: 35%;
        border: none;
    }

    /* Vertical fade line doesn't fit the stacked mobile layout. */
    /* .activity-finder__pricing::before {
        display: none;
    } */

    .activity-finder__register {
        width: 100%;
        height: 52px;
    }
}

@container (max-width: 620px) {
    .activity-finder__date {
        width: 100%;
        flex: 0 0 100%;
        padding: 15px 28px;

        flex-direction: row;
        gap: 6px;
        justify-content: start;
        align-items: center;
    }
    .activity-finder__date-month,
    .activity-finder__date-day {
        margin: 0;
        font-size: 32px;
    }

    .activity-finder__info {
        flex: 0 0 100%;
    }

    .activity-finder__pricing {
        flex: 0 0 100%;
        border-top: 1px solid var(--gray);
    }
    .activity-finder__pricing::before {
        display: none;
    }
}
