/* ===================== SITE NAV ===================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  background: rgba(244, 241, 234, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(221, 213, 200, 0.6);
}

.site-nav-logo {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
}

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.search-toggle:hover {
  color: #1a1a1a;
}

.search-toggle svg {
  width: 20px;
  height: 20px;
}

/* Push page content below fixed nav */
body.has-nav {
  padding-top: 52px;
}

/* ===================== SEARCH PANEL ===================== */
.search-panel {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 799;
  background: #f4f1ea;
  border-bottom: 1px solid #ddd5c8;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  max-height: calc(100vh - 52px);
  overflow-y: auto;
}

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

.search-panel-inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px 20px;
}

/* ===================== SEARCH INPUT ===================== */
.search-input-wrapper {
  position: relative;
  margin-bottom: 4px;
}

.search-input-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #999;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 44px 14px 44px;
  font-family: 'Work Sans', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #2c2c2c;
  background: #fff;
  border: 1px solid #ddd5c8;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input::placeholder {
  color: #aaa;
}

.search-input:focus {
  border-color: #b5a999;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover {
  color: #555;
}

.search-clear svg {
  position: static;
  transform: none;
  width: 16px;
  height: 16px;
}

/* ===================== SEARCH RESULTS ===================== */
.search-results {
  padding-top: 8px;
}

.search-results:empty {
  display: none;
}

.search-result-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #ebe6dc;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-radius: 6px;
  padding-left: 6px;
  padding-right: 6px;
}

.search-result-card:last-child {
  border-bottom: none;
}

.search-result-card:hover {
  background: #ebe6dc;
}

.search-result-img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
  border: 1px solid #ddd5c8;
}

.search-result-body {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-family: 'Fraunces', serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-reason {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 0.625rem;
  font-weight: 500;
  color: #555;
  background: #ebe6dc;
  border-radius: 100px;
}

.search-empty {
  text-align: center;
  padding: 24px 0 12px;
  font-size: 0.875rem;
  color: #888;
}

/* ===================== SEARCH OVERLAY ===================== */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 798;
  background: rgba(0, 0, 0, 0.15);
}

.search-overlay.active {
  display: block;
}

/* ===================== RESPONSIVE ===================== */
@media (min-width: 600px) {
  .site-nav {
    padding: 0 32px;
  }

  .search-panel-inner {
    padding: 20px 32px 24px;
  }

  .search-result-img {
    width: 88px;
    height: 64px;
  }

  .search-result-title {
    font-size: 1rem;
  }

  .search-result-meta {
    font-size: 0.8125rem;
  }
}

@media (min-width: 900px) {
  .site-nav-logo {
    font-size: 1.0625rem;
  }

  .search-result-card {
    gap: 16px;
    padding: 12px 8px;
  }

  .search-result-img {
    width: 100px;
    height: 70px;
  }
}
