/* Hand-written fixes for imported Elementor pages (LegacyHtmlBlock). Loaded after the
   generated legacy CSS in public/elementor-legacy/elementor/; bump DIRE_LEGACY_CSS_VERSION in
   src/lib/legacy-elementor.ts when this file changes. */

/* Full-bleed legacy layout: the site <main> is not a content column. */
.dire-legacy {
  width: 100%;
  overflow-x: clip;
}

/* YouTube facades stand in for Elementor's video player slot. */
.dire-legacy .elementor-wrapper > [data-facade] {
  margin: 0;
  height: 100%;
  border-radius: 0;
}

/* Lead forms: the page's optIn block in place of the legacy form; the legacy heading stays. */
.dire-legacy .dire-inline-optin {
  width: 100%;
}
.dire-legacy .dire-inline-optin section {
  margin: 0;
  padding: 0;
  max-width: none;
  background: none;
  border-radius: 0;
}
.dire-legacy .dire-inline-optin section > h2,
.dire-legacy .dire-inline-optin section > h2 + p {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.dire-legacy .dire-inline-optin section > div {
  margin-top: 0;
}
.dire-legacy .elementor-wrapper > [data-facade] > button {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #f00;
  color: #fff;
  font-size: 20px;
  line-height: 48px;
}
.dire-legacy .elementor-wrapper > [data-facade] > button:hover,
.dire-legacy .elementor-wrapper > [data-facade] > button:focus-visible {
  background: #c00;
}

.dire-legacy [hidden] {
  display: none !important;
}

/* Plain LeadForm (no recorded look, or no JavaScript) in the Elementor form look: labelled
   fields in a grid, Mulish, lilac borders. dire-forms.js swaps in the legacy form markup. */
.dire-legacy .dire-inline-optin:not([data-dire-form-done]) form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px 30px;
  align-items: end;
  font-family: "Mulish", sans-serif;
}
.dire-legacy .dire-inline-optin:not([data-dire-form-done]) form > label > span {
  color: #524c6f;
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
}
.dire-legacy
  .dire-inline-optin:not([data-dire-form-done])
  form
  input:not([type="hidden"]) {
  width: 100%;
  min-height: 47px;
  padding: 5px 16px;
  border: 1px solid #aeb4dd;
  border-radius: 5px;
  background: #fff;
  color: #191919;
  font-family: inherit;
  font-size: 14px;
  font-weight: 300;
  line-height: 24px;
}
.dire-legacy
  .dire-inline-optin:not([data-dire-form-done])
  form
  button[type="submit"] {
  min-height: 47px;
  padding: 12px 24px;
  border: 0;
  border-radius: 5px;
  background-color: var(--e-global-color-accent, #51c36c);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
}
.dire-legacy
  .dire-inline-optin:not([data-dire-form-done])
  form
  button[type="submit"]:hover {
  background-color: #36a851;
}
.dire-legacy
  .dire-inline-optin:not([data-dire-form-done])
  form:has(input[name="phone"])
  button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
  min-width: 160px;
}
.dire-legacy
  .dire-inline-optin:not([data-dire-form-done])
  form
  > p[data-capture-status] {
  grid-column: 1 / -1;
  margin: 0;
}
@media (min-width: 768px) {
  .dire-legacy
    .dire-inline-optin:not([data-dire-form-done])
    form:has(input[name="phone"]) {
    grid-template-columns: 1fr 1fr;
  }
}
.dire-legacy .elementor-wrapper > [data-facade] > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* WordPress block-editor presets (the core default palette and font sizes) used by
   default-template legacy pages; legacy printed them as global-styles inline CSS. */
.dire-legacy .has-black-color {
  color: #000 !important;
}
.dire-legacy .has-white-color {
  color: #fff !important;
}
.dire-legacy .has-black-background-color {
  background-color: #000 !important;
}
.dire-legacy .has-white-background-color {
  background-color: #fff !important;
}
.dire-legacy .has-cyan-bluish-gray-background-color {
  background-color: #abb8c3 !important;
}
.dire-legacy .has-pale-pink-background-color {
  background-color: #f78da7 !important;
}
.dire-legacy .has-vivid-red-background-color {
  background-color: #cf2e2e !important;
}
.dire-legacy .has-luminous-vivid-orange-background-color {
  background-color: #ff6900 !important;
}
.dire-legacy .has-luminous-vivid-amber-background-color {
  background-color: #fcb900 !important;
}
.dire-legacy .has-light-green-cyan-background-color {
  background-color: #7bdcb5 !important;
}
.dire-legacy .has-vivid-green-cyan-background-color {
  background-color: #00d084 !important;
}
.dire-legacy .has-pale-cyan-blue-background-color {
  background-color: #8ed1fc !important;
}
.dire-legacy .has-vivid-cyan-blue-background-color {
  background-color: #0693e3 !important;
}
.dire-legacy .has-vivid-purple-background-color {
  background-color: #9b51e0 !important;
}
.dire-legacy .has-small-font-size {
  font-size: 13px !important;
}
.dire-legacy .has-medium-font-size {
  font-size: 20px !important;
}
.dire-legacy .has-large-font-size {
  font-size: 36px !important;
}
.dire-legacy .has-x-large-font-size {
  font-size: 42px !important;
}
.dire-legacy p.has-background {
  padding: 1.25em 2.375em;
}
@media (max-width: 767px) {
  .dire-legacy
    .dire-inline-optin:not([data-dire-form-done])
    form
    button[type="submit"] {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }
}

/* Dressed capture forms (dire-forms.js): the status line spans the row. */
.dire-legacy .dire-inline-optin form.elementor-form > p[data-capture-status] {
  margin: 8px 0 0;
}

/* Text-editor and classic-content lists: the site's Tailwind preflight strips list markers and
   indents that legacy left to the browser defaults. */
.dire-legacy
  :where(.elementor-widget-text-editor, .page-content)
  :where(ul, ol) {
  margin-block: 0 0.9rem;
  padding-inline-start: 40px;
}
.dire-legacy :where(.elementor-widget-text-editor, .page-content) ul {
  list-style: disc;
}
.dire-legacy :where(.elementor-widget-text-editor, .page-content) ol {
  list-style: decimal;
}
.dire-legacy
  :where(.elementor-widget-text-editor, .page-content)
  :where(ul ul, ol ul) {
  list-style: circle;
  margin-block-end: 0;
}

/* Knowledge-base search (sanitize.ts KB_SEARCH_HTML) in BetterDocs' layout-1 look: a 50px
   margin and padding band (#f9fafb) around a 66px bar, measured on the live page. */
.dire-legacy .betterdocs-search-form-widget-wrapper {
  max-width: 1080px;
  margin: 50px auto;
  padding: 50px 15px;
  background: #f9fafb;
}
.dire-legacy .dire-kb-search {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 656px;
  height: 66px;
  margin: 0 auto;
  padding: 12px 12px 12px 20px;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #fff;
  font-family: "Mulish", sans-serif;
}
.dire-legacy .dire-kb-search__field {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 15px;
  margin-right: 10px;
  color: #98a2b3;
}
.dire-legacy .dire-kb-search__icon {
  flex: none;
  width: 20px;
  height: 20px;
}
.dire-legacy .dire-kb-search__field input {
  flex: 1;
  min-width: 0;
  height: 20px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #344054;
  font: inherit;
  font-size: 16px;
}
/* No native search-field chrome: its inner padding and cancel button clip the placeholder. */
.dire-legacy .dire-kb-search__field input {
  appearance: none;
}
.dire-legacy .dire-kb-search__field input::-webkit-search-decoration,
.dire-legacy .dire-kb-search__field input::-webkit-search-cancel-button {
  display: none;
}
.dire-legacy .dire-kb-search__field input::placeholder {
  color: #667085;
  opacity: 1;
}
.dire-legacy .dire-kb-search .dire-kb-search__button {
  flex: none;
  height: 40px;
  padding: 0 32px;
  border: 0;
  border-radius: 6px;
  background: #667085;
  color: #fff;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.dire-legacy .dire-kb-search .dire-kb-search__button:hover {
  background: #475467;
}
/* Phones: the band keeps its 50px margin and padding, so the bar is only ~170px wide; legacy
   lets the icon, the placeholder and the full-size button overflow it, centred. */
@media (max-width: 767px) {
  .dire-legacy .betterdocs-search-form-widget-wrapper {
    margin: 50px;
    padding: 50px;
  }
  .dire-legacy .dire-kb-search__field {
    flex: none;
    gap: 14px;
  }
  .dire-legacy .dire-kb-search__field input {
    flex: none;
    width: 53px;
  }
}

/* Classic (non-Elementor) content: WordPress global styles underline links. */
.dire-legacy .page-content a:where(:not(.wp-element-button)) {
  text-decoration: underline;
}

/* Embedded iframes (Google Calendar on the events page) keep inside the content column on
   phones, as Hello's reset (iframe max-width:100%) did on legacy. */
.dire-legacy iframe {
  max-width: 100%;
}

/* Legacy pages end flush on the footer (the Elementor page's last band touched it). */
#main:has(> article > [data-legacy-html]) + footer {
  margin-top: 0;
}

/* Checkbox/radio groups in a dressed form keep their label on top when a taller neighbour
   stretches the row (legacy Elementor's JS-free layout showed them top-aligned). */
.dire-legacy .dire-inline-optin
  :is(.elementor-field-type-checkbox, .elementor-field-type-radio) {
  align-content: flex-start;
}

/* Home's latest-posts grid (listing 35630 inside widget d897317): on phones legacy shows the
   small cards without their thumbnail, keeping only the empty image link's line (44px above the
   category row with the widget's margin), while the same listing keeps its thumbnails on other
   pages (Best Strategies) and on wider screens. The legacy markup and Elementor CSS carry no
   hide class or rule for it (the hide comes from outside the localized sheets), so it is
   restated here for the home grid only. */
@media (max-width: 767px) {
  .dire-legacy .elementor-element-d897317 .elementor-35630 .elementor-element-33b4890 img {
    display: none;
  }
}

/* /latest-deals/ market and strategy filter (lib/deal-filter.ts): the legacy JetSmartFilters
   radio buttons. The input stays focusable but invisible; its label is the pill. */
.dire-legacy [data-deal-filter] fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
}
.dire-legacy [data-deal-filter] .jet-radio-list__item {
  display: block;
  position: relative;
  cursor: pointer;
}
.dire-legacy [data-deal-filter] .jet-radio-list__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.dire-legacy [data-deal-filter] .jet-radio-list__input:focus-visible ~ .jet-radio-list__button {
  outline: 2px solid #1e4c64;
  outline-offset: 2px;
}
