/* ============================================
   Creator Economy Course — style.css
   Light theme, Heebo, RTL Hebrew
   Accent: #d97706 (amber/gold)
   ============================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; max-width: 100vw; scroll-behavior: smooth; }

:root {
    --bg: #f8f9fb;
    --text: #1a1a2e;
    --text-2: #64748b;
    --text-3: #94a3b8;
    --accent: #d97706;
    --accent-hover: #b45309;
    --accent-light: #fffbeb;
    --accent-soft: #fef3c7;
    --card: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.03);
    --shadow-hover: 0 8px 30px rgba(217,119,6,.12), 0 2px 8px rgba(0,0,0,.05);
}

body {
    font-family: 'Heebo', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
}

/* ===== NAV BAR (used in chapter pages) ===== */
.nav-bar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -.3px;
}
.nav-logo span { color: var(--accent); }

.nav-back {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color .2s;
}
.nav-back:hover { color: var(--accent-hover); }

/* ===== CHAPTER HEADER ===== */
.chapter-header {
    background: linear-gradient(135deg, #fffbeb 0%, #fef9ed 100%);
    border-bottom: 1px solid #fde68a;
    padding: 48px 24px 40px;
    text-align: center;
}

.chapter-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.chapter-num {
    width: 38px;
    height: 38px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
}

.chapter-phase {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: .3px;
}

.phase-foundation { background: #dcfce7; color: #15803d; }
.phase-skillbuilding { background: #dbeafe; color: #1d4ed8; }
.phase-integration { background: #f3e8ff; color: #7c3aed; }

.chapter-header h1 {
    max-width: 760px;
    margin: 0 auto 14px;
    font-size: clamp(22px, 3.5vw, 36px);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -.4px;
}

.chapter-header .subtitle {
    max-width: 640px;
    margin: 0 auto;
    font-size: 16px;
    color: var(--text-2);
    line-height: 1.75;
}

/* ===== TABLE OF CONTENTS ===== */
.toc {
    max-width: 900px;
    margin: 32px auto;
    padding: 0 24px;
}

.toc-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 12px;
}

.toc-list {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    list-style: none;
    padding: 8px 0;
    counter-reset: toc-counter;
}

.toc-list li {
    counter-increment: toc-counter;
    border-bottom: 1px solid var(--border-light);
}
.toc-list li:last-child { border-bottom: none; }

.toc-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    font-size: 14px;
    color: var(--text-2);
    transition: all .2s;
}
.toc-list a::before {
    content: counter(toc-counter, decimal-leading-zero);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    min-width: 22px;
}
.toc-list a:hover {
    color: var(--accent);
    background: var(--accent-light);
    padding-right: 24px;
}

/* ===== MAIN CONTENT ===== */
.content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px 72px;
}

.content h2 {
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 800;
    margin: 48px 0 16px;
    color: var(--text);
    letter-spacing: -.3px;
    padding-top: 8px;
    border-top: 3px solid var(--accent);
    display: inline-block;
}

.content h3 {
    font-size: 19px;
    font-weight: 700;
    margin: 28px 0 12px;
    color: var(--text);
}

.content h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 8px;
    color: var(--text);
}

.content p {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.8;
}

.content ul, .content ol {
    margin: 0 20px 16px 0;
    padding-right: 0;
}

.content li {
    font-size: 15.5px;
    line-height: 1.75;
    margin-bottom: 8px;
    padding-right: 4px;
}

/* ===== SECTION TAGS ===== */
.section-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 36px 0 -8px;
}

.tag {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    background: var(--border-light);
    color: var(--text-3);
    border: 1px solid var(--border);
}

.tag-beginner { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.tag-intermediate { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.tag-advanced { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* ===== CALLOUT BOXES ===== */
.learning-objectives,
.prerequisites,
.deliverables,
.tip,
.warning,
.framework,
.glossary,
.summary {
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 24px 0;
    position: relative;
}

.callout-title {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 10px;
}

.learning-objectives {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-right: 4px solid var(--accent);
}
.learning-objectives .callout-title { color: var(--accent); }

.prerequisites {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-right: 4px solid #16a34a;
}
.prerequisites .callout-title { color: #15803d; }

.deliverables {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-right: 4px solid #2563eb;
}
.deliverables .callout-title { color: #1d4ed8; }

.tip {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-right: 4px solid var(--text-3);
}
.tip .callout-title { color: var(--text-2); }

.tip.do-now {
    background: #fffbeb;
    border-color: #fde68a;
    border-right-color: var(--accent);
}
.tip.do-now .callout-title { color: var(--accent); }

.tip.project-thread {
    background: #fdf4ff;
    border-color: #e9d5ff;
    border-right-color: #7c3aed;
}
.tip.project-thread .callout-title { color: #7c3aed; }

.warning {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-right: 4px solid #dc2626;
}
.warning .callout-title { color: #dc2626; }

.framework {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-right: 4px solid #16a34a;
}
.framework .callout-title { color: #15803d; }

.glossary {
    background: var(--card);
    border: 1px solid var(--border);
    border-right: 4px solid var(--accent);
}
.glossary .callout-title { color: var(--accent); }

.summary {
    background: linear-gradient(135deg, #fffbeb 0%, #fef9ed 100%);
    border: 1px solid #fde68a;
    border-right: 4px solid var(--accent);
}
.summary .callout-title { color: var(--accent); }

/* ===== TIME BADGE ===== */
.time-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    margin-bottom: 8px;
}

/* ===== TABLES ===== */
.content table, .glossary table, .framework table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.content th, .glossary th, .framework th {
    background: var(--accent-soft);
    color: var(--text);
    font-weight: 700;
    padding: 10px 14px;
    text-align: right;
    border-bottom: 2px solid #fde68a;
}

.content td, .glossary td, .framework td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: top;
}

.content tr:last-child td, .glossary tr:last-child td, .framework tr:last-child td {
    border-bottom: none;
}

.content tr:nth-child(even) td, .glossary tr:nth-child(even) td {
    background: #fafafa;
}

/* ===== CHAPTER NAV (prev/next) ===== */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.chapter-nav a {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    flex: 1;
    transition: all .2s;
    max-width: 48%;
}
.chapter-nav a:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
}
.chapter-nav .nav-dir {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 4px;
}
.chapter-nav .nav-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}
.chapter-nav .next { text-align: left; }

/* ===== FOOTER ===== */
footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-3);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-inner { padding: 12px 16px; }
    .chapter-header { padding: 36px 16px 28px; }
    .toc { padding: 0 16px; margin: 20px auto; }
    .content { padding: 0 16px 48px; }
    .content h2 { font-size: 20px; }
    .content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .chapter-nav { flex-direction: column; }
    .chapter-nav a { max-width: 100%; }
    .learning-objectives, .prerequisites, .deliverables,
    .tip, .warning, .framework, .glossary, .summary {
        padding: 16px 18px;
    }
}

@media (max-width: 480px) {
    .chapter-header h1 { font-size: 20px; }
    .chapter-badge { flex-direction: column; gap: 6px; }
}
