/*
 * Montenegro Listings v3.0.3 — CTA + TOC hardening
 * Purpose: preserve PageSpeed CSS reduction while restoring strong WhatsApp CTA styling
 * and exact centered Table of Contents summaries.
 */

:root {
    --ml-wa-cta: var(--epf-whatsapp, var(--ek-whatsapp, #128C7E));
    --ml-wa-cta-hover: var(--epf-whatsapp-hover, var(--ek-whatsapp-hover, #2F2F2F));
    --ml-wa-cta-text: #FFFFFF;
    --ml-wa-cta-icon: #FFFFFF;
}

/* WhatsApp CTAs: align with Ekosphere Property Frontend color logic. */
body:not(.wp-admin) :where(
    a.ek-btn--whatsapp,
    a.ek-cta__link--whatsapp,
    .ek-cta__links a[href*="wa.me"],
    .ek-cta__links a[href*="api.whatsapp.com"],
    .ek-hero a[href*="wa.me"],
    .ek-section a.ek-btn[href*="wa.me"],
    .ek-section a.ek-btn[href*="api.whatsapp.com"],
    .entry-content a.ek-btn[href*="wa.me"],
    .entry-content a.ek-btn[href*="api.whatsapp.com"],
    .ml-slim-footer__cta,
    .ml-slim-footer__cta:link,
    .ml-slim-footer__cta:visited
) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    min-height: 44px !important;
    padding: 12px 22px !important;
    background: var(--ml-wa-cta) !important;
    background-color: var(--ml-wa-cta) !important;
    border: 1px solid var(--ml-wa-cta) !important;
    color: var(--ml-wa-cta-text) !important;
    -webkit-text-fill-color: var(--ml-wa-cta-text) !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

body:not(.wp-admin) :where(
    a.ek-btn--whatsapp,
    a.ek-cta__link--whatsapp,
    .ek-cta__links a[href*="wa.me"],
    .ek-cta__links a[href*="api.whatsapp.com"],
    .ek-hero a[href*="wa.me"],
    .ek-section a.ek-btn[href*="wa.me"],
    .ek-section a.ek-btn[href*="api.whatsapp.com"],
    .entry-content a.ek-btn[href*="wa.me"],
    .entry-content a.ek-btn[href*="api.whatsapp.com"],
    .ml-slim-footer__cta
):hover,
body:not(.wp-admin) :where(
    a.ek-btn--whatsapp,
    a.ek-cta__link--whatsapp,
    .ek-cta__links a[href*="wa.me"],
    .ek-cta__links a[href*="api.whatsapp.com"],
    .ek-hero a[href*="wa.me"],
    .ek-section a.ek-btn[href*="wa.me"],
    .ek-section a.ek-btn[href*="api.whatsapp.com"],
    .entry-content a.ek-btn[href*="wa.me"],
    .entry-content a.ek-btn[href*="api.whatsapp.com"],
    .ml-slim-footer__cta
):focus,
body:not(.wp-admin) :where(
    a.ek-btn--whatsapp,
    a.ek-cta__link--whatsapp,
    .ek-cta__links a[href*="wa.me"],
    .ek-cta__links a[href*="api.whatsapp.com"],
    .ek-hero a[href*="wa.me"],
    .ek-section a.ek-btn[href*="wa.me"],
    .ek-section a.ek-btn[href*="api.whatsapp.com"],
    .entry-content a.ek-btn[href*="wa.me"],
    .entry-content a.ek-btn[href*="api.whatsapp.com"],
    .ml-slim-footer__cta
):focus-visible {
    background: var(--ml-wa-cta-hover) !important;
    background-color: var(--ml-wa-cta-hover) !important;
    border-color: var(--ml-wa-cta-hover) !important;
    color: var(--ml-wa-cta-text) !important;
    -webkit-text-fill-color: var(--ml-wa-cta-text) !important;
    text-decoration: none !important;
}

/* Replace inconsistent PNG icon rendering with a white inline SVG mask. */
body:not(.wp-admin) :where(
    a.ek-btn--whatsapp,
    a.ek-cta__link--whatsapp,
    .ek-cta__links a[href*="wa.me"],
    .ek-cta__links a[href*="api.whatsapp.com"],
    .ek-hero a[href*="wa.me"],
    .ek-section a.ek-btn[href*="wa.me"],
    .ek-section a.ek-btn[href*="api.whatsapp.com"],
    .entry-content a.ek-btn[href*="wa.me"],
    .entry-content a.ek-btn[href*="api.whatsapp.com"],
    .ml-slim-footer__cta
)::before {
    content: "" !important;
    display: inline-block !important;
    flex: 0 0 21px !important;
    width: 21px !important;
    height: 21px !important;
    background-color: var(--ml-wa-cta-icon) !important;
    background-image: none !important;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M16.04 3C9.02 3 3.32 8.63 3.32 15.56c0 2.22.59 4.38 1.71 6.28L3 29l7.37-1.91a12.9 12.9 0 0 0 5.67 1.3h.01c7.01 0 12.72-5.63 12.72-12.56C28.77 8.88 23.06 3 16.04 3Zm0 23.27h-.01c-1.87 0-3.7-.5-5.3-1.45l-.38-.23-4.37 1.13 1.17-4.2-.25-.4a10.24 10.24 0 0 1-1.58-5.46c0-5.76 4.75-10.44 10.6-10.44 2.83 0 5.49 1.1 7.49 3.08a10.28 10.28 0 0 1 3.11 7.38c0 5.76-4.75 10.59-10.58 10.59Zm5.81-7.82c-.32-.16-1.89-.92-2.18-1.03-.29-.1-.5-.16-.72.16-.21.31-.82 1.02-1 1.23-.19.21-.37.24-.69.08-.32-.16-1.35-.49-2.57-1.56-.95-.84-1.59-1.88-1.78-2.2-.18-.31-.02-.48.14-.64.14-.14.32-.37.48-.55.16-.18.21-.31.32-.52.11-.21.05-.39-.03-.55-.08-.16-.72-1.71-.98-2.34-.26-.62-.52-.53-.72-.54h-.61c-.21 0-.55.08-.84.39-.29.31-1.1 1.06-1.1 2.59s1.13 3.01 1.29 3.22c.16.21 2.23 3.35 5.4 4.69.75.32 1.34.51 1.8.65.76.24 1.45.2 2 .12.61-.09 1.89-.76 2.15-1.5.27-.73.27-1.36.19-1.5-.08-.13-.29-.21-.61-.37Z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M16.04 3C9.02 3 3.32 8.63 3.32 15.56c0 2.22.59 4.38 1.71 6.28L3 29l7.37-1.91a12.9 12.9 0 0 0 5.67 1.3h.01c7.01 0 12.72-5.63 12.72-12.56C28.77 8.88 23.06 3 16.04 3Zm0 23.27h-.01c-1.87 0-3.7-.5-5.3-1.45l-.38-.23-4.37 1.13 1.17-4.2-.25-.4a10.24 10.24 0 0 1-1.58-5.46c0-5.76 4.75-10.44 10.6-10.44 2.83 0 5.49 1.1 7.49 3.08a10.28 10.28 0 0 1 3.11 7.38c0 5.76-4.75 10.59-10.58 10.59Zm5.81-7.82c-.32-.16-1.89-.92-2.18-1.03-.29-.1-.5-.16-.72.16-.21.31-.82 1.02-1 1.23-.19.21-.37.24-.69.08-.32-.16-1.35-.49-2.57-1.56-.95-.84-1.59-1.88-1.78-2.2-.18-.31-.02-.48.14-.64.14-.14.32-.37.48-.55.16-.18.21-.31.32-.52.11-.21.05-.39-.03-.55-.08-.16-.72-1.71-.98-2.34-.26-.62-.52-.53-.72-.54h-.61c-.21 0-.55.08-.84.39-.29.31-1.1 1.06-1.1 2.59s1.13 3.01 1.29 3.22c.16.21 2.23 3.35 5.4 4.69.75.32 1.34.51 1.8.65.76.24 1.45.2 2 .12.61-.09 1.89-.76 2.15-1.5.27-.73.27-1.36.19-1.5-.08-.13-.29-.21-.61-.37Z'/%3E%3C/svg%3E") !important;
    -webkit-mask-size: contain !important;
    mask-size: contain !important;
    -webkit-mask-repeat: no-repeat !important;
    mask-repeat: no-repeat !important;
    -webkit-mask-position: center !important;
    mask-position: center !important;
}

/* Avoid duplicate low-contrast PNG icons inside footer CTA. */
body:not(.wp-admin) .ml-slim-footer__cta-icon {
    display: none !important;
}

body:not(.wp-admin) :where(
    a.ek-btn--whatsapp,
    a.ek-cta__link--whatsapp,
    .ek-cta__links a[href*="wa.me"],
    .ek-cta__links a[href*="api.whatsapp.com"],
    .ek-section a.ek-btn[href*="wa.me"],
    .ek-section a.ek-btn[href*="api.whatsapp.com"],
    .entry-content a.ek-btn[href*="wa.me"],
    .entry-content a.ek-btn[href*="api.whatsapp.com"],
    .ml-slim-footer__cta
) :where(span, strong, em) {
    color: var(--ml-wa-cta-text) !important;
    -webkit-text-fill-color: var(--ml-wa-cta-text) !important;
}

@media (max-width: 640px) {
    body:not(.wp-admin) :where(.ek-cta__links a[href*="wa.me"], .ek-cta__links a[href*="api.whatsapp.com"], .ml-slim-footer__cta) {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Table of Contents: keep title mathematically centered despite right-side arrow. */
body:not(.wp-admin) :where(.ek-faq.eko-toc, .ek-faq--toc) > details > summary,
body:not(.wp-admin) :where(.ek-faq.eko-toc, .ek-faq--toc) summary {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 48px !important;
    padding-left: 56px !important;
    padding-right: 56px !important;
    text-align: center !important;
}

body:not(.wp-admin) :where(.ek-faq.eko-toc, .ek-faq--toc) > details > summary > :where(span, strong, b),
body:not(.wp-admin) :where(.ek-faq.eko-toc, .ek-faq--toc) summary > :where(span, strong, b),
body:not(.wp-admin) :where(.ek-faq.eko-toc, .ek-faq--toc) summary .eko-toc__title,
body:not(.wp-admin) :where(.ek-faq.eko-toc, .ek-faq--toc) summary .ek-faq__question {
    display: block !important;
    width: 100% !important;
    margin: 0 auto !important;
    text-align: center !important;
    flex: 1 1 auto !important;
}

body:not(.wp-admin) :where(.ek-faq.eko-toc, .ek-faq--toc) > details > summary::before,
body:not(.wp-admin) :where(.ek-faq.eko-toc, .ek-faq--toc) summary::before {
    content: none !important;
    display: none !important;
}

body:not(.wp-admin) :where(.ek-faq.eko-toc, .ek-faq--toc) > details > summary::after,
body:not(.wp-admin) :where(.ek-faq.eko-toc, .ek-faq--toc) summary::after {
    position: absolute !important;
    right: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
}

/*
 * v3.0.4 override: use ONLY the approved PNG WhatsApp CTA icon and force readable white text.
 * Removes the v3.0.3 SVG-mask icon and hides any inline duplicate icons inside CTA links.
 */
html body:not(.wp-admin) main#content a.ek-btn--whatsapp,
html body:not(.wp-admin) main#content a.ek-cta__link--whatsapp,
html body:not(.wp-admin) main#content .ek-cta__links a[href*="wa.me"],
html body:not(.wp-admin) main#content .ek-cta__links a[href*="api.whatsapp.com"],
html body:not(.wp-admin) main#content .ek-section a.ek-btn[href*="wa.me"],
html body:not(.wp-admin) main#content .ek-section a.ek-btn[href*="api.whatsapp.com"],
html body:not(.wp-admin) main#content .entry-content a.ek-btn[href*="wa.me"],
html body:not(.wp-admin) main#content .entry-content a.ek-btn[href*="api.whatsapp.com"],
html body:not(.wp-admin) a.ml-slim-footer__cta,
html body:not(.wp-admin) a.ml-slim-footer__cta:link,
html body:not(.wp-admin) a.ml-slim-footer__cta:visited {
    background: #128C7E !important;
    background-color: #128C7E !important;
    border-color: #128C7E !important;
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    opacity: 1 !important;
    text-decoration: none !important;
    text-shadow: none !important;
}

html body:not(.wp-admin) main#content a.ek-btn--whatsapp:hover,
html body:not(.wp-admin) main#content a.ek-btn--whatsapp:focus,
html body:not(.wp-admin) main#content a.ek-btn--whatsapp:focus-visible,
html body:not(.wp-admin) main#content a.ek-cta__link--whatsapp:hover,
html body:not(.wp-admin) main#content a.ek-cta__link--whatsapp:focus,
html body:not(.wp-admin) main#content a.ek-cta__link--whatsapp:focus-visible,
html body:not(.wp-admin) main#content .ek-cta__links a[href*="wa.me"]:hover,
html body:not(.wp-admin) main#content .ek-cta__links a[href*="wa.me"]:focus,
html body:not(.wp-admin) main#content .ek-cta__links a[href*="api.whatsapp.com"]:hover,
html body:not(.wp-admin) main#content .ek-cta__links a[href*="api.whatsapp.com"]:focus,
html body:not(.wp-admin) a.ml-slim-footer__cta:hover,
html body:not(.wp-admin) a.ml-slim-footer__cta:focus,
html body:not(.wp-admin) a.ml-slim-footer__cta:focus-visible {
    background: #2F2F2F !important;
    background-color: #2F2F2F !important;
    border-color: #2F2F2F !important;
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
}

html body:not(.wp-admin) main#content a.ek-btn--whatsapp *,
html body:not(.wp-admin) main#content a.ek-cta__link--whatsapp *,
html body:not(.wp-admin) main#content .ek-cta__links a[href*="wa.me"] *,
html body:not(.wp-admin) main#content .ek-cta__links a[href*="api.whatsapp.com"] *,
html body:not(.wp-admin) main#content .ek-section a.ek-btn[href*="wa.me"] *,
html body:not(.wp-admin) main#content .ek-section a.ek-btn[href*="api.whatsapp.com"] *,
html body:not(.wp-admin) main#content .entry-content a.ek-btn[href*="wa.me"] *,
html body:not(.wp-admin) main#content .entry-content a.ek-btn[href*="api.whatsapp.com"] *,
html body:not(.wp-admin) a.ml-slim-footer__cta * {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    text-shadow: none !important;
}

html body:not(.wp-admin) main#content a.ek-btn--whatsapp img,
html body:not(.wp-admin) main#content a.ek-cta__link--whatsapp img,
html body:not(.wp-admin) main#content .ek-cta__links a[href*="wa.me"] img,
html body:not(.wp-admin) main#content .ek-cta__links a[href*="api.whatsapp.com"] img,
html body:not(.wp-admin) main#content .ek-section a.ek-btn[href*="wa.me"] img,
html body:not(.wp-admin) main#content .ek-section a.ek-btn[href*="api.whatsapp.com"] img,
html body:not(.wp-admin) main#content .entry-content a.ek-btn[href*="wa.me"] img,
html body:not(.wp-admin) main#content .entry-content a.ek-btn[href*="api.whatsapp.com"] img,
html body:not(.wp-admin) a.ml-slim-footer__cta img,
html body:not(.wp-admin) .ml-slim-footer__cta-icon {
    display: none !important;
    visibility: hidden !important;
}

html body:not(.wp-admin) main#content a.ek-btn--whatsapp::before,
html body:not(.wp-admin) main#content a.ek-cta__link--whatsapp::before,
html body:not(.wp-admin) main#content .ek-cta__links a[href*="wa.me"]::before,
html body:not(.wp-admin) main#content .ek-cta__links a[href*="api.whatsapp.com"]::before,
html body:not(.wp-admin) main#content .ek-section a.ek-btn[href*="wa.me"]::before,
html body:not(.wp-admin) main#content .ek-section a.ek-btn[href*="api.whatsapp.com"]::before,
html body:not(.wp-admin) main#content .entry-content a.ek-btn[href*="wa.me"]::before,
html body:not(.wp-admin) main#content .entry-content a.ek-btn[href*="api.whatsapp.com"]::before,
html body:not(.wp-admin) a.ml-slim-footer__cta::before {
    content: "" !important;
    display: inline-block !important;
    flex: 0 0 22px !important;
    width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    background-color: transparent !important;
    background-image: url("https://montenegro-listings.me/wp-content/uploads/2026/07/cta-whatsapp.png") !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: contain !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}
