#nav-pagefind-btn {
  cursor: var(--cursor-pointer);
}

.pagefind-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  width: clamp(320px, 92vw, 860px);
  max-height: clamp(220px, 62vh, 540px);
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(140, 156, 201, 0.22);
  background: color-mix(in srgb, var(--color-wrap) 84%, transparent);
  backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 12px 36px rgba(24, 32, 64, 0.2);
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 260;
}

.pagefind-search-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pf-shell {
  display: grid;
  gap: 10px;
  max-height: calc(62vh - 34px);
  overflow: auto;
  padding-right: 6px;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--red-1) 35%, transparent) transparent;
}

.pf-shell::-webkit-scrollbar {
  width: 10px;
}

.pf-shell::-webkit-scrollbar-track {
  border-radius: 999px;
  background: transparent;
}

.pf-shell::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  background-color: color-mix(in srgb, var(--red-1) 30%, transparent);
}

.pf-input-row {
  position: relative;
  display: flex;
  align-items: center;
}

.pf-search-icon {
  position: absolute;
  left: 12px;
  color: var(--red-0);
  font-size: 18px;
}

.pf-search-icon::before {
  content: "\f002";
  font-family: var(--font-icon);
}

.pf-query {
  width: 100%;
  height: 44px;
  padding: 0 82px 0 38px;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--red-1) 50%, transparent);
  background: color-mix(in srgb, var(--color-background) 92%, transparent);
  color: var(--red-2);
  font-size: 16px;
  font-weight: 600;
  box-sizing: border-box;
}

.pf-query:focus {
  border-color: color-mix(in srgb, var(--red-1) 70%, transparent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red-1) 18%, transparent);
}

.pf-clear {
  position: absolute;
  right: 4px;
  top: 4px;
  height: 36px;
  min-width: 52px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--red-1) 50%, transparent);
  background: color-mix(in srgb, var(--color-wrap) 94%, transparent);
  color: var(--red-0);
  font-size: 14px;
  line-height: 1;
  text-align: center;
  cursor: var(--cursor-pointer);
}

.pf-clear:hover {
  color: var(--red-1);
  border-color: color-mix(in srgb, var(--red-1) 70%, transparent);
}

.pf-message {
  margin: 0;
  color: var(--red-1);
  font-weight: 700;
  min-height: 24px;
}

.pf-sections {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-template-areas:
    "posts others";
  gap: 12px;
  align-items: start;
}

.pf-sections.pf-only-posts,
.pf-sections.pf-only-others {
  grid-template-columns: 1fr;
  grid-template-areas: "posts";
}

.pf-sections.pf-only-others {
  grid-template-areas: "others";
}

.pf-section {
  border: 1px solid color-mix(in srgb, var(--red-2) 14%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-wrap) 94%, transparent);
  padding: 10px;
}

.pf-section-posts {
  grid-area: posts;
}

.pf-section-others {
  grid-area: others;
}

.pf-section-head h3 {
  margin: 0;
  color: var(--red-1);
  font-size: 16px;
  font-weight: 700;
}

.pf-cards {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.pf-card {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--red-2) 16%, transparent);
  border-radius: 10px;
  padding: 8px;
  background: color-mix(in srgb, var(--color-wrap) 97%, transparent);
}

.pf-card.pf-hidden {
  display: none;
}

.pf-thumb {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--red-1) 10%, transparent);
}

.pf-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pf-card-content {
  min-width: 0;
}

.pf-title {
  color: var(--red-1);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.pf-title:hover {
  text-decoration: underline;
}

.pf-excerpt {
  margin-top: 4px;
  color: var(--red-2);
  line-height: 1.5;
  font-size: 14px;
}

.pf-excerpt mark {
  background: color-mix(in srgb, #ffeb3b 65%, transparent);
  border-radius: 4px;
  padding: 0 2px;
}

.pf-section-others .pf-card {
  grid-template-columns: 1fr;
}

.pf-more {
  margin-top: 8px;
  border: 1px solid color-mix(in srgb, var(--red-1) 52%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-wrap) 94%, transparent);
  color: var(--red-1);
  height: 36px;
  width: 100%;
  cursor: var(--cursor-pointer);
}

@media (max-width: 900px) {
  .pagefind-search-panel {
    width: clamp(280px, 94vw, 560px);
    max-height: clamp(220px, 62vh, 500px);
    padding: 10px;
  }

  .pf-shell {
    max-height: calc(62vh - 28px);
  }

  .pf-sections {
    grid-template-columns: 1fr;
    grid-template-areas:
      "posts"
      "others";
  }

  .pf-title {
    font-size: 16px;
  }

  .pf-excerpt {
    font-size: 13px;
  }
}
