/* ==========================================================================
   Traveller Stories Archive
   ========================================================================== */

/* --- Base --- */
.traveller_story_listing {
    font-family: 'Montserrat', sans-serif;
}

/* --- Hero Section --- */
.ts-archive-hero {
    text-align: center;
    padding: calc(48px + 40px) 20px 48px;
    max-width: 1169px;
    margin: 0 auto;
}

.ts-archive-hero__title {
    font-family: 'Playfair Display', serif;
    font-size: 76px;
    font-weight: 400;
    color: #222;
    margin: 0 0 16px;
    line-height: 110%;
    letter-spacing: 0px;
}

.ts-archive-hero__subtitle {
    font-size: 20px;
    font-weight: 400;
    color: #666;
    line-height: 140%;
    letter-spacing: 0;
    margin: 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Featured Card --- */
.ts-archive-featured-story {
    max-width: 1169px;
    margin: 0 auto;
    padding: 0 20px;
}

.ts-featured-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    max-width: 1169px;
    margin: 0 auto 64px;
    cursor: pointer;
}

.ts-featured-card__image-wrap {
    position: relative;
    width: 100%;
    height: 425px;
}

.ts-featured-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ts-featured-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0) 30%,
            rgba(0, 0, 0, 0.65) 100%);
    pointer-events: none;
}

.ts-featured-card__content {
    position: absolute;
    inset: 0;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.ts-featured-card__meta {
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    gap: 8px;
    align-items: center;
}

.ts-featured-card__meta p {
    margin: 0;
}


.ts-featured-card__meta-separator {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.ts-featured-card__title {
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 39px;
    line-height: 130%;
    letter-spacing: 0px;
    max-width: 704px;
    margin: 0;
    margin-bottom: 24px;
}

/* Button sits above clickable parent */
.ts-featured-card__cta {
    position: relative;
    z-index: 2;
}

.ts-featured-card__bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    gap: 24px;
}

.ts-featured-card__traveller {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ts-featured-card__avatars {
    display: flex;
    align-items: center;
}

.ts-featured-card__avatars--overlap .ts-featured-card__avatar-wrap {
    margin-left: -14px;
    flex-shrink: 0;
    position: relative;
    line-height: 0;
}

.ts-featured-card__avatars--overlap .ts-featured-card__avatar-wrap:first-child {
    margin-left: 0;
}

.ts-featured-card__avatars--overlap .ts-featured-card__avatar-wrap:nth-child(1) {
    z-index: 1;
}

.ts-featured-card__avatars--overlap .ts-featured-card__avatar-wrap:nth-child(2) {
    z-index: 2;
}

.ts-featured-card__avatars--overlap .ts-featured-card__avatar-wrap:nth-child(3) {
    z-index: 3;
}

.ts-featured-card__avatars--overlap .ts-featured-card__avatar-wrap:nth-child(4) {
    z-index: 4;
}

.ts-featured-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

.ts-featured-card__traveller-info {
    text-align: right;
}

.ts-featured-card__traveller-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    display: block;
}

.ts-featured-card__traveller-country {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.ts-featured-card__flag {
    width: 16px;
    height: 11px;
    object-fit: cover;
    border-radius: 2px;
}

.ts-featured-card__traveller-badge {
    font-size: 10px;
    font-weight: 500;
    line-height: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
}

.ts-featured-card__badge-icon {
    color: #E0C14F;
    flex-shrink: 0;
}

/* --- Previous Stories Section --- */
.ts-archive-stories {
    padding: 0 0 64px;
    max-width: 1169px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.ts-archive-stories__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.ts-archive-stories__empty {
    text-align: center;
    padding: 64px 20px;
    color: #999;
    font-size: 16px;
}

/* --- Filter Bar (Desktop) --- */
.ts-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 16px;
}

.ts-filter-bar__heading {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 400;
    color: #222;
    margin: 0;
    white-space: nowrap;
}

.ts-filter-bar__controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ts-filter-bar__reset {
    background: none;
    border: none;
    color: #b83426;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.ts-filter-bar__reset:hover {
    text-decoration: underline;
}

/* --- Toggle --- */
.ts-filter-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.ts-filter-toggle__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ts-filter-toggle__track {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.ts-filter-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.ts-filter-toggle__input:checked+.ts-filter-toggle__track {
    background: #333;
}

.ts-filter-toggle__input:checked+.ts-filter-toggle__track .ts-filter-toggle__thumb {
    transform: translateX(20px);
}

.ts-filter-toggle__label {
    font-size: 14px;
    font-weight: 400;
    color: #333;
}

/* --- Dropdown --- */
.ts-filter-dropdown {
    position: relative;
}

.ts-filter-dropdown__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
}

.ts-filter-dropdown__trigger:hover {
    border-color: #bbb;
}

.ts-filter-dropdown__chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.ts-filter-dropdown__trigger[aria-expanded="true"] .ts-filter-dropdown__chevron {
    transform: rotate(180deg);
}

.ts-filter-dropdown__sort-icon {
    flex-shrink: 0;
}

.ts-filter-dropdown__panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 240px;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 8px 0;
    display: none;
}

.ts-filter-dropdown__trigger[aria-expanded="true"]+.ts-filter-dropdown__panel {
    display: block;
}

.ts-filter-dropdown__panel--sort {
    min-width: 140px;
}

.ts-filter-dropdown__group {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ts-filter-dropdown__group:last-child {
    border-bottom: none;
}

.ts-filter-dropdown__group-label {
    display: block;
    padding: 4px 16px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}

.ts-filter-dropdown__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.ts-filter-dropdown__option span,
.ts-mobile-filter__option span {
    font-weight: 400;
}


.ts-filter-dropdown__option:hover {
    background: #f8f8f8;
}

.ts-filter-dropdown__option input[type="checkbox"],
.ts-filter-dropdown__option input[type="radio"] {
    accent-color: #333;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ts-filter-dropdown__count {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

/* --- Pagination --- */
.ts-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 48px;
}

.ts-pagination__pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ts-pagination__link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 14px;
    background: none;
    border: none;
    font-family: inherit;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.ts-pagination__link:hover {
    background: #f5f5f5;
    color: #333;
}

.ts-pagination__link--active {
    background: #f5f5f5;
    font-weight: 600;
    cursor: default;
}

.ts-pagination__link--disabled {
    color: #ccc;
    cursor: default;
    pointer-events: none;
}

.ts-pagination__prev,
.ts-pagination__next {
    color: #b83426;
    font-weight: 500;
}

.ts-pagination__prev:hover,
.ts-pagination__next:hover {
    color: #631c15;
    background: transparent;
}

.ts-pagination__prev.ts-pagination__link--disabled,
.ts-pagination__next.ts-pagination__link--disabled {
    color: #ccc;
}

.ts-pagination__ellipsis {
    padding: 8px 4px;
    color: #999;
}

/* --- Card Enter Transition --- */
#ts-stories-target.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.ts-card-enter {
    opacity: 0;
    transform: translateY(16px);
}

.ts-card-enter--active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* --- Mobile Filter Bar --- */
.ts-filter-bar-mobile {
    display: none;
}

.ts-filter-bar-mobile__heading {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 400;
    color: #222;
    margin: 0;
    flex: 1;
}

.ts-filter-bar-mobile__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ts-filter-bar-mobile__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    flex: 1;
}

/* --- Mobile Filter Panel --- */
.ts-mobile-filter {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.ts-mobile-filter[aria-hidden="false"] {
    display: block;
}

.ts-mobile-filter__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.ts-mobile-filter__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.ts-mobile-filter[aria-hidden="false"] .ts-mobile-filter__panel {
    transform: translateX(0);
}

.ts-mobile-filter__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.ts-mobile-filter__title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin: 0;
}

.ts-mobile-filter__close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
}

.ts-mobile-filter__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.ts-mobile-filter__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.ts-mobile-filter__section-reset {
    background: none;
    border: none;
    color: #b83426;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.ts-mobile-filter__search {
    position: relative;
    margin-bottom: 20px;
}

.ts-mobile-filter__search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    box-sizing: border-box;
}

.ts-mobile-filter__search-input::placeholder {
    color: #999;
}

.ts-mobile-filter__search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.ts-mobile-filter__group {
    border-bottom: 1px solid #eee;
}

.ts-mobile-filter__group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 0;
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    cursor: pointer;
}

.ts-mobile-filter__group-chevron {
    transition: transform 0.2s ease;
}

.ts-mobile-filter__group-toggle[aria-expanded="true"] .ts-mobile-filter__group-chevron {
    transform: rotate(180deg);
}

.ts-mobile-filter__group-options {
    padding-bottom: 12px;
}

.ts-mobile-filter__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.ts-mobile-filter__option input[type="checkbox"] {
    accent-color: #333;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ts-mobile-filter__option-count {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

.ts-mobile-filter__expert-row {
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.ts-mobile-filter__footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ts-mobile-filter__apply {
    width: 100%;
    text-align: center;
    justify-content: center;
}

.ts-mobile-filter__reset-all {
    background: none;
    border: 1px solid #b83426;
    color: #b83426;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
}

.ts-mobile-filter__reset-all:hover {
    background: #fef5f4;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .ts-archive-hero__title {
        font-size: 48px;
    }

    .ts-archive-hero__subtitle {
        font-size: 16px;
    }

    .ts-featured-card__image-wrap {
        height: 360px;
    }

    .ts-featured-card__title {
        font-size: 24px;
    }

    .ts-archive-stories__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .ts-archive-hero {
        padding: 32px 20px 32px;
    }

    .ts-archive-hero__title {
        font-size: 36px;
    }

    .ts-archive-hero__subtitle {
        font-size: 14px;
    }

    .ts-featured-card {
        margin-bottom: 48px;
    }

    .ts-featured-card__overlay {
        background: rgba(0, 0, 0, 0.5);
    }

    .ts-featured-card__image-wrap,
    .ts-featured-card__image {
        height: auto;
        min-height: 467px;
    }

    .ts-featured-card__content {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ts-featured-card__left {
        width: 100%;
        flex: 1;
        justify-content: space-between;
        display: flex;
        flex-direction: column;
    }

    .ts-featured-card__title {
        font-size: 24px;
        margin-bottom: 0;
    }

    .ts-featured-card__bottom {
        width: 100%;
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 16px;
    }

    .ts-featured-card__traveller-info {
        text-align: left;
    }

    .ts-featured-card__traveller-country,
    .ts-featured-card__traveller-badge {
        justify-content: flex-start;
    }

    /* Filter bar: show mobile, hide desktop */
    .ts-filter-bar {
        display: none;
    }

    .ts-filter-bar-mobile {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 24px;
    }

    .ts-archive-stories__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ts-archive-stories {
        padding-left: 16px;
        padding-right: 16px;
    }
}