:root{
  --explore-search-width: 1100px;
  --explore-search-height: 70px;
  --chip-height: 46px;
  --chip-font-size: 16px;
}

.explore-wrap {
  width: 100%;
  background: transparent;
  padding: 2.5rem 0;
}

.explore-inner {
  max-width: 1200px !important;
  margin: 0 auto;
  padding: 0 16px;
}

.explore-title {
  font-family: EB Garamond, serif;
  font-size: clamp(2.25rem, 2.5vw + 1rem, 2.75rem) !important;
  line-height: 1.15 !important;
  margin-bottom: 1.2rem !important;
  color: #2e2a25;
  text-align: center;
}

.explore-searchbar,
.explore-search .es-search-wrap,
.explore-chips + * {
  max-width: var(--explore-search-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.explore-searchbar {
  position: relative;
  margin: 0 auto .9rem;
}

.explore-input,
.explore-search .es-search-input,
.explore-search input[type="search"],
.explore-search input[type="text"],
.explore-search input,
input.es-search-input,
.es-search-input,
.explore-search .es-search-wrap input,
.explore-searchbar input {
  width: 100% !important;
  height: var(--explore-search-height) !important;
  border-radius: 999px !important;
  border: 1px solid #e5e7eb !important;
  padding: 0 28px !important;
  font-size: 1.125rem !important;
  box-shadow: 0 2px 10px rgba(0,0,0,.06) !important;
  background: #fff !important;
}

.explore-searchbar input::placeholder,
.explore-search .es-search-wrap input::placeholder {
  color: #3B3121BF !important;
  font-size: 1em !important;
}

.explore-input:focus,
.explore-search .es-search-input:focus,
.explore-search input:focus,
.explore-search input[type="text"]:focus,
.explore-search input[type="search"]:focus,
input.es-search-input:focus,
.es-search-input:focus {
  outline: none !important;
  border-color: #a78bfa !important;
  box-shadow: 0 4px 14px rgba(167,139,250,.18) !important;
}

.explore-icon,
.explore-search .es-search-icon,
.es-search-icon,
.search-icon {
  display: none !important;
}

.explore-search,
.explore-search * {
  color: #3B3121 !important;
  text-align: center !important;
}

.explore-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  align-items: center;
  margin: .5rem 0 .25rem;
}

.explore-search .es-chip,
.chip,
.es-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--chip-height) !important;
  padding: 0 22px !important;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--chip-font-size) !important;
  line-height: 1;
  border: 1px solid transparent;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}

.explore-search .es-chip:hover,
.chip:hover,
.es-chip:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.12) !important;
  background-image: none !important;
}

.explore-search .es-chip[data-filter="all"],
.explore-search .es-chip[data-filter="all"]:hover,
.explore-search .es-chip--all,
.explore-search .es-chip--all:hover,
.chip--all,
.chip--all:hover,
.explore-search .es-chip[data-filter="*"],
.explore-search .es-chip[data-filter="*"]:hover {
  background: #111111 !important;
  border-color: #111111 !important;
  color: #fff !important;
  --es-accent: #111111;
}

.explore-search .es-chip[data-filter="book"],
.explore-search .es-chip[data-filter="book"]:hover,
.chip--book,
.chip--book:hover,
.es-chip[data-filter="book"],
.es-chip[data-filter="book"]:hover { background: #C7F9CC !important; border-color: #C7F9CC !important; }

.explore-search .es-chip[data-filter="author"],
.explore-search .es-chip[data-filter="author"]:hover,
.explore-search .es-chip[data-filter="quote_author"],
.explore-search .es-chip[data-filter="quote_author"]:hover,
.chip--author,
.chip--author:hover,
.es-chip[data-filter="author"],
.es-chip[data-filter="author"]:hover,
.es-chip[data-filter="quote_author"],
.es-chip[data-filter="quote_author"]:hover { background: #F1C0E8 !important; border-color: #F1C0E8 !important; }

.explore-search .es-chip[data-filter="character"],
.explore-search .es-chip[data-filter="character"]:hover,
.chip--character,
.chip--character:hover,
.es-chip[data-filter="character"],
.es-chip[data-filter="character"]:hover { background: #FFF1BF !important; border-color: #FFF1BF !important; }

.explore-search .es-chip[data-filter="emotion"],
.explore-search .es-chip[data-filter="emotion"]:hover,
.chip--emotion,
.chip--emotion:hover,
.es-chip[data-filter="emotion"],
.es-chip[data-filter="emotion"]:hover { background: #FFADAD !important; border-color: #FFADAD !important; }

.explore-search .es-chip[data-filter="theme"],
.explore-search .es-chip[data-filter="theme"]:hover,
.explore-search .es-chip[data-filter="quote-theme"],
.explore-search .es-chip[data-filter="quote-theme"]:hover,
.chip--theme,
.chip--theme:hover,
.es-chip[data-filter="theme"],
.es-chip[data-filter="theme"]:hover,
.es-chip[data-filter="quote-theme"],
.es-chip[data-filter="quote-theme"]:hover { background: #FFD6A5 !important; border-color: #FFD6A5 !important; }

.explore-search .es-chip[data-filter="genre"],
.explore-search .es-chip[data-filter="genre"]:hover,
.chip--genre,
.chip--genre:hover,
.es-chip[data-filter="genre"],
.es-chip[data-filter="genre"]:hover { background: #D9EDF8 !important; border-color: #D9EDF8 !important; }

.explore-search .es-chip[data-filter="literary-device"],
.explore-search .es-chip[data-filter="literary-device"]:hover,
.explore-search .es-chip[data-filter="literary_device"],
.explore-search .es-chip[data-filter="literary_device"]:hover,
.chip--device,
.chip--device:hover,
.es-chip[data-filter="literary-device"],
.es-chip[data-filter="literary-device"]:hover,
.es-chip[data-filter="literary_device"],
.es-chip[data-filter="literary_device"]:hover { background: #DEDAF4 !important; border-color: #DEDAF4 !important; }

.explore-search .es-chip[data-filter="all"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]),
.explore-search .es-chip--all:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]),
.chip--all:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]),
.explore-search .es-chip[data-filter="*"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]) {
  background: #0d0d0d !important;
  border-color: #0d0d0d !important;
  color: #fff !important;
  --es-accent: #0d0d0d;
}

.explore-search .es-chip[data-filter="book"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]) { background: #98E0AE !important; border-color: #98E0AE !important; }
.explore-search .es-chip[data-filter="author"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]),
.explore-search .es-chip[data-filter="quote_author"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]) { background: #E39AD9 !important; border-color: #E39AD9 !important; }
.explore-search .es-chip[data-filter="character"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]) { background: #FFE08C !important; border-color: #FFE08C !important; }
.explore-search .es-chip[data-filter="emotion"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]) { background: #FF8C8C !important; border-color: #FF8C8C !important; }
.explore-search .es-chip[data-filter="theme"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]),
.explore-search .es-chip[data-filter="quote-theme"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]) { background: #FFBC6E !important; border-color: #FFBC6E !important; }
.explore-search .es-chip[data-filter="genre"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]) { background: #A8D4F0 !important; border-color: #A8D4F0 !important; }
.explore-search .es-chip[data-filter="literary-device"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]),
.explore-search .es-chip[data-filter="literary_device"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]) { background: #BDB4EA !important; border-color: #BDB4EA !important; }

.explore-search .es-chip:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]) {
  filter: none !important;
  background-image: none !important;
}

.explore-chips + * {
  max-width: var(--explore-search-width) !important;
  margin: 8px auto 0 !important;
  text-align: center !important;
  display: block !important;
}

.explore-chips + * > * { text-align: inherit !important; }

.explore-results {
  max-width: 860px;
  margin: .5rem auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.group {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.04);
  overflow: hidden;
}

.group-header {
  background: linear-gradient(180deg, #fafafa, #f5f5f5);
  padding: .6rem .9rem;
  font-weight: 700;
  color: #374151;
  border-bottom: 1px solid #eee;
}

.group-items {
  display: flex;
  flex-direction: column;
  padding: .5rem;
}

.result {
  display: block;
  padding: .55rem .7rem;
  border-radius: 10px;
  text-decoration: none;
  color: #374151;
  border: 1px solid transparent;
}

.result:hover {
  background: #f9fafb;
  border-color: #e5e7eb;
}

.no-results {
  padding: 1rem;
  color: #6b7280;
  text-align: center;
}

@media (max-width:640px){
  :root{
    --explore-search-height: 60px;
    --chip-height: 42px;
    --chip-font-size: 15px;
  }
  .explore-results {
    grid-template-columns: 1fr;
    gap: .75rem;
  }
  .explore-title { font-size: 2rem !important; }
}
.explore-search .es-chip,
.explore-search .es-chip *,
.chip,
.chip *,
.es-chip,
.es-chip * {
  color: #3B3121 !important;
}

.explore-search .es-chip:is(:hover,:focus,:focus-visible,:active,.is-active,.active,[aria-pressed="true"],[aria-selected="true"]),
.explore-search .es-chip:is(:hover,:focus,:focus-visible,:active,.is-active,.active,[aria-pressed="true"],[aria-selected="true"]) * {
  color: #3B3121 !important;
}

.explore-search .es-chip[data-filter="all"],
.explore-search .es-chip[data-filter="all"]:hover,
.explore-search .es-chip--all,
.explore-search .es-chip--all:hover,
.chip--all,
.chip--all:hover,
.explore-search .es-chip[data-filter="*"],
.explore-search .es-chip[data-filter="*"]:hover {
  background: #E5E7EB !important;
  border-color: #E5E7EB !important;
}

.explore-search .es-chip[data-filter="all"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]),
.explore-search .es-chip--all:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]),
.chip--all:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]),
.explore-search .es-chip[data-filter="*"]:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]) {
  background: #D1D5DB !important;
  border-color: #D1D5DB !important;
}

