/* Search field (searchform.php) */
.search-form[data-quick-search] { position: relative; scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 12px); }
.search-form[data-quick-search] label { position: relative; display: block; }
.search-form[data-quick-search] label::before { content: ""; position: absolute; top: 50%; left: 16px; z-index: 1; width: 15px; height: 15px; margin-top: -7.5px; pointer-events: none; background: var(--wm-text-muted); transition: background-color .15s;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='7'/%3E%3Cpath d='m16 16 5.5 5.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='7'/%3E%3Cpath d='m16 16 5.5 5.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.search-form[data-quick-search]:focus-within label::before { background: var(--wm-red); }
.search-form.wq-loading label::before { animation: wq-pulse .8s ease-in-out infinite alternate; }
@keyframes wq-pulse { to { opacity: .3; } }

.search-form[data-quick-search] .search-field { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; height: 46px; margin: 0; padding: 0 16px 0 42px; font: inherit; font-size: 1rem; line-height: 46px; text-transform: none; color: var(--wm-text); cursor: text; background: var(--wm-surface); border: 1px solid var(--wm-line-strong); border-radius: 99px; box-shadow: inset 0 1px 2px rgb(0 0 0 / 6%); transition: width .3s var(--wm-ease), background-color .2s, border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.search-form[data-quick-search] .search-field:hover { border-color: var(--wm-text-muted); }
.search-form[data-quick-search] .search-field:focus { outline: none; border-color: var(--wm-red); box-shadow: 0 0 0 4px rgb(226 0 26 / 22%); }
.search-form[data-quick-search] .search-field::placeholder { color: var(--wm-text-muted); opacity: 1; }
.search-form[data-quick-search] label::before { left: 16px; }

/* In the navbar (header.php): a translucent pill on red that turns solid while typing */
@media (min-width: 90em) {
	.wm-search .search-form[data-quick-search] .search-field { width: 16.5rem; height: 40px; line-height: 40px; color: #fff; background: rgb(255 255 255 / 14%); border-color: rgb(255 255 255 / 32%); box-shadow: none; }
	.wm-search .search-form[data-quick-search] .search-field::placeholder { color: rgb(255 255 255 / 80%); }
	.wm-search .search-form[data-quick-search] label::before { background: #fff; }
	.wm-search .search-form[data-quick-search] .search-field:hover { background: rgb(255 255 255 / 22%); border-color: #fff; }
	.wm-search .search-form[data-quick-search] .search-field:focus { width: 24rem; color: var(--wm-text); background: var(--wm-surface); border-color: #fff; box-shadow: 0 0 0 4px rgb(255 255 255 / 30%); }
	.wm-search .search-form[data-quick-search] .search-field:focus::placeholder { color: var(--wm-text-muted); }
	.wm-search .search-form[data-quick-search]:focus-within label::before { background: var(--wm-red); }
}
.search-form[data-quick-search] .search-field::-webkit-search-cancel-button { -webkit-appearance: none; width: 14px; height: 14px; cursor: pointer; background: var(--wm-text-muted);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat; }
.search-form[data-quick-search] .search-field::-webkit-search-cancel-button:hover { background: var(--wm-red); }

/* Shared type identities: labels and icons keep the meaning clear without color. */
.wq-group, .wq-item, .wq-tab { --wq-accent: var(--wm-text-muted); --wq-tint: var(--wm-surface-2); --wq-icon: url('../images/search-page.svg'); }
.wq-group-post, .wq-item-post, .wq-type-post { --wq-accent: light-dark(#b80019, #ff7584); --wq-tint: light-dark(#fff0f2, #3a1a20); --wq-icon: url('../images/search-news.svg'); }
.wq-group-player, .wq-item-player, .wq-type-player { --wq-accent: light-dark(#21613f, #6fd598); --wq-tint: light-dark(#edf6ef, #17301f); --wq-icon: url('../images/search-player.svg'); }
.wq-group-page, .wq-item-page, .wq-type-page { --wq-accent: light-dark(#245b8a, #86bdf0); --wq-tint: light-dark(#edf4fb, #18283a); --wq-icon: url('../images/search-page.svg'); }
.wq-group-press, .wq-item-press, .wq-type-press { --wq-accent: light-dark(#70438a, #cfa3ec); --wq-tint: light-dark(#f5eff9, #2c1f36); --wq-icon: url('../images/search-press.svg'); }
.wq-type-icon { display: inline-block; flex: 0 0 auto; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--wq-icon) center / contain no-repeat; mask: var(--wq-icon) center / contain no-repeat; }

/* Quick search mega panel (js/quick-search.js) */
.wq-results { box-sizing: border-box; position: absolute; top: calc(100% + 10px); right: 0; z-index: 1000; width: 760px; max-width: calc(100vw - 20px); max-height: 70vh; max-height: 70dvh; overflow-y: auto; padding: 0; text-align: left; color: var(--wm-text); background: var(--wm-surface); border: 1px solid var(--wm-line); border-top: 3px solid var(--wm-red); border-radius: var(--wm-radius); box-shadow: var(--wm-shadow-lg); transform: translateX(var(--wq-shift, 0px)); }
.wq-results[hidden] { display: none; }
.wq-results { max-height: min(70dvh, var(--wq-available-height, 70dvh)); }
.wq-results.wq-single-group { width: 480px; }
.wq-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; padding: 20px; }
.wq-single-group .wq-groups { grid-template-columns: minmax(0, 1fr); }
.wq-group { min-width: 0; }
.wq-group-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 6px; padding: 10px; border-left: 3px solid var(--wq-accent); font-size: 15px; line-height: 1.4; font-weight: 700; color: var(--wq-accent); background: var(--wq-tint); }
.wq-group-title { display: flex; align-items: center; gap: 8px; }
.wq-group-count { font-size: 12px; font-weight: 700; color: var(--wq-accent); }

.wq-option { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 8px; color: var(--wm-text); text-decoration: none; border-radius: 4px; }
.wq-option:hover, .wq-option.is-active { color: var(--wm-text); background: var(--wq-tint, var(--wm-surface-2)); }
.wq-option.is-active { box-shadow: inset 3px 0 0 var(--wq-accent, #e2001a); }
.wq-text { display: flex; flex-direction: column; min-width: 0; }
.wq-title { font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wq-title mark { padding: 0; color: inherit; font-weight: 700; background: none; }
.wq-subtitle { margin-top: 3px; font-size: 12px; line-height: 1.4; color: var(--wm-text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wq-thumb { display: flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; overflow: hidden; border-radius: 4px; color: var(--wq-accent); background: var(--wq-tint); }
.wq-thumb-player { border-radius: 50%; }
.wq-thumb .wq-type-icon { width: 25px; height: 25px; }
.wq-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.wq-groups:empty { display: none; }
.wq-empty { padding: 24px; font-size: 14px; color: var(--wm-text-muted); }
.wq-footer { padding: 10px 20px; border-top: 1px solid var(--wm-line); background: var(--wm-surface-2); }
.wq-option.wq-all { font-size: 14px; line-height: 1.4; font-weight: 700; color: var(--wm-red-ink); }

@media only screen and (min-width: 1200px) {
	.wq-results { width: 1080px; }
	.wq-groups { grid-template-columns: repeat(var(--wq-columns, 4), minmax(0, 1fr)); gap: 20px; }
}

@media only screen and (max-width: 767px) {
	.wq-results, .wq-results.wq-single-group { width: 480px; }
	.wm-search .wq-results { left: 50%; right: auto; transform: translateX(calc(-50% + var(--wq-shift, 0px))); width: calc(100vw - 20px); }
	.wq-groups { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 14px; }
	.wq-footer { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.search-form.wq-loading label::before { animation: none; }
	.search-form[data-quick-search] .search-field { transition: none; }
}

/* Search results page (search.php) */
.wq-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.wq-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; color: var(--wq-accent); background: var(--wq-tint); border: 1px solid var(--wm-line); border-radius: 99px; text-decoration: none; }
.wq-tab .wq-type-icon { width: 17px; height: 17px; }
.wq-tab:hover { color: var(--wq-accent); border-color: var(--wq-accent); }
.wq-tab.is-active { color: var(--wm-surface); background: var(--wq-accent); border-color: var(--wq-accent); }
.wq-tab:focus-visible, .wq-item .entry-title a:focus-visible { outline: 2px solid var(--wq-accent); outline-offset: 3px; }
.wq-tab-count { margin-left: 4px; font-size: 11px; opacity: .75; }
.wq-badge { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 8px; padding: 3px 8px; font-size: 12px; line-height: 1.4; font-weight: 700; color: var(--wq-accent); background: var(--wq-tint); }
.wq-badge .wq-type-icon { width: 16px; height: 16px; }
.wq-page .wq-item { display: flex; align-items: flex-start; gap: 18px; padding-left: 12px; border-left: 3px solid var(--wq-accent); }
.wq-page .wq-item .mh-posts-list-thumb { float: none; flex: 0 0 140px; width: 140px; margin: 0; }
.wq-page .wq-item .mh-posts-list-thumb a { display: block; }
.wq-page .wq-item .mh-posts-list-thumb img { display: block; width: 100%; height: 110px; object-fit: cover; }
.wq-page .wq-item .mh-posts-list-content { flex: 1; min-width: 0; }
.wq-placeholder { display: flex; align-items: center; justify-content: center; height: 110px; color: var(--wq-accent); background: var(--wq-tint); }
.wq-placeholder .wq-type-icon { width: 48px; height: 48px; }
.wq-item .mh-posts-list-excerpt mark { padding: 0 .15em; font-weight: 700; color: inherit; background: light-dark(#fff3b0, #5a4a00); border-radius: 3px; }
.wq-page .wq-item-player .mh-posts-list-thumb img { object-position: center top; }
@media only screen and (max-width: 767px) {
	.wq-page .wq-item { gap: 12px; padding-left: 8px; }
	.wq-page .wq-item .mh-posts-list-thumb { flex-basis: 72px; width: 72px; }
	.wq-page .wq-item .mh-posts-list-thumb img, .wq-placeholder { height: 72px; }
	.wq-placeholder .wq-type-icon { width: 32px; height: 32px; }
}
