.site-search-toggle {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(216, 180, 74, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text, #f5f5f2);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--ease, 180ms ease), border-color var(--ease, 180ms ease), background var(--ease, 180ms ease), color var(--ease, 180ms ease);
  flex: 0 0 auto;
}

.site-search-toggle:hover,
.site-search-toggle:focus-visible {
  transform: translateY(-1px);
  color: var(--gold-2, #f1d777);
  border-color: rgba(241, 215, 122, 0.62);
  background: rgba(216, 180, 74, 0.1);
}

.mobile-search-link {
  min-height: 48px;
  justify-content: flex-start;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.aid-red-text {
  color: #ff6b5c;
}

.aid-search-modal {
  position: fixed;
  inset: 0;
  z-index: 10002; /* above the cookie banner (10001) so results are never covered */
  background: rgba(5, 5, 4, 0.78);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  display: grid;
  align-items: start;
  padding: min(8vh, 72px) 18px 28px;
}

.aid-search-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.aid-search-shell {
  width: min(100%, 940px);
  margin: 0 auto;
  border: 1px solid rgba(216, 180, 74, 0.3);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(216, 180, 74, 0.08), transparent 22%), #10100d;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
  overflow: hidden;
  transform: translateY(14px);
  transition: transform 180ms ease;
}

.aid-search-modal.open .aid-search-shell {
  transform: translateY(0);
}

.aid-search-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.aid-search-input-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(216, 180, 74, 0.32);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  padding: 0 16px;
  min-height: 56px;
}

.aid-search-input-wrap input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text, #f5f5f2);
  font-size: 1rem;
}

.aid-search-input-wrap input::placeholder {
  color: rgba(245, 241, 230, 0.52);
}

.aid-search-close {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(216, 180, 74, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text, #f5f5f2);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.aid-search-body {
  display: grid;
  grid-template-columns: minmax(190px, 0.34fr) 1fr;
  min-height: 480px;
}

.aid-search-suggestions {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.aid-search-suggestions h3,
.aid-search-results h3 {
  color: var(--gold-2, #f1d777);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  margin: 0 0 12px;
}

.aid-suggestion-list {
  display: grid;
  gap: 8px;
}

.aid-suggestion-list button {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #f5f5f2);
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.aid-suggestion-list button:hover {
  border-color: rgba(216, 180, 74, 0.42);
  color: var(--gold-2, #f1d777);
}

.aid-search-results {
  padding: 18px;
  max-height: min(68vh, 620px);
  overflow: auto;
}

.aid-result-count {
  color: var(--muted, #b9b8b1);
  margin: 0 0 14px;
  line-height: 1.5;
}

.aid-result-list {
  display: grid;
  gap: 12px;
}

.aid-result-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.aid-result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(216, 180, 74, 0.36);
  background: rgba(255, 255, 255, 0.06);
}

.aid-result-meta {
  color: var(--gold-2, #f1d777);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 900;
  margin-bottom: 6px;
}

.aid-result-card h4 {
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.aid-result-card p {
  color: var(--muted, #b9b8b1);
  line-height: 1.58;
  margin: 0;
}

.aid-result-card mark {
  color: #0a0906;
  background: var(--gold-2, #f1d777);
  border-radius: 4px;
  padding: 0 3px;
}

.aid-cookie-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 10001;
  display: none;
  justify-content: center;
  pointer-events: none;
}

.aid-cookie-banner.show {
  display: flex;
}

.aid-cookie-card {
  width: min(100%, 940px);
  border: 1px solid rgba(216, 180, 74, 0.26);
  border-radius: 8px;
  background: rgba(12, 12, 10, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  pointer-events: auto;
  backdrop-filter: blur(14px);
}

.aid-cookie-card p {
  color: var(--muted, #b9b8b1);
  line-height: 1.5;
  margin: 0;
  font-size: 0.94rem;
}

.aid-cookie-card strong {
  color: var(--text, #f5f5f2);
}

.aid-cookie-card a {
  color: var(--gold-2, #f1d777);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.aid-cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.aid-cookie-actions .btn {
  min-height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.aid-cookie-actions .btn-secondary {
  border: 1px solid rgba(216, 180, 74, 0.32);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text, #f5f5f2);
}

.aid-cookie-actions .btn-primary {
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--gold-2, #f1d777), var(--gold, #d8b44a));
  color: #17120a;
}

.aid-cookie-prefs {
  grid-column: 1 / -1;
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  color: var(--muted, #b9b8b1);
  line-height: 1.5;
  font-size: 0.9rem;
}

.aid-cookie-card.prefs-open .aid-cookie-prefs {
  display: block;
}

@media (max-width: 980px) {
  .nav-actions .site-search-toggle {
    display: inline-grid;
  }
}

@media (max-width: 760px) {
  .aid-search-body,
  .aid-cookie-card {
    grid-template-columns: 1fr;
  }

  /* keep the search box + close button on one row (don't stack) */
  .aid-search-top {
    grid-template-columns: 1fr auto;
  }

  .aid-search-suggestions {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .aid-suggestion-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .aid-suggestion-list button {
    white-space: nowrap;
  }

  /* Once the visitor types, hide suggestions so results appear right under
     the search box (no scrolling past a full screen of suggestions). */
  .aid-search-modal.has-query .aid-search-suggestions {
    display: none;
  }

  .aid-search-results {
    max-height: 72vh;
  }

  .aid-cookie-actions {
    justify-content: flex-start;
  }
}

/* =========================================================================
   Rounded, dynamic action buttons — sitewide
   Loaded on every page (after each page's inline styles), so these win.
   ========================================================================= */
.btn {
  border-radius: 999px !important;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease !important;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.04); }

/* Primary (gold) action buttons get a soft glow + a gentle attention pulse */
.btn-primary, .btn.primary {
  box-shadow: 0 12px 34px rgba(216, 180, 74, .20);
}
.btn-primary:hover, .btn.primary:hover {
  box-shadow: 0 16px 44px rgba(216, 180, 74, .30);
}
@keyframes aidBtnPulse {
  0%   { box-shadow: 0 12px 34px rgba(216,180,74,.20), 0 0 0 0 rgba(216,180,74,.42); }
  70%  { box-shadow: 0 12px 34px rgba(216,180,74,.20), 0 0 0 13px rgba(216,180,74,0); }
  100% { box-shadow: 0 12px 34px rgba(216,180,74,.20), 0 0 0 0 rgba(216,180,74,0); }
}
.btn-primary, .btn.primary {
  animation: aidBtnPulse 2.8s cubic-bezier(.4, 0, .6, 1) infinite;
}
.btn-primary:hover, .btn.primary:hover { animation-play-state: paused; }
/* Don't pulse the always-visible nav button or the mobile sticky bar (too distracting) */
.nav-actions .btn-primary,
.site-header .btn-primary,
.mobile-sticky-cta { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .btn-primary, .btn.primary { animation: none !important; }
}
