
/* PocketZi Theme — Safe CSS (colors only, no layout overrides)
   This file defines CSS variables for colors and light/dark themes.
   It intentionally avoids changing layout, spacing, or typography utilities
   so it plays nicely with Tailwind classes used in your HTML. */

:root {
  /* Base palette (light mode) */
  --bg: #ffffff;
  --bg-secondary: #f8fafc; /* slate-50-ish */
  --text: #0f172a;         /* slate-900 */
  --accent: #756079;       /* emerald-500 */
  --link: #756079;         /* sky-500 */
  color-scheme: light;
}

/* Dark theme (toggled by app.js via [data-theme="dark"]) */
[data-theme="dark"] {
  --bg: #161318;           /* deep blue/gray */
  --bg-secondary: #201D21; /* gray-900 */
  --text: #e5e7eb;         /* gray-200 */
  --accent: #756079;       /* keep brand accent consistent */
  --link: #C3B89E;         /* emerald-400 for links in dark */
  color-scheme: dark;
}

.theme-light,
.theme-dark {
  display: none !important; /* Hide by default, force override Tailwind display */
}

[data-theme="light"] .theme-light {
  display: block !important;
}
[data-theme="dark"] .theme-dark {
  display: block !important;
}
/* When dark mode is active */
[data-theme="dark"] .theme-light {
  display: none;
}
[data-theme="dark"] .theme-dark {
  display: block;
}

/* Minimal, safe element-level theming */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0; /* Tailwind assumes margin reset */
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Text selection matches accent */
::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Links default to link color, with subtle hover */
/* (Tailwind utilities on specific elements will still take precedence) */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--text); }

/* Borders and focus rings that use your tokens */
:where(button, [role="button"], input, select, textarea) {
  accent-color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Utility helpers (optional) — used by app.js template */
.token-bg-secondary { background: var(--bg-secondary); }
.token-text        { color: var(--text); }
.token-link        { color: var(--link); }
.token-accent      { color: var(--accent); }
.token-border      { border-color: color-mix(in srgb, var(--accent) 20%, transparent); }

/* Header/footer from app.js already rely on inline styles with variables
   so we keep this file minimal and non-invasive. */
