/* ============================================
   Newsletter Navigation Component
   화살표(이전/다음) + 드롭다운 + 검색
   ============================================ */

/* --- Container --- */
.nl-nav {
  max-width: 700px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
  font-family: 'Noto Sans KR', 'Inter', sans-serif;
  /* PRO 레이아웃의 -mt-6 z-20 콘텐츠에 가리지 않도록 */
  position: relative;
  z-index: 30;
}

.nl-nav * { box-sizing: border-box; }

/* --- Top Bar: Prev / Dropdown / Next --- */
.nl-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.nl-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nl-nav-btn:hover {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(124,58,237,0.25);
}

.nl-nav-btn:disabled, .nl-nav-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.nl-nav-select {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #1e293b;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  text-align: center;
  transition: border-color 0.2s;
}

.nl-nav-select:hover { border-color: #7c3aed; }
.nl-nav-select:focus { outline: 2px solid #7c3aed; outline-offset: 1px; }

/* --- Search Bar --- */
.nl-search {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.nl-search-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nl-search-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #1e293b;
  transition: border-color 0.2s;
}

.nl-search-input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124,58,237,0.15);
}

.nl-search-input::placeholder { color: #94a3b8; }

.nl-search-scope {
  display: flex;
  gap: 0.25rem;
}

.nl-scope-btn {
  padding: 0.35rem 0.6rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.nl-scope-btn.active {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}

.nl-scope-btn:hover:not(.active) {
  background: #e2e8f0;
}

.nl-search-go {
  padding: 0.5rem 0.75rem;
  background: #7c3aed;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.nl-search-go:hover { background: #6d28d9; }

/* --- Search Results --- */
.nl-search-results {
  margin-top: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.nl-result-item {
  display: block;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  color: #1e293b;
  font-size: 0.82rem;
  transition: all 0.2s;
  cursor: pointer;
}

.nl-result-item:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
  transform: translateX(4px);
}

.nl-result-issue {
  font-size: 0.7rem;
  color: #7c3aed;
  font-weight: 700;
  margin-right: 0.5rem;
}

.nl-result-type {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  background: #ddd6fe;
  color: #5b21b6;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 0.5rem;
}

.nl-result-body {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.3;
}

.nl-no-results {
  text-align: center;
  padding: 1rem;
  color: #94a3b8;
  font-size: 0.82rem;
}

.nl-result-count {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

/* --- Bottom Nav (same controls as top; bar style slightly muted) --- */
.nl-nav-bottom {
  margin-top: 1.5rem;
}
.nl-nav-bottom .nl-nav-bar {
  background: #fafafa;
}

/* --- Mobile --- */
@media (max-width: 640px) {
  .nl-nav { padding: 0 0.5rem; }
  .nl-nav-bar { padding: 0.5rem; gap: 0.25rem; }
  .nl-nav-btn { padding: 0.4rem 0.5rem; font-size: 0.75rem; }
  .nl-nav-select { font-size: 0.75rem; }
  .nl-search-row { flex-wrap: wrap; }
  .nl-search-input { min-width: 100%; }
  .nl-search-scope { width: 100%; justify-content: center; }
}

/* --- PRO 전용 Override --- */
.nl-nav-pro .nl-nav-bar {
  background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
  border-color: #ddd6fe;
}

.nl-nav-pro .nl-nav-btn:hover {
  background: #d97706;
  border-color: #d97706;
  box-shadow: 0 2px 8px rgba(217,119,6,0.25);
}

.nl-nav-pro .nl-scope-btn.active {
  background: #d97706;
  border-color: #d97706;
}

.nl-nav-pro .nl-search-go {
  background: #d97706;
}

.nl-nav-pro .nl-search-go:hover {
  background: #b45309;
}

.nl-nav-pro .nl-result-issue { color: #d97706; }

.nl-nav-pro .nl-result-type {
  background: #fef3c7;
  color: #92400e;
}
