/**
 * Header + search page styles
 */

/* ── Header search toggle ───────────────────────────── */
.hg-header-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.hg-header-search__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  min-height: 34px;
  border: none;
  border-radius: 999px;
  background: #efefef;
  color: #111;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  font-family: var(--hg-font-sans, sans-serif);
}

.hg-header-search__toggle:hover,
.hg-header-search__toggle[aria-expanded="true"] {
  background: #e6e6e6;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.hg-header-search__toggle-label {
  display: none;
}

.hg-header-search__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  padding: 14px;
  z-index: 300;
}

.hg-header-search__panel[hidden] {
  display: none !important;
}

.hg-header-search__form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.hg-header-search__input {
  grid-column: 1 / -1;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.hg-header-search__section {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  background: #fafafa;
}

.hg-header-search__submit {
  padding: 8px 16px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.hg-header-search__submit:hover {
  background: #333;
}

.hg-header-search__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.hg-search-chip {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  background: #f0f4f0;
  color: #3d5a3d;
  border-radius: 999px;
  text-decoration: none !important;
  white-space: nowrap;
}

.hg-search-chip:hover {
  background: #678E61;
  color: #fff !important;
}

/* Nav layout: search before auth buttons */
#masthead .main-navigation .main-nav {
  flex-wrap: nowrap;
}

#masthead .main-navigation .main-nav > ul {
  flex: 1 1 auto;
  min-width: 0;
}

/* ── Search results page ────────────────────────────── */
.hg-search-page {
  background: #f7f8f9;
  min-height: 60vh;
}

.hg-search-page__hero {
  background: linear-gradient(135deg, #1a2340 0%, #2d4a3e 100%);
  color: #fff;
  padding: 28px 20px 32px;
}

.hg-search-page__hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

.hg-search-page__hero .hg-breadcrumb a {
  color: rgba(255, 255, 255, 0.85) !important;
}

.hg-search-page__hero .hg-bc-current,
.hg-search-page__hero .hg-bc-sep {
  color: rgba(255, 255, 255, 0.65);
}

.hg-search-page__title {
  font-family: var(--hg-font-serif, Georgia, serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 8px 0 6px;
  color: #fff;
}

.hg-search-page__subtitle {
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 18px;
  font-size: 15px;
}

.hg-search-page-form__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.hg-search-page-form__input {
  padding: 12px 14px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
}

.hg-search-page-form__select {
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
}

.hg-search-page-form__btn {
  padding: 10px 20px;
  background: #678E61;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.hg-search-page__filters {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hg-search-page__filters-label {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin-right: 4px;
}

.hg-search-filter-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  background: #fff;
  color: #444 !important;
  border: 1px solid #ddd;
}

.hg-search-filter-tab.is-active,
.hg-search-filter-tab:hover {
  background: #678E61;
  color: #fff !important;
  border-color: #678E61;
}

.hg-search-page__results {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 32px;
}

.hg-search-page__count {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
}

.hg-search-page__count-sec {
  color: #678E61;
  font-weight: 500;
}

.hg-search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.hg-search-result-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  transition: box-shadow 0.2s;
}

.hg-search-result-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.hg-search-result-card__link {
  display: block;
  text-decoration: none !important;
  color: inherit;
}

.hg-search-result-card__thumb {
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: #eee;
}

.hg-search-result-card__body {
  padding: 14px;
}

.hg-search-result-card__cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #678E61;
  margin-bottom: 6px;
}

.hg-search-result-card__title {
  font-size: 15px;
  font-weight: 600;
  color: #1a2340;
  margin: 0 0 6px;
  line-height: 1.35;
}

.hg-search-result-card__excerpt {
  font-size: 13px;
  color: #666;
  margin: 0 0 8px;
  line-height: 1.45;
}

.hg-search-result-card__date {
  font-size: 12px;
  color: #999;
}

.hg-search-empty {
  background: #fff;
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  color: #666;
}

.hg-search-page__pagination {
  margin-top: 24px;
}

.hg-search-page__pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hg-search-page__pagination .page-numbers {
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-decoration: none !important;
}

.hg-search-page__pagination .current {
  background: #678E61;
  color: #fff !important;
  border-color: #678E61;
}

/* Trending keywords block */
.hg-trending-keywords {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.hg-trending-keywords__title {
  font-size: 1.25rem;
  color: #1a2340;
  margin: 0 0 6px;
}

.hg-trending-keywords__desc {
  font-size: 14px;
  color: #666;
  margin: 0 0 16px;
}

.hg-trending-keywords__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.hg-trending-kw {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  text-decoration: none !important;
  transition: border-color 0.2s;
}

.hg-trending-kw:hover {
  border-color: #678E61;
}

.hg-trending-kw__q {
  font-size: 14px;
  font-weight: 600;
  color: #1a2340;
}

.hg-trending-kw__sec {
  font-size: 11px;
  color: #678E61;
  text-transform: uppercase;
  font-weight: 600;
}

@media (min-width: 1024px) {
  .hg-header-search__toggle-label {
    display: inline;
  }
}

@media (max-width: 1023px) {
  #masthead #site-navigation .hg-header-utility {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  #masthead #site-navigation .hg-header-search__toggle {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }
}

@media (max-width: 768px) {
  .hg-header-search__form {
    grid-template-columns: 1fr;
  }

  .hg-search-page-form__row {
    grid-template-columns: 1fr;
  }

  .hg-header-search__panel {
    right: -60px;
  }
}

@media (max-width: 480px) {
  .hg-header-search__panel {
    position: fixed;
    top: var(--hg-header-height, 56px);
    left: 12px;
    right: 12px;
    width: auto;
  }
}
