html.lg-search-open,
body.lg-search-open {
  overflow: hidden !important;
}

.lg-search-overlay,
.lg-search-overlay * {
  box-sizing: border-box;
  font-family: inherit;
}

.lg-search-overlay[hidden] {
  display: none !important;
}

.lg-search-overlay {
  --lg-search-ink: #111;
  --lg-search-muted: #6e6e6e;
  --lg-search-line: rgba(17, 17, 17, .14);
  --lg-search-soft: #f5f5f3;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  opacity: 0;
  transition: opacity .14s ease;
  color: var(--lg-search-ink);
}

.lg-search-overlay.is-visible {
  opacity: 1;
}

.lg-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .42);
}

/* LG Search is deliberately independent from Jetpack Search styling. */
.lg-search-dialog {
  position: absolute;
  inset: 28px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  color: var(--lg-search-ink);
  border: 1px solid rgba(17, 17, 17, .16);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .18);
}

.lg-search-bar {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 66px 74px;
  min-height: 78px;
  border-bottom: 1px solid var(--lg-search-line);
}

.lg-search-icon {
  display: grid;
  place-items: center;
  color: var(--lg-search-ink);
}

.lg-search-icon svg,
.lg-search-close svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#lg-search-input {
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lg-search-ink);
  font: inherit;
  font-size: clamp(22px, 2.2vw, 31px);
  line-height: 1;
  box-shadow: none;
  appearance: none;
}

#lg-search-input::-webkit-search-cancel-button {
  display: none;
}

#lg-search-input:focus {
  box-shadow: inset 0 -2px 0 #111;
}

.lg-search-clear,
.lg-search-close,
.lg-search-sort button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--lg-search-muted);
  font: inherit;
  cursor: pointer;
}

.lg-search-clear {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--lg-search-line);
  border-right: 1px solid var(--lg-search-line);
}

/* The clear icon is rendered by LG SVG Library itself. LG Search intentionally
   does not override its SVG geometry, fill, stroke, weight, opacity or size. */

.lg-search-clear-fallback {
  display: block;
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
}

.lg-search-clear:hover,
.lg-search-clear:focus-visible,
.lg-search-close:hover,
.lg-search-close:focus-visible,
.lg-search-sort button:hover,
.lg-search-sort button:focus-visible {
  color: var(--lg-search-ink);
  outline: 0;
}

.lg-search-close {
  display: grid;
  place-items: center;
}

.lg-search-close svg {
  width: 31px;
  height: 31px;
}

.lg-search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 58px 8px;
}

#lg-search-status {
  font-size: 16px;
  font-weight: 400;
}

.lg-search-sort {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #aaa;
  white-space: nowrap;
}

.lg-search-sort button {
  padding: 2px 0;
  font-size: 14px;
}

.lg-search-sort button.is-active {
  color: var(--lg-search-ink);
  font-weight: 400;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.lg-search-results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 58px 34px;
  overscroll-behavior: contain;
}

.lg-search-result {
  margin: 0;
  border-bottom: 1px solid var(--lg-search-line);
}

.lg-search-result:last-child {
  border-bottom: 0;
}

.lg-search-result-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 32px;
  align-items: center;
  min-height: 132px;
  padding: 18px 0;
  color: inherit;
  text-decoration: none;
}

.lg-search-result-link:hover,
.lg-search-result-link:focus-visible {
  color: inherit;
  outline: 0;
}

.lg-search-result-link:hover h2,
.lg-search-result-link:focus-visible h2 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.lg-search-result-copy {
  min-width: 0;
}

.lg-search-result h2 {
  margin: 0 0 5px;
  color: var(--lg-search-ink);
  font-size: clamp(21px, 1.8vw, 29px);
  font-weight: 500;
  line-height: 1.15;
}

.lg-search-result-type {
  margin: 0 0 9px;
  color: var(--lg-search-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .045em;
  line-height: 1.3;
  text-transform: uppercase;
}

.lg-search-result p {
  display: -webkit-box;
  max-width: 920px;
  margin: 0;
  overflow: hidden;
  color: #2e2e2e;
  font-size: 15px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lg-search-result-media {
  width: 132px;
  justify-self: end;
}

.lg-search-result-media img {
  display: block;
  width: 100%;
  max-height: 112px;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

/* Highlighting follows the site's monochrome language instead of Jetpack's yellow marks. */
.lg-search-result mark {
  padding: 0;
  background: transparent;
  color: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.lg-search-message {
  padding: 42px 0;
  color: var(--lg-search-muted);
  font-size: 15px;
}

.lg-search-loading {
  display: flex;
  gap: 7px;
  padding: 42px 0;
}

.lg-search-loading span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #777;
  animation: lg-search-pulse 1s infinite ease-in-out;
}

.lg-search-loading span:nth-child(2) { animation-delay: .13s; }
.lg-search-loading span:nth-child(3) { animation-delay: .26s; }

@keyframes lg-search-pulse {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.lg-search-trigger {
  cursor: pointer;
}

@media (max-width: 900px) {
  .lg-search-dialog {
    inset: 16px;
  }

  .lg-search-bar {
    grid-template-columns: 52px minmax(0, 1fr) 58px 58px;
    min-height: 68px;
  }

  .lg-search-toolbar,
  .lg-search-results {
    padding-right: 28px;
    padding-left: 28px;
  }

  .lg-search-result-link {
    grid-template-columns: minmax(0, 1fr) 106px;
    gap: 22px;
    min-height: 120px;
  }

  .lg-search-result-media {
    width: 106px;
  }

  .lg-search-result-media img {
    max-height: 94px;
  }
}

@media (max-width: 620px) {
  .lg-search-dialog {
    inset: 0;
    border: 0;
  }

  .lg-search-bar {
    grid-template-columns: 44px minmax(0, 1fr) 50px 50px;
    min-height: 60px;
  }

  .lg-search-icon svg {
    width: 22px;
    height: 22px;
  }

  .lg-search-close svg {
    width: 27px;
    height: 27px;
  }


  #lg-search-input {
    padding: 0 6px;
    font-size: 19px;
  }

  .lg-search-clear {
    font-size: 12px;
  }

  .lg-search-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 16px 18px 6px;
  }

  #lg-search-status,
  .lg-search-sort button {
    font-size: 13px;
  }

  .lg-search-results {
    padding: 0 18px 24px;
  }

  .lg-search-result-link {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 14px;
    min-height: 105px;
    padding: 16px 0;
  }

  .lg-search-result h2 {
    font-size: 20px;
  }

  .lg-search-result-type {
    margin-bottom: 6px;
    font-size: 10px;
  }

  .lg-search-result p {
    font-size: 13px;
    line-height: 1.4;
  }

  .lg-search-result-media {
    width: 76px;
  }

  .lg-search-result-media img {
    max-height: 70px;
  }
}
