/* OnlineTools site-wide search 1.0 (Core 1.23.0): header button, floating button and the search dialog.
   Light colours only; scripts/dark-mode.py appends the dark block. */

/* Header button: sits with the dark mode switch (order 1 on wide screens, beside the menu button on small ones). */
.otk-search-open { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 8px; order: 1; min-width: 44px; height: 44px; margin: 0; padding: 0 12px; border: 1px solid #dce4f0 !important; border-radius: 10px; color: #13233e; background: #fff; text-decoration: none !important; font-size: 13px; line-height: 1; font-weight: 650; cursor: pointer; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.otk-search-open:hover { border-color: #afcaf6 !important; color: #0053e2; background: #f4f8ff; }
.otk-search-open:focus-visible, .otk-search-float:focus-visible { outline: 3px solid #73a5ff; outline-offset: 2px; }
.otk-search-open svg { width: 20px; height: 20px; flex-shrink: 0; }
.otk-search-open kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid #dce4f0; border-radius: 5px; color: #52637b; background: #f3f6fb; font: 600 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.otk-site-header > .otk-search-open + .otk-theme-toggle { margin-left: 0; }
@media (max-width: 1279px) {
  .otk-search-open { width: 44px; padding: 0; }
  .otk-search-open-label, .otk-search-open kbd { display: none; }
}
@media (max-width: 1080px) {
  /* Logo on the left; search, theme switch and menu together on the right. */
  .otk-search-open { order: 0; margin-left: auto; }
  .otk-site-header > .otk-search-open ~ .otk-theme-toggle { order: 0; margin-left: 0; }
}
@media (max-width: 560px) {
  .otk-site-header:has(> .otk-search-open) { column-gap: 8px; }
}
@media (max-width: 400px) {
  .otk-site-header:has(> .otk-search-open) { column-gap: 6px; }
  .otk-site-header > .otk-search-open, .otk-site-header > .otk-search-open ~ .otk-theme-toggle { width: 40px; min-width: 40px; height: 40px; }
  .otk-site-header:has(> .otk-search-open) .otk-menu-toggle { min-width: 0; padding-inline: 10px; gap: 7px; }
}
@media (max-width: 340px) {
  .otk-site-header:has(> .otk-search-open) { column-gap: 4px; }
  .otk-site-header > .otk-search-open, .otk-site-header > .otk-search-open ~ .otk-theme-toggle { width: 38px; min-width: 38px; height: 40px; }
  .otk-site-header:has(> .otk-search-open) .otk-menu-toggle { padding-inline: 8px; }
}

/* Floating button, shown by search.js only while the header is out of view. */
.otk-search-float { position: fixed; z-index: 60; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: 0; padding: 0; border: 1px solid #dce4f0 !important; border-radius: 14px; color: #13233e; background: #fff; box-shadow: 0 8px 24px rgba(16, 32, 60, .18) !important; cursor: pointer; transition: transform .18s ease, opacity .18s ease, background .16s ease, color .16s ease; }
.otk-search-float:hover { color: #0053e2; background: #f4f8ff; }
.otk-search-float[hidden] { display: none; }
.otk-search-float svg { width: 22px; height: 22px; }
.otk-search-float.otk-search-float-away { opacity: 0; pointer-events: none; transform: translateY(12px); }
@media (hover: hover) and (pointer: fine) { .otk-search-float.otk-search-float-away { opacity: 1; pointer-events: auto; transform: none; } }

/* The dialog. */
.otk-search-active { overflow: hidden; }
.otk-search-dialog { width: min(640px, calc(100% - 32px)); max-width: none; max-height: min(640px, calc(100dvh - 80px)); margin: min(12vh, 96px) auto auto; padding: 0; border-width: 1px; border-style: solid; border-color: #dce4f0; border-radius: 16px; color: #13233e; background: #fff; box-shadow: 0 24px 64px rgba(16, 32, 60, .28); overflow: hidden; }
.otk-search-dialog[open] { display: flex; flex-direction: column; }
.otk-search-dialog::backdrop { background: rgba(10, 18, 32, .55); }
.otk-search-panel { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.otk-search-bar { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; border-bottom: 1px solid #e1e8f2; }
.otk-search-bar > svg { width: 22px; height: 22px; flex-shrink: 0; color: #52637b; }
/* Specific enough to win over the site's general field styles (borders, fills, focus edges). */
html body:not(.wp-admin) .otk-search-dialog .otk-search-bar input { flex: 1; min-width: 0; height: 48px; margin: 0; padding: 0; border: 0 !important; outline: 0; color: #13233e; background: transparent; box-shadow: none !important; font-size: 18px; }
.otk-search-bar input::placeholder { color: #6b7a90; }
.otk-search-bar input::-webkit-search-cancel-button { display: none; }
.otk-search-dialog .otk-search-bar:focus-within { box-shadow: inset 0 -2px 0 #0053e2; }
/* The bar's underline is the focus mark; focus.css would add a second edge to the field itself. */
html body:not(.wp-admin) .otk-search-dialog .otk-search-bar input:focus-visible:focus { outline: none !important; box-shadow: none !important; }
.otk-search-close { flex-shrink: 0; height: 32px; margin: 0; padding: 0 10px; border: 1px solid #dce4f0 !important; border-radius: 8px; color: #52637b; background: #f3f6fb; font-size: 12px; font-weight: 650; cursor: pointer; }
.otk-search-close:hover { color: #13233e; background: #e9eff8; }
.otk-search-heading { margin: 0; padding: 14px 20px 6px; color: #52637b; font-size: 12px; line-height: 1.4; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.otk-search-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 8px; }
.otk-search-list[hidden] { display: none; }
.otk-search-list a { display: flex; align-items: center; gap: 13px; min-height: 58px; padding: 9px 10px; border-radius: 10px; color: #13233e; text-decoration: none !important; }
.otk-search-list a[aria-selected="true"] { background: #edf4ff; }
.otk-search-list a > svg { width: 18px; height: 18px; flex-shrink: 0; margin-left: auto; color: #0053e2; opacity: 0; }
.otk-search-list a[aria-selected="true"] > svg { opacity: 1; }
.otk-search-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; color: #0053e2; background: #edf4ff; }
.otk-search-list a[aria-selected="true"] .otk-search-icon { background: #fff; }
.otk-search-icon svg { width: 21px; height: 21px; }
.otk-search-text { display: grid; gap: 3px; min-width: 0; }
.otk-search-text strong { overflow: hidden; color: #13233e; font-size: 15px; line-height: 1.3; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.otk-search-text small { color: #52637b; font-size: 12px; line-height: 1.3; }
.otk-search-all { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 20px; border-top: 1px solid #e1e8f2; color: #0053e2; text-decoration: none !important; font-size: 14px; font-weight: 650; }
.otk-search-all:hover { background: #f4f8ff; }
.otk-search-all svg { width: 17px; height: 17px; }
.otk-search-keys { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 10px 20px 12px; border-top: 1px solid #e1e8f2; color: #6b7a90; background: #f8fafd; font-size: 12px; }
.otk-search-keys kbd { display: inline-block; min-width: 18px; margin-right: 4px; padding: 2px 5px; border: 1px solid #dce4f0; border-radius: 5px; color: #52637b; background: #fff; font: 600 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: center; }
@media (hover: none), (max-width: 700px) { .otk-search-keys { display: none; } }
@media (max-width: 560px) {
  /* Full width at the top, so the on-screen keyboard leaves the results in view. */
  .otk-search-dialog { width: 100%; max-height: 100dvh; margin: 0 0 auto; border-width: 0 0 1px; border-radius: 0 0 16px 16px; }
  .otk-search-bar { padding-left: 14px; }
  .otk-search-bar input { font-size: 17px; }
  .otk-search-heading { padding-inline: 16px; }
  .otk-search-list { padding-inline: 6px; }
  .otk-search-all { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) { .otk-search-open, .otk-search-float { transition: none; } }
@media print { .otk-search-open, .otk-search-float, .otk-search-dialog { display: none !important; } }

.otk-search-rating { margin-left: 8px; color: #a15c00; font-weight: 700; white-space: nowrap; }

/* dark-mode:start — generated by scripts/dark-mode.py from assets/search.css; do not edit by hand */
@media screen{
 html[data-theme="dark"] .otk-search-open:not([data-otk-paper],[data-otk-paper] *){border:1px solid #3c3c3c !important;color:#fafafa;background:#212121}
 html[data-theme="dark"] .otk-search-open:hover:not([data-otk-paper],[data-otk-paper] *){border-color:#374762 !important;color:#80abf7;background:#191919}
 html[data-theme="dark"] .otk-search-open:focus-visible:not([data-otk-paper],[data-otk-paper] *),
html[data-theme="dark"] .otk-search-float:focus-visible:not([data-otk-paper],[data-otk-paper] *){outline:3px solid #465671}
 html[data-theme="dark"] .otk-search-open kbd:not([data-otk-paper],[data-otk-paper] *){border:1px solid #3c3c3c;color:#adadad;background:#191919}
 html[data-theme="dark"] .otk-search-float:not([data-otk-paper],[data-otk-paper] *){border:1px solid #3c3c3c !important;color:#fafafa;background:#212121;box-shadow:0 8px 24px rgba(16, 32, 60, .18) !important}
 html[data-theme="dark"] .otk-search-float:hover:not([data-otk-paper],[data-otk-paper] *){color:#80abf7;background:#191919}
 html[data-theme="dark"] .otk-search-dialog:not([data-otk-paper],[data-otk-paper] *){border-color:#3c3c3c;color:#fafafa;background:#212121;box-shadow:0 24px 64px rgba(16, 32, 60, .28)}
 html[data-theme="dark"] .otk-search-dialog:not([data-otk-paper],[data-otk-paper] *)::backdrop{background:rgba(10, 18, 32, .55)}
 html[data-theme="dark"] .otk-search-bar:not([data-otk-paper],[data-otk-paper] *){border-bottom:1px solid #3a3a3a}
 html[data-theme="dark"] .otk-search-bar > svg:not([data-otk-paper],[data-otk-paper] *){color:#adadad}
 html[data-theme="dark"] body:not(.wp-admin) .otk-search-dialog .otk-search-bar input{border:0 !important;outline:0;color:#fafafa;background:transparent;box-shadow:none !important}
 html[data-theme="dark"] .otk-search-bar input:not([data-otk-paper],[data-otk-paper] *)::placeholder{color:#949494}
 html[data-theme="dark"] .otk-search-dialog .otk-search-bar:focus-within:not([data-otk-paper],[data-otk-paper] *){box-shadow:inset 0 -2px 0 #0053e2}
 html[data-theme="dark"] body:not(.wp-admin) .otk-search-dialog .otk-search-bar input:focus-visible:focus{outline:none !important;box-shadow:none !important}
 html[data-theme="dark"] .otk-search-close:not([data-otk-paper],[data-otk-paper] *){border:1px solid #3c3c3c !important;color:#adadad;background:#191919}
 html[data-theme="dark"] .otk-search-close:hover:not([data-otk-paper],[data-otk-paper] *){color:#fafafa;background:#2c2c2c}
 html[data-theme="dark"] .otk-search-heading:not([data-otk-paper],[data-otk-paper] *){color:#adadad}
 html[data-theme="dark"] .otk-search-list a:not([data-otk-paper],[data-otk-paper] *){color:#fafafa}
 html[data-theme="dark"] .otk-search-list a[aria-selected="true"]:not([data-otk-paper],[data-otk-paper] *){background:#292929}
 html[data-theme="dark"] .otk-search-list a > svg:not([data-otk-paper],[data-otk-paper] *){color:#80abf7}
 html[data-theme="dark"] .otk-search-icon:not([data-otk-paper],[data-otk-paper] *){color:#80abf7;background:#292929}
 html[data-theme="dark"] .otk-search-list a[aria-selected="true"] .otk-search-icon:not([data-otk-paper],[data-otk-paper] *){background:#212121}
 html[data-theme="dark"] .otk-search-text strong:not([data-otk-paper],[data-otk-paper] *){color:#fafafa}
 html[data-theme="dark"] .otk-search-text small:not([data-otk-paper],[data-otk-paper] *){color:#adadad}
 html[data-theme="dark"] .otk-search-all:not([data-otk-paper],[data-otk-paper] *){border-top:1px solid #3a3a3a;color:#80abf7}
 html[data-theme="dark"] .otk-search-all:hover:not([data-otk-paper],[data-otk-paper] *){background:#191919}
 html[data-theme="dark"] .otk-search-keys:not([data-otk-paper],[data-otk-paper] *){border-top:1px solid #3a3a3a;color:#949494;background:#1d1d1d}
 html[data-theme="dark"] .otk-search-keys kbd:not([data-otk-paper],[data-otk-paper] *){border:1px solid #3c3c3c;color:#adadad;background:#212121}
 html[data-theme="dark"] .otk-search-rating:not([data-otk-paper],[data-otk-paper] *){color:#d58c44}
}
/* dark-mode:end */
