/* ==========================================================================
   Directory & Results page polish (Bootstrap 5.3-styled layer)
   --------------------------------------------------------------------------
   Layered over the existing .g-* classes used by category.php / results.php /
   listing.php without any template changes. Uses Bootstrap tokens (shadows,
   focus rings, spacing scale) and Bootstrap Icons for visual hierarchy.
   ========================================================================== */

/* ── Breadcrumbs ──────────────────────────────────────────────────────── */
.g-crumbs {
  margin: 0 0 1.25rem;
  padding: 0.55rem 1rem;
  background: #fff;
  border: 1px solid #e7eaf0;
  border-radius: 0.65rem;
  box-shadow: 0 1px 2px rgba(26, 32, 44, 0.04);
  font-size: 0.82rem;
  line-height: 1.3;
}
.g-crumbs a {
  color: #1a73e8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
.g-crumbs a:hover {
  color: #0b5bca;
  text-decoration: underline;
}
.g-crumbs__sep {
  color: #c4c9d1;
  margin: 0 0.45rem;
  font-weight: 400;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.g-hero-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  font-weight: 600;
  line-height: 1.2;
  color: #20232a;
  letter-spacing: -0.02em;
}
.g-serp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: center;
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eef0f4;
  color: #5f6368;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Live-update pill on category pages */
.g-live-update-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  background: rgba(52, 168, 83, 0.12);
  color: #188038;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.g-live-update-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #34a853;
  animation: g-live-pulse 1.6s ease-in-out infinite;
}
@keyframes g-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.35); }
}

/* ── Results grid layout ──────────────────────────────────────────────── */
.g-serp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 992px) {
  .g-serp-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
  }
}

/* ── Result cards ─────────────────────────────────────────────────────── */
.g-result {
  position: relative;
  margin: 0 0 1rem;
  padding: 1.1rem 1.25rem 1.05rem;
  background: #fff;
  border: 1px solid #e7eaf0;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(26, 32, 44, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.g-result:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(26, 32, 44, 0.08), 0 1px 3px rgba(26, 32, 44, 0.06);
  border-color: #d5dce7;
}

.g-result__url {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #5f6368;
  font-size: 0.8rem;
  line-height: 1.2;
  margin-bottom: 0.45rem;
}
.g-result__url::before {
  content: "\f3dd"; /* bi-globe */
  font-family: bootstrap-icons !important;
  font-size: 0.9rem;
  color: #9aa0a6;
  line-height: 1;
}
.g-result__url-trail { color: #80868b; }

.g-result__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 600;
}
.g-result__title a {
  color: #1a0dab;
  text-decoration: none;
}
.g-result__title a:hover { text-decoration: underline; }

.g-result__desc {
  margin: 0 0 0.7rem;
  color: #4d5156;
  font-size: 0.93rem;
  line-height: 1.55;
}

/* ── Meta chips (Bootstrap badge-pill style with icons) ───────────────── */
.g-result__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
}
.g-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  border: 1px solid transparent;
  background: #f1f3f4;
  color: #3c4043;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.g-meta-chip::before {
  font-family: bootstrap-icons !important;
  font-size: 0.85rem;
  line-height: 1;
}
.g-meta-chip--category {
  background: rgba(26, 115, 232, 0.08);
  color: #1967d2;
  border-color: rgba(26, 115, 232, 0.16);
}
.g-meta-chip--category::before { content: "\f412"; } /* bi-tag */
.g-meta-chip--state {
  background: rgba(234, 67, 53, 0.06);
  color: #b1261b;
  border-color: rgba(234, 67, 53, 0.15);
}
.g-meta-chip--state::before { content: "\f3e7"; } /* bi-geo-alt */
.g-meta-chip--region {
  background: rgba(251, 188, 4, 0.09);
  color: #856404;
  border-color: rgba(251, 188, 4, 0.22);
}
.g-meta-chip--region::before { content: "\f3f6"; } /* bi-map */
.g-meta-chip--locality {
  background: rgba(52, 168, 83, 0.08);
  color: #137333;
  border-color: rgba(52, 168, 83, 0.2);
}
.g-meta-chip--locality::before { content: "\f425"; } /* bi-pin-map */

/* ── Reviews strip ────────────────────────────────────────────────────── */
.g-result__reviews {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
  padding: 0.3rem 0.7rem;
  background: rgba(251, 188, 4, 0.1);
  border: 1px solid rgba(251, 188, 4, 0.28);
  border-radius: 0.4rem;
  font-size: 0.82rem;
  color: #5f4b00;
}
.g-result__reviews strong { color: #20232a; }
.g-review-stars {
  letter-spacing: 0.05em;
  color: #f9ab00;
  font-size: 0.95rem;
  line-height: 1;
}
.g-result__reviews--external {
  background: rgba(95, 99, 104, 0.08);
  border-color: rgba(95, 99, 104, 0.22);
  color: #3c4043;
}

/* ── Tags ─────────────────────────────────────────────────────────────── */
.g-tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.g-tag {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  background: #f8f9fa;
  border: 1px solid #e7eaf0;
  border-radius: 999px;
  font-size: 0.72rem;
  color: #5f6368;
  line-height: 1.45;
}
.g-tag--more {
  background: rgba(26, 115, 232, 0.06);
  color: #1967d2;
  border-color: rgba(26, 115, 232, 0.2);
  font-weight: 600;
}

/* ── Featured badge on result title ───────────────────────────────────── */
.g-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.55rem;
  margin-left: 0.5rem;
  background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.28);
}
.g-badge::before {
  content: "\f586"; /* bi-star-fill */
  font-family: bootstrap-icons !important;
  font-size: 0.75rem;
}

/* ── Empty state (Bootstrap alert-soft feel) ──────────────────────────── */
.g-empty {
  margin: 0 0 1.25rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #fff;
  border: 1px dashed #d5dce7;
  border-radius: 0.75rem;
  color: #5f6368;
}
.g-empty__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #20232a;
}
.g-empty__title::before {
  content: "\f33a"; /* bi-inbox */
  font-family: bootstrap-icons !important;
  font-size: 1.35rem;
  color: #9aa0a6;
}
.g-empty p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ── Pagination (Bootstrap pagination style) ──────────────────────────── */
.g-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
  margin: 1.5rem 0 0.5rem;
  padding: 0;
}
.g-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.3rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid #dadce0;
  border-radius: 0.5rem;
  background: #fff;
  color: #1a73e8;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.g-pagination__link:hover {
  background: rgba(26, 115, 232, 0.08);
  border-color: rgba(26, 115, 232, 0.35);
}
.g-pagination__link:active {
  transform: translateY(1px);
}
.g-pagination__link.is-active {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #fff;
  font-weight: 600;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.24);
}
.g-pagination__link--nav {
  gap: 0.35rem;
  color: #3c4043;
}
.g-pagination__link--nav::before,
.g-pagination__link--nav::after {
  font-family: bootstrap-icons !important;
  font-size: 0.85rem;
  line-height: 1;
}
.g-pagination__link--nav:first-child::before  { content: "\f284"; } /* bi-chevron-left */
.g-pagination__link--nav:last-child::after    { content: "\f285"; } /* bi-chevron-right */

/* ── Aside panels ─────────────────────────────────────────────────────── */
aside .g-panel,
.g-serp-layout aside > .g-panel {
  background: #fff;
  border: 1px solid #e7eaf0;
  border-radius: 0.75rem;
  padding: 1rem 1.15rem;
  margin: 0 0 1rem;
  box-shadow: 0 1px 2px rgba(26, 32, 44, 0.04);
}
.g-panel__title {
  margin: 0 0 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #eef0f4;
  font-size: 0.95rem;
  font-weight: 600;
  color: #20232a;
  letter-spacing: -0.01em;
}
.g-panel__eyebrow {
  margin: 0 0 0.55rem;
  color: #1a73e8;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.g-panel__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.g-panel__list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed #f1f3f5;
  font-size: 0.88rem;
}
.g-panel__list li:last-child { border-bottom: none; }
.g-panel__list a {
  color: #1a73e8;
  text-decoration: none;
  transition: color 0.15s ease;
  flex: 1 1 auto;
  min-width: 0;
}
.g-panel__list a:hover { color: #0b5bca; text-decoration: underline; }

/* Subcategory/state/region count badges */
.g-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.08rem 0.45rem;
  margin-left: 0.5rem;
  background: #f1f3f4;
  color: #5f6368;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.2s ease, color 0.2s ease;
}
.g-panel__list a:hover + .g-count-badge {
  background: rgba(26, 115, 232, 0.14);
  color: #1967d2;
}

/* ── Search pill on /results.php ──────────────────────────────────────── */
.g-search--compact {
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #e7eaf0;
  border-radius: 0.9rem;
  box-shadow: 0 1px 2px rgba(26, 32, 44, 0.04), 0 4px 16px rgba(26, 32, 44, 0.04);
  margin: 0 0 1.25rem;
}
.g-search__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
}
.g-search__field { display: flex; flex-direction: column; }
.g-search__field--wide { grid-column: span 2; }
@media (max-width: 640px) {
  .g-search__field--wide { grid-column: span 1; }
}
.g-search__label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #5f6368;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.g-search__input,
.g-search__select {
  width: 100%;
  padding: 0.5rem 0.7rem;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 0.5rem;
  font-size: 0.92rem;
  color: #20232a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.g-search__input:focus,
.g-search__select:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 0.2rem rgba(26, 115, 232, 0.2);
}
.g-search__select:disabled {
  background: #f8f9fa;
  color: #80868b;
  cursor: not-allowed;
}
.g-search__actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid #eef0f4;
}
.g-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}
.g-btn--primary {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.26);
}
.g-btn--primary::before {
  content: "\f52a"; /* bi-search */
  font-family: bootstrap-icons !important;
}
.g-btn--primary:hover {
  background: #0b5bca;
  border-color: #0b5bca;
  box-shadow: 0 4px 12px rgba(11, 91, 202, 0.35);
}
.g-btn--primary:active { transform: translateY(1px); }
.g-status {
  color: #5f6368;
  font-size: 0.85rem;
}

/* ── Responsive tweaks ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .g-result { padding: 0.95rem 1rem; }
  .g-result__title { font-size: 1.05rem; }
  .g-serp-meta { font-size: 0.85rem; }
  .g-crumbs { padding: 0.5rem 0.75rem; }
  .g-pagination__link { min-width: 2rem; padding: 0.3rem 0.6rem; font-size: 0.85rem; }
}

/* ── New-listing toast: speaker opt-in button ─────────────────────────── */
.g-home-toast__speaker {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid rgba(66, 133, 244, 0.22);
  border-radius: 999px;
  background: #fff;
  color: #5f6368;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.g-home-toast__speaker:hover {
  background: rgba(26, 115, 232, 0.08);
  border-color: rgba(26, 115, 232, 0.45);
  color: #1a73e8;
}
.g-home-toast__speaker:active { transform: scale(0.94); }
.g-home-toast__speaker:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(26, 115, 232, 0.25);
}
.g-home-toast__speaker.is-unlocked {
  background: rgba(52, 168, 83, 0.12);
  border-color: rgba(52, 168, 83, 0.4);
  color: #137333;
}

/* ── Subtle fade-in on card render (staggered via nth-child) ──────────── */
@media (prefers-reduced-motion: no-preference) {
  .g-result {
    animation: g-result-enter 0.45s ease both;
  }
  .g-result:nth-child(1) { animation-delay: 0.00s; }
  .g-result:nth-child(2) { animation-delay: 0.05s; }
  .g-result:nth-child(3) { animation-delay: 0.10s; }
  .g-result:nth-child(4) { animation-delay: 0.15s; }
  .g-result:nth-child(5) { animation-delay: 0.20s; }
  .g-result:nth-child(6) { animation-delay: 0.25s; }
  .g-result:nth-child(n+7) { animation-delay: 0.30s; }

  @keyframes g-result-enter {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
