/*
 * rem-consent.css: Real Estate Moguls privacy choices.
 * The notice, the "Privacy choices" control and the click-to-load placeholders.
 * Every surface is navy with light text, so the focus ring keeps the same contrast everywhere.
 * Phone rules ship inline with the notice markup in inc/consent.php.
 */

.rem-consent,
.rem-consent-ph,
.rem-consent-bar {
  --rem-consent-navy: #0D1B2A;
  --rem-consent-light: #F2F4F7;
  --rem-consent-ring: #29ABE2;
  font-family: var(--font-body, system-ui, -apple-system, "Segoe UI", sans-serif);
  box-sizing: border-box;
}
.rem-consent *,
.rem-consent-ph *,
.rem-consent-bar * { box-sizing: border-box; }

[data-rem-off] { display: none !important; }

.rem-consent-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Notice ──────────────────────────────────────────────────────────── */
.rem-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--rem-consent-offset, 0px);
  z-index: 10050;
  max-height: calc(100vh - var(--rem-consent-offset, 0px) - 16px);
  overflow-y: auto;
  padding: 20px 32px;
  background: var(--rem-consent-navy);
  color: #fff;
  border-top: 2px solid var(--rem-consent-ring);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
}
.rem-consent[hidden] { display: none; }
.rem-consent__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 32px;
  align-items: center;
}
.rem-consent__panel { grid-column: 1 / -1; }
.rem-consent__title {
  margin: 0 0 6px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}
.rem-consent__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #fff;
}
.rem-consent__gpc { margin-top: 8px; font-weight: 600; }
.rem-consent__link {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
}
.rem-consent__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.rem-consent__check {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin: 2px 0 0;
  accent-color: var(--rem-consent-ring);
}
.rem-consent__row-text { display: block; flex: 1; min-height: 28px; color: #fff; }
.rem-consent__row-name { display: block; font-size: 15px; font-weight: 700; }
.rem-consent__row-desc { display: block; font-size: 14px; line-height: 1.5; }
.rem-consent__check:disabled + .rem-consent__row-text { opacity: 0.7; }

.rem-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* One button style for Reject, Allow, Manage, Save and every placeholder. */
.rem-consent__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 44px;
  margin: 0;
  padding: 0 20px;
  background: var(--rem-consent-light);
  color: var(--rem-consent-navy);
  border: 2px solid var(--rem-consent-light);
  border-radius: 4px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
  cursor: pointer;
}
.rem-consent__btn[hidden] { display: none; }
.rem-consent__btn:hover { background: #fff; border-color: #fff; }

.rem-consent__btn:focus-visible,
.rem-consent__link:focus-visible,
.rem-consent__check:focus-visible,
.rem-consent__title:focus-visible,
.rem-consent-reopen:focus-visible {
  outline: 3px solid var(--rem-consent-ring);
  outline-offset: 3px;
}

/* ── "Privacy choices" control ───────────────────────────────────────── */
.rem-consent-bar {
  padding: 8px 32px;
  background: var(--rem-consent-navy);
  text-align: center;
}
.rem-consent-reopen {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  background: transparent;
  color: #fff;
  border: 0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.rem-consent-reopen[hidden] { display: none; }

/* ── Click-to-load placeholder ───────────────────────────────────────── */
.rem-consent-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 20px 16px;
  background: var(--rem-consent-navy);
  color: #fff;
  border-radius: 8px;
  text-align: center;
}
.rem-consent-ph--fill {
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: auto;
}
.rem-consent-ph__text {
  margin: 0;
  max-width: 46ch;
  font-size: 14px;
  line-height: 1.5;
  color: #fff;
}
.rem-consent-ph__btn { max-width: 100%; white-space: normal; padding-top: 8px; padding-bottom: 8px; }

@media (prefers-reduced-motion: no-preference) {
  .rem-consent__btn { transition: background-color 0.15s ease, border-color 0.15s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .rem-consent, .rem-consent *, .rem-consent-ph, .rem-consent-ph *, .rem-consent-reopen {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ── Phone widths, pages other than the card ─────────────────────────────
   The card moves the notice into the page itself (rem-myconnect.css). Every other page keeps it
   fixed at the foot of the screen, and with the choices panel open it could fill the whole
   screen and cover the page, the menu button included. Here it stops at 60% of the screen
   height and scrolls inside itself, so the top of the page stays in view. While the notice is
   showing, an open menu sits above it, so its items can be read and used; with the notice
   answered the menu keeps its usual place under the search and popup layers. Same notice, same
   buttons, same choices: only how much of the screen it may take changes. */
@media (max-width: 767px) {
  body:not(.rem-myconnect-page) .rem-consent {
    max-height: min(calc(100vh - var(--rem-consent-offset, 0px) - 16px), 60vh);
  }
}
@media (max-width: 900px) {
  body:not(.rem-myconnect-page) > .rem-consent:not([hidden]) ~ .rem-nav.open { z-index: 10060; }
}
