/* ==========================================================================
   Typography System - Wholesum Design System
   Headings, body text, links, shared text components, and utilities.
   Version: 1.0 | Phase 4 of CSS Unification
   ========================================================================== */

/* ===== BASE RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-base);
  background: var(--color-bg-primary);
  color: #111;
  min-height: 100vh;
}

/* ===== HEADING STYLES ===== */
h1, h2, h3, h4, h5, h6 {
  color: #111;
  margin: 0;
  line-height: var(--line-height-tight);
}

h1, .heading-1 {
  font-size: 1.75rem;
  font-weight: var(--font-weight-medium);
  letter-spacing: -0.3px;
}

h2, .heading-2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

h3, .heading-3 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

h4, .heading-4 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

h5, .heading-5 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

h6, .heading-6 {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== PARAGRAPH STYLES ===== */
p {
  margin: 0;
}

p.text-lead {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
}

p.text-muted {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
}

/* ===== LINK STYLES ===== */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
  cursor: pointer;
}

a:hover {
  text-decoration: underline;
}

/* Explicit brand link */
.link, .link-primary {
  color: var(--color-primary);
  text-decoration: none;
}

.link:hover, .link-primary:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* ===== SMALL TEXT ===== */
small, .text-small {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

/* ===== MONO / CODE STYLES ===== */
code, pre {
  font-family: var(--font-family-mono);
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-md);
}

code {
  font-size: var(--font-size-sm);
  padding: 0.125rem 0.375rem;
}

pre {
  padding: var(--spacing-4);
  overflow-x: auto;
  line-height: var(--line-height-normal);
  margin: 0;
}

pre code {
  background: none;
  padding: 0;
}

/* ===== EMPHASIS ===== */
strong {
  font-weight: var(--font-weight-bold);
}

mark, .highlight {
  background-color: var(--color-warning-light);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
}

/* ===== LABELS & BADGES ===== */
.label {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  background-color: var(--color-bg-tertiary);
  color: #111;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.label-primary {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.label-success {
  background-color: var(--color-success);
  color: var(--color-text-inverse);
}

.label-warning {
  background-color: var(--color-warning);
  color: var(--color-text-inverse);
}

.label-error {
  background-color: var(--color-error);
  color: var(--color-text-inverse);
}


/* ==========================================================================
   SHARED COMPONENTS — Extracted from duplicated inline styles
   ========================================================================== */

/* ── Hero title (used in index.html + privacy-terms.html) ── */
.hero {
  text-align: center;
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: var(--font-weight-medium);
  color: #111;
  letter-spacing: -0.3px;
}

/* ── Section label (repeated pattern: .recommended-header span,
     .starred-notes-header span, .recent-inline-header span, etc.) ── */
.section-label {
  font-size: 0.95rem;
  font-weight: var(--font-weight-semibold);
  color: #111;
}

/* ── User bar (duplicated in index.html + notes.html) ── */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.9rem;
  font-weight: var(--font-weight-medium);
  color: #222;
}

/* Footer styles are now in components/wholesum-footer.js */


/* ==========================================================================
   TEXT UTILITY CLASSES
   ========================================================================== */

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

/* Truncation */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.text-line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Transform */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* Tracking (letter-spacing) */
.tracking-tight { letter-spacing: -0.3px; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.5px; }

/* Tabular numbers (for timers, counters) */
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Reduced motion preference */
@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;
  }
}
