/*
 * Search overlay
 *
 * Original Design Specifications
 * Target: > 1800px
 * Test Resolution: 1920 x 1080
 */
:root {
  --search-overlay-backdrop: rgba(81, 15, 0, 0.62);
  --search-overlay-padding-top: 17rem;
  --search-panel-width: 104rem;
  --search-panel-max-height: 76rem;
  --search-panel-border-radius: 2rem;
  --search-panel-padding-x: 3.4rem;
  --search-form-height: 10rem;
  --search-form-gap: 2rem;
  --search-input-font-size: 3.2rem;
  --search-icon-dimensions: 3rem;
  --search-close-dimensions: 4.6rem;
  --search-group-title-font-size: 1.4rem;
  --search-result-title-font-size: 1.9rem;
  --search-result-meta-font-size: 1.6rem;
  --search-result-thumb-dimensions: 4.6rem;
  --search-results-columns: 2;
  --search-results-gap: 2.4rem;
  --search-footer-font-size: 1.5rem;
}

/*
 * 2XL Media Query (1536px)
 * Target: 1799px > 1536px
 * Test Resolution: 1536 x 864
 */
@media screen and (max-width: 1799px) {
  :root {
    --search-overlay-padding-top: 14rem;
    --search-panel-width: 88rem;
    --search-panel-max-height: 64rem;
    --search-panel-padding-x: 2.8rem;
    --search-form-height: 8.6rem;
    --search-input-font-size: 2.6rem;
    --search-icon-dimensions: 2.6rem;
    --search-close-dimensions: 4rem;
    --search-result-title-font-size: 1.7rem;
    --search-result-meta-font-size: 1.4rem;
    --search-result-thumb-dimensions: 4rem;
    --search-footer-font-size: 1.4rem;
  }
}

/*
 * XL Media Query (1280px)
 * Target: 1535px > 1280px
 * Test Resolution: 1280 x 720
 */
@media screen and (max-width: 1535px) {
  :root {
    --search-overlay-padding-top: 13rem;
    --search-panel-width: 82rem;
    --search-panel-max-height: 58rem;
    --search-form-height: 8rem;
    --search-input-font-size: 2.4rem;
  }
}

/*
 * L Media Query (1024px)
 * Target: 1279px > 1024px
 * Test Resolution: 1024 x 768
 */
@media screen and (max-width: 1279px) {
  :root {
    --search-overlay-padding-top: 12rem;
    --search-panel-width: 72rem;
    --search-panel-max-height: 52rem;
    --search-panel-padding-x: 2.2rem;
    --search-form-height: 7.2rem;
    --search-input-font-size: 2.2rem;
    --search-icon-dimensions: 2.2rem;
    --search-close-dimensions: 3.6rem;
    --search-results-columns: 1;
  }
}

/*
 * M Media Query (768px)
 * Target: 1023px > 768px
 * Test Resolution: 768 x 1024
 */
@media screen and (max-width: 1023px) {
  :root {
    --search-overlay-padding-top: 0rem;
    --search-panel-width: 100%;
    --search-panel-max-height: 100%;
    --search-panel-border-radius: 0rem;
  }
}

/*
 * S Media Query (640px)
 * Target: < 767px
 * Test Resolution: 390 x 844
 */
@media screen and (max-width: 767px) {
  :root {
    --search-panel-padding-x: 1.6rem;
    --search-form-height: 6.4rem;
    --search-form-gap: 1.2rem;
    --search-input-font-size: 1.8rem;
    --search-icon-dimensions: 2rem;
    --search-close-dimensions: 4.4rem;
    --search-result-title-font-size: 1.6rem;
    --search-result-meta-font-size: 1.3rem;
    --search-result-thumb-dimensions: 3.6rem;
    --search-footer-font-size: 1.3rem;
  }
}

.socion-search-overlay.is-closing {
  pointer-events: none;
}

.socion-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: var(--search-overlay-padding-top);
}

body.admin-bar .socion-search-overlay {
  padding-top: calc(
    var(--search-overlay-padding-top) + var(--wp-admin--admin-bar--height, 0px)
  );
}

.socion-search-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--search-overlay-backdrop);
}

.socion-search-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: var(--search-panel-width);
  max-width: 100%;
  max-height: var(--search-panel-max-height);
  background-color: var(--theme-color-white);
  border-radius: var(--search-panel-border-radius);
  box-shadow: 0 1.6rem 4rem var(--theme-color-shadow);
  overflow: hidden;
}

@media screen and (max-width: 1023px) {
  .socion-search-panel {
    height: 100%;
  }
}

/* Form */

.socion-search-form {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--search-form-gap);
  height: var(--search-form-height);
  padding: 0 calc(var(--search-panel-padding-x) * 0.6) 0
    var(--search-panel-padding-x);
  border-bottom: 1px solid var(--theme-color-primary-20);
}

.socion-search-form-icon {
  display: block;
  flex-shrink: 0;
  width: var(--search-icon-dimensions);
  height: var(--search-icon-dimensions);
}

.socion-search-form-icon > svg {
  display: block;
  width: 100%;
  height: 100%;
}

.socion-search-form-icon > svg path {
  fill: var(--theme-color-border);
}

.socion-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.socion-search-input {
  flex-grow: 1;
  min-width: 0;
  border: none;
  outline: none;
  background-color: transparent;
  font-family: var(--typography-body-font-family);
  font-size: var(--search-input-font-size);
  line-height: 1.2;
  color: var(--theme-color-primary);
  padding: 0;
  appearance: none;
}

.socion-search-input::placeholder {
  color: var(--theme-color-primary-50);
  opacity: 1;
}

.socion-search-input::-webkit-search-cancel-button {
  display: none;
}

.socion-search-status,
.socion-search-shortcut {
  flex-shrink: 0;
  font-size: var(--search-footer-font-size);
  color: var(--theme-color-primary-70);
}

.socion-search-shortcut {
  border: 1px solid var(--theme-color-horizontal-line);
  border-radius: 0.6rem;
  padding: 0.4rem 0.8rem;
  line-height: 1;
}

@media screen and (max-width: 767px) {
  .socion-search-shortcut {
    display: none;
  }
}

.socion-search-close {
  transition: background-color 0.18s ease-out;
  touch-action: manipulation;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--search-close-dimensions);
  height: var(--search-close-dimensions);
  border: none;
  border-radius: 50%;
  background-color: var(--theme-color-secondary);
  cursor: pointer;
  padding: 0;
}

.socion-search-close:hover {
  background-color: var(--theme-color-primary-20);
}

.socion-search-close-icon {
  display: block;
  width: 40%;
  height: 40%;
}

.socion-search-close-icon > svg {
  display: block;
  width: 100%;
  height: 100%;
}

.socion-search-close-icon > svg path {
  fill: var(--theme-color-border);
}

/* Body */

.socion-search-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: calc(var(--search-panel-padding-x) * 0.4)
    calc(var(--search-panel-padding-x) * 0.5);
}

.socion-search-results {
  display: grid;
  grid-template-columns: repeat(var(--search-results-columns), minmax(0, 1fr));
  gap: 0 var(--search-results-gap);
  align-items: start;
}

.socion-search-group {
  padding-bottom: 1.2rem;
}

.socion-search-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem 0.4rem;
}

.socion-search-group-title {
  font-family: var(--typography-body-font-family);
  font-size: var(--search-group-title-font-size);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  color: var(--theme-color-primary-70);
}

.socion-search-group-count {
  font-size: var(--search-group-title-font-size);
  color: var(--theme-color-primary-70);
}

.socion-search-result {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0.9rem 1.4rem;
  border-radius: 1rem;
  color: var(--theme-color-primary);
  transition:
    background-color 0.18s ease-out,
    transform 0.18s ease-out;
}

.socion-search-result.is-active {
  transform: translateX(0.3rem);
}

@media (prefers-reduced-motion: reduce) {
  .socion-search-result {
    transition: none;
  }

  .socion-search-result.is-active {
    transform: none;
  }
}

.socion-search-result.is-active,
.socion-search-result:hover,
.socion-search-result:focus-visible {
  background-color: var(--theme-color-primary-20);
}

.socion-search-result-thumb {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--search-result-thumb-dimensions);
  height: var(--search-result-thumb-dimensions);
  border-radius: 0.8rem;
  background-color: var(--theme-color-secondary);
  overflow: hidden;
}

.socion-search-result-thumb.is-round {
  border-radius: 50%;
}

.socion-search-result-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.socion-search-result-initial {
  font-size: var(--search-result-meta-font-size);
  font-weight: 600;
  color: var(--theme-color-primary-70);
  line-height: 1;
}

.socion-search-result-text {
  display: block;
  min-width: 0;
}

.socion-search-result-title {
  display: block;
  font-size: var(--search-result-title-font-size);
  line-height: 1.3;
  color: var(--theme-color-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.socion-search-result-meta {
  display: block;
  font-size: var(--search-result-meta-font-size);
  line-height: 1.4;
  color: var(--theme-color-primary-70);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.socion-search-mark {
  background-color: var(--theme-color-accent);
  color: var(--theme-color-primary);
  border-radius: 0.2rem;
  padding: 0 0.1rem;
}

/* Empty state and suggestions */

.socion-search-message {
  padding: 3.2rem 1.4rem;
  text-align: center;
}

.socion-search-message-title {
  font-size: var(--search-result-title-font-size);
  line-height: 1.3;
  color: var(--theme-color-primary);
}

.socion-search-message-text {
  font-size: var(--search-result-meta-font-size);
  line-height: 1.4;
  color: var(--theme-color-primary-70);
  margin-top: 0.6rem;
}

.socion-search-suggestions {
  padding-bottom: 1.6rem;
}

.socion-search-suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.6rem 1.4rem 0;
  list-style: none;
}

.socion-search-suggestion-link {
  transition:
    background-color 0.18s ease-out,
    border-color 0.18s ease-out;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--theme-color-horizontal-line);
  border-radius: 999rem;
  padding: 0.9rem 1.6rem;
  font-size: var(--search-result-meta-font-size);
  line-height: 1;
  color: var(--theme-color-border);
}

.socion-search-suggestion-link:hover {
  background-color: var(--theme-color-secondary);
}

/* Footer */

.socion-search-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  padding: calc(var(--search-panel-padding-x) * 0.4)
    calc(var(--search-panel-padding-x) * 0.6);
  border-top: 1px solid var(--theme-color-primary-20);
  background-color: var(--theme-color-white);
}

.socion-search-keys {
  font-size: var(--search-footer-font-size);
  color: var(--theme-color-primary-70);
}

@media screen and (max-width: 767px) {
  .socion-search-keys {
    display: none;
  }

  .socion-search-footer {
    justify-content: stretch;
  }

  .socion-search-all {
    flex-grow: 1;
    justify-content: center;
  }
}

/*
 * Locking the page behind the overlay removes the scrollbar; hold its width
 * so the page underneath does not jump sideways as the overlay opens.
 */
body.has-scrollbar-lock.overlay-is-active {
  padding-right: var(--socion-scrollbar-width, 0px);
}

body.has-scrollbar-lock.overlay-is-active .header .content-container,
body.has-scrollbar-lock.overlay-is-active .news-ticker {
  margin-right: var(--socion-scrollbar-width, 0px);
}
