@import './tokens/color-context.css';

/* LDS-152: keep native search clearing, but paint its browser-owned glyph with
   Luna tokens on pages loading this foundation, including SearchInput and
   SelectMenu. The mask follows the shared x-close icon's geometry; its
   black stroke is an alpha mask, not a display color. Browsers without this
   pseudo-element retain their existing search behavior. */
input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  inline-size: var(--luna-primitive-space-16);
  block-size: var(--luna-primitive-space-16);
  background-color: var(--luna-color-text-secondary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 6 6 18M6 6l12 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 6 6 18M6 6l12 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  cursor: pointer;
}

input[type='search']::-webkit-search-cancel-button:hover,
input[type='search']::-webkit-search-cancel-button:active {
  background-color: var(--luna-color-text-primary);
}

/* Preserve visibility in system high-contrast palettes, where author
   background colors are replaced. */
@media (forced-colors: active) {
  input[type='search']::-webkit-search-cancel-button,
  input[type='search']::-webkit-search-cancel-button:hover,
  input[type='search']::-webkit-search-cancel-button:active {
    background-color: ButtonText;
    forced-color-adjust: none;
  }
}

html,
body,
.body-wrapper {
  /* Shared link underline motion is not tokenized yet, so keep it centralized here. */
  --luna-link-underline-motion-duration: 180ms;
  --luna-link-underline-motion-easing: cubic-bezier(0.22, 1, 0.36, 1);

  margin: 0;
  padding: 0;
  font-family: var(--luna-typography-body-body-2-font-family), sans-serif;
  font-size: var(--luna-typography-body-body-2-font-size);
  font-style: var(--luna-typography-body-body-2-font-style);
  font-weight: var(--luna-typography-body-body-2-font-weight);
  letter-spacing: var(--luna-typography-body-body-2-letter-spacing);
  line-height: var(--luna-typography-body-body-2-line-height);
  color: var(--luna-color-text-primary);
  background-color: var(--luna-color-bg-canvas);
}

body {
  min-width: 100%;
}

.body-wrapper {
  --luna-header-sticky-offset: 0px;

  min-height: 100vh;
}

@media (min-width: 769px) {
  .body-wrapper.hs-content-id-214008798627 {
    /* The homepage currently shows a runtime-injected promo bar above the Luna
       header on larger breakpoints only. Keep the sticky offset scoped to that
       page and viewport range so mobile and all non-home pages stay flush. */
    --luna-header-sticky-offset: var(--luna-primitive-space-40);
  }
}

.body-wrapper
  > [data-global-resource-path$='partials/global-header.hubl.html'] {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 200;
}

.body-wrapper > [data-global-resource-path$='partials/global-header.hubl.html'],
.body-wrapper
  > [data-global-resource-path$='partials/global-header.hubl.html']
  > .hs_cos_wrapper,
.body-wrapper
  > [data-global-resource-path$='partials/global-header.hubl.html']
  > .hs_cos_wrapper
  > [data-hs-island='true'] {
  display: block;
}

.body-wrapper,
.body-wrapper * {
  font-family: inherit;
}

.luna-page-main {
  min-block-size: 40vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--luna-color-text-primary);
  margin-block: 0;
}

h1 {
  font-family: var(--luna-typography-heading-heading-1-font-family), sans-serif;
  font-size: var(--luna-typography-heading-heading-1-font-size);
  font-style: var(--luna-typography-heading-heading-1-font-style);
  font-weight: var(--luna-typography-heading-heading-1-font-weight);
  letter-spacing: var(--luna-typography-heading-heading-1-letter-spacing);
  line-height: var(--luna-typography-heading-heading-1-line-height);
}

h2 {
  font-family: var(--luna-typography-heading-heading-2-font-family), sans-serif;
  font-size: var(--luna-typography-heading-heading-2-font-size);
  font-style: var(--luna-typography-heading-heading-2-font-style);
  font-weight: var(--luna-typography-heading-heading-2-font-weight);
  letter-spacing: var(--luna-typography-heading-heading-2-letter-spacing);
  line-height: var(--luna-typography-heading-heading-2-line-height);
}

h3 {
  font-family: var(--luna-typography-heading-heading-3-font-family), sans-serif;
  font-size: var(--luna-typography-heading-heading-3-font-size);
  font-style: var(--luna-typography-heading-heading-3-font-style);
  font-weight: var(--luna-typography-heading-heading-3-font-weight);
  letter-spacing: var(--luna-typography-heading-heading-3-letter-spacing);
  line-height: var(--luna-typography-heading-heading-3-line-height);
}

h4 {
  font-family: var(--luna-typography-heading-heading-4-font-family), sans-serif;
  font-size: var(--luna-typography-heading-heading-4-font-size);
  font-style: var(--luna-typography-heading-heading-4-font-style);
  font-weight: var(--luna-typography-heading-heading-4-font-weight);
  letter-spacing: var(--luna-typography-heading-heading-4-letter-spacing);
  line-height: var(--luna-typography-heading-heading-4-line-height);
}

h5 {
  font-family: var(--luna-typography-heading-heading-5-font-family), sans-serif;
  font-size: var(--luna-typography-heading-heading-5-font-size);
  font-style: var(--luna-typography-heading-heading-5-font-style);
  font-weight: var(--luna-typography-heading-heading-5-font-weight);
  letter-spacing: var(--luna-typography-heading-heading-5-letter-spacing);
  line-height: var(--luna-typography-heading-heading-5-line-height);
}

h6 {
  font-family: var(--luna-typography-heading-heading-6-font-family), sans-serif;
  font-size: var(--luna-typography-heading-heading-6-font-size);
  font-style: var(--luna-typography-heading-heading-6-font-style);
  font-weight: var(--luna-typography-heading-heading-6-font-weight);
  letter-spacing: var(--luna-typography-heading-heading-6-letter-spacing);
  line-height: var(--luna-typography-heading-heading-6-line-height);
}

/* Blog listing heroes stay vertically centered, including existing saved module
   instances. Keep the PageHeader defaults on other page types unchanged. */
@media (min-width: 1025px) {
  .body-wrapper.hs-blog-listing [data-desktop-content-alignment] {
    justify-content: center;
    --page-header-desktop-block-alignment: center;
    --page-header-desktop-media-object-position: center;
  }
}
