/* ================================================================
   MOBILE FIXES - loaded after the page stylesheets on every main page
   (home, planner, portal, policies). Phones are the primary device.
   ================================================================ */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

img,
video,
svg {
    max-width: 100%;
}

/* ---- Stop iOS Safari from zooming the page when a field is tapped ---- */
@media (max-width: 768px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ---- Top bar on small phones: keep logo, CTA and menu on one line ---- */
.nav-logo {
    min-width: 0;
}

@media (max-width: 480px) {
    .nav-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        gap: 0.5rem;
    }

    .logo-text {
        font-size: 0.95rem;
        white-space: nowrap;
    }

    .nav-cta {
        padding: 0.5rem 0.85rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

@media (max-width: 360px) {
    .logo-text {
        font-size: 0.8rem;
        letter-spacing: 0;
    }

    .logo-mark {
        height: 28px;
        width: auto;
    }

    .nav-cta {
        padding: 0.45rem 0.65rem;
        font-size: 0.72rem;
    }
}

/* ---- Homepage: the long "2027 MASTER EXPEDITION CALENDAR" label overflowed ---- */
@media (max-width: 640px) {
    .windows-label-row {
        gap: 0.6rem;
    }

    .windows-label-text {
        white-space: normal;
        text-align: center;
        font-size: 0.72rem;
        letter-spacing: 0.06em;
        line-height: 1.4;
    }

    .windows-label-line {
        min-width: 16px;
    }
}

/* ================================================================
   GUEST PORTAL
   ================================================================ */

/* Grid children must be allowed to shrink or they push the cards off-screen */
.portal-card,
.readiness-hero-card,
.dashboard-container,
.login-card,
.form-field {
    min-width: 0;
    max-width: 100%;
}

.portal-modules-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 1024px) {
    .portal-modules-grid,
    .prep-two-col {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .portal-wrapper {
        padding: 5rem 0.75rem 3rem;
    }

    .demo-mode-banner {
        padding: 0.75rem 0.9rem;
    }

    .demo-tour-select {
        width: 100%;
        max-width: 100%;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .readiness-hero-card {
        padding: 1.25rem 1rem;
    }

    .readiness-welcome h2 {
        font-size: 1.3rem;
    }

    .readiness-bar-labels {
        flex-direction: column;
        gap: 0.25rem;
    }

    .portal-card {
        padding: 1.1rem 1rem;
    }

    .portal-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .portal-card-title-wrap {
        gap: 0.65rem;
        min-width: 0;
    }

    .portal-card-title {
        font-size: 1.05rem;
    }

    .portal-card-icon {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .status-pill {
        white-space: normal;
    }

    .timeline-row {
        padding: 0.75rem;
        gap: 0.65rem;
    }

    .ledger-line {
        flex-wrap: wrap;
        gap: 0.25rem 0.75rem;
    }

    .ledger-line > :last-child {
        margin-left: auto;
    }

    .milestone-card {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .form-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .primary-portal-btn {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    .secondary-portal-btn {
        display: block;
        text-align: center;
    }

    .guide-contact-methods {
        flex-direction: column;
    }

    .guide-contact-badge {
        justify-content: center;
    }

    .signout-btn,
    .header-action-link {
        text-align: center;
    }
}

/* ================================================================
   PLANNER
   ================================================================ */

.m-summary-bar {
    display: none;
}

@media (max-width: 1024px) {
    .m-summary-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.65rem 0.9rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
        background: rgba(10, 14, 26, 0.96);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(251, 191, 36, 0.35);
    }

    body.has-m-bar {
        padding-bottom: 88px;
    }

    .m-bar-figures {
        display: flex;
        gap: 1.1rem;
        min-width: 0;
    }

    .m-bar-fig span {
        display: block;
        font-size: 0.66rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: rgba(249, 250, 251, 0.6);
    }

    .m-bar-fig strong {
        font-family: var(--font-heading);
        font-size: 1.05rem;
        color: #fff;
    }

    .m-bar-btn {
        flex-shrink: 0;
        border: none;
        border-radius: 999px;
        padding: 0.65rem 1.1rem;
        background: linear-gradient(135deg, #fbbf24, #f59e0b);
        color: #0a0e1a;
        font-weight: 700;
        font-size: 0.85rem;
        cursor: pointer;
    }
}

@media (max-width: 768px) {
    /* Credit rows: stack the amount under the text instead of squeezing the text */
    .credit-toggle-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .credit-left {
        width: 100%;
    }

    .credit-badge-val {
        align-self: flex-end;
    }

    .mode-switcher-bar {
        display: flex;
        width: 100%;
    }

    .mode-switch-btn {
        flex: 1 1 100%;
        justify-content: center;
        text-align: center;
    }
}

/* ================================================================
   STEP 2: tap targets, readable text, compact hero, 2-column gallery
   ================================================================ */
@media (max-width: 768px) {
    /* ~44px tap targets for small text links */
    .companion-link,
    .inline-link {
        display: inline-block;
        padding: 0.7rem 0.1rem;
        line-height: 1.3;
    }

    .footer-links a,
    .footer-contact a,
    .footer-legal a {
        display: inline-block;
        padding: 0.65rem 0;
    }

    .footer-links li {
        margin-bottom: 0;
    }

    .footer-legal {
        gap: 1rem;
        flex-wrap: wrap;
    }

    /* Price and countdown labels: at least 12-13px */
    .wp-label,
    .tier-price-label {
        font-size: 0.8rem;
    }

    .countdown-unit {
        font-size: 0.78rem;
    }

    .countdown-urgency {
        font-size: 0.85rem;
    }

    .companion-option-box,
    .companion-link {
        font-size: 0.85rem;
    }

    /* Gallery: 2 columns instead of 12 full-width photos in a single column */
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .gallery-item {
        border-radius: 10px;
    }
}

/* Compact hero so the main button is on the first screen */
@media (max-width: 640px) {
    .hero {
        min-height: auto;
        padding: 5.25rem 0 2rem;
    }

    .hero-content {
        padding: 1rem;
    }

    .hero-seo-eyebrow {
        font-size: 0.7rem;
        letter-spacing: 0.1em;
        padding: 0.3rem 0.8rem;
        margin-bottom: 0.6rem;
    }

    .hero-title {
        font-size: 2.1rem;
        line-height: 1.12;
        margin-bottom: 0.6rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.45;
        margin-bottom: 1rem;
    }

    .season-countdown {
        padding: 0.85rem 0.9rem;
        margin: 1rem auto;
    }

    .countdown-label {
        font-size: 0.98rem;
        margin-bottom: 0.45rem;
    }

    .countdown-timer {
        gap: 1rem;
        margin-bottom: 0.45rem;
    }

    .countdown-value {
        font-size: 1.75rem;
    }

    .hero-cta {
        padding: 0.9rem 2rem;
        font-size: 1.05rem;
        margin-bottom: 1.25rem;
    }
}

/* Step 2 follow-up: hide the "Explore" cue on phones (it overlapped the main button
   once the hero was shortened) and give small links a full ~44px tap area. */
@media (max-width: 640px) {
    .scroll-indicator {
        display: none;
    }
}

@media (max-width: 768px) {
    .companion-link,
    .inline-link {
        padding: 0.85rem 0.1rem;
    }

    .footer-links a,
    .footer-contact a,
    .footer-legal a {
        padding: 0.75rem 0;
    }
}

/* ================================================================
   STEP 3: collapsible tour list (phones). js/tour-list.js adds the
   summary row and the is-collapsible / is-collapsed classes.
   Desktop and no-JS keep the full cards.
   ================================================================ */
.window-summary,
.ws-peak-link,
.ws-reserve,
.tours-toggle-all {
    display: none;
}

.tours-toggle-all {
    width: 100%;
    margin: 0 0 1rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.08);
    color: var(--electric-amber);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.window-card.is-collapsible .window-summary {
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ws-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.ws-code {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--electric-amber);
}

.ws-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.ws-dates {
    font-size: 0.88rem;
    line-height: 1.4;
    color: rgba(249, 250, 251, 0.78);
}

.ws-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--electric-amber);
}

.ws-chevron {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(251, 191, 36, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--electric-amber);
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.window-card.is-collapsible:not(.is-collapsed) .ws-chevron {
    transform: rotate(180deg);
}

/* Collapsed: show only the summary, the ribbon, the peak 7-Day line and Reserve */
.window-card.is-collapsible.is-collapsed > *:not(.window-summary):not(.ws-peak-link):not(.ws-reserve):not(.prime-ribbon) {
    display: none !important;
}

.window-card.is-collapsible.is-collapsed .ws-peak-link {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.7rem 0;
    font-size: 0.88rem;
}

.window-card.is-collapsible.is-collapsed .ws-reserve {
    display: block;
    margin-top: 0.6rem;
}

/* Expanded: the summary acts as the header, so hide the duplicate title block */
.window-card.is-collapsible:not(.is-collapsed) > .window-top-meta,
.window-card.is-collapsible:not(.is-collapsed) > .window-title {
    display: none;
}

.window-card.is-collapsible:not(.is-collapsed) .window-summary {
    margin-bottom: 0.9rem;
}

/* ================================================================
   "Plan Your Pursuit" menu link + sticky Reserve bar (phones)
   ================================================================ */
.nav-links a.nav-planner-link {
    color: var(--electric-amber);
    font-weight: 700;
}

.sticky-reserve {
    display: none;
}

@media (max-width: 768px) {
    .sticky-reserve {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        align-items: center;
        gap: 0.85rem;
        padding: 0.6rem 0.9rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
        background: rgba(10, 14, 26, 0.96);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(251, 191, 36, 0.35);
        transform: translateY(110%);
        visibility: hidden;
        transition: transform 0.25s ease, visibility 0s linear 0.25s;
    }

    .sticky-reserve.is-visible {
        transform: translateY(0);
        visibility: visible;
        transition: transform 0.25s ease;
    }

    .sr-main {
        flex: 1;
        min-height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        background: linear-gradient(135deg, #fbbf24, #fb923c);
        color: #0a0e1a;
        font-weight: 700;
        font-size: 1rem;
    }

    .sr-link {
        flex-shrink: 0;
        padding: 0.75rem 0.25rem;
        font-size: 0.85rem;
        color: var(--electric-amber);
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    /* One booking button at a time: hide the top-bar one while the bar is showing */
    body.has-sticky-reserve .nav-cta {
        display: none;
    }

    /* Keep footer content clear of the bar */
    body.has-sticky-page .footer {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    }
}

/* ================================================================
   Desktop/tablet nav: with the new "Plan Your Pursuit" item, keep the
   menu on one line between 901px and the full-width layout.
   ================================================================ */
.nav-links li {
    white-space: nowrap;
}

@media (min-width: 901px) and (max-width: 1280px) {
    .nav-links {
        gap: 1.25rem;
    }

    .nav-links a {
        font-size: 0.92rem;
    }

    .nav-cta {
        padding: 0.65rem 1.2rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
}

@media (min-width: 901px) and (max-width: 1080px) {
    .nav-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .nav-links {
        gap: 0.9rem;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .logo-text {
        font-size: 1rem;
    }
}
