/* assets/css/search.css */

.search-page-wrap { max-width: 1100px; margin: 0 auto; }

/* ── SEARCH HERO ──────────────────────────────────────────────────────── */
.search-hero {
  padding: 2.5rem 2rem 1.5rem;
  border-bottom: 1px solid var(--bd);
  background: var(--bg2);
}

.search-form-lg { margin-bottom: 1.25rem; }
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg);
  border: 2px solid var(--bd2);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s;
  max-width: 680px;
}
.search-input-wrap:focus-within { border-color: var(--ac); }
.search-icon-lg { flex-shrink: 0; margin: 0 .75rem; color: var(--tx3); }
.search-input-lg {
  flex: 1; border: none; background: none; outline: none;
  font-size: 1rem; color: var(--tx); padding: .75rem 0;
  font-family: 'DM Sans', system-ui, sans-serif;
}
.search-submit-lg {
  padding: .75rem 1.25rem; background: var(--ac); color: #fff;
  border: none; cursor: pointer; font-weight: 700; font-size: .85rem;
  font-family: 'DM Sans', system-ui, sans-serif; transition: background .15s;
  white-space: nowrap;
}
.search-submit-lg:hover { filter: brightness(1.1); }

.search-cats { display: flex; gap: .4rem; flex-wrap: wrap; }
.search-cat-pill {
  padding: .28rem .75rem; border-radius: 100px;
  font-size: .72rem; font-weight: 600;
  border: 1px solid var(--bd2); color: var(--tx2);
  background: var(--bg3); transition: all .15s;
}
.search-cat-pill:hover, .search-cat-pill.active {
  background: var(--ac); color: #fff; border-color: var(--ac);
}

/* ── RESULTS ──────────────────────────────────────────────────────────── */
.search-results-wrap { padding: 1.5rem 2rem 3rem; }

.search-meta {
  font-size: .82rem; color: var(--tx3);
  margin-bottom: 1.5rem; padding-bottom: .75rem;
  border-bottom: 1px solid var(--bd);
}
.search-meta strong { color: var(--tx); }

.search-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.search-card {
  display: flex; flex-direction: column;
  background: var(--bg2); border: 1px solid var(--bd);
  border-radius: 7px; overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.search-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); border-color: var(--ac); }
.search-card-img { width: 100%; height: 140px; object-fit: cover; }
.search-card-no-img {
  width: 100%; height: 140px; background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 700; color: var(--bd2);
}
.search-card-body { padding: .85rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.search-card-cat { font-size: .58rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ac); }
.search-card-title { font-family: 'Fraunces', serif; font-size: .9rem; font-weight: 700; color: var(--tx); line-height: 1.35; }
.search-card-title mark { background: rgba(13,115,119,.15); color: var(--ac); border-radius: 2px; padding: 0 .15rem; }
.search-card-excerpt { font-size: .78rem; color: var(--tx3); line-height: 1.5; }
.search-card-excerpt mark { background: rgba(13,115,119,.15); color: var(--ac); border-radius: 2px; padding: 0 .1rem; }
.search-card-meta { font-size: .68rem; color: var(--tx3); margin-top: .2rem; }

/* ── EMPTY STATE ──────────────────────────────────────────────────────── */
.search-empty {
  text-align: center; padding: 5rem 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.search-empty-icon { font-size: 3rem; opacity: .3; }
.search-empty h2 { font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 700; color: var(--tx); margin: 0; }
.search-empty p { font-size: .88rem; color: var(--tx3); margin: 0; }

/* ── PAGINATION ───────────────────────────────────────────────────────── */
.search-pagination {
  display: flex; justify-content: center; gap: .4rem;
  margin-top: 2.5rem;
}
.search-page-btn {
  padding: .4rem .85rem; border-radius: 4px; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--bd2); background: var(--bg3); color: var(--tx2);
  transition: all .15s;
}
.search-page-btn:hover, .search-page-btn.active {
  background: var(--ac); color: #fff; border-color: var(--ac);
}

/* ── DROPDOWN (injected into header) ─────────────────────────────────── */
.search-dropdown-wrap { position: relative; }

.site-search-input {
  background: var(--bg2); border: 1px solid var(--bd2);
  border-radius: 20px; padding: .3rem .85rem .3rem 2rem;
  font-size: .78rem; color: var(--tx); outline: none; width: 180px;
  font-family: 'DM Sans', system-ui, sans-serif; transition: all .15s;
}
.site-search-input:focus { width: 240px; border-color: var(--ac); background: var(--bg); }
.site-search-icon {
  position: absolute; left: .6rem; top: 50%; transform: translateY(-50%);
  color: var(--tx3); pointer-events: none;
}

.search-dropdown {
  position: absolute; top: calc(100% + .5rem); right: 0;
  width: 380px; background: var(--bg); border: 1px solid var(--bd);
  border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 1000; overflow: hidden; display: none;
}
.search-dropdown.open { display: block; }
.search-drop-item {
  display: flex; gap: .75rem; padding: .75rem 1rem;
  border-bottom: 1px solid var(--bd); transition: background .12s;
  cursor: pointer;
}
.search-drop-item:last-child { border-bottom: none; }
.search-drop-item:hover { background: var(--bg2); }
.search-drop-img { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: var(--bg3); }
.search-drop-body { flex: 1; min-width: 0; }
.search-drop-cat { font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ac); margin-bottom: .15rem; }
.search-drop-title { font-size: .82rem; font-weight: 600; color: var(--tx); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-drop-title mark { background: rgba(13,115,119,.15); color: var(--ac); }
.search-drop-time { font-size: .65rem; color: var(--tx3); margin-top: .15rem; }
.search-drop-footer {
  padding: .6rem 1rem; background: var(--bg2);
  font-size: .75rem; font-weight: 600; color: var(--ac);
  text-align: center; cursor: pointer;
}
.search-drop-footer:hover { color: var(--am); }
.search-drop-loading { padding: 1rem; text-align: center; font-size: .78rem; color: var(--tx3); }

@media (max-width: 768px) {
  .search-grid { grid-template-columns: 1fr 1fr; }
  .search-results-wrap { padding: 1.25rem 1rem 2rem; }
  .search-hero { padding: 1.5rem 1rem 1.25rem; }
  .search-dropdown { width: 320px; right: -1rem; }
}
@media (max-width: 500px) {
  .search-grid { grid-template-columns: 1fr; }
  .site-search-input { width: 140px; }
  .site-search-input:focus { width: 180px; }
}