/* =============================================
   GLOBAL SEARCH MODAL — SLOW FIRE
   Cmd+K / Ctrl+K to open
   ============================================= */

/* Trigger button in nav */
.gs-trigger {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: var(--r);
  color: var(--gray-900); cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.gs-trigger:hover { background: var(--gray-100); }
.gs-trigger svg { display: block; }

/* Modal backdrop & layout */
.gs-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 12vh 24px 24px;
  -webkit-font-smoothing: antialiased;
}
.gs-modal.open { display: flex; }
.gs-modal[aria-hidden="false"] { display: flex; }

.gs-backdrop {
  position: absolute; inset: 0;
  background: rgba(17, 17, 17, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: gs-fade 0.18s ease;
}

@keyframes gs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gs-slide-down {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gs-panel {
  position: relative;
  width: 100%; max-width: 720px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 76vh;
  animation: gs-slide-down 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Input */
.gs-input-wrap {
  display: flex; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-200);
  gap: 12px;
}
.gs-input-icon {
  color: var(--gray-400);
  flex-shrink: 0;
}
.gs-input {
  flex: 1;
  font-size: 17px;
  font-family: inherit;
  color: var(--gray-900);
  background: transparent;
  border: none; outline: none;
  padding: 6px 0;
}
.gs-input::placeholder { color: var(--gray-400); }
.gs-close-btn {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.gs-close-btn:hover { background: var(--gray-200); }

/* Tabs */
.gs-tabs {
  display: flex; overflow-x: auto;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--gray-100);
  gap: 4px;
  scrollbar-width: none;
}
.gs-tabs::-webkit-scrollbar { display: none; }
.gs-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.gs-tab:hover { background: var(--gray-50); color: var(--gray-900); }
.gs-tab.active { background: var(--brand-500); color: var(--white); }
.gs-tab-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  background: rgba(255,255,255,0.25);
  border-radius: 100px;
}
.gs-tab.active .gs-tab-count { background: rgba(255,255,255,0.3); }
.gs-tab:not(.active) .gs-tab-count { background: var(--gray-100); }

/* Body */
.gs-body { overflow-y: auto; flex: 1; }
.gs-body::-webkit-scrollbar { width: 8px; }
.gs-body::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 8px; }

/* Hint / suggested */
.gs-section {
  padding: 14px 20px;
}
.gs-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.gs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gs-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.gs-chip:hover {
  background: var(--brand-50);
  border-color: var(--brand-500);
  color: var(--brand-700);
}
.gs-chip-icon { font-size: 10px; color: var(--gray-400); }

/* Results */
.gs-results { padding: 6px 12px 16px; }
.gs-result-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s;
}
.gs-result-item:hover,
.gs-result-item.gs-active {
  background: var(--gray-50);
}
.gs-result-item.gs-active {
  background: var(--brand-50);
}
.gs-result-cat {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brand-700);
  background: var(--brand-50);
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  white-space: nowrap;
  height: fit-content;
  align-self: flex-start;
  margin-top: 2px;
}
.gs-result-cat[data-cat="記事"] { color: var(--brand-700); background: var(--brand-50); }
.gs-result-cat[data-cat="肉×調理法ガイド"] { color: var(--gray-700); background: var(--gray-100); }
.gs-result-cat[data-cat="食材リスト"] { color: var(--success); background: rgba(22,163,74,0.08); }
.gs-result-cat[data-cat="ツール"] { color: var(--info); background: rgba(2,132,199,0.08); }
.gs-result-cat[data-cat="BBQ場"] { color: var(--warning); background: rgba(202,138,4,0.08); }
.gs-result-body { flex: 1; min-width: 0; }
.gs-result-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.4;
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gs-result-desc {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.gs-result-key {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--gray-400);
  font-family: monospace;
}
.gs-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--gray-500);
  font-size: 13px;
}
.gs-empty strong { color: var(--gray-900); display: block; margin-bottom: 4px; font-size: 14px; }

/* Highlight in results */
.gs-hi { background: var(--cream); color: var(--brand-700); padding: 0 2px; border-radius: 3px; font-weight: 600; }

/* Footer hints */
.gs-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--gray-500);
  gap: 12px;
}
.gs-kbd {
  display: inline-flex; align-items: center; gap: 4px;
}
.gs-kbd kbd {
  font-family: inherit;
  font-size: 10px; font-weight: 600;
  padding: 2px 6px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--gray-200);
}

/* Mobile */
@media (max-width: 640px) {
  .gs-modal { padding: 8vh 12px 12px; }
  .gs-panel { max-height: 86vh; border-radius: 12px; }
  .gs-input { font-size: 16px; }
  .gs-footer { display: none; }
}

/* =============================================
   RICH CARD STYLES — Universal upgrades
   ============================================= */

/* Apply rich hover to all card-like elements */
.jr-list-card,
.jr-related-card,
.jr-feat-card,
.bs-card,
.jr-rub-card {
  position: relative;
  isolation: isolate;
}

.jr-list-card .jr-list-img,
.jr-related-card .jr-related-img,
.jr-feat-card .jr-feat-img,
.bs-card .bs-card-img {
  overflow: hidden;
  position: relative;
}
.jr-list-card .jr-list-img img,
.jr-related-card .jr-related-img img,
.jr-feat-card .jr-feat-img img,
.bs-card .bs-card-img img {
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}
.jr-list-card:hover .jr-list-img img,
.jr-related-card:hover .jr-related-img img,
.jr-feat-card:hover .jr-feat-img img,
.bs-card:hover .bs-card-img img {
  transform: scale(1.06);
}

/* Image gradient overlay on hover */
.jr-list-card .jr-list-img::after,
.bs-card .bs-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.35));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.jr-list-card:hover .jr-list-img::after,
.bs-card:hover .bs-card-img::after {
  opacity: 1;
}

/* Card lifting */
.jr-list-card, .bs-card {
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, border-color 0.18s;
}
.jr-list-card:hover, .bs-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
}

/* Category pill badge on list cards (auto-positioning) */
.jr-list-img .jr-list-cat-badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.95);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-700);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 1;
}

/* Reading time overlay (bottom-right of image) */
.jr-list-img .jr-list-readtime-overlay {
  position: absolute;
  bottom: 10px; right: 10px;
  padding: 3px 8px;
  background: rgba(17,17,17,0.75);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.04em;
  z-index: 1;
}
