/*
 * Africa Safari Connect — responsive / accessibility hardening
 * v1.10.214
 *
 * Final launch-readiness layer. Keeps page-specific designs intact while
 * fixing cross-marketplace mobile/touch/text-overflow issues found in the
 * responsive UI audit.
 */

/* Flex/grid children containing real-world data (emails, URLs, long names)
 * must be allowed to shrink instead of widening the viewport. */
.traveler-marketplace-child .tmc-dashboard :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tod-directory :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tod-operator-profile :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tmc-accommodations :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tmc-accommodation-single :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tmc-all-tours :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tmc-single-tour--clear :where(div,article,section,header,footer,li){min-width:0}

.traveler-marketplace-child :where(
    .tmc-dashboard,
    .tod-directory,
    .tod-operator-profile,
    .tmc-accommodations,
    .tmc-accommodation-single,
    .tmc-owned-accommodations,
    .tmc-all-tours,
    .tmc-single-tour--clear,
    .tmc-operator-auth
) :where(p,small,strong,span,a,dd,dt){overflow-wrap:anywhere}

/* One consistent keyboard focus treatment. Existing component focus styles
 * remain visible underneath; this mainly covers links/buttons that had none. */
.traveler-marketplace-child :where(a,button,input,select,textarea,summary):focus-visible{
    outline:3px solid rgba(22,128,60,.24);
    outline-offset:2px;
}

/* Authentication close controls and public inquiry modal close controls are
 * genuine touch targets, not 34–36px desktop-only icons. */
.tmc-operator-auth-modal .tmc-auth-modal-header .close,
.traveler-marketplace-child .tmc-single-tour--clear .tmc-d2-inquiry-modal__close,
.traveler-marketplace-child .tod-operator-inquiry-modal__close{
    min-width:44px!important;
    width:44px!important;
    min-height:44px!important;
    height:44px!important;
}

/* Public primary actions should meet a 44px touch target. */
.traveler-marketplace-child .tmc-tour-card__cta,
.traveler-marketplace-child .tod-button,
.traveler-marketplace-child .tod-profile-action,
.traveler-marketplace-child .tmc-accommodation-single__inquiry-cta,
.traveler-marketplace-child .tmc-owned-property-card__actions a,
.traveler-marketplace-child .tmc-dashboard-button,
.traveler-marketplace-child .tod-inquiry-reply,
.traveler-marketplace-child .tod-inquiry-source-link,
.traveler-marketplace-child .tod-promo-buy{
    min-height:44px!important;
}

/* Horizontal navigation rails remain usable on touch screens. */
.traveler-marketplace-child :where(
    .tod-profile-nav,
    .tod-promotion-hub__tabs,
    .tmc-destination-tabs,
    .tmc-cf-section-nav
){
    overscroll-behavior-inline:contain;
    scrollbar-width:thin;
    -webkit-overflow-scrolling:touch;
}

/* Dashboard utility copy was dipping below a comfortable readable size. */
.traveler-marketplace-child .tmc-dashboard :where(.tmc-stat-card small,.tmc-quick-action p,.tmc-panel-heading p),
.traveler-marketplace-child .tmc-owned-accommodations :where(.tmc-owned-property-card__completeness span,.tmc-owned-accommodations__profile-logo small),
.traveler-marketplace-child .tod-accommodation-promotion-hub :where(.tod-promotion-hub__summary span,.tod-promotion-hub__summary p){
    font-size:11px!important;
    line-height:1.5!important;
}

/* Prevent file inputs and long account data from escaping dashboard cards. */
.traveler-marketplace-child .tmc-dashboard input[type="file"],
.traveler-marketplace-child .tmc-owned-accommodations input[type="file"],
.traveler-marketplace-child .tmc-dashboard input[type="url"],
.traveler-marketplace-child .tmc-dashboard input[type="email"]{
    max-width:100%;
}

@media (max-width:767px){
    /* 16px mobile form text prevents Safari/iOS zoom and makes every major
     * marketplace form easier to complete. */
    .traveler-marketplace-child :where(
        .tmc-operator-auth,
        .tod-tour-inquiry,
        .tod-directory,
        .tmc-all-tours,
        .tmc-accommodations,
        .tmc-owned-accommodations,
        .tmc-dashboard,
        .tmc-single-tour--clear
    ) :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
        font-size:16px!important;
    }

    .traveler-marketplace-child .tmc-operator-auth-modal .modal-dialog{
        width:calc(100% - 20px)!important;
        margin-left:auto;
        margin-right:auto;
    }

    .traveler-marketplace-child .tmc-operator-auth-modal .modal-body{
        padding-left:16px!important;
        padding-right:16px!important;
    }

    .traveler-marketplace-child .tmc-dashboard-hero__actions{
        width:100%;
    }

    .traveler-marketplace-child .tmc-dashboard-hero__actions .tmc-dashboard-button{
        flex:1 1 180px;
    }

    .traveler-marketplace-child .tmc-management-toolbar,
    .traveler-marketplace-child .tmc-management-header,
    .traveler-marketplace-child .tod-inquiry-detail__header,
    .traveler-marketplace-child .tod-inquiry-detail__actions{
        min-width:0;
    }

    .traveler-marketplace-child .tod-profile-action{
        justify-content:center;
    }

    .traveler-marketplace-child .tod-profile-hero-topbadges{
        max-width:calc(100% - 40px);
        flex-wrap:wrap;
    }

    .traveler-marketplace-child .tod-operator-profile-v2 .tod-profile-identity h1{
        font-size:clamp(31px,9vw,38px)!important;
        overflow-wrap:anywhere;
    }

    .traveler-marketplace-child .tmc-all-tours__results-tools select,
    .traveler-marketplace-child .tmc-tour-filter__control,
    .traveler-marketplace-child .tmc-accommodations__filters select,
    .traveler-marketplace-child .tmc-accommodations__filters input{
        width:100%;
        max-width:100%;
    }

    /* Public inquiry modals use the available screen height and retain access
     * to their close control even on short phones. */
    .traveler-marketplace-child .tmc-single-tour--clear .tmc-d2-inquiry-modal{
        padding:14px 10px!important;
    }
    .traveler-marketplace-child .tmc-single-tour--clear .tmc-d2-inquiry-modal__dialog{
        max-height:calc(100dvh - 28px);
        overflow:auto;
    }

    /* Accommodation management actions should not squeeze into tiny buttons. */
    .traveler-marketplace-child .tmc-owned-property-card__actions a{
        flex:1 1 150px;
        padding-left:12px;
        padding-right:12px;
    }
}

@media (max-width:640px){
    /* The dashboard previously held two columns until 480px.  On real devices
     * that left stats/actions cramped once the Traveler dashboard shell and
     * page padding were accounted for. */
    .traveler-marketplace-child .tmc-dashboard-stats,
    .traveler-marketplace-child .tmc-quick-actions,
    .traveler-marketplace-child .tmc-conversation-grid{
        grid-template-columns:1fr!important;
    }

    .traveler-marketplace-child .tmc-dashboard-hero__actions .tmc-dashboard-button{
        flex-basis:100%;
        width:100%;
    }

    .traveler-marketplace-child .tod-accommodation-promotion-hub .tod-promotion-hub__tabs a,
    .traveler-marketplace-child .tod-profile-nav a{
        min-height:44px;
        display:inline-flex;
        align-items:center;
    }

    .traveler-marketplace-child .tod-inquiry-detail__actions{
        align-items:stretch!important;
        width:100%;
    }
    .traveler-marketplace-child .tod-inquiry-detail__actions > :where(a,button,form){
        max-width:100%;
    }
}

@media (max-width:480px){
    .traveler-marketplace-child .tmc-auth-page__card,
    .traveler-marketplace-child .tmc-dashboard-panel,
    .traveler-marketplace-child .tmc-owned-accommodations__prerequisite-gate{
        border-radius:12px;
    }

    .traveler-marketplace-child .tod-review-score{
        text-align:left;
    }
}

@media (prefers-reduced-motion:reduce){
    .traveler-marketplace-child *,
    .traveler-marketplace-child *::before,
    .traveler-marketplace-child *::after{
        scroll-behavior:auto!important;
        transition-duration:.01ms!important;
        animation-duration:.01ms!important;
        animation-iteration-count:1!important;
    }
}
