/*
 * djust-theming demo utilities
 *
 * Replaces Tailwind CDN with a minimal set of layout utilities.
 * All styles are inside @layer base so they never override
 * @layer djust-components or unlayered theme styles.
 */

@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  body { margin: 0; }
  img, svg { display: block; max-width: 100%; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; }
  a { color: inherit; }
}

/* --- Display & Position --- */
.block { display: block; }
.hidden { display: none; }
.flex { display: flex; }
.grid { display: grid; }
.inline-flex { display: inline-flex; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* --- Flex --- */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.shrink-0 { flex-shrink: 0; }

/* --- Grid --- */
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --- Spacing --- */
.mx-auto { margin-left: auto; margin-right: auto; }
.p-2 { padding: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.gap-3 { gap: 0.75rem; }

/* --- Sizing --- */
.w-full { width: 100%; }
.w-3 { width: 0.75rem; }
.w-4 { width: 1rem; }
.w-6 { width: 1.5rem; }
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-6 { height: 1.5rem; }
.min-h-screen { min-height: 100vh; }

/* --- Position offsets --- */
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-10 { top: 2.5rem; }
.top-20 { top: 5rem; }
.top-40 { top: 10rem; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.left-1\/2 { left: 50%; }
.left-1\/3 { left: 33.333%; }
.-translate-x-1\/2 { transform: translateX(-50%); }
.-inset-1 { top: -0.25rem; right: -0.25rem; bottom: -0.25rem; left: -0.25rem; }

/* --- Z-index --- */
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.z-\[45\] { z-index: 45; }
.z-\[60\] { z-index: 60; }
.z-\[100\] { z-index: 100; }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }

/* --- Text --- */
.text-center { text-center: center; text-align: center; }
.text-current { color: currentColor; }
.no-underline { text-decoration: none; }

/* --- Border --- */
.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-r { border-right-width: 1px; border-right-style: solid; }
.rounded-full { border-radius: 9999px; }

/* --- Theme-aware color utilities --- */
.bg-background { background-color: hsl(var(--background)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-card\/50 { background-color: hsl(var(--card) / 0.5); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-primary\/10 { background-color: hsl(var(--primary) / 0.1); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-accent { background-color: hsl(var(--accent)); }
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.text-accent-foreground { color: hsl(var(--accent-foreground)); }
.border-border { border-color: hsl(var(--border)); }
.border-input { border-color: hsl(var(--input)); }

/* --- Hover --- */
.hover\:text-foreground:hover { color: hsl(var(--foreground)); }
.hover\:text-primary:hover { color: hsl(var(--primary)); }
.hover\:bg-accent:hover { background-color: hsl(var(--accent)); }
.hover\:underline:hover { text-decoration: underline; }

/* --- Focus --- */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px hsl(var(--ring) / 0.4); }
.focus\:ring-inset:focus { box-shadow: inset 0 0 0 2px hsl(var(--ring) / 0.4); }
.focus\:ring-primary:focus { --tw-ring-color: hsl(var(--primary)); }

/* --- SR only --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.focus\:not-sr-only:focus { position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal; }
.focus\:absolute:focus { position: absolute; }
.focus\:top-4:focus { top: 1rem; }
.focus\:left-4:focus { left: 1rem; }

/* --- Misc --- */
.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* --- Blur (for hero glows) --- */
.blur-\[120px\] { filter: blur(120px); }
.blur-\[100px\] { filter: blur(100px); }
.blur-lg { filter: blur(16px); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }

/* --- Arbitrary widths/heights (hero glows) --- */
.w-\[500px\] { width: 500px; }
.w-\[600px\] { width: 600px; }
.w-\[700px\] { width: 700px; }
.w-\[800px\] { width: 800px; }
.h-\[300px\] { height: 300px; }
.h-\[400px\] { height: 400px; }
.h-\[500px\] { height: 500px; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333%; }
.h-full { height: 100%; }

/* --- Responsive --- */
@media (min-width: 640px) {
  .sm\:block { display: block; }
  .sm\:hidden { display: none; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:w-auto { width: auto; }
}
@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:flex-row { flex-direction: row; }
  .md\:hidden { display: none; }
  .md\:inline-flex { display: inline-flex; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:flex { display: flex; }
  .lg\:hidden { display: none; }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
