/* Prevent layout shift when scrollbar appears/disappears */
html {
  scrollbar-gutter: stable;
}

/* Alpine.js - Hide elements until Alpine initializes */
[x-cloak] {
  display: none !important;
}

.catalog-search-shell {
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.catalog-search-shell:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px #eff6ff;
}

.catalog-search-shell #main_query {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  padding-left: 46px !important;
}

.catalog-search-shell #main_query_button {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
}

.catalog-search-input-wrap {
  position: relative;
}

.catalog-search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 18px;
  height: 18px;
  margin-left: 0 !important;
  transform: translateY(-50%);
  color: #94a3b8;
}

.catalog-autocomplete-wrap {
  position: relative;
}

.catalog-suggest {
  position: absolute;
  z-index: 10000;
  display: block;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16), 0 8px 20px rgba(15, 23, 42, 0.08);
}

.catalog-suggest.hidden {
  display: none;
}

.catalog-main-suggest {
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-height: min(440px, calc(100vh - 280px));
}

.catalog-facet-suggest {
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 280px;
  padding: 6px;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.catalog-suggest-section {
  margin-top: 7px;
  padding: 8px 10px 5px;
  border-top: 1px solid #eef2f7;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.catalog-suggest-section-first {
  margin-top: 0;
  border-top: 0;
}

.catalog-suggest-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  min-height: 46px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
}

.catalog-suggest-item:hover,
.catalog-suggest-item.is-active {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.catalog-suggest-item.is-locked {
  background: #fffbeb;
  color: #78350f;
}

.catalog-suggest-item.is-locked:hover,
.catalog-suggest-item.is-locked.is-active {
  background: #fef3c7;
  box-shadow: inset 3px 0 0 #f59e0b;
}

.catalog-suggest-icon {
  display: inline-flex;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
}

.catalog-suggest-item.is-locked .catalog-suggest-icon {
  background: #fef3c7;
  color: #b45309;
}

.catalog-suggest-item.is-locked .catalog-suggest-label {
  color: #78350f;
}

.catalog-suggest-item.is-locked .catalog-suggest-action {
  color: #b45309;
}

.catalog-suggest-main {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.catalog-suggest-label {
  overflow: hidden;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-suggest-meta {
  margin-top: 3px;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-suggest-action {
  flex: 0 0 auto;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.catalog-suggest-footer {
  margin: 6px 4px 0;
  padding: 9px 6px 2px;
  border-top: 1px solid #e5e7eb;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1;
  text-align: right;
}

@media (max-width: 640px) {
  .catalog-main-suggest {
    width: 100%;
    max-height: 360px;
  }

  .catalog-suggest-action {
    display: none;
  }
}


/* ============================================
   Blog Article Styles (prose)
   Aligned with system styles (text-sm/text-base, leading-relaxed)
   ============================================ */

.prose {
  max-width: 65ch;
  color: #374151;
  line-height: 1.625; /* leading-relaxed */
}

.prose h1 {
  font-size: 1.5rem; /* text-2xl - matches system page headers */
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: #111827;
}

.prose h2 {
  font-size: 1.25rem; /* text-xl */
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: #111827;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid #e5e7eb;
}

.prose h3 {
  font-size: 1.125rem; /* text-lg - matches system section headers */
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #111827;
}

.prose h4 {
  font-size: 1rem; /* text-base */
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.375rem;
  color: #111827;
}

.prose p {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.prose a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover {
  color: #1d4ed8;
}

.prose strong {
  font-weight: 600;
  color: #111827;
}

.prose ul, .prose ol {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-left: 1.25rem;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.prose li::marker {
  color: #6b7280;
}

.prose blockquote {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-left: 0.875rem;
  border-left: 3px solid #2563eb;
  font-style: italic;
  color: #4b5563;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  background-color: #f3f4f6;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  color: #111827;
}

.prose pre {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0.875rem;
  background-color: #1f2937;
  border-radius: 0.375rem;
  overflow-x: auto;
}

.prose pre code {
  background-color: transparent;
  padding: 0;
  color: #e5e7eb;
  font-size: 0.8125rem; /* text-sm minus a bit */
}

.prose hr {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border: 0;
  border-top: 1px solid #e5e7eb;
}

.prose img {
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.375rem;
  max-width: 100%;
}

/* Tables - matches system table styling */
.prose table {
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-collapse: collapse;
  font-size: 0.875rem; /* text-sm */
}

.prose thead {
  background-color: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.prose th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #111827;
}

.prose td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.prose tbody tr:hover {
  background-color: #f9fafb;
}

.prose tbody tr:last-child td {
  border-bottom: none;
}

/* Slightly larger prose variant */
.prose-lg {
  font-size: 1rem; /* text-base */
  line-height: 1.625; /* leading-relaxed */
}

/* Key Finding / Callout boxes */
.prose blockquote:has(strong:first-child) {
  background-color: #eff6ff;
  border-left-color: #2563eb;
  padding: 0.75rem 1rem;
  border-radius: 0 0.375rem 0.375rem 0;
  font-style: normal;
}

/* Remove max-width constraint when needed */
.prose.max-w-none {
  max-width: none;
}
