/* Snippets gallery + snippet page - in the language of the Components page (component cards, badges,
   premium shadow, gradient hero). Also loaded by the snippet page (index.php). Colours meet WCAG 2.2 AA. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* cards */
.sg-card { position: relative; transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; }
.sg-card:hover, .sg-card:focus-within { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15); }
.sg-card-link { color: inherit; text-decoration: none; }
.sg-card-link::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: 0.75rem; } /* the whole card is the link */
.sg-card-link:focus-visible { outline: none; }
.sg-card-link:focus-visible::after { outline: 3px solid #4f46e5; outline-offset: 3px; }
.sg-preview { position: relative; height: 200px; overflow: hidden; background: #eef2ff; border-bottom: 1px solid #e5e7eb; }
.sg-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: opacity 0.3s ease; }
.sg-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #4f46e5; }
.sg-card-frame { position: absolute; top: 0; left: 0; width: 200%; height: 200%; border: 0; transform: scale(0.5); transform-origin: 0 0; pointer-events: none; background: #fff; }
.sg-live .sg-thumb { opacity: 0; }
.sg-locked .sg-thumb { filter: blur(6px) saturate(0.6); transform: scale(1.05); }
.sg-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; background: rgba(30, 27, 75, 0.55); color: #fff; font-weight: 600; font-size: 1rem; }
.sg-lock i { font-size: 1.75rem; }
.sg-preview .category-badge { position: absolute; top: 12px; right: 12px; z-index: 1; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; color: #fff; }
.sg-preview .mixed-badge { background: linear-gradient(135deg, #4f46e5, #9333ea); }

.sg-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; line-height: 1.4; }
.sg-badge-free { background: #dcfce7; color: #166534; }
.sg-badge-pro { background: #fef3c7; color: #78350f; }
.sg-badge-verified { background: #e0e7ff; color: #3730a3; }
.sg-badge-cat { background: #f3f4f6; color: #374151; }

.sg-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.sg-tags li { padding: 2px 10px; border-radius: 9999px; background: #eef2ff; color: #3730a3; font-size: 0.75rem; font-weight: 500; }
.sg-tags a { color: inherit; text-decoration: none; position: relative; z-index: 3; }
.sg-tags a:hover, .sg-tags a:focus-visible { text-decoration: underline; }

/* filters */
.sg-filters select[multiple].sg-native-multi { min-height: 7rem; padding: 0.25rem; }
.sg-tags-field xon-multiselect { display: block; position: relative; }
.xon-multiselect-label { display: block; font-size: 0.875rem; font-weight: 500; color: #374151; margin-bottom: 0.5rem; }
.xon-multiselect-input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 0.5rem; color: #1f2937; background: #fff; }
.xon-multiselect-input:focus { outline: none; box-shadow: 0 0 0 2px #6366f1; }
.xon-multiselect-list { border: 1px solid #d1d5db !important; border-radius: 0.5rem; background: #fff !important; color: #1f2937 !important; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12); margin-top: 4px !important; }
.xon-multiselect-list [role="option"] { padding: 0.4rem 0.75rem; cursor: pointer; }
.xon-multiselect-list [role="option"]:hover, .xon-multiselect-active { background: #eef2ff; outline: none !important; }
.xon-multiselect-list [aria-disabled="true"] { color: #6b7280; }
.xon-multiselect-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; list-style: none; margin: 0 0 0.5rem; padding: 0; }
.xon-multiselect-chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 2px 4px 2px 10px; border-radius: 9999px; background: #e0e7ff; color: #3730a3; font-size: 0.75rem; font-weight: 600; border: 0; }
.xon-multiselect-chip button, button.xon-multiselect-chip { cursor: pointer; }
.xon-multiselect-all, .xon-multiselect-none { margin-top: 0.5rem; font-size: 0.8125rem; color: #4338ca; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; }
.xon-multiselect-all:hover, .xon-multiselect-none:hover { text-decoration: underline; }
.xon-multiselect-count { display: block; font-size: 0.75rem; color: #4b5563; margin-top: 0.25rem; }

/* pager: the look of the Components page's .page-link */
.xon-pagination-list { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.xon-pagination-list a, .xon-pagination-list span { display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 0.75rem; border-radius: 8px; font-weight: 500; color: #4b5563; text-decoration: none; transition: all 0.3s ease; background: #fff; border: 1px solid #e5e7eb; }
.xon-pagination-list a:hover, .xon-pagination-list a[aria-current="page"] { background-color: #4f46e5; border-color: #4f46e5; color: #fff; }
.xon-pagination-list span[aria-disabled="true"] { color: #9ca3af; background: #f9fafb; }
.xon-pagination-list li[aria-hidden="true"] { color: #6b7280; padding: 0 0.25rem; }

/* snippet page */
.sg-crumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.sg-crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: #9ca3af; }
.sg-crumbs a { color: #4338ca; }
.action-btn { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 6px; font-weight: 500; cursor: pointer; transition: all 0.3s ease; border: 1px solid transparent; text-decoration: none; }
.action-btn.primary { background: #4f46e5; color: #fff; }
.action-btn.secondary { background: #f1f5f9; color: #374151; border-color: #e2e8f0; }
.action-btn:hover { opacity: 0.9; }
.sg-stage { overflow: hidden; }
.sg-stage-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid #e5e7eb; background: #f8fafc; }
.sg-viewports { display: inline-flex; background: #e5e7eb; border-radius: 0.5rem; padding: 3px; gap: 2px; }
.sg-viewports button { padding: 0.375rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem; font-weight: 500; color: #374151; background: transparent; border: 0; cursor: pointer; }
.sg-viewports button[aria-pressed="true"] { background: #4f46e5; color: #fff; }
.sg-open-frame { font-size: 0.875rem; color: #4338ca; font-weight: 500; }
.sg-open-frame:hover { text-decoration: underline; }
.sg-stage-body { background: repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 50% / 20px 20px; padding: 1rem; }
.sg-device { margin: 0 auto; max-width: none; transition: max-width 0.3s ease; background: #fff; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12); border-radius: 0.5rem; overflow: hidden; }
.sg-frame { display: block; width: 100%; height: 520px; border: 0; background: #fff; }
.sg-code-bar { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem; background: #0f172a; color: #e2e8f0; border-radius: 0.5rem 0.5rem 0 0; }
.sg-code-name { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; }
.sg-copy { font-size: 0.8125rem; color: #e2e8f0; background: #1e293b; border: 1px solid #334155; border-radius: 0.375rem; padding: 0.25rem 0.625rem; cursor: pointer; }
.sg-copy:hover, .sg-copy.sg-copied { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.sg-pre { margin: 0; max-height: 480px; overflow: auto; background: #1e293b; color: #e2e8f0; padding: 1rem; border-radius: 0 0 0.5rem 0.5rem; font-size: 0.8125rem; line-height: 1.6; tab-size: 4; }
.sg-pre code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.sg-code-panel + .sg-code-panel { margin-top: 1rem; } /* without JavaScript the three panels stand one under the other */
xon-tabs .xon-tabs-list { display: flex; gap: 0.25rem; border-bottom: 1px solid #e5e7eb; margin-bottom: 1rem; }
xon-tabs [role="tab"] { padding: 0.5rem 1rem; font-weight: 500; color: #4b5563; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
xon-tabs [role="tab"][aria-selected="true"] { color: #4338ca; border-bottom-color: #4f46e5; }
xon-tabs [role="tabpanel"] + [role="tabpanel"] { margin-top: 0; }
.sg-pro-cta { margin-bottom: 2rem; }
.sg-pro-dialog .xon-dialog-open { background: #fff; color: #4338ca; padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-weight: 600; border: 0; cursor: pointer; }
.sg-pro-dialog dialog { max-width: 32rem; border: 0; border-radius: 1rem; padding: 1.5rem; color: #1f2937; text-align: left; box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25); }
.sg-pro-dialog dialog::backdrop { background: rgba(15, 23, 42, 0.55); }
.sg-pro-dialog dialog h2, .sg-pro-dialog .xon-dialog-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
.sg-pro-dialog .xon-dialog-close { margin-top: 1rem; background: #4f46e5; color: #fff; padding: 0.5rem 1rem; border-radius: 0.5rem; border: 0; cursor: pointer; }

/* toast */
xon-toast { position: fixed; bottom: 1rem; right: 1rem; z-index: 60; display: flex; flex-direction: column; gap: 0.5rem; }
.xon-toast-item { display: flex; align-items: center; gap: 0.75rem; background: #1f2937; color: #fff; padding: 0.75rem 1rem; border-radius: 0.5rem; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); }
.xon-toast-item p { margin: 0; }
.xon-toast-dismiss { color: #fff; background: transparent; border: 0; cursor: pointer; }

:focus-visible { outline: 3px solid #4f46e5; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sg-card, .sg-thumb, .sg-device { transition: none; } .sg-card:hover { transform: none; } }
