/*
 * main.css — Project-wide styles for tertulia.
 *
 * This file defines CSS custom properties (design tokens) and global
 * utilities. It is loaded by templates/base.html before any app-specific CSS.
 *
 * The primary colour can be overridden at runtime via the SystemSetting
 * `appearance.primary_color`. The base.html template injects an inline
 * <style> block when that setting is set.
 */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */

:root {
    --color-primary:    #0d6efd;
    --color-secondary:  #6c757d;
    --color-success:    #198754;
    --color-danger:     #dc3545;
    --color-warning:    #ffc107;
    --color-info:       #0dcaf0;
    --color-background: #ffffff;
    --color-surface:    #f8f9fa;
    --color-text:       #212529;
    --color-muted:      #6c757d;
    --color-border:     #dee2e6;

    --font-family-base: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base:   1rem;
    --line-height-base: 1.5;

    --border-radius:    0.375rem;
    --border-radius-lg: 0.5rem;
    --transition-speed: 0.15s;
    --shadow-sm:        0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow:           0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Dark theme tokens — applied when <html data-theme="dark"> */
[data-theme="dark"] {
    --color-background: #1a1a2e;
    --color-surface:    #16213e;
    --color-text:       #e0e0e0;
    --color-muted:      #a0a0b0;
    --color-border:     #2d2d4e;
}

/* --------------------------------------------------------------------------
   Global resets / base
   -------------------------------------------------------------------------- */

body {
    font-family: var(--font-family-base);
    font-size:   var(--font-size-base);
    line-height: var(--line-height-base);
    color:       var(--color-text);
    background:  var(--color-background);
}

/* --------------------------------------------------------------------------
   Accessibility: skip-to-content link
   -------------------------------------------------------------------------- */

.skip-link {
    position:   absolute;
    top:        -100%;
    left:       0;
    z-index:    9999;
    padding:    0.5rem 1rem;
    background: var(--color-primary);
    color:      #fff;
    font-weight: bold;
    text-decoration: none;
    border-radius: 0 0 var(--border-radius) 0;
    transition: top var(--transition-speed);
}

.skip-link:focus {
    top: 0;
}

/* --------------------------------------------------------------------------
   Flash messages
   -------------------------------------------------------------------------- */

.messages-container {
    position: fixed;
    top:      1rem;
    right:    1rem;
    z-index:  1050;
    min-width: 300px;
    max-width: 500px;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */

.empty-state {
    text-align: center;
    padding:    3rem 1rem;
    color:      var(--color-muted);
}

.empty-state .empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* --------------------------------------------------------------------------
   Utility classes
   -------------------------------------------------------------------------- */

.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display:            -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow:           hidden;
}
