/**
 * Luma Aligner Dental Lab — Design Polish
 * Additive refinements on top of design-system.css (light #E0F0F0 theme).
 * Typography, focus, interaction feedback, motion and safety nets.
 */

/* === Typography hierarchy === */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { letter-spacing: -0.015em; line-height: 1.25; }
h1 { font-weight: 700; }
h2, h3 { font-weight: 650; }

.page-title { letter-spacing: -0.022em; color: #000; }
.page-subtitle, .text-muted { color: var(--color-gray-400); }

/* Numbers line up in tables, stats and money columns */
.table td, .stat-value { font-variant-numeric: tabular-nums; }

/* === Page header separation === */
.page-header {
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-line);
}

/* === Cards: interactive ones (links) get a quiet hover, gated to real pointers === */
@media (hover: hover) and (pointer: fine) {
    a.glass-card:hover,
    .glass-card.clickable:hover {
        border-color: rgba(50, 76, 151, 0.28);
        box-shadow: var(--shadow-lg);
    }
}
.glass-card h1, .glass-card h2, .glass-card h3,
.glass-card h4, .glass-card h5, .glass-card h6 { color: #000; }

/* === Focus: visible ring for keyboard users only === */
:focus-visible {
    outline: 2px solid rgba(50, 76, 151, 0.7);
    outline-offset: 2px;
}
.btn:focus-visible { outline-offset: 3px; }
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible { outline: none; }

/* === Pressable feedback — anything that acts like a button === */
.sidebar-nav-link,
.mobile-menu-toggle,
.tab-btn,
.filter-btn,
[role="button"] {
    transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.sidebar-nav-link:active,
.mobile-menu-toggle:active,
.tab-btn:active,
.filter-btn:active,
[role="button"]:active { transform: scale(0.98); }

/* === Form inputs: hover hint, keep base size === */
@media (hover: hover) and (pointer: fine) {
    .form-input:hover:not(:focus):not(:disabled),
    .form-select:hover:not(:focus):not(:disabled),
    .form-textarea:hover:not(:focus):not(:disabled) {
        border-color: rgba(10, 40, 40, 0.3);
    }
}

/* Native controls follow the light scheme (date pickers, file inputs, etc.) */
input, select, textarea, button { color-scheme: light; }
input[type="file"] { color: var(--color-text); }

/* === Safety net: plain controls without classes still read black on white === */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]),
select,
textarea {
    color: #000;
}

/* === Code / pre blocks === */
code, pre, kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #0b1515;
}
:not(pre) > code {
    background: rgba(10, 40, 40, 0.06);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.88em;
}

/* === Horizontal rules === */
hr { border: none; border-top: 1px solid var(--color-line); }

/* === Blog editor: extra breathing room for content blocks === */
.content-block {
    padding: var(--space-5) !important;
}
.add-block-buttons {
    padding: var(--space-5) !important;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.blog-editor-layout {
    gap: var(--space-8) !important;
}

/* === Mobile menu toggle sits on the light canvas === */
.mobile-menu-toggle {
    box-shadow: var(--shadow-md);
}

/* === Scrollbars (Firefox) === */
* { scrollbar-width: thin; scrollbar-color: rgba(10, 40, 40, 0.2) transparent; }

/* === Reduced motion: keep gentle fades, drop movement === */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .fade-in, .slide-in { animation: reducedFade 200ms ease both; }
    .btn:active:not(:disabled),
    .sidebar-nav-link:active,
    .form-check-input:active,
    [role="button"]:active { transform: none; }
    .modal, .modal-overlay.active .modal { transform: none; }
    .sidebar { transition-duration: 0.001ms; }
    .badge.pulse { animation: none; }
    *, *::before, *::after { scroll-behavior: auto !important; }
}
@keyframes reducedFade { from { opacity: 0; } to { opacity: 1; } }
