/* ── Skeleton ── */
.skel {
  border-radius: 12px;
  background: linear-gradient(90deg, var(--border) 25%, var(--hbs) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 2.1s ease-in-out infinite;
}
.skel-search {
  height: 44px;
  width: 220px;
}
@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Input wrapper ── */
.search {
  flex: 1;
  min-width: 250px;
}
.search-wrapper {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  border-radius: 15px;
  transition: all 0.3s ease;
}
.search-wrapper:focus-within .search-input-blog {
  box-shadow: 0 2px 10px var(--shadow-primary-15, rgba(59,187,201,0.15));
  border-color: var(--link-active);
}
.search-icon {
  position: absolute;
  left: 11px;
  min-width: 22px;
  max-width: 22px;
  height: 22px;
  width: 22px;
  fill: var(--link-active);
  transition: fill 0.3s ease;
}
.search-input-blog {
  width: 100%;
  padding: 10px 36px 10px 38px;
  outline: none;
  background: var(--app);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--font);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
@media (max-width: 900px) {
    .header-search {
        min-width: 180px;
    }
}
.search-input-blog::placeholder {
  color: var(--font-four);
}
.search-clear {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
}
.search-clear svg {
  fill: var(--font-four);
  transition: fill 0.2s;
}
.search-clear:hover {
  background: var(--red-bxs);
}
.search-clear:hover svg {
  fill: var(--red-solid);
}

/* ── Dropdown container ── */
.header-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: var(--app);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 32px var(--shadow-primary-20, rgba(59,187,201,0.15)), 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  animation: search-dropdown-in 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}
@keyframes search-dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 720px) {
  .header-search-dropdown {
    position: fixed;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: calc(100vw - 20px);
    max-width: 540px;
  }
  @keyframes search-dropdown-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
}

/* ── Result items ── */
.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  text-align: left;
  padding: 14px 18px 14px 22px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.search-result-item:last-of-type {
  border-bottom: none;
}
.search-result-item:hover {
  background: var(--hbs);
  border-left-color: var(--link-active);
}
.result-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--font);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}
.search-result-item:hover .result-title {
  color: var(--primary-teal);
}
.result-excerpt {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--font-four);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  margin: 0;
}
.result-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.result-tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--green);
  color: var(--font-sec);
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 2px 6px var(--shadow-primary-15, rgba(59,187,201,0.15));
}

/* ── Footer: see all ── */
.search-see-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--font);
  text-decoration: none;
  border-top: 1px solid var(--border);
  border-left: 4px solid transparent;
  background: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-see-all:hover {
  background: var(--hbs);
  border-left-color: var(--link-active);
  color: var(--primary-teal);
}
.search-see-all svg {
  transition: transform 0.3s ease;
}
.search-see-all:hover svg {
  transform: translateX(4px);
}

/* ── Loading / no-results ── */
.search-dropdown-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 18px;
  font-size: 0.9rem;
  color: var(--font-four);
}
.search-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 18px;
  font-size: 0.88rem;
  color: var(--font-four);
  text-align: center;
}
.search-no-results strong {
  color: var(--font);
  font-size: 0.95rem;
}
.search-no-results-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--hbs);
  margin-bottom: 4px;
  color: var(--font-four);
}
.search-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--border);
  border-top-color: var(--link-active);
  border-radius: 50%;
  animation: search-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes search-spin {
  to { transform: rotate(360deg); }
}

/* Skeleton/inline styles */
.skel {
  border-radius: 12px;
  background: linear-gradient(90deg, var(--border) 25%, var(--hbs) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 2.1s ease-in-out infinite;
}
.skel-search {
  height: 44px;
}
@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
