/* Shared responsive layer for the exported public marketing and booking pages. */
body.fm-exported {
    overflow-x: hidden;
}

body.fm-exported img,
body.fm-exported svg,
body.fm-exported video,
body.fm-exported canvas,
body.fm-exported iframe {
    max-width: 100%;
}

body.fm-exported h1,
body.fm-exported h2,
body.fm-exported h3,
body.fm-exported p,
body.fm-exported li,
body.fm-exported dd,
body.fm-exported code,
body.fm-exported [style*="ui-monospace"] {
    overflow-wrap: anywhere;
}

body.fm-exported [style*="display:grid"],
body.fm-exported [style*="display: grid"],
body.fm-exported [style*="display:flex"] > *,
body.fm-exported [style*="display: flex"] > * {
    min-width: 0;
}

body.fm-exported :is(button, a, input, select, textarea, [tabindex="0"]):focus-visible {
    outline: 3px solid #de9630;
    outline-offset: 3px;
}

body.fm-exported .home-stay-card-link,
body.fm-exported .pricing-view-toggle-button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 44px;
}

.fm-responsive-nav-toggle {
    align-items: center;
    background: #fbf8f1;
    border: 1px solid rgba(74, 48, 26, 0.2);
    border-radius: 10px;
    color: #382213;
    cursor: pointer;
    display: none;
    font: 700 15px/1 "Hanken Grotesk", system-ui, sans-serif;
    gap: 9px;
    justify-content: center;
    min-height: 44px;
    padding: 10px 13px;
}

.fm-responsive-nav-icon {
    display: grid;
    gap: 4px;
    width: 18px;
}

.fm-responsive-nav-icon span {
    background: currentColor;
    border-radius: 2px;
    display: block;
    height: 2px;
    transition: transform 0.16s ease, opacity 0.16s ease;
}

nav.is-open .fm-responsive-nav-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

nav.is-open .fm-responsive-nav-icon span:nth-child(2) {
    opacity: 0;
}

nav.is-open .fm-responsive-nav-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.fm-responsive-nav-panel {
    align-items: center;
    display: flex;
    flex: 1;
    gap: 24px;
    justify-content: space-between;
    min-width: 0;
}

.fm-responsive-nav-links {
    align-items: center;
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    min-width: 0;
}

/* Tablet navigation: the raw rule is also a safe fallback while the exported
   custom-element runtime is still replacing page content. */
@media (max-width: 1120px) {
    body.fm-exported header > nav:not([data-fm-responsive-ready="true"]) {
        flex-wrap: wrap !important;
        gap: 8px 16px !important;
    }

    body.fm-exported header > nav:not([data-fm-responsive-ready="true"]) > div {
        display: flex !important;
        flex: 0 0 100% !important;
        flex-wrap: nowrap !important;
        gap: 18px !important;
        justify-content: flex-start !important;
        order: 3;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
        width: 100% !important;
    }

    body.fm-exported header > nav:not([data-fm-responsive-ready="true"]) > div > a {
        align-items: center;
        display: inline-flex;
        flex: none;
        min-height: 44px;
    }

    body.fm-exported header > nav[data-fm-responsive-ready="true"] {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 10px 16px !important;
        padding-block: 13px !important;
    }

    body.fm-exported .fm-responsive-nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    body.fm-exported nav[data-fm-responsive-ready="true"] .fm-responsive-nav-panel {
        align-items: stretch;
        display: none;
        flex: 0 0 100%;
        flex-direction: column;
        gap: 10px;
        max-height: calc(100vh - 76px);
        max-height: calc(100dvh - 76px);
        overflow-y: auto;
        padding: 5px 0 3px;
        width: 100%;
    }

    body.fm-exported nav[data-fm-responsive-ready="true"].is-open .fm-responsive-nav-panel {
        display: flex;
    }

    body.fm-exported .fm-responsive-nav-links {
        align-items: stretch !important;
        flex-direction: column;
        gap: 0 !important;
        justify-content: flex-start !important;
        width: 100% !important;
    }

    body.fm-exported .fm-responsive-nav-links a {
        align-items: center;
        border-bottom: 1px solid rgba(74, 48, 26, 0.1);
        display: flex;
        min-height: 44px;
        padding: 10px 4px;
        width: 100%;
    }

    body.fm-exported .fm-responsive-nav-action {
        align-items: center;
        display: inline-flex;
        justify-content: center;
        min-height: 46px;
        text-align: center;
        width: 100%;
    }
}

/* Compact multi-card grids stay two-up on tablets. */
@media (max-width: 980px) {
    body.fm-exported [style*="grid-template-columns:repeat(3,"],
    body.fm-exported [style*="grid-template-columns:repeat(4,"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.fm-exported #gallery [style*="grid-template-columns:repeat(4,"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Structural columns stack once their copy becomes cramped. */
@media (max-width: 860px) {
    body.fm-exported [style*="grid-template-columns:1.5fr 1fr"],
    body.fm-exported [style*="grid-template-columns:1.15fr .85fr"],
    body.fm-exported [style*="grid-template-columns:1.1fr .9fr"],
    body.fm-exported [style*="grid-template-columns:1.1fr 0.9fr"],
    body.fm-exported [style*="grid-template-columns:1.1fr 1fr"],
    body.fm-exported [style*="grid-template-columns:1fr 1.15fr"],
    body.fm-exported [style*="grid-template-columns:1.05fr .95fr"],
    body.fm-exported [style*="grid-template-columns:1fr 1fr"],
    body.fm-exported [style*="grid-template-columns:1.4fr 1fr 1fr"],
    body.fm-exported [style*="grid-template-columns:minmax(280px"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.fm-exported .jdm-quick-facts,
    body.fm-exported .jdm-awards-grid,
    body.fm-exported .jdm-allowances {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.fm-exported .booking-panel {
        position: static !important;
        scroll-margin-top: 82px;
    }
}

@media (max-width: 820px), (pointer: coarse) {
    body.fm-exported .booking-site-marker,
    body.fm-exported button[style*="width:30px"][style*="height:30px"],
    body.fm-exported button[style*="width:28px"][style*="height:28px"] {
        height: 44px !important;
        min-width: 44px !important;
        width: 44px !important;
    }
}

@media (max-width: 640px) {
    /* Preserve full-width colour bands, but tighten their centered content. */
    body.fm-exported section:not([style*="max-width"]) {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.fm-exported section[style*="max-width"],
    body.fm-exported section > div[style*="max-width"][style*="margin:0 auto"],
    body.fm-exported footer [style*="max-width"][style*="margin:0 auto"],
    body.fm-exported header > nav {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    body.fm-exported input:not([type="checkbox"]):not([type="radio"]),
    body.fm-exported select,
    body.fm-exported textarea {
        font-size: 16px !important;
        max-width: 100%;
        min-height: 44px;
    }

    body.fm-exported textarea {
        min-height: 120px;
    }

    body.fm-exported a[href^="tel:"],
    body.fm-exported a[href^="mailto:"] {
        overflow-wrap: anywhere;
    }

    body.fm-exported footer a {
        align-items: center;
        display: inline-flex;
        min-height: 44px;
    }

    body.fm-exported [style*="grid-template-columns:repeat(auto-fit,minmax("] {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.fm-exported [style*="grid-template-columns:repeat(3,"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.fm-exported #gallery [style*="grid-template-columns:repeat(4,"] {
        grid-auto-rows: 130px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.fm-exported [style*="padding:72px 48px"] {
        padding: 42px 20px !important;
    }

    body.fm-exported .mw-card[style*="padding:30px"],
    body.fm-exported .jdm-card[style*="padding:26px"],
    body.fm-exported .contact-form-card,
    body.fm-exported .longterm-pricing-card {
        padding: 22px !important;
    }

    body.fm-exported .contact-info-card {
        gap: 12px !important;
        padding: 18px !important;
    }

    body.fm-exported .contact-form-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.fm-exported .home-stay-actions,
    body.fm-exported .home-stay-price-row {
        align-items: flex-start !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    body.fm-exported .home-arrival-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.fm-exported .fm-after-hours-availability-inner,
    body.fm-exported .fm-pricing-live-availability {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    body.fm-exported .fm-after-hours-availability-inner > div:first-child,
    body.fm-exported .fm-pricing-live-availability > div:first-child {
        min-width: 0;
        width: 100%;
    }

    body.fm-exported .fm-after-hours-availability-inner > a,
    body.fm-exported .fm-pricing-live-availability > a {
        align-items: center;
        display: inline-flex;
        justify-content: center;
        min-height: 44px;
        text-align: center;
        width: 100%;
    }

    body.fm-exported .mw-featured-image,
    body.fm-exported .jdm-compound-image {
        min-height: 270px !important;
    }

    body.fm-exported .mw-banner-scroll {
        border-radius: 20px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }

    body.fm-exported .mw-banner-art {
        max-width: none !important;
        width: 560px !important;
    }

    body.fm-exported .booking-panel [style="display:flex;gap:10px"] {
        flex-wrap: wrap !important;
    }

    body.fm-exported .booking-panel [style="display:flex;gap:10px"] > label {
        flex: 1 1 100% !important;
    }

    body.fm-exported .booking-map,
    body.fm-exported .booking-panel {
        border-radius: 16px !important;
        padding: 16px !important;
    }

    body.fm-exported .booking-map [style*="overflow:auto"] {
        -webkit-overflow-scrolling: touch;
    }

    body.fm-exported button[style*="width:30px"][style*="height:30px"],
    body.fm-exported button[style*="width:28px"][style*="height:28px"] {
        height: 44px !important;
        min-width: 44px !important;
        width: 44px !important;
    }

    body.fm-exported .booking-site-marker {
        height: 44px !important;
        width: 44px !important;
    }

    body.fm-exported .booking-unit-button {
        min-height: 44px !important;
        min-width: 48px;
    }

    body.fm-exported .booking-service-filter-card {
        min-height: 64px;
    }

    body.fm-exported .booking-price-line {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    body.fm-exported .booking-price-line-label {
        flex: 1 1 190px;
        min-width: 0;
    }

    body.fm-exported .booking-price-line-amount {
        flex: none;
        margin-left: auto;
    }

    body.fm-exported .booking-selected-site-row {
        align-items: flex-start !important;
        flex-wrap: wrap !important;
    }

    body.fm-exported .booking-selected-site-copy {
        flex: 1 1 calc(100% - 38px) !important;
    }

    body.fm-exported .booking-selected-site-price {
        align-items: center;
        display: flex;
        flex: 1 1 100% !important;
        justify-content: space-between;
        margin-left: 34px;
        text-align: left !important;
    }

    body.fm-exported .booking-remove-site {
        align-items: center;
        display: inline-flex;
        justify-content: center;
        min-height: 44px;
        padding: 7px 2px 7px 14px !important;
    }

    body.fm-exported .amenity-carousel-dot {
        align-items: center;
        background: transparent !important;
        border: 0 !important;
        cursor: pointer;
        display: inline-flex;
        height: 44px !important;
        justify-content: center;
        padding: 0 !important;
        width: 44px !important;
    }

    body.fm-exported .amenity-carousel-dot-visual {
        display: block;
        pointer-events: none;
    }

    body.fm-exported .longterm-apply-cta {
        text-align: center;
        white-space: normal !important;
    }
}

@media (max-width: 480px) {
    body.fm-exported .booking-service-filter-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.fm-exported .jdm-quick-facts,
    body.fm-exported .jdm-awards-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.fm-exported .pricing-longterm-actions,
    body.fm-exported .pricing-longterm-rates,
    body.fm-exported .pricing-sauna-rates,
    body.fm-exported .longterm-rate-row {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    body.fm-exported .pricing-longterm-actions > a,
    body.fm-exported .longterm-apply-cta {
        align-items: center;
        display: inline-flex !important;
        justify-content: center;
        width: 100%;
    }

    body.fm-exported .pricing-view-toggle-button {
        flex: 1;
    }
}

@media (max-width: 380px) {
    body.fm-exported section[style*="max-width"],
    body.fm-exported section > div[style*="max-width"][style*="margin:0 auto"],
    body.fm-exported footer [style*="max-width"][style*="margin:0 auto"],
    body.fm-exported header > nav {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    body.fm-exported .fm-responsive-nav-toggle > span:last-child {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    body.fm-exported .jdm-allowances {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fm-responsive-nav-icon span {
        transition: none;
    }
}
