/* ==========================================================================
   db-search.css · Daelim Belefic child theme
   --------------------------------------------------------------------------
   Site search (inc/db-search.php, js/db-search.js): the icon at the end of the desktop menu bar and the field it opens,
   the field at the top of the phone/tablet menu, and the result count on the Search Results template.
   ========================================================================== */

.db-search-form .screen-reader-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.db-search-icon { display: block; width: 22px; height: 22px; }

/* ---- the field: one line, the magnifier is the submit button ---- */
.db-search-form { display: flex; align-items: stretch; width: 100%; margin: 0; }
.db-search-input {
  flex: 1 1 auto; min-width: 0; height: 52px; margin: 0; padding: 0 var(--sp-16); border: var(--bw-hair) solid var(--c-field-border); border-right: 0; border-radius: 0;
  background: var(--c-white); color: var(--c-text); font-family: var(--ff-base); font-size: var(--fs-16); line-height: 1; -webkit-appearance: none; appearance: none;
}
.db-search-input::placeholder { color: var(--c-grey-500); opacity: 1; }
.db-search-input:focus { outline: none; border-color: var(--c-field-focus); }
.db-search-input::-webkit-search-cancel-button { cursor: pointer; }
.db-search-submit {
  display: inline-flex !important; align-items: center; justify-content: center; flex: none; width: 52px; height: 52px; padding: 0 !important;
  border: 0 !important; border-radius: 0; background: var(--c-blue) !important; color: var(--c-white) !important; cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-standard);
}
.db-search-submit:hover, .db-search-submit:focus-visible { background: var(--c-blue-700) !important; }
.db-search-submit:focus-visible, .db-search-toggle:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }

/* ---- desktop: icon at the end of the menu, field in a white panel under the bar, right-aligned to the icon ---- */
.g1-header .db-nav-search { position: relative; }
.g1-header .db-search-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -11px; color: var(--c-white);
  transition: color var(--dur-fast) var(--ease-standard);
}
.g1-header .db-search-toggle:hover, .g1-header .db-search-toggle[aria-expanded="true"] { color: var(--c-red); }
.g1-header .db-search-panel {
  position: absolute; top: 100%; right: -11px; z-index: 5; width: min(440px, calc(100vw - 48px)); padding: var(--sp-16);
  background: var(--c-white); box-shadow: var(--shadow-flyout);
}
.g1-header .db-search-panel[hidden] { display: none; }
/* while the field is open, hovering the menu on the way to it doesn't open a flyout over it (Dan, 2026-11-02). A click
   on a menu item closes the search (js/db-search.js) and opens that item as usual. */
@media (min-width: 1280px) {
  .db-main-nav:has(.db-search-toggle[aria-expanded="true"]) .db-nav-item:not(.is-open) > :is(.db-flyout, .db-flyout-caret) { visibility: hidden; opacity: 0; transition: none; }
  .db-main-nav:has(.db-search-toggle[aria-expanded="true"]) .db-nav-item:not(.is-open) > .db-nav-trigger::after,
  .db-main-nav:has(.db-search-toggle[aria-expanded="true"]) .db-nav-item:not(.is-open) > .db-nav-toggle::before { rotate: none; }
}

/* ---- phone/tablet menu: the field sits above the menu list ---- */
.db-canvas__search { flex: none; padding: var(--sp-24) 24px var(--sp-16); }   /* space above the field (Dan, 11-11: it touched the top of the panel) */

/* ---- Search Results template: "3 results" under the search box ---- */
.db-search-count { margin: var(--sp-16) 0 0; padding: 0; font-size: var(--fs-16); color: var(--c-grey-600); }

/* the Visual Builder wraps layouts in #et-boc and recolours buttons; keep the header icon white there too */
.et-db #et-boc .et-l .g1-header .db-search-toggle { color: var(--c-white); }
