/**
 * 2LZ Legal Pages - Utility CSS
 * Replaces Tailwind CDN for privacy.html and terms.html
 * v2
 */

/* Layout */
.legal-page { scroll-behavior: smooth; }
.max-w-7xl { max-width: 80rem; margin-left: auto; margin-right: auto; }
.max-w-4xl { max-width: 56rem; }
.max-w-none { max-width: none; }

/* Display */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.hidden { display: none; }

.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-shrink-0 { flex-shrink: 0; }

/* Gap */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

/* Space */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Padding */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pl-4 { padding-left: 1rem; }
.pl-8 { padding-left: 2rem; }
.pt-8 { padding-top: 2rem; }
.pt-32 { padding-top: 8rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-12 { padding-bottom: 3rem; }

/* Margin */
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.ml-4 { margin-left: 1rem; }

/* Sizing */
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-full { width: 100%; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-4xl { font-size: 2.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.uppercase { text-transform: uppercase; }
.underline { text-decoration: underline; }
.leading-relaxed { line-height: 1.625; }
.text-left { text-align: left; }

/* Colors - Text */
.text-gray-900 { color: #0f172a; }
.text-gray-700 { color: #334155; }
.text-gray-600 { color: #475569; }
.text-gray-500 { color: #64748b; }
.text-gray-400 { color: #94a3b8; }
.text-white { color: #fff; }
.text-blue-500 { color: #264a7a; }
.text-blue-600 { color: #193259; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #193259; }
.text-green-500 { color: #22c55e; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-orange-500 { color: #f97316; }
.text-orange-700 { color: #c2410c; }
.text-orange-800 { color: #9a3412; }
.text-amber-700 { color: #b45309; }
.text-amber-800 { color: #92400e; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-red-800 { color: #991b1b; }
.text-purple-600 { color: #9333ea; }
.text-yellow-600 { color: #ca8a04; }
.text-yellow-700 { color: #a16207; }
.text-yellow-800 { color: #854d0e; }

/* Colors - Background */
.bg-white { background-color: #fff; }
.bg-gray-50 { background-color: #f8fafc; }
.bg-gray-900 { background-color: #0f172a; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-500 { background-color: #264a7a; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-amber-50 { background-color: #fffbeb; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-orange-50 { background-color: #fff7ed; }
.bg-orange-500 { background-color: #f97316; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-yellow-50 { background-color: #fefce8; }

/* Borders */
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-l-2 { border-left-width: 2px; border-left-style: solid; }
.border-gray-100 { border-color: #f1f5f9; }
.border-gray-200 { border-color: #e2e8f0; }
.border-gray-800 { border-color: #1e293b; }
.border-transparent { border-color: transparent; }
.border-blue-100 { border-color: #dbeafe; }
.border-blue-200 { border-color: #bfdbfe; }
.border-green-200 { border-color: #bbf7d0; }
.border-amber-200 { border-color: #fde68a; }
.border-orange-100 { border-color: #ffedd5; }
.border-orange-200 { border-color: #fed7aa; }
.border-red-200 { border-color: #fecaca; }
.border-yellow-200 { border-color: #fde68a; }

/* Border Radius */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Shadows */
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.shadow-lg { box-shadow: 0 10px 25px rgba(0,0,0,0.1); }

/* Position */
.sticky { position: sticky; }
.fixed { position: fixed; }
.relative { position: relative; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.top-24 { top: 6rem; }
.top-28 { top: 7rem; }
.z-50 { z-index: 50; }

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

/* Lists */
.list-disc { list-style-type: disc; }
.list-inside { list-style-position: inside; }

/* Dividers */
.divide-y > * + * { border-top: 1px solid; }
.divide-gray-200 > * + * { border-color: #e2e8f0; }

/* Tables */
table { border-collapse: collapse; }

/* Transitions */
.transition-colors { transition: color 0.15s, background-color 0.15s, border-color 0.15s; }
.transition-all { transition: all 0.15s; }

/* Hover states */
.hover\:text-white:hover { color: #fff; }
.hover\:bg-gray-100:hover { background-color: #f1f5f9; }
.hover\:underline:hover { text-decoration: underline; }
.hover\:text-gray-900:hover { color: #0f172a; }
.hover\:shadow-lg:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.1); }

/* Custom color classes with brackets - use data attributes instead */
.legal-brand-bg { background-color: #1e3a5f; }
.legal-brand-text { color: #1e3a5f; }
.legal-brand-bg-light { background-color: rgba(30,58,95,0.05); }
.legal-brand-bg-10 { background-color: rgba(30,58,95,0.1); }
.legal-brand-border { border-color: rgba(30,58,95,0.1); }
.legal-brand-border-20 { border-color: rgba(30,58,95,0.2); }

/* Bracket color utilities via attribute selectors */
[class*="bg-\[#1e3a5f\]\/5"] { background-color: rgba(30,58,95,0.05); }
[class*="bg-\[#1e3a5f\]\/10"] { background-color: rgba(30,58,95,0.1); }
[class*="border-\[#1e3a5f\]\/10"] { border-color: rgba(30,58,95,0.1); }
[class*="border-\[#1e3a5f\]\/20"] { border-color: rgba(30,58,95,0.2); }
[class*="text-\[#1e3a5f\]"] { color: #1e3a5f; }
[class*="bg-\[#1e3a5f\]"] { background-color: #1e3a5f; }
[class*="hover\:bg-\[#2d5a8a\]"]:hover { background-color: #2d5a8a; }
[class*="hover\:text-\[#2d5a8a\]"]:hover { color: #2d5a8a; }
[class*="text-white\/80"] { color: rgba(255,255,255,0.8); }
[class*="bg-white\/10"] { background-color: rgba(255,255,255,0.1); }
[class*="bg-white\/20"] { background-color: rgba(255,255,255,0.2); }
[class*="border-gray-200\/50"] { border-color: rgba(226,232,240,0.5); }

/* Gradient backgrounds */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-from, transparent), var(--tw-to, transparent));
}
[class*="from-slate-50"] { --tw-from: #f8fafc; }
[class*="via-white"] { --tw-via: #fff; }
[class*="to-blue-50"] { --tw-to: #eff6ff; }
[class*="from-\[#1e3a5f\]"] { --tw-from: #1e3a5f; }
[class*="to-\[#2d5a8a\]"] { --tw-to: #2d5a8a; }
[class*="to-\[#264a7a\]"] { --tw-to: #264a7a; }

/* Hero gradient for legal pages */
.bg-gradient-to-br.from-slate-50 {
  background: linear-gradient(to bottom right, #f8fafc, #fff, #eff6ff);
}

/* Glass effect */
.glass {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* TOC */
.toc-link { transition: all 0.2s ease; }
.toc-link:hover { transform: translateX(4px); color: #1e3a5f; border-left-color: #1e3a5f; }
.toc-link.active { color: #1e3a5f; font-weight: 600; border-left-color: #1e3a5f; }

/* Legal content */
.legal-content h2 { scroll-margin-top: 100px; }
.legal-content h3 { scroll-margin-top: 100px; }
.prose { line-height: 1.75; }
.not-prose { line-height: normal; }

/* Print */
@media print {
  .no-print { display: none !important; }
  .legal-content { max-width: 100% !important; }
}

/* Responsive */
@media (min-width: 640px) {
  .sm\:text-5xl { font-size: 3rem; }
  .sm\:block { display: block; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .md\:col-span-2 { grid-column: span 2; }
  .md\:flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
  .lg\:block { display: block; }
  .lg\:grid { display: grid; }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, 1fr); }
  .lg\:col-span-3 { grid-column: span 3; }
  .lg\:col-span-9 { grid-column: span 9; }
  .lg\:gap-12 { gap: 3rem; }
  .lg\:flex { display: flex; }
  .lg\:h-20 { height: 5rem; }
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* ============================================
   DARK MODE — Legal pages
   ============================================ */

[data-theme="dark"] .bg-white {
  background-color: #1e293b;
}

[data-theme="dark"] .bg-gray-50 {
  background-color: #0f172a;
}

[data-theme="dark"] .text-gray-900 {
  color: #f1f5f9;
}

[data-theme="dark"] .text-gray-700 {
  color: #cbd5e1;
}

[data-theme="dark"] .text-gray-600 {
  color: #94a3b8;
}

[data-theme="dark"] .text-gray-500 {
  color: #94a3b8;
}

[data-theme="dark"] .text-gray-400 {
  color: #64748b;
}

[data-theme="dark"] .border-gray-100,
[data-theme="dark"] .border-gray-200 {
  border-color: #334155;
}

[data-theme="dark"] .divide-gray-200 > * + * {
  border-color: #334155;
}

[data-theme="dark"] .shadow-sm {
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

[data-theme="dark"] .shadow-lg {
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

[data-theme="dark"] .glass {
  background: rgba(30, 41, 59, 0.8);
}

[data-theme="dark"] .hover\:bg-gray-100:hover {
  background-color: #334155;
}

[data-theme="dark"] .hover\:text-gray-900:hover {
  color: #f1f5f9;
}

[data-theme="dark"] .toc-link:hover,
[data-theme="dark"] .toc-link.active {
  color: #60a5fa;
  border-left-color: #60a5fa;
}

[data-theme="dark"] .legal-brand-bg {
  background-color: #1e3a5f;
}

[data-theme="dark"] .legal-brand-bg-light {
  background-color: rgba(30, 58, 95, 0.2);
}

[data-theme="dark"] .bg-blue-50 {
  background-color: rgba(30, 58, 95, 0.15);
}

[data-theme="dark"] .bg-green-50 {
  background-color: rgba(22, 163, 74, 0.1);
}

[data-theme="dark"] .bg-amber-50 {
  background-color: rgba(202, 138, 4, 0.1);
}

[data-theme="dark"] .bg-red-50 {
  background-color: rgba(220, 38, 38, 0.1);
}

[data-theme="dark"] .bg-orange-50 {
  background-color: rgba(249, 115, 22, 0.1);
}

[data-theme="dark"] .bg-yellow-50 {
  background-color: rgba(234, 179, 8, 0.1);
}

[data-theme="dark"] .bg-purple-100 {
  background-color: rgba(147, 51, 234, 0.15);
}
