/*
 * Native catalog search — compact, editorial controls in the established
 * GSU blue / steel / coolblue system.
 */
.gsu-search-entry,
.gsu-search-page {
  color: var(--wp--preset--color--gsu-blue-steel);
  font-family: var(--wp--preset--font-family--lato);
  line-height: var(--wp--custom--academic--line-height);
}

.gsu-search-entry,
.gsu-search-page,
.gsu-search-entry :where(*, *::before, *::after),
.gsu-search-page :where(*, *::before, *::after) {
  box-sizing: border-box;
}

.gsu-search-entry {
  position: relative;
  z-index: 20;
  width: min(100%, 31rem);
  min-width: 0;
  margin-inline: auto;
  padding: .75rem;
  background: var(--wp--preset--color--gsu-blue);
}

.gsu-search-entry form {
  display: flex;
  align-items: stretch;
  gap: .35rem;
  min-width: 0;
  margin: 0;
  padding: .25rem;
  border: 1px solid color-mix(in srgb, var(--wp--preset--color--gsu-white) 45%, transparent);
  background: color-mix(in srgb, var(--wp--preset--color--gsu-white) 10%, transparent);
}

.gsu-search-entry label,
.gsu-search-entry > .gsu-search-context,
.gsu-search-entry .gsu-search-announcement {
  color: var(--wp--preset--color--gsu-white);
}

.gsu-search-entry .gsu-search-query-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.gsu-search-entry input[type="search"],
.gsu-search-entry input[type="text"] {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .5rem .7rem;
  border: 1px solid transparent;
  border-radius: var(--wp--custom--button--radius);
  color: var(--wp--preset--color--gsu-blue-steel);
  background: var(--wp--custom--semantic--surface);
  font: inherit;
  line-height: var(--wp--custom--academic--small-line-height);
}

.gsu-search-entry input::placeholder {
  color: var(--wp--preset--color--gsu-blue-steel);
  opacity: .8;
}

.gsu-search-entry button,
.gsu-search-entry input[type="submit"],
.gsu-search-page button[type="submit"],
.gsu-search-page input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  min-height: var(--wp--custom--button--min-height);
  max-width: 100%;
  padding: .45rem var(--wp--custom--button--horizontal-padding);
  border: 1px solid var(--wp--preset--color--gsu-blue);
  border-radius: var(--wp--custom--button--radius);
  color: var(--wp--preset--color--gsu-white);
  background: var(--wp--preset--color--gsu-blue);
  font: inherit;
  font-weight: 700;
  line-height: var(--wp--custom--academic--small-line-height);
  text-align: center;
  cursor: pointer;
}

.gsu-search-entry button:hover,
.gsu-search-entry input[type="submit"]:hover,
.gsu-search-page button[type="submit"]:hover,
.gsu-search-page input[type="submit"]:hover {
  border-color: var(--wp--preset--color--gsu-blue-steel);
  background: var(--wp--preset--color--gsu-blue-steel);
}

.gsu-search-suggestions {
  position: absolute;
  z-index: 30;
  inset: calc(100% + .25rem) 0 auto;
  max-height: min(19rem, 60vh);
  overflow-y: auto;
  margin: 0;
  padding: .25rem;
  border: 1px solid var(--wp--custom--semantic--border);
  background: var(--wp--custom--semantic--surface);
  box-shadow: 0 .5rem 1.2rem color-mix(in srgb, var(--wp--preset--color--gsu-blue) 18%, transparent);
  list-style: none;
}

.gsu-search-suggestions[hidden] { display: none !important; }
.gsu-search-suggestions li[role="option"] {
  min-width: 0;
  padding: .55rem .7rem;
  color: var(--wp--preset--color--gsu-blue-steel);
  line-height: var(--wp--custom--academic--small-line-height);
  overflow-wrap: anywhere;
  cursor: pointer;
}
.gsu-search-suggestions li[role="option"]:hover,
.gsu-search-suggestions li[role="option"][aria-selected="true"] {
  color: var(--wp--preset--color--gsu-white);
  background: var(--wp--preset--color--gsu-blue);
}

.gsu-search-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.gsu-search-page {
  width: min(100%, var(--wp--custom--academic--content-width));
  min-width: 0;
  margin-inline: auto;
  padding-block: clamp(1.5rem, 4vw, 3rem) var(--wp--preset--spacing--60);
}

.gsu-search-page > :where(h1, .gsu-search-context, .gsu-search-form, .gsu-search-active,
  .gsu-search-tabs, .gsu-search-results, .gsu-search-pagination, .gsu-search-state,
  .gsu-search-notice) {
  min-width: 0;
}

.gsu-search-page h1 {
  margin: 0 0 .4rem;
  color: var(--wp--preset--color--gsu-blue);
  font-size: var(--wp--custom--academic--title-size);
  font-weight: 700;
  line-height: var(--wp--custom--academic--heading-line-height);
  overflow-wrap: anywhere;
}

.gsu-search-context {
  max-width: 72ch;
  margin: 0 0 var(--wp--preset--spacing--30);
  color: var(--wp--custom--semantic--muted);
  font-size: .9375rem;
}

.gsu-search-form {
  display: grid;
  gap: var(--wp--preset--spacing--30);
  min-width: 0;
  margin: 0 0 var(--wp--preset--spacing--40);
  padding: var(--wp--preset--spacing--30);
  border: 1px solid var(--wp--custom--semantic--border);
  border-top: 3px solid var(--wp--preset--color--gsu-coolblue);
  background: var(--wp--custom--semantic--surface-subtle);
}

.gsu-search-form .gsu-search-query-wrap {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
}

.gsu-search-page .gsu-search-query-wrap input[type="search"],
.gsu-search-page .gsu-search-query-wrap input[type="text"] {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: var(--wp--custom--academic--control-target);
  padding: .55rem .7rem;
  border: 1px solid var(--wp--custom--semantic--border);
  border-radius: var(--wp--custom--button--radius);
  color: var(--wp--preset--color--gsu-blue-steel);
  background: var(--wp--custom--semantic--surface);
  font: inherit;
}

.gsu-search-form > button[type="submit"],
.gsu-search-form > input[type="submit"] { justify-self: start; }

.gsu-search-filters {
  min-width: 0;
  margin: 0;
  padding: .65rem .8rem;
  border: 1px solid var(--wp--custom--semantic--border);
  background: var(--wp--custom--semantic--surface);
}

.gsu-search-filters summary {
  min-height: 2.25rem;
  color: var(--wp--preset--color--gsu-blue);
  font-weight: 700;
  line-height: 2.25rem;
  cursor: pointer;
}

.gsu-search-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: var(--wp--preset--spacing--30);
  margin-top: .75rem;
}

.gsu-search-filter-grid label {
  display: grid;
  align-content: start;
  gap: .25rem;
  min-width: 0;
  color: var(--wp--preset--color--gsu-blue-steel);
  font-size: var(--wp--custom--academic--label-size);
  font-weight: 700;
  line-height: var(--wp--custom--academic--small-line-height);
}

.gsu-search-filter-grid select {
  width: 100%;
  min-width: 0;
  min-height: var(--wp--custom--academic--control-target);
  padding: .4rem 2rem .4rem .6rem;
  border: 1px solid var(--wp--custom--semantic--border);
  border-radius: var(--wp--custom--button--radius);
  color: var(--wp--preset--color--gsu-blue-steel);
  background: var(--wp--custom--semantic--surface);
  font: inherit;
}

.gsu-search-active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .55rem;
  min-width: 0;
  margin-block: 0 var(--wp--preset--spacing--30);
  font-size: var(--wp--custom--academic--label-size);
}

.gsu-search-active a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  max-width: 100%;
  padding: .15rem .5rem;
  border: 1px solid var(--wp--custom--semantic--border);
  color: var(--wp--preset--color--gsu-blue);
  background: var(--wp--custom--semantic--surface);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.gsu-search-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem;
  min-width: 0;
  margin-block: var(--wp--preset--spacing--30);
  padding: .25rem;
  border: 1px solid var(--wp--custom--semantic--border);
  background: var(--wp--custom--semantic--surface-subtle);
}

.gsu-search-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--wp--custom--academic--control-target);
  max-width: 100%;
  padding: .4rem .7rem;
  color: var(--wp--preset--color--gsu-blue);
  font-size: var(--wp--custom--academic--navigation-size);
  font-weight: 700;
  line-height: var(--wp--custom--academic--small-line-height);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.gsu-search-tabs a[aria-current="page"] {
  color: var(--wp--preset--color--gsu-white);
  background: var(--wp--preset--color--gsu-blue);
}

.gsu-search-tabs a:hover:not([aria-current="page"]) {
  background: var(--wp--preset--color--gsu-gray);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.gsu-search-results {
  min-width: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--wp--custom--semantic--border);
  list-style: none;
}

.gsu-search-result {
  min-width: 0;
  padding: .85rem .35rem .9rem;
  border-bottom: 1px solid var(--wp--custom--semantic--border);
}

.gsu-search-result h2 {
  margin: 0 0 .15rem;
  color: var(--wp--preset--color--gsu-blue);
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  font-weight: 700;
  line-height: var(--wp--custom--academic--heading-line-height);
  overflow-wrap: anywhere;
}

.gsu-search-result h2 a {
  color: var(--wp--preset--color--gsu-blue);
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
  overflow-wrap: anywhere;
}

.gsu-search-result h2 a:hover { color: var(--wp--preset--color--gsu-accent); }

.gsu-search-kind {
  display: inline-block;
  margin: 0 0 .2rem;
  color: var(--wp--preset--color--gsu-blue-steel);
  font-size: var(--wp--custom--academic--label-size);
  font-weight: 700;
  line-height: var(--wp--custom--academic--small-line-height);
}

.gsu-search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .9rem;
  margin: .3rem 0;
  color: var(--wp--custom--semantic--muted);
  font-size: var(--wp--custom--academic--label-size);
  line-height: var(--wp--custom--academic--small-line-height);
}

.gsu-search-result-meta > div {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .35rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.gsu-search-result-meta dt { font-weight: 700; }
.gsu-search-result-meta dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }

.gsu-search-result p.excerpt {
  max-width: 78ch;
  margin: .35rem 0 0;
  color: var(--wp--preset--color--gsu-blue-steel);
  font-size: .9375rem;
  line-height: var(--wp--custom--academic--small-line-height);
  overflow-wrap: anywhere;
}

.gsu-search-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin-block: var(--wp--preset--spacing--40);
}

.gsu-search-pagination a,
.gsu-search-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--wp--custom--academic--control-target);
  min-height: var(--wp--custom--academic--control-target);
  padding: .3rem .6rem;
  border: 1px solid var(--wp--custom--semantic--border);
  color: var(--wp--preset--color--gsu-blue);
  background: var(--wp--custom--semantic--surface);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.gsu-search-pagination [aria-current="page"] {
  border-color: var(--wp--preset--color--gsu-blue);
  color: var(--wp--preset--color--gsu-white);
  background: var(--wp--preset--color--gsu-blue);
}

.gsu-search-pagination a:hover {
  color: var(--wp--preset--color--gsu-white);
  background: var(--wp--preset--color--gsu-blue-steel);
}

.gsu-search-state,
.gsu-search-notice {
  min-width: 0;
  margin-block: var(--wp--preset--spacing--30);
  padding: var(--wp--preset--spacing--30);
  border: 1px solid var(--wp--custom--semantic--border);
  border-left: 4px solid var(--wp--preset--color--gsu-coolblue);
  color: var(--wp--preset--color--gsu-blue-steel);
  background: var(--wp--custom--semantic--surface-subtle);
}

.gsu-search-notice { margin-top: 0; }
.gsu-search-state > :first-child,
.gsu-search-notice > :first-child { margin-top: 0; }
.gsu-search-state > :last-child,
.gsu-search-notice > :last-child { margin-bottom: 0; }

.gsu-search-page :where(a, button, input, select, summary):focus-visible,
.gsu-search-entry :where(a, button, input, select):focus-visible {
  outline: 3px solid var(--wp--custom--semantic--focus);
  outline-offset: 3px;
}

.gsu-search-page :where(a, button, input, select),
.gsu-search-entry :where(a, button, input, select) {
  max-width: 100%;
}

.gsu-search-page [hidden],
.gsu-search-entry [hidden] { display: none !important; }

@media (max-width: 767px) {
  .gsu-search-page {
    width: 100%;
    padding-inline: var(--wp--preset--spacing--30);
  }

  .gsu-search-form > button[type="submit"],
  .gsu-search-form > input[type="submit"] { width: 100%; }
}

@media (max-width: 520px) {
  .gsu-search-entry { width: 100%; }
  .gsu-search-entry form { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .gsu-search-entry button[type="submit"] { width: 100%; }
  .gsu-search-entry label,
  .gsu-search-entry > .gsu-search-context { overflow-wrap: anywhere; }
  .gsu-search-entry button,
  .gsu-search-entry input[type="submit"] {
    min-width: 0;
    padding-inline: .65rem;
  }

  .gsu-search-page { padding-inline: .75rem; }
  .gsu-search-form { padding: .75rem; }
  .gsu-search-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr)); }
  .gsu-search-tabs a { text-align: center; }
}

@media print {
  .gsu-search-entry,
  .gsu-search-form,
  .gsu-search-tabs,
  .gsu-search-pagination,
  .gsu-search-suggestions {
    display: none !important;
  }

  .gsu-search-page {
    width: 100%;
    padding: 0;
    color: #17243a;
  }

  .gsu-search-context,
  .gsu-search-results,
  .gsu-search-result,
  .gsu-search-state,
  .gsu-search-notice {
    color: #17243a !important;
    background: transparent !important;
  }

  .gsu-search-result { break-inside: avoid; }
  .gsu-search-result h2 a { color: #0039a6 !important; }
}
