/* ============================================================
   site-search.css — Public site search
   Belkasoft 2026
   ============================================================ */

/* ── Highlight ───────────────────────────────────────────── */
mark.ss-hl {
  background: none;
  color: #E07B00;
  font-weight: 700;
  padding: 0;
}

/* ── Trigger button (injected into .belka-header-contacts) ── */
/* Matches .belka-header-contacts-item-link exactly:          */
/*   default: var(--navy) #00263c                             */
/*   hover:   var(--blue) #29658A                             */
/*   open:    var(--orange) #F5911E  (brand accent)           */
.ss-trigger-item {
  list-style: none;
}
.ss-trigger-btn {
  display: grid;
  grid-gap: 0 5px;
  grid-template-columns: 18px auto;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  /* Same color as phone / Sign In */
  color: var(--navy, #00263c);
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: color .15s;
  white-space: nowrap;
}
.ss-trigger-btn:hover {
  color: var(--blue, #29658A);
}
/* When search panel is open → orange brand accent */
.ss-trigger-btn[aria-expanded="true"] {
  color: var(--orange, #F5911E);
}

/* The SVG icon: stroke-based, should follow currentColor */
.ss-trigger-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  /* Slightly thinner stroke to match the weight of fill-based icons */
  stroke-width: 1.75;
}

/* ── Search bar panel (full-width, below header) ─────────── */
.ss-bar {
  position: relative;
  width: 100%;
  background: #fff;
  border-bottom: 2px solid #e8ecf0;
  box-shadow: 0 4px 20px rgba(0,0,0,.10);
  z-index: 1000;

  /* Hidden by default */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .25s ease, opacity .2s ease, box-shadow .2s;
}
.ss-bar.is-open {
  max-height: 90vh;
  opacity: 1;
}

/* Inner row: icon + input + close button */
.ss-bar__inner {
  display: flex;
  align-items: center;
  max-width: 780px;
  margin: 0 auto;
  padding: 14px 20px;
  gap: 12px;
}

.ss-bar__icon {
  color: #aaa;
  flex-shrink: 0;
  transition: color .2s;
}
.ss-bar__inner:focus-within .ss-bar__icon {
  color: #F5911E;
}

.ss-bar__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 18px;
  font-family: inherit;
  color: #111;
  background: transparent;
  min-width: 0;
}
.ss-bar__input::placeholder { color: #bbb; }

.ss-bar__close {
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 4px;
  border-radius: 4px;
  line-height: 0;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.ss-bar__close:hover { color: #333; background: #f0f0f0; }

/* ── Autocomplete dropdown (inside .ss-bar) ──────────────── */
.ss-dropdown {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
  display: none;
  flex-direction: column;
}
.ss-dropdown.is-open {
  display: flex;
  padding-bottom: 8px;
  max-height: 460px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

/* Result items */
.ss-item {
  display: block;
  padding: 11px 12px;
  text-decoration: none;
  color: #222;
  border-radius: 6px;
  transition: background .1s;
  cursor: pointer;
}
.ss-item + .ss-item { border-top: 1px solid #f0f0f0; border-radius: 0; }
.ss-item:first-child { border-radius: 6px 6px 0 0; }
.ss-item:hover,
.ss-item.is-active { background: #f4f8fc; text-decoration: none; }

.ss-item__path {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.ss-item__url {
  font-size: 12px;
  color: #1a7a3f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-badge {
  display: inline-block;
  padding: 1px 5px;
  background: #e8f0fe;
  color: #1a56b0;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.ss-item__title {
  font-size: 15px;
  font-weight: 600;
  color: #0090D5;
  line-height: 1.3;
  margin-bottom: 3px;
}

.ss-item__snippet {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* "Show all" sticky header — always visible at top of dropdown */
.ss-showall {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: #0090D5;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
  transition: background .12s;
  flex-shrink: 0;
}
.ss-showall:hover { background: #f0f6fc; text-decoration: none; }

/* ── Popular topics chips ───────────────────────────────── */
.ss-chips {
  padding: 10px 12px 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ss-chips__label {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  margin-right: 2px;
}
.ss-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: #f0f6fc;
  border: 1px solid #d0e4f5;
  border-radius: 20px;
  font-size: 13px;
  color: #29658A;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
}
.ss-chip:hover {
  background: #ddeeff;
  border-color: #29658A;
  color: #00263c;
}

/* Infinite scroll sentinel */
.ss-sentinel {
  height: 4px;
  width: 100%;
  flex-shrink: 0;
}

/* Pagination loader — running belka */
.ss-page-loader {
  display: flex;
  justify-content: center;
  padding: 10px 12px 14px;
  flex-shrink: 0;
}
.ss-belka-run {
  height: 40px;
  width: auto;
  display: block;
}
.ss-belka-inline {
  height: 22px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  margin-right: 2px;
}

/* Loading / empty */
.ss-loading,
.ss-empty {
  padding: 14px 12px;
  font-size: 14px;
  color: #999;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ss-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #ddd;
  border-top-color: #29658A;
  border-radius: 50%;
  animation: ss-spin .65s linear infinite;
  flex-shrink: 0;
}
@keyframes ss-spin { to { transform: rotate(360deg); } }

/* ── Search results page (/cgi-bin/search.cgi?q=...) ─────── */
.site-search-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 0 60px;
}

.site-search-form {
  margin-bottom: 28px;
}
.site-search-form__inner {
  display: flex;
  border: 2px solid #29658A;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.site-search-form__inner:focus-within {
  border-color: #F5911E;
  box-shadow: 0 0 0 3px rgba(245,145,30,.15);
}
.site-search-form input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  font-size: 17px;
  border: none;
  outline: none;
  background: #fff;
  color: #111;
  min-width: 0;
}
.site-search-btn {
  padding: 12px 22px;
  background: #29658A;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .15s;
  white-space: nowrap;
  font-family: inherit;
}
.site-search-btn:hover { background: #00263c; }

.site-search-count {
  margin: 0 0 20px;
  font-size: 14px;
  color: #666;
}

.site-search-results { display: flex; flex-direction: column; }

.site-search-result {
  padding: 18px 0;
  border-bottom: 1px solid #eee;
}
.site-search-result:first-child { border-top: 1px solid #eee; }

.site-search-result__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.site-search-path {
  font-size: 12px;
  color: #1a7a3f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-search-lang-badge {
  display: inline-block;
  padding: 2px 6px;
  background: #e8f0fe;
  color: #1a56b0;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
.site-search-result__title {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}
.site-search-result__title a {
  color: #0090D5;
  text-decoration: none;
}
.site-search-result__title a:hover { text-decoration: underline; }

.site-search-result__snippet {
  margin: 0;
  font-size: 14px;
  color: #555;
  line-height: 1.55;
}

.site-search-noresults,
.site-search-hint {
  padding: 28px 0;
  color: #666;
  font-size: 15px;
}
.site-search-noresults ul { margin: 10px 0 0 20px; line-height: 1.9; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ss-bar__input { font-size: 16px; }
  .ss-item__title { font-size: 14px; }
}
