/*
 * Site-wide search page (resources/views/pages/search.blade.php).
 * Builds on catalogue.css: colours, buttons, covers, the access switch and the pager.
 */
.srch {
  /* One colour per catalogue, used for dots, tags and icons. */
  --t-ebook: #b8741a;
  --t-journal: #24624f;
  --t-article: #7a2d52;
  --t-material: #2c4a86;
  --t-research: #0f6e74;
}
.srch li {
  width: auto;
  margin: 0;
  font-size: inherit;
  color: inherit;
}
.cat .srch-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--cat-maroon);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Hero: the zooming library, like the catalogue pages, with one large search box */
.srch-hero {
  position: relative;
  overflow: visible;
  isolation: isolate;
  color: #ffffff;
  padding: 3rem 0 3.2rem;
  background: var(--cat-deep);
}
.srch-hero::before,
.srch-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}
.srch-hero::before {
  background: url("../images/img3.jpg") center 45% / cover no-repeat;
  opacity: 0.5;
}
.srch-hero::after {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(224, 165, 38, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(44, 0, 0, 0.75), rgba(44, 0, 0, 0.92));
}
.srch-hero__inner {
  display: grid;
  /* One column the width of the screen, so the search box can't push past it. */
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
  gap: 0.6rem;
}
.srch-hero__kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cat-gold-2) !important;
}
.srch-hero h1 {
  font-size: clamp(1.8rem, 4.2vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.srch-hero__hint {
  max-width: 40rem;
  font-size: 0.85rem;
  color: #e6cfcf !important;
}
.srch-form {
  width: 100%;
  max-width: 44rem;
  margin: 0.8rem 0 0.2rem;
}
.srch-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 62px;
  padding: 0 0.45rem 0 1.15rem;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 50px -22px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.2);
  text-align: left;
  transition: box-shadow 0.15s ease;
}
.srch-box:focus-within {
  box-shadow: 0 0 0 4px rgba(255, 176, 0, 0.45), 0 24px 50px -22px rgba(0, 0, 0, 0.7);
}
.srch-box__icon {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--cat-maroon);
}
.srch-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  margin: 0;
  background: transparent;
  color: var(--cat-ink);
  font-size: 1.08rem;
}
.srch-box input::placeholder {
  color: #9a8d90;
}
.srch-box input::-webkit-search-cancel-button {
  cursor: pointer;
}
.srch-box__kbd {
  flex: none;
}
.srch-box input:focus ~ .srch-box__kbd,
.srch-box input:not(:placeholder-shown) ~ .srch-box__kbd {
  display: none;
}
.cat .srch-box button {
  flex: none;
  height: 48px;
  border: 0;
  border-radius: 12px;
  padding: 0 1.4rem;
  background: var(--cat-maroon);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}
.cat .srch-box button:hover {
  background: var(--cat-maroon-2);
}
.srch kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cat-muted);
  background: #faf6f0;
  border: 1px solid var(--cat-line);
  border-bottom-width: 2px;
  border-radius: 6px;
}

/* Before searching */
.srch-start {
  display: grid;
  gap: 2rem;
  padding-top: 2.4rem;
  padding-bottom: 3.5rem;
}
.srch-start h2 {
  font-size: 1.1rem;
  margin-bottom: 0.9rem !important;
}
.srch-start__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}
.cat .srch-cat {
  --t: var(--cat-maroon);
  display: grid;
  gap: 0.35rem;
  align-content: start;
  padding: 1.1rem;
  background: var(--cat-card);
  border: 1px solid var(--cat-line);
  border-radius: 16px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.cat .srch-cat:hover {
  transform: translateY(-2px);
  border-color: var(--t);
  box-shadow: 0 16px 30px -24px rgba(44, 0, 0, 0.6);
}
.cat .srch-cat--ebook { --t: var(--t-ebook); }
.cat .srch-cat--journal { --t: var(--t-journal); }
.cat .srch-cat--article { --t: var(--t-article); }
.cat .srch-cat--material { --t: var(--t-material); }
.cat .srch-cat--research { --t: var(--t-research); }
.srch-cat__icon {
  width: 40px;
  height: 40px;
  padding: 9px;
  margin-bottom: 0.3rem;
  border-radius: 12px;
  color: var(--t);
  background: color-mix(in srgb, var(--t) 12%, #ffffff);
}
.srch-cat__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.srch-cat b {
  color: var(--cat-ink);
}
.srch-cat > span:last-child {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--cat-muted);
}
.srch-start__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}
.srch-panel {
  background: var(--cat-card);
  border: 1px solid var(--cat-line);
  border-radius: 16px;
  padding: 1.2rem 1.3rem;
}
.srch-panel[hidden] {
  display: none;
}
.srch-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.srch-panel h2 {
  font-size: 1rem;
}
.cat .srch-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.cat .srch-chips li {
  display: inline-flex;
  align-items: center;
  background: #faf6f0;
  border: 1px solid var(--cat-line);
  border-radius: 999px;
}
.cat .srch-chips a {
  padding: 0.35rem 0.3rem 0.35rem 0.85rem;
  font-size: 0.88rem;
}
.cat .srch-chips a:hover {
  color: var(--cat-maroon);
  text-decoration: underline;
}
.cat .srch-chips button {
  border: 0;
  background: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--cat-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.cat .srch-chips button:hover {
  background: #efe6e6;
  color: var(--cat-maroon);
}
.cat .srch-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.cat .srch-tips li {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: baseline;
  font-size: 0.9rem;
  color: var(--cat-ink-2, #3a2a2d);
}
.srch-tips li > p {
  margin: 0;
  color: inherit;
}
.srch-tips li > span {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--cat-gold-soft);
  color: var(--cat-gold-ink);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Results: refine sidebar and list */
.srch-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding-top: 2rem;
  padding-bottom: 3.5rem;
}
.srch-refine {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 1.2rem;
  padding: 1.2rem;
  background: var(--cat-card);
  border: 1px solid var(--cat-line);
  border-radius: 16px;
}
.srch-refine__title {
  font-size: 1rem;
}
.srch-refine__form {
  display: grid;
  gap: 1.2rem;
}
.srch-refine__group {
  display: grid;
  gap: 0.5rem;
}
.cat .srch-refine__label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cat-muted);
}
.cat .srch-types {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.cat .srch-types a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 9px;
  font-size: 0.9rem;
  color: var(--cat-ink);
}
.cat .srch-types a:hover {
  background: #f6eeee;
}
.cat .srch-types a[aria-current="page"] {
  background: var(--cat-gold-soft);
  font-weight: 700;
  color: var(--cat-maroon);
}
.cat .srch-types a.is-empty:not([aria-current]) {
  color: #a8999c;
}
.srch-types em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cat-muted);
  background: #f3ecec;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}
.srch-types a[aria-current="page"] em {
  background: var(--cat-maroon);
  color: #ffffff;
}
.srch-types__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.srch-types__dot--all { background: var(--cat-maroon); }
.srch-types__dot--ebook { background: var(--t-ebook); }
.srch-types__dot--journal { background: var(--t-journal); }
.srch-types__dot--article { background: var(--t-article); }
.srch-types__dot--material { background: var(--t-material); }
.srch-types__dot--research { background: var(--t-research); }
.srch-refine .cat-access {
  display: flex;
}
.srch-refine .cat-access label {
  flex: 1;
}
.srch-refine .cat-access span {
  justify-content: center;
  width: 100%;
  padding: 0 0.4rem;
}
.srch-select {
  width: 100%;
  height: 42px;
  border: 1px solid #ddd0d2;
  border-radius: 10px;
  padding: 0 0.7rem;
  background: #fdfbf9;
  color: var(--cat-ink);
  margin: 0;
}

.srch-main {
  min-width: 0;
}
.srch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin-bottom: 1rem;
}
.srch-head h2 {
  font-size: 1.25rem;
}
.srch-head h2 span {
  font-weight: 400;
  color: var(--cat-muted);
}
.srch-active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.cat .srch-active a:not(.srch-link) {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--cat-maroon);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}
.srch-active a:not(.srch-link) span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
  line-height: 1;
}

.cat .srch-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.srch-hit {
  --t: var(--cat-maroon);
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 1.1rem;
  align-items: start;
  padding: 1rem 1.1rem;
  background: var(--cat-card);
  border: 1px solid var(--cat-line);
  border-radius: 16px;
  color: var(--cat-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.srch-hit:hover {
  border-color: #ddc8cb;
  box-shadow: 0 18px 32px -26px rgba(44, 0, 0, 0.6);
}
.srch-hit--ebook { --t: var(--t-ebook); }
.srch-hit--journal { --t: var(--t-journal); }
.srch-hit--article { --t: var(--t-article); }
.srch-hit--material { --t: var(--t-material); }
.srch-hit--research { --t: var(--t-research); }
.srch-hit__cover {
  display: block;
}
.srch-hit__cover .cat-book {
  width: 100%;
  transform: none;
  padding: 0.45rem;
  box-shadow: inset 4px 0 0 rgba(0, 0, 0, 0.22), 0 10px 18px -12px rgba(30, 5, 10, 0.7);
}
.srch-hit__cover .cat-book small {
  font-size: 0.48rem;
}
.srch-hit__body {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.srch-hit__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
}
.srch-hit__type {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t);
}
.srch-hit__type::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--t);
}
.srch-hit__genre {
  color: var(--cat-muted);
}
.srch-hit__genre::before {
  content: "·";
  margin-right: 0.4rem;
}
.srch-hit h3 {
  font-size: 1.08rem;
  line-height: 1.3;
}
.cat .srch-hit h3 a::after {
  /* The whole card is clickable through the title link. */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
}
.cat .srch-hit h3 a:hover {
  color: var(--cat-maroon);
}
.cat .srch-hit h3 a:focus-visible {
  outline: none;
}
.cat .srch-hit h3 a:focus-visible::after {
  outline: 3px solid var(--cat-gold);
  outline-offset: 2px;
}
.srch-hit__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0;
  font-size: 0.85rem;
  color: var(--cat-muted) !important;
}
.srch-hit__meta span + span::before {
  content: "·";
  margin: 0 0.45rem;
}
.srch-hit__snippet {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #4a3a3d !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.srch-hit__side {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: end;
  align-content: space-between;
  gap: 0.8rem;
  min-width: 9.5rem;
  height: 100%;
}
.srch-hit__price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cat-ink);
}
.srch-hit__price--free {
  color: var(--cat-ok);
}
.srch-hit__price--owned {
  font-size: 0.78rem;
  color: var(--cat-ok);
}
.srch-hit__actions {
  padding-top: 0;
  width: 100%;
}
.srch mark {
  background: linear-gradient(180deg, transparent 55%, rgba(255, 176, 0, 0.45) 55%);
  color: inherit;
  padding: 0 1px;
}

.srch-empty {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 2.8rem 1.5rem;
  text-align: center;
  background: var(--cat-card);
  border: 1px dashed #d9c3c6;
  border-radius: 16px;
}
.srch-empty__icon {
  width: 56px;
  height: 56px;
  padding: 14px;
  margin-bottom: 0.4rem;
  border-radius: 50%;
  background: var(--cat-gold-soft);
  color: var(--cat-maroon);
}
.srch-empty__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.srch-empty b {
  font-size: 1.1rem;
}
.srch-empty > span {
  max-width: 30rem;
  font-size: 0.9rem;
  color: var(--cat-muted);
}
.srch-empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

@media (max-width: 1024px) {
  .srch-start__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Below 900px the sidebar becomes a strip above the results. */
@media (max-width: 900px) {
  .srch-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.2rem;
  }
  .srch-refine {
    position: static;
    padding: 0.9rem;
    gap: 0.8rem;
  }
  .srch-refine__title,
  .srch-refine nav .srch-refine__label {
    display: none;
  }
  .cat .srch-types {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -0.9rem;
    padding: 0 0.9rem;
  }
  .cat .srch-types a {
    white-space: nowrap;
    border: 1px solid var(--cat-line);
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
  }
  .srch-types em {
    margin-left: 0.2rem;
  }
  .srch-refine__form {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 0.6rem;
  }
}

@media (max-width: 640px) {
  .srch-hero {
    padding: 2rem 0 2.2rem;
  }
  .srch-box {
    height: 56px;
    padding-left: 0.9rem;
  }
  .srch-box__kbd {
    display: none;
  }
  .cat .srch-box button {
    height: 44px;
    padding: 0 0.9rem;
  }
  .srch-start__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .srch-refine__form {
    grid-template-columns: minmax(0, 1fr);
  }
  .srch-hit {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0.85rem;
    padding: 0.9rem;
  }
  .srch-hit__side {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    min-width: 0;
  }
  .srch-hit__actions {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cat .srch-cat,
  .srch-box,
  .srch-hit {
    transition: none;
  }
  .cat .srch-cat:hover {
    transform: none;
  }
}
