/* ekosphere DS 10.4.18 — frontend safety fixes */
@media (max-width: 767px) {
  body:not(.wp-admin) main#content.montenegro-listings-page :where(.ek-services-grid,.ek-grid-cards) > .ek-card,
  body:not(.wp-admin) main#content.ml-homepage :where(.ek-services-grid,.ek-grid-cards) > .ek-card {
    height: auto !important;
    min-height: 0 !important;
    align-self: start !important;
  }

  body:not(.wp-admin) main#content.montenegro-listings-page :where(.ek-services-grid,.ek-grid-cards) > .ek-card > figure.ek-card__media,
  body:not(.wp-admin) main#content.ml-homepage :where(.ek-services-grid,.ek-grid-cards) > .ek-card > figure.ek-card__media {
    margin-top: 12px !important;
    margin-bottom: 14px !important;
    min-height: 0 !important;
    height: auto !important;
  }

  body:not(.wp-admin) main#content.montenegro-listings-page :where(.ek-services-grid,.ek-grid-cards) > .ek-card > figure.ek-card__media img,
  body:not(.wp-admin) main#content.ml-homepage :where(.ek-services-grid,.ek-grid-cards) > .ek-card > figure.ek-card__media img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body:not(.wp-admin) main#content.montenegro-listings-page :where(.ek-services-grid,.ek-grid-cards) > .ek-card > .ek-card__cta,
  body:not(.wp-admin) main#content.ml-homepage :where(.ek-services-grid,.ek-grid-cards) > .ek-card > .ek-card__cta {
    margin-top: 14px !important;
  }
}

/* Floating controls are a mobile aid. On desktop they obscure headings and
   duplicate the primary navigation, so the DS suppresses the legacy bar. */
@media (min-width: 901px) {
  html body:not(.wp-admin) {
    padding-bottom: 0 !important;
  }

  html body:not(.wp-admin) .planb-bottom-nav,
  html body:not(.wp-admin) nav.planb-bottom-nav[data-planb-bottom-nav] {
    display: none !important;
  }
}

/* ekosphere DS 10.5.35 — authoritative runtime layer.
 * This file is enqueued after the active theme, so the corrections also reach
 * child themes that were created before the current DS version. */
:root {
  --ekds-content-max: var(--ek-site-max, 1100px);
}

/* Domain palette is request-derived, so a migrated installation never keeps
 * the source domain's visual tokens. */
body.ekds-domain-immorenta-me:not(.wp-admin) {
  --ek-primary: #8b6a32 !important;
  --ek-primary-dark: #60471f !important;
  --ek-secondary: #163b3b !important;
  --ek-accent: #c7a45e !important;
  --ek-cta: #163b3b !important;
  --ek-cta-hover: #0d2929 !important;
  --ek-whatsapp: #128c7e !important;
  --ek-whatsapp-hover: #0d5f56 !important;
  --ek-ink: #17212b !important;
  --ek-text-muted: #58636b !important;
  --ek-bg: #f7f5f0 !important;
  --ek-card-bg: #ffffff !important;
  --ek-card-soft: #eeeae2 !important;
  --ek-card-bg-unified: #eeeae2 !important;
  --ek-card-border-unified: #8b6a32 !important;
  --ek-border: #d3cbbf !important;
  --ek-note-bg: #ffffff !important;
  --ek-note-border: #8b6a32 !important;
  --ek-link: #145b57 !important;
  --ek-link-hover: #0c3d3a !important;
}

/* One content axis for standalone DS blocks that do not carry .ek-container. */
body:not(.wp-admin) main#content > :is(
  p, ul, ol,
  .ek-note, .ek-hinweis, .ek-info, .ek-info-box, .ek-box--note,
  .ek-card--note, .ekex-decision-note,
  .ek-topic-area, .ek-topic-context, .ek-related-topic, .ek-page-topic,
  .eko-post-meta-updated, .ekds-content-width
),
body:not(.wp-admin) main#content .ekds-content-width,
body:not(.wp-admin) main#content :is(
  .ek-topic-area, .ek-topic-context, .ek-related-topic, .ek-page-topic,
  .eko-post-meta-updated
) {
  width: 100% !important;
  max-width: var(--ekds-content-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* Longer explanatory and concluding copy is always justified. */
body:not(.wp-admin) main#content :is(
  .ek-note, .ek-hinweis, .ek-info, .ek-info-box, .ek-box--note,
  .ek-card--note, .ekex-decision-note, .ek-services-intro-text,
  .ek-topic-area, .ek-topic-context, .ek-related-topic, .ek-page-topic
),
body:not(.wp-admin) main#content :is(
  .ek-note, .ek-hinweis, .ek-info, .ek-info-box, .ek-box--note,
  .ek-card--note, .ekex-decision-note, .ek-services-intro-text,
  .ek-topic-area, .ek-topic-context, .ek-related-topic, .ek-page-topic
) :is(p, li, span) {
  text-align: justify !important;
  text-justify: inter-word !important;
}

/* ImmoRenta note contract: white surface and exactly 1px bronze border. */
body.ekds-domain-immorenta-me:not(.wp-admin) main#content :is(
  .ek-note, .ek-note.warn, .ek-note--hint, .ek-note--sources,
  .ek-card.ek-note, .ek-card.warn, .ek-card--note, .ek-card--hint,
  .ek-card--info, .ek-hinweis, .ek-hint, .ek-info, .ek-info-box,
  .ek-box--note, .ek-box--hint, .ekex-decision-note
) {
  background-color: #ffffff !important;
  background: #ffffff !important;
  border: 1px solid #8b6a32 !important;
  border-left: 1px solid #8b6a32 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

/* TOC title must remain white for every interactive hover/focus state. */
body:not(.wp-admin) main#content .ek-faq--toc > details > summary:hover,
body:not(.wp-admin) main#content .ek-faq--toc > details > summary:focus,
body:not(.wp-admin) main#content .ek-faq--toc > details > summary:focus-visible,
body:not(.wp-admin) main#content .ek-faq--toc > details > summary:hover *,
body:not(.wp-admin) main#content .ek-faq--toc > details > summary:focus *,
body:not(.wp-admin) main#content .ek-faq--toc > details > summary:focus-visible * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* One bundled icon per WhatsApp target; old textual chevrons/pseudo-icons end here. */
body:not(.wp-admin) a.ek-wa-cta::before,
body:not(.wp-admin) a.ek-wa-cta::after,
body:not(.wp-admin) a[href*="wa.me/"]::before,
body:not(.wp-admin) a[href*="wa.me/"]::after,
body:not(.wp-admin) a[href*="whatsapp.com/channel/"]::before,
body:not(.wp-admin) a[href*="whatsapp.com/channel/"]::after {
  content: none !important;
  display: none !important;
}

body:not(.wp-admin) a.ek-wa-cta {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center;
  gap: .55em;
}

body:not(.wp-admin) a.ek-wa-cta > img.ek-wa-icon {
  display: inline-block !important;
  width: 1.25em !important;
  height: 1.25em !important;
  min-width: 1.25em !important;
  max-width: 1.25em !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  object-fit: contain !important;
  flex: 0 0 1.25em;
}

@media (max-width: 767px) {
  body:not(.wp-admin) main#content > :is(
    p, ul, ol,
    .ek-note, .ek-hinweis, .ek-info, .ek-info-box, .ek-box--note,
    .ek-card--note, .ekex-decision-note,
    .ek-topic-area, .ek-topic-context, .ek-related-topic, .ek-page-topic,
    .eko-post-meta-updated, .ekds-content-width
  ),
  body:not(.wp-admin) main#content .ekds-content-width {
    max-width: 100% !important;
  }
}
