/* Hudson Street Library Design System - Production CSS */

/* ============================================
   CSS Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    line-height: 1.5;
}

body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    color: #171717;
    background-color: #fafafa;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Design Tokens
   ============================================ */
:root {
    /* Colors */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;

    --primary-400: #2dd4bf;
    --primary-500: #14b8a6;
    --primary-600: #0d9488;
    --primary-700: #0f766e;

    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);

    /* Borders */
    --border: 1px solid rgba(0,0,0,0.08);
    --border-dark: 1px solid rgba(0,0,0,0.12);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 80ms;
    --duration-base: 120ms;
    --duration-slow: 200ms;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: Georgia, Cambria, 'Times New Roman', serif;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 40px; }
h2 { font-size: 32px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
h5 { font-size: 18px; }
h6 { font-size: 16px; }

p {
    line-height: 1.6;
    max-width: 65ch;
}

.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 32px; }
.text-4xl { font-size: 40px; }
.text-5xl { font-size: 48px; }
.text-7xl { font-size: 72px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-display { font-family: Georgia, Cambria, serif; }

.tracking-tight { letter-spacing: -0.02em; }

/* Text Colors */
.text-neutral-50 { color: var(--neutral-50); }
.text-neutral-200 { color: var(--neutral-200); }
.text-neutral-400 { color: var(--neutral-400); }
.text-neutral-500 { color: var(--neutral-500); }
.text-neutral-600 { color: var(--neutral-600); }
.text-neutral-700 { color: var(--neutral-700); }
.text-neutral-800 { color: var(--neutral-800); }
.text-neutral-900 { color: var(--neutral-900); }
.text-primary-600 { color: var(--primary-600); }
.text-primary-700 { color: var(--primary-700); }
.text-teal-700 { color: var(--primary-700); }
.text-teal-800 { color: var(--primary-600); }
.text-teal-900 { color: var(--primary-700); }
.text-white { color: white; }
.text-black { color: black; }

/* ============================================
   Layout
   ============================================ */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-6);
    max-width: 1200px;
}

.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-6xl { max-width: 1152px; }
.max-w-3xl { max-width: 768px; }
.max-w-md { max-width: 448px; }
.max-w-sm { max-width: 384px; }
.max-w-prose { max-width: 65ch; }

.min-h-screen { min-height: 100vh; }
.h-full { height: 100%; }
.w-full { width: 100%; }
.h-screen { height: 100vh; }

.leading-relaxed { line-height: 1.625; }

/* Flexbox */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

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

/* Spacing */
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.p-12 { padding: var(--space-12); }

.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.px-8 { padding-left: var(--space-8); padding-right: var(--space-8); }

.py-1 { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-10 { padding-top: 40px; padding-bottom: 40px; }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.py-24 { padding-top: 96px; padding-bottom: 96px; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }
.-mb-px { margin-bottom: -1px; }

.space-y-2 > * + * { margin-top: var(--space-2); }
.space-y-3 > * + * { margin-top: var(--space-3); }
.space-y-4 > * + * { margin-top: var(--space-4); }
.space-y-6 > * + * { margin-top: var(--space-6); }
.space-x-4 > * + * { margin-left: var(--space-4); }

/* ============================================
   Components
   ============================================ */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-weight: 500;
    font-size: 16px;
    line-height: 1;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease);
    min-height: 44px;
    text-decoration: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Variants */
.btn-primary {
    background-color: var(--neutral-900);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background-color: var(--neutral-800);
}

.btn-secondary {
    background-color: transparent;
    color: var(--neutral-900);
    border: var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background-color: var(--neutral-50);
}

.btn-ghost {
    background-color: transparent;
    color: var(--neutral-700);
}
.btn-ghost:hover:not(:disabled) {
    background-color: var(--neutral-100);
}

.btn-accent {
    background-color: var(--primary-600);
    color: white;
}
.btn-accent:hover:not(:disabled) {
    background-color: var(--primary-700);
}

.btn-destructive {
    background-color: var(--error);
    color: white;
}
.btn-destructive:hover:not(:disabled) {
    background-color: #dc2626;
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
    min-height: 36px;
}
.btn-lg {
    padding: 12px 24px;
    font-size: 18px;
    min-height: 52px;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: 16px;
    border: var(--border);
    border-radius: var(--radius-sm);
    background-color: white;
    transition: all var(--duration-base) var(--ease);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.1);
}

.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.1);
    border-color: var(--primary-500);
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-2);
}

/* Cards */
.card {
    background-color: white;
    border: var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-sm); }
.rounded-xl { border-radius: var(--radius-md); }
.rounded-2xl { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: var(--neutral-50);
    border-bottom: var(--border);
}

th {
    padding: var(--space-3) var(--space-6);
    text-align: left;
    font-size: 14px;
    font-weight: 500;
}

td {
    padding: var(--space-4) var(--space-6);
}

tbody tr {
    border-bottom: var(--border);
}

tbody tr:hover {
    background-color: var(--neutral-50);
}

.divide-y > * + * {
    border-top: var(--border);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-default {
    background-color: var(--neutral-100);
    color: var(--neutral-700);
}

.badge-success {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Alerts */
.alert {
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    border-width: 1px;
    border-style: solid;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Navigation */
.nav-link {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    transition: all var(--duration-base) var(--ease);
    text-decoration: none;
    color: inherit;
}

.nav-link:hover {
    background-color: var(--neutral-100);
}

.nav-link[aria-current="page"] {
    background-color: var(--neutral-100);
    font-weight: 500;
}

/* ============================================
   Utilities
   ============================================ */

/* Backgrounds */
.bg-white { background-color: white; }
.bg-neutral-50 { background-color: var(--neutral-50); }
.bg-neutral-100 { background-color: var(--neutral-100); }
.bg-neutral-200 { background-color: var(--neutral-200); }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-neutral-900 { background-color: var(--neutral-900); }
.bg-primary-600 { background-color: var(--primary-600); }
.bg-red-600 { background-color: var(--error); }

/* Borders */
.border { border: var(--border); }
.border-b { border-bottom: var(--border); }
.border-t { border-top: var(--border); }
.border-black\/8 { border-color: rgba(0,0,0,0.08); }
.border-black\/12 { border-color: rgba(0,0,0,0.12); }
.border-2 { border-width: 2px; }
.border-b-2 { border-bottom-width: 2px; }
.border-neutral-900 { border-color: var(--neutral-900); }
.border-neutral-200 { border-color: var(--neutral-200); }
.border-t-primary-600 { border-top-color: var(--primary-600); }

/* Effects */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.opacity-50 { opacity: 0.5; }
.opacity-95 { opacity: 0.95; }

/* Backdrop */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.absolute { position: absolute; }
.relative { position: relative; }
.z-10 { z-index: 10; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

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

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

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: var(--ease);
    transition-duration: var(--duration-base);
}

.transition-colors {
    transition-property: background-color, border-color, color;
    transition-timing-function: var(--ease);
    transition-duration: var(--duration-base);
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: var(--ease);
    transition-duration: var(--duration-base);
}

.duration-120 { transition-duration: var(--duration-base); }
.duration-200 { transition-duration: var(--duration-slow); }

/* Hover */
.hover\:bg-neutral-50:hover { background-color: var(--neutral-50); }
.hover\:bg-neutral-100:hover { background-color: var(--neutral-100); }
.hover\:bg-neutral-800:hover { background-color: var(--neutral-800); }
.hover\:text-neutral-900:hover { color: var(--neutral-900); }
.hover\:text-primary-700:hover { color: var(--primary-700); }
.hover\:border-black\/12:hover { border-color: rgba(0,0,0,0.12); }
.hover\:translate-x-1:hover { transform: translateX(4px); }

.group:hover .group-hover\:translate-x-1 { transform: translateX(4px); }

/* Object Fit */
.object-cover { object-fit: cover; }

/* Gradients */
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.from-black\/70 { --tw-gradient-from: rgba(0,0,0,0.7); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-black\/50 { --tw-gradient-to: rgba(0,0,0,0.5); }
.from-teal-700 { --tw-gradient-from: var(--primary-700); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-teal-900 { --tw-gradient-to: var(--primary-700); }

/* Shadows */
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }

/* Max Width */
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }

/* Space Between */
.space-x-4 > * + * { margin-left: var(--space-4); }
.space-x-8 > * + * { margin-left: var(--space-8); }
.space-y-4 > * + * { margin-top: var(--space-4); }
.space-y-0 > * + * { margin-top: 0; }

/* Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes skeleton {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

.skeleton {
    background: linear-gradient(90deg, #f5f5f5 0%, #e5e5e5 50%, #f5f5f5 100%);
    background-size: 200px 100%;
    animation: skeleton 1.2s ease-in-out infinite;
}

/* Responsive */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm\:flex-row { flex-direction: row; }
    .sm\:space-y-0 > * + * { margin-top: 0; }
    .sm\:space-x-4 > * + * { margin-left: var(--space-4); }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .md\:col-span-2 { grid-column: span 2; }
    .md\:text-left { text-align: left; }
    .md\:text-2xl { font-size: 24px; }
    .md\:text-7xl { font-size: 72px; }
    .md\:mx-0 { margin-left: 0; margin-right: 0; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:flex-row { flex-direction: row; }
    .lg\:w-1\/2 { width: 50%; }
    .lg\:mx-0 { margin-left: 0; margin-right: 0; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Screen reader 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;
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .no-print {
        display: none;
    }
}