{"id":10,"date":"2018-08-29T20:03:44","date_gmt":"2018-08-29T20:03:44","guid":{"rendered":"https:\/\/decellesconsulting.com\/search-results\/"},"modified":"2025-10-03T13:47:12","modified_gmt":"2025-10-03T17:47:12","slug":"search-results","status":"publish","type":"page","link":"https:\/\/resortlacstemarie.com\/fr\/search-results\/","title":{"rendered":"S\u00e9lectionnez un h\u00e9bergement"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"10\" class=\"elementor elementor-10\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2da2baf e-con-full e-flex e-con e-parent\" data-id=\"2da2baf\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t<div class=\"elementor-element elementor-element-6836c62 e-con-full e-flex e-con e-child\" data-id=\"6836c62\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-14c668a elementor-widget elementor-widget-mphbe-search-results\" data-id=\"14c668a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"mphbe-search-results.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"mphb_sc_search_results-wrapper \"><div class=\"mphb-errors-wrapper\">\n\t<\/div>\n<\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e19dca2 elementor-widget elementor-widget-html\" data-id=\"e19dca2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<script>\r\n   document.addEventListener('DOMContentLoaded', function () {\r\n    \/\/ Select the parent wrapper that contains the cards and other elements\r\n    const wrapper = document.querySelector('.mphb_sc_search_results-wrapper');\r\n    document.body.classList.add('loaded'); \/\/ Ensures smooth reveal\r\n    \r\n    if (wrapper) {\r\n        \/\/ Create a new div that will hold the cards as a grid\r\n        const cardWrapper = document.createElement('div');\r\n        cardWrapper.classList.add('card-wrapper'); \/\/ Add class for styling\r\n        wrapper.appendChild(cardWrapper); \/\/ Append it to the original wrapper\r\n        \r\n        \/\/ Move all room cards (mphb-room-type) into the new wrapper\r\n        const roomCards = document.querySelectorAll('.mphb-room-type');\r\n        \r\n        roomCards.forEach(card => {\r\n            \/\/ Add specific classes to elements inside the card\r\n            const image = card.querySelector('.post-thumbnail');\r\n            const title = card.querySelector('.mphb-room-type-title');\r\n            const description = card.querySelector('.mphb-room-type-title ~ p');\r\n\r\n            if (image) image.classList.add('room-image'); \/\/ Add 'room-image' class\r\n            if (title) title.classList.add('room-title'); \/\/ Add 'room-title' class\r\n            if (description) description.classList.add('room-description'); \/\/ Add 'room-description' class\r\n\r\n            cardWrapper.appendChild(card);\r\n        });\r\n    }\r\n\r\n    const cardWrapper = document.querySelector('.card-wrapper');\r\n    \r\n    function setUniformAreaHeights() {\r\n        \/\/ Select all the cards\r\n        const cards = document.querySelectorAll('.mphb-room-type');\r\n\r\n        \/\/ Define the grid-area classes to target\r\n        const areaSelectors = {\r\n            image: '.room-image',\r\n            title: '.room-title',\r\n            description: '.room-description',\r\n            'regular-price': '.mphb-regular-price',\r\n            'book-button': '.mphb-reserve-room-section',\r\n            'detail-button': '.mphb-view-details-button-wrapper'\r\n        };\r\n    \r\n        \/\/ Loop through each grid-area type\r\n        Object.keys(areaSelectors).forEach(area => {\r\n            let maxHeight = 0;\r\n            \/\/ Calculate the maximum height for this area across all cards\r\n            cards.forEach((card, index) => {\r\n                const element = card.querySelector(areaSelectors[area]);\r\n                if (element) {\r\n                    element.style.height = 'auto'; \/\/ Reset height before recalculating\r\n                    const elementHeight = element.offsetHeight;\r\n    \r\n                    if (elementHeight > maxHeight) {\r\n                        maxHeight = elementHeight;\r\n                    }\r\n                } \r\n            });\r\n    \r\n            \/\/ Apply the maximum height to all elements of this area\r\n            cards.forEach((card, index) => {\r\n                const element = card.querySelector(areaSelectors[area]);\r\n                if (element) {\r\n                    element.style.height = `${maxHeight}px`;\r\n                }\r\n            });\r\n        });\r\n    }\r\n\r\n\r\n    function setCardHeights() {\r\n        const cards = document.querySelectorAll('.mphb-room-type');\r\n    \r\n        \/\/ Reset all card heights to auto so they can expand naturally\r\n        cards.forEach(card => {\r\n            card.style.height = 'auto'; \/\/ Allow cards to grow if needed\r\n        });\r\n    \r\n        \/\/ Now apply uniform heights only to inner sections, not the card itself\r\n        setUniformAreaHeights(); \r\n    }\r\n\r\n    \/\/ Call the function to set uniform heights for each area\r\n    setUniformAreaHeights();\r\n    \r\n    \/\/ Call the function to adjust card heights\r\n    setCardHeights();\r\n\r\n    \/\/ Re-adjust heights on window resize\r\n    window.addEventListener('resize', function () {\r\n        setUniformAreaHeights();\r\n        setCardHeights();\r\n    });\r\n    \r\n\r\n\r\n    document.addEventListener('click', function (event) {\r\n        let bookButton = event.target.closest('.mphb-book-button');\r\n        let reserveSection = event.target.closest('.mphb-reserve-room-section');\r\n    \r\n        if (bookButton) {\r\n            \/\/ Wait for the section to expand before recalculating heights\r\n                let expandedSection = bookButton.closest('.mphb-room-type').querySelector('.mphb-reserve-room-section');\r\n    \r\n                if (expandedSection) {\r\n                    setTimeout(() => {\r\n                        setUniformAreaHeights();\r\n                        setCardHeights();\r\n                }, 300); \/\/ Allow for animation delay\r\n            } \r\n        }\r\n    \r\n        if (reserveSection && !bookButton) { \/\/ Prevent double execution\r\n            requestAnimationFrame(() => {\r\n                setUniformAreaHeights();\r\n                setCardHeights();\r\n            });\r\n        }\r\n    }, true); \/\/ Capture phase\r\n\r\n\r\n    \/\/ Watch for changes in the .card-wrapper area\r\n    const observer = new MutationObserver(() => {\r\n        setUniformAreaHeights();\r\n        setCardHeights();\r\n    });\r\n\r\n    \/\/ Start observing the card wrapper for child changes (add\/remove)\r\n    if (cardWrapper) {\r\n        observer.observe(cardWrapper, { childList: true, subtree: true });\r\n    }\r\n    \r\n});\r\n\r\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a877b20 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a877b20\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4ca74ad\" data-id=\"4ca74ad\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b2af8a0 elementor-widget elementor-widget-spacer\" data-id=\"b2af8a0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":32,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_eb_attr":"","om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-10","page","type-page","status-publish","hentry"],"aioseo_notices":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/resortlacstemarie.com\/fr\/wp-json\/wp\/v2\/pages\/10","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/resortlacstemarie.com\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/resortlacstemarie.com\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/resortlacstemarie.com\/fr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/resortlacstemarie.com\/fr\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":76,"href":"https:\/\/resortlacstemarie.com\/fr\/wp-json\/wp\/v2\/pages\/10\/revisions"}],"predecessor-version":[{"id":58859,"href":"https:\/\/resortlacstemarie.com\/fr\/wp-json\/wp\/v2\/pages\/10\/revisions\/58859"}],"wp:attachment":[{"href":"https:\/\/resortlacstemarie.com\/fr\/wp-json\/wp\/v2\/media?parent=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}