/* Keep the decorative header inside the mobile viewport without clipping menus. */
@media (max-width: 1279.98px) {
    header.header-main .header-image {
        width: 100%;
        object-fit: cover;
        object-position: left top;
    }
}

/* Portraits need the upper image edge, including in the stacked mobile hero. */
body.ts-migrated-team .ts-hero__image > img {
    object-position: center top;
}

@media (max-width: 991.98px) {
    body.ts-migrated-team .ts-hero__image {
        aspect-ratio: 3 / 4;
    }
}

@media (max-width: 768px) {
    body.ts-migrated-content .fl-builder-content h1.fl-heading {
        font-size: clamp(30px, 8.7vw, 34px);
        line-height: 1.2;
    }

    body.ts-migrated-content .fl-builder-content h2.fl-heading {
        font-size: clamp(26px, 7.2vw, 30px);
        line-height: 1.25;
    }

    body.ts-migrated-content .fl-builder-content :is(h1, h2, h3) {
        max-width: 100%;
        min-width: 0;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    body.ts-migrated-content .fl-builder-content .block-header__headline {
        font-size: clamp(38px, 11.3vw, 48px);
        line-height: 1.1;
    }

    body.ts-migrated-content .fl-module-rich-text .fl-rich-text {
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    body.ts-migrated-content .fl-module-rich-text .fl-rich-text :is(a, span, nobr) {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    body.ts-migrated-content .fl-module-rich-text .fl-rich-text a {
        hyphens: manual;
    }

    /* BB's mobile defaults reset module margins to zero. Padding adds readable
       separation while preserving the customer's editable module margins. */
    body.ts-migrated-content .fl-col-content > .fl-module:not(:last-child) {
        padding-bottom: 24px;
    }

    body.ts-migrated-content .fl-col-content > .fl-module-heading:has(+ .fl-module-rich-text) {
        padding-bottom: 12px;
    }

    body.ts-migrated-content .fl-module-ts-legacy-travel-results .pagination {
        gap: 2px;
    }

    body.ts-migrated-content .fl-module-ts-legacy-travel-results .page-link {
        min-width: 36px;
        width: 36px;
        height: 44px;
        padding: 8px;
    }

    body.ts-migrated-content .fl-module-ts-legacy-travel-results .page-link-ellipsis {
        min-width: 14px;
        width: 14px;
        padding-left: 0;
        padding-right: 0;
        font-size: 12px;
        letter-spacing: 0;
    }

    body.ts-migrated-content .fl-module-ts-legacy-travel-results .page-link.page-link-chevron {
        width: 36px;
    }

    body.ts-migrated-content .fl-module-ts-legacy-travel-results :is(.page-item-prev, .page-item-next) {
        margin-left: 0;
        margin-right: 0;
    }

    body.ts-migrated-content button.contrast-mode-button {
        width: 48px;
        padding-left: 0;
        padding-right: 0;
    }

    /* The button keeps its complete aria-label and its visible contrast icon. */
    body.ts-migrated-content button.contrast-mode-button > div:not([aria-hidden]) {
        display: none;
    }
}

/* AMIS 463557: contrast mode and keyboard legend are not required for the Swiss website. */
button.contrast-mode-button,
#legend-toggle,
#navigation-legend {
    display: none !important;
}

/* AMIS 463557: sidelayer sits at the bottom edge so it no longer overlaps the travel detail booking box. */
@media (min-width: 992px) {
    .sidelayer {
        top: auto;
        bottom: 1rem;
        transform: none;
    }

    /* Keep the booking box of the travel detail header clear of the sidelayer on lower screens. */
    body.pm-detail-page .detail-header__info {
        padding-right: 5rem;
    }
}

/* AMIS 463732: editable content layouts; all selectors belong to these sections. */
.ts-boarding-columns .fl-col-content,
.ts-catalogues .fl-col-content,
.ts-group-intro .fl-col-content,
.ts-contact-columns .fl-col-content,
.ts-event .fl-col-content,
.ts-fleet-vehicle .fl-col-content {
    padding: 0 16px;
}

.ts-check-list .fl-rich-text ul {
    list-style: none;
    padding-left: 0;
}

.ts-check-list .fl-rich-text li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 8px;
}

.ts-check-list .fl-rich-text li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0.2em;
    width: 18px;
    height: 18px;
    border: 1px solid var(--bs-primary, #df8a21);
    border-radius: 50%;
    color: var(--bs-primary, #df8a21);
    font-size: 14px;
    line-height: 16px;
    text-align: center;
}

.ts-info-box > .fl-col-content,
.ts-contact-box > .fl-col-content {
    padding: 24px;
    border: 1px solid #e4e4e4;
    background: #fff;
}

.ts-contact-columns .fl-col-group:has(> .ts-contact-box) {
    display: flex;
    gap: 24px;
    margin: 32px 0;
}

.ts-contact-columns .ts-contact-box {
    flex: 1 1 0;
    min-width: 0;
}

.ts-job-link .fl-rich-text {
    text-align: center;
    font-size: 0;
}

.ts-job-link .fl-rich-text p { font-size: 0; }

.ts-job-link .fl-rich-text a {
    display: inline-block;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    line-height: 1.4;
}

.ts-partner-toscatours .fl-photo-content {
    padding: 24px;
    background: #fff;
}

.ts-catalogue-cover .fl-photo-content img {
    max-height: 310px;
    width: auto;
    object-fit: contain;
}

.ts-fleet-gallery .fl-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    height: auto !important;
}

.ts-fleet-gallery .fl-gallery-item {
    /* Wookmark's fixed-width positioning must yield to this column's layout. */
    display: block !important;
    position: static !important;
    min-height: 0;
    width: calc(50% - 4px) !important;
    padding: 0 !important;
}

.ts-fleet-gallery .fl-gallery-item:first-child {
    width: 100% !important;
}

.ts-fleet-gallery .fl-photo-content,
.ts-fleet-gallery .fl-photo-img {
    width: 100%;
    height: auto;
}

.ts-fleet-seating img {
    width: auto;
    max-height: 440px;
    object-fit: contain;
}

/* Keep the complete portrait visible, including short biographies. */
body.ts-migrated-team .ts-team-portrait .ts-hero {
    min-height: 0;
}

body.ts-migrated-team .ts-team-portrait .ts-hero__image {
    align-self: flex-start;
    aspect-ratio: auto;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

body.ts-migrated-team .ts-team-portrait .ts-hero__image > img {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.ts-history-entry > .fl-row-content-wrap > .fl-row-content {
    position: relative;
}

.ts-history-entry > .fl-row-content-wrap > .fl-row-content::before {
    content: '';
    position: absolute;
    top: -12px;
    bottom: -12px;
    left: 50%;
    width: 2px;
    background: #ddd;
}

.ts-history-entry .fl-col-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
}

.ts-history-entry .fl-col {
    width: auto !important;
    float: none;
    min-width: 0;
    grid-row: 1;
}

.ts-history-entry .fl-module-heading .fl-heading {
    font-size: 20px;
    padding: 16px 36px;
}

.ts-history-entry .fl-module-rich-text > .fl-module-content {
    padding: 20px;
    margin: 0 48px 16px 0;
    border: 1px solid #ddd;
    box-shadow: 0 2px 6px #00000012;
    background: #fff;
}

.ts-history-entry .fl-module-heading {
    position: relative;
}

.ts-history-entry .fl-module-heading::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 25px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bs-primary, #df8a21);
    border: 4px solid #fff;
}

.ts-history-left .fl-col:first-child { grid-column: 2; }
.ts-history-left .fl-col:last-child { grid-column: 1; }
.ts-history-right .fl-col:first-child { grid-column: 1; text-align: right; }
.ts-history-right .fl-col:last-child { grid-column: 2; }
.ts-history-right .fl-module-rich-text > .fl-module-content { margin: 0 0 16px 48px; }
.ts-history-right .fl-module-heading::before { left: auto; right: -11px; }

@media (min-width: 992px) {
    body.ts-migrated-team .ts-team-portrait .ts-hero__image {
        flex: 0 0 33.333333%;
        max-width: none;
    }

    body.ts-migrated-team .ts-team-portrait .ts-hero__body {
        flex: 0 0 66.666667%;
    }
}

@media (max-width: 767.98px) {
    .ts-contact-columns .fl-col-group:has(> .ts-contact-box) {
        display: block;
    }

    .ts-contact-columns .ts-contact-box {
        margin-bottom: 24px;
    }

    .ts-boarding-columns .fl-col-content,
    .ts-catalogues .fl-col-content,
    .ts-group-intro .fl-col-content,
    .ts-event .fl-col-content,
    .ts-fleet-vehicle .fl-col-content {
        padding: 0;
    }

    .ts-history-entry > .fl-row-content-wrap > .fl-row-content::before {
        left: 10px;
    }

    .ts-history-entry .fl-col-group {
        display: block;
        padding-left: 30px;
    }

    .ts-history-entry .fl-module-heading .fl-heading {
        text-align: left;
        padding: 0 0 12px;
    }

    .ts-history-entry .fl-module-heading::before {
        left: -29px;
        right: auto;
        top: 5px;
    }

    .ts-history-entry .fl-module-rich-text > .fl-module-content {
        margin: 0 0 16px;
    }
}

/* AMIS 464302: booking information badges - "Ausgebucht" red, every other status orange (teaser and travel detail). */
.card-travel.card-travel--teaser1 .card-badge--sold-out {
    border-left-color: #d3202a;
    color: #d3202a;
}

.detail-intro__badge {
    background-color: rgba(229, 145, 0, .1);
    border-left-color: #e59100;
    color: #e59100;
}

.detail-intro__badge.detail-intro__badge--sold-out {
    background-color: rgba(211, 32, 42, .1);
    border-left-color: #d3202a;
    color: #d3202a;
}
