# CSS Variants — 3 Versoes para 3 Formatos

> O mesmo conteudo, 3 experiencias visuais diferentes.
> Cada formato tem limitacoes proprias.

---

## VARIANTE 1: css-kindle.css (EPUB / Kindle)

### Regras
- SOMENTE unidades relativas (em, rem, %)
- ZERO flex, grid, shadow, transform, animation
- Background-color + border para destaque
- page-break-before: always para capitulos
- Fontes genericas com fallback serif/sans-serif
- Testavel em Kindle Previewer

### Template Base
```css
/* === KINDLE CSS — Reflowable === */

/* Reset */
body {
  margin: 0;
  padding: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1em;
  line-height: 1.6;
  color: #1a1a1a;
}

/* Headings */
h1 {
  font-size: 1.8em;
  font-weight: bold;
  text-align: center;
  margin-top: 2em;
  margin-bottom: 0.5em;
  page-break-before: always;
}

h2 {
  font-size: 1.4em;
  font-weight: bold;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: VAR_COLOR_PRIMARY;
}

h3 {
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 1.2em;
  margin-bottom: 0.3em;
}

/* Body Text */
p {
  margin: 0.5em 0;
  text-indent: 1.5em;
  text-align: justify;
}

p.no-indent {
  text-indent: 0;
}

/* Chapter Container */
.chapter {
  page-break-before: always;
}

.chapter-number {
  font-size: 0.9em;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: VAR_COLOR_SECONDARY;
  margin-bottom: 0.3em;
}

/* Exercise Box */
.exercise-box {
  border-left: 4px solid VAR_COLOR_ACCENT;
  padding: 1em;
  margin: 1.5em 0;
  background-color: VAR_COLOR_BG_LIGHT;
  page-break-inside: avoid;
}

.exercise-box h3 {
  margin-top: 0;
  color: VAR_COLOR_ACCENT;
}

/* Callout / Destaque */
.callout {
  border: 2px solid VAR_COLOR_PRIMARY;
  border-radius: 0.5em;
  padding: 1em;
  margin: 1.5em 0;
  background-color: VAR_COLOR_BG_HIGHLIGHT;
  page-break-inside: avoid;
}

/* Quote */
blockquote {
  border-left: 3px solid VAR_COLOR_ACCENT;
  padding-left: 1em;
  margin: 1.5em 0;
  font-style: italic;
  color: #555;
}

blockquote cite {
  display: block;
  text-align: right;
  font-style: normal;
  font-size: 0.9em;
  margin-top: 0.5em;
}

/* Lists */
ul, ol {
  margin: 1em 0;
  padding-left: 2em;
}

li {
  margin-bottom: 0.3em;
}

/* Checklist */
.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  padding-left: 1.5em;
  text-indent: -1.5em;
}

.checklist li::before {
  content: "\2610 ";  /* ☐ */
}

/* Separator */
hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2em auto;
  width: 40%;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
}

.img-center {
  text-align: center;
  margin: 1em 0;
}

/* Table */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 0.9em;
}

th, td {
  border: 1px solid #ccc;
  padding: 0.5em;
  text-align: left;
}

th {
  background-color: VAR_COLOR_BG_HIGHLIGHT;
  font-weight: bold;
}

/* Small text */
.small {
  font-size: 0.85em;
  color: #777;
}

/* Strong emphasis */
strong {
  color: VAR_COLOR_PRIMARY;
}

/* Script box */
.script-box {
  border: 1px solid VAR_COLOR_ACCENT;
  padding: 1em;
  margin: 1.5em 0;
  background-color: VAR_COLOR_BG_LIGHT;
  font-style: italic;
  page-break-inside: avoid;
}

/* Template fill-in */
.template-box {
  border: 2px dashed VAR_COLOR_SECONDARY;
  padding: 1em;
  margin: 1.5em 0;
  page-break-inside: avoid;
}

.template-box .blank {
  border-bottom: 1px solid #999;
  display: inline-block;
  min-width: 10em;
}
```

**Notas:** Substituir VAR_COLOR_* pelas cores do Design System (Fase 7).

---

## VARIANTE 2: css-html.css (HTML Standalone / PDF)

### Regras
- CSS completo (sem framework JS)
- Google Fonts via @import
- Print CSS embutido (@media print)
- Largura maxima 680px (editorial)
- Pode usar shadow, gradient, border-radius amplo
- NAO usar flex/grid (manter simples pro print)

### Adicoes sobre o Kindle CSS
```css
/* === HTML PREMIUM — Standalone === */

@import url('https://fonts.googleapis.com/css2?family=VAR_FONT_HEADING:wght@400;700&family=VAR_FONT_BODY:wght@400;400italic;700&display=swap');

body {
  max-width: 680px;
  margin: 0 auto;
  padding: 2em;
  font-family: 'VAR_FONT_BODY', Georgia, serif;
  font-size: 1.1em;
  line-height: 1.8;
  color: #2d2d2d;
  background: VAR_COLOR_BG_PAGE;
}

h1, h2, h3 {
  font-family: 'VAR_FONT_HEADING', Georgia, serif;
}

/* Exercise Box — versao premium */
.exercise-box {
  border-left: 5px solid VAR_COLOR_ACCENT;
  padding: 1.5em 2em;
  margin: 2em 0;
  background-color: VAR_COLOR_BG_LIGHT;
  border-radius: 0 0.75em 0.75em 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Callout premium */
.callout {
  border: 2px solid VAR_COLOR_PRIMARY;
  border-radius: 1em;
  padding: 1.5em 2em;
  margin: 2em 0;
  background: linear-gradient(135deg, VAR_COLOR_BG_HIGHLIGHT, VAR_COLOR_BG_LIGHT);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

/* Quote premium */
blockquote {
  border-left: 4px solid VAR_COLOR_ACCENT;
  padding: 1em 1.5em;
  margin: 2em 0;
  font-style: italic;
  background: VAR_COLOR_BG_LIGHT;
  border-radius: 0 0.5em 0.5em 0;
  font-size: 1.1em;
  color: #444;
}

/* Divider premium */
.chapter-divider {
  text-align: center;
  margin: 3em 0;
  font-size: 1.5em;
  color: VAR_COLOR_ACCENT;
  letter-spacing: 0.5em;
}

/* Cover hero */
.cover-hero {
  text-align: center;
  padding: 4em 2em;
  margin-bottom: 3em;
  background: VAR_COLOR_PRIMARY;
  color: white;
  border-radius: 1em;
}

.cover-hero h1 {
  font-size: 2.5em;
  color: white;
  margin-bottom: 0.5em;
}

.cover-hero .subtitle {
  font-size: 1.3em;
  opacity: 0.9;
}

.cover-hero .author {
  margin-top: 2em;
  font-size: 1.1em;
  opacity: 0.8;
}

/* Table premium */
table {
  border-radius: 0.5em;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

th {
  background-color: VAR_COLOR_PRIMARY;
  color: white;
}

/* === Print CSS === */
@media print {
  body {
    background: white;
    max-width: none;
    padding: 0;
    font-size: 11pt;
  }

  .chapter {
    page-break-before: always;
  }

  .exercise-box,
  .callout,
  blockquote {
    page-break-inside: avoid;
    box-shadow: none;
  }

  .cover-hero {
    page-break-after: always;
  }

  a { color: inherit; text-decoration: none; }
  
  img { max-width: 100% !important; }
}
```

---

## VARIANTE 3: Tailwind Config (React + 21st)

### Para o projeto React, o design system vira tailwind.config.js
```js
// tailwind.config.js — Gerado pelo Design System (Fase 7)
export default {
  content: ['./src/**/*.{js,jsx}'],
  theme: {
    extend: {
      colors: {
        primary: 'VAR_COLOR_PRIMARY',
        secondary: 'VAR_COLOR_SECONDARY',
        accent: 'VAR_COLOR_ACCENT',
        'bg-page': 'VAR_COLOR_BG_PAGE',
        'bg-light': 'VAR_COLOR_BG_LIGHT',
        'bg-highlight': 'VAR_COLOR_BG_HIGHLIGHT',
      },
      fontFamily: {
        heading: ['VAR_FONT_HEADING', 'Georgia', 'serif'],
        body: ['VAR_FONT_BODY', 'Georgia', 'serif'],
      },
      maxWidth: {
        content: '680px',
      },
      typography: {
        DEFAULT: {
          css: {
            maxWidth: '680px',
            lineHeight: '1.8',
          },
        },
      },
    },
  },
  plugins: [],
}
```

### Componentes React usam classes Tailwind
```jsx
// ExerciseBox.jsx — Exemplo
export function ExerciseBox({ title, children }) {
  return (
    <div className="border-l-4 border-accent bg-bg-light rounded-r-xl 
                    p-6 my-8 shadow-sm">
      <h3 className="font-heading text-accent text-lg font-bold mt-0 mb-3">
        {title}
      </h3>
      <div className="font-body text-gray-700 leading-relaxed">
        {children}
      </div>
    </div>
  )
}
```

---

## COMO PERSONALIZAR

Na Fase 7, o Design System gera valores reais para todas as VAR_*:

| Variavel | Exemplo Elegante | Exemplo Dark | Exemplo Vibrante |
|----------|-----------------|-------------|------------------|
| VAR_COLOR_PRIMARY | #2c3e50 | #e2c074 | #6c63ff |
| VAR_COLOR_SECONDARY | #7f8c8d | #a0a0a0 | #ff6584 |
| VAR_COLOR_ACCENT | #c9a96e | #e2c074 | #43b581 |
| VAR_COLOR_BG_PAGE | #faf8f5 | #1a1a2e | #ffffff |
| VAR_COLOR_BG_LIGHT | #fdf6e3 | #16213e | #f8f9fa |
| VAR_COLOR_BG_HIGHLIGHT | #f5efe6 | #0f3460 | #e8f5e9 |
| VAR_FONT_HEADING | Playfair Display | Cormorant Garamond | Poppins |
| VAR_FONT_BODY | Inter | Lato | Nunito |

O script de build substitui VAR_* pelos valores reais em cada variante.
