/* ============================
   /search — Modern search bar
   ============================ */

/* Page spacing + center */
body.path-search .layout-content {
  padding-top: clamp(24px, 5vh, 64px);
  padding-bottom: 64px;
}

body.path-search .main-content__container,
body.path-search .region-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Card wrapper */
body.path-search .block-system-main-block,
body.path-search .view-search {
  width: min(980px, calc(100% - 48px));
}

body.path-search form.search-form,
body.path-search form[action*="/search"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.10);
  backdrop-filter: blur(6px);
}

/* Hide the label (optional) */
body.path-search .form-item label {
  display: none;
}

/* --- The “google-like” bar we build via JS --- */
body.path-search .ex1-searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Input should fill available space */
body.path-search .ex1-searchbar input[type="search"],
body.path-search .ex1-searchbar input[type="text"] {
  flex: 1 1 auto;
  height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.96);
  padding: 0 16px;
  font-size: 16px;
  outline: none;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);
}

body.path-search .ex1-searchbar input[type="search"]:focus,
body.path-search .ex1-searchbar input[type="text"]:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16), 0 6px 18px rgba(2, 6, 23, 0.06);
}

/* Icon buttons */
body.path-search .ex1-searchbar .ex1-iconbtn {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  color: rgba(15, 23, 42, 0.75); /* svg uses currentColor */
}

body.path-search .ex1-searchbar .ex1-iconbtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.10);
  filter: brightness(1.02);
}

body.path-search .ex1-searchbar .ex1-iconbtn:active {
  transform: translateY(0);
}

body.path-search .ex1-searchbar .ex1-iconbtn svg {
  width: 22px;
  height: 22px;
}

/* Submit (magnifying) button: more “primary” */
body.path-search .ex1-searchbar .ex1-submitbtn {
  border-color: rgba(37, 99, 235, 0.35);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.98));
  color: #fff;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}

/* Clear button: hidden until there is text (JS toggles class) */
body.path-search .ex1-searchbar .ex1-clearbtn {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}

body.path-search .ex1-searchbar.has-text .ex1-clearbtn {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Hide Drupal’s default submit input (we replace it with our icon button) */
body.path-search input[type="submit"]#edit-submit-search,
body.path-search input[type="submit"]#edit-submit {
  display: none !important;
}

/* Helper text */
body.path-search .form-item .description,
body.path-search .search-help,
body.path-search .view-empty {
  margin-top: 12px;
  color: rgba(15, 23, 42, 0.70);
  font-size: 14px;
  text-align: center;
}

/* Dark mode tweaks (your theme uses html.dark-mode) */
html.dark-mode body.path-search form.search-form,
html.dark-mode body.path-search form[action*="/search"] {
  background: rgba(2, 6, 23, 0.55);
  border-color: rgba(148, 163, 184, 0.20);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

html.dark-mode body.path-search .ex1-searchbar input[type="search"],
html.dark-mode body.path-search .ex1-searchbar input[type="text"] {
  background: rgba(2, 6, 23, 0.65);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(255, 255, 255, 0.92);
}

html.dark-mode body.path-search .ex1-searchbar .ex1-iconbtn {
  background: rgba(2, 6, 23, 0.55);
  border-color: rgba(148, 163, 184, 0.20);
  color: rgba(226, 232, 240, 0.82);
}

html.dark-mode body.path-search .form-item .description {
  color: rgba(226, 232, 240, 0.70);
}

/* =========================================================
   Tighten /search wrappers: make outer = inner width
   Targets Views exposed filters on /search
   ========================================================= */

body.path-search .views-element-container,
body.path-search .view-filters {
  /* shrink-wrap to the form instead of stretching full page */
  display: inline-block;
  width: fit-content;
  max-width: 100%;
}

/* Make the filters area not add extra width */
body.path-search .view-filters {
  padding: 0 !important;
  margin: 0 !important;
}

/* Make the exposed form wrapper not add padding/extra width */
body.path-search form.views-exposed-form,
body.path-search .views-exposed-form {
  display: inline-block;       /* shrink-wrap */
  width: fit-content;
  max-width: 100%;
  padding: 0 !important;       /* remove outer padding so it hugs inner */
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Ensure the inline form row doesn't force full width */
body.path-search .views-exposed-form .form--inline {
  display: inline-flex;        /* shrink-wrap row */
  width: fit-content;
  max-width: 100%;
  gap: 10px;
}

/* Make the inner form-item be the "width authority" */
body.path-search .views-exposed-form .form-item,
body.path-search .views-exposed-form .js-form-item {
  margin: 0 !important;
}

/* The input wrapper (your inner box) controls width */
body.path-search .views-exposed-form .form-item-keys,
body.path-search .views-exposed-form .js-form-item-keys {
  display: inline-flex;
  width: min(760px, calc(100vw - 120px)); /* adjust 760px if you want wider/narrower */
  max-width: 100%;
}

/* The actual input fills its wrapper */
body.path-search .views-exposed-form .form-item-keys input,
body.path-search .views-exposed-form .js-form-item-keys input {
  width: 100%;
}

/* If you are using the new .ex1-searchbar wrapper, let it define the box */
body.path-search .ex1-searchbar {
  width: 100%;
}

/* Tighten /search wrapper widths so everything matches */
body.path-search .views-element-container.contextual-region,
body.path-search .view-filters,
body.path-search form.views-exposed-form.form--inline {
  width: 100% !important;
  max-width: 920px !important;   /* pick your desired max width */
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Ensure the inner form-item also spans the same width */
body.path-search .views-exposed-form .form--inline {
  width: 100% !important;
}

/* Make the input wrapper fill remaining space */
body.path-search .views-exposed-form .form-item {
  flex: 1 1 auto;
  min-width: 0;
}

/* Keep input + actions aligned nicely */
body.path-search .views-exposed-form .form--inline {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

body.path-search .views-field-search-api-excerpt {
  display: block !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
  overflow: visible !important;
}
