/* ============================================
   kaveh-main.css — استایل کامل
   کتاب «کاوه و فریدون؛ دو نیمهٔ حق»
   ============================================ */

/* ========== ریست پایه ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-text);
    background-color: var(--color-bg);
}

/* ========== هدر کتاب ========== */
.book-header {
    background-color: var(--color-bg-dark);
    border-bottom: 2px solid var(--color-fire);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.book-header__inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.book-header__parent-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text-light);
    transition: color 0.3s;
}
.book-header__parent-link:hover { color: var(--color-fire-light); }
.book-header__icon { width: 36px; height: 36px; }
.book-header__parent-text {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 700;
}
.book-header__nav { display: flex; gap: 1.5rem; }
.book-header__nav-link {
    text-decoration: none;
    color: var(--color-text-light);
    font-size: var(--text-sm);
    transition: color 0.3s;
    border-bottom: 1px solid transparent;
}
.book-header__nav-link:hover {
    color: var(--color-fire-light);
    border-bottom-color: var(--color-fire-light);
}
.book-header__nav-link--active {
    color: var(--color-fire-light) !important;
    border-bottom: 1px solid var(--color-fire-light) !important;
}

/* ========== صفحهٔ فرود ========== */
.book-landing {
    max-width: var(--container-reading);
    margin: 0 auto;
    padding: 2rem var(--container-padding) 4rem;
}

/* Hero */
.book-hero {
    text-align: center;
    padding: 4rem 0 3rem;
}
.book-hero__ornament { font-size: 2.5rem; margin-bottom: 1rem; }
.book-hero__title {
    font-family: var(--font-heading);
    font-size: var(--text-5xl);
    font-weight: 900;
    color: var(--color-fire-light);
    letter-spacing: 0.25rem;
    margin-bottom: 0.5rem;
}
.book-hero__subtitle {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    color: var(--color-leather-light);
    font-weight: 400;
    margin-bottom: 2rem;
}
.book-hero__divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.book-hero__divider-line {
    width: 80px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-fire), transparent);
}
.book-hero__divider-symbol { color: var(--color-fire-light); font-size: 1.5rem; }
.book-hero__description {
    font-size: var(--text-lg);
    color: var(--color-text-light);
    line-height: var(--leading-loose);
    max-width: 650px;
    margin: 0 auto;
}
.book-hero__description strong { color: var(--color-fire-light); }

/* نقل‌قول میثاق */
.book-covenant {
    background: linear-gradient(135deg, var(--color-bg-card), var(--color-bg-dark));
    border: 1px solid var(--color-border);
    border-right: 4px solid var(--color-fire);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0 4rem;
    text-align: center;
}
.book-covenant__quote p {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--color-text-light);
    font-style: italic;
    line-height: var(--leading-loose);
}
.book-covenant__quote strong { color: var(--color-fire-light); }

/* فهرست */
.book-toc { margin-bottom: 4rem; }
.book-toc__title {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    color: var(--color-fire-light);
    text-align: center;
    margin-bottom: 1rem;
}
.book-toc__intro {
    text-align: center;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: var(--leading-relaxed);
}
.book-toc__list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.book-toc__link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}
.book-toc__link:hover {
    border-color: var(--color-fire);
    background-color: var(--color-bg-hover);
    transform: translateX(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.book-toc__number {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    color: var(--color-fire-light);
    min-width: 90px;
    text-align: center;
}
.book-toc__chapter-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--color-text);
    flex: 1;
}
.book-toc__question {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-style: italic;
}

/* روش‌شناسی (صفحهٔ فرود) */
.book-methodology {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 3rem;
}
.book-methodology__title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    color: var(--color-fire-light);
    margin-bottom: 1.5rem;
    text-align: center;
}
.book-methodology__text { color: var(--color-text-light); line-height: var(--leading-relaxed); margin-bottom: 1.25rem; }
.book-methodology__more { color: var(--color-fire-light); text-decoration: none; font-weight: 600; }
.book-methodology__more:hover { opacity: 0.7; }

/* دعوت */
.book-invitation {
    text-align: center;
    padding: 3rem 0;
    border-top: 1px solid var(--color-border);
}
.book-invitation__title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    color: var(--color-fire-light);
    margin-bottom: 1.5rem;
}
.book-invitation__text { color: var(--color-text-light); line-height: var(--leading-loose); max-width: 600px; margin: 0 auto 1.5rem; }
.book-invitation__signature, .signature {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--color-fire-light);
    font-weight: 700;
    margin-top: 1.5rem;
    text-align: center;
}

/* ========== استایل‌های مشترک فصل‌ها ========== */
.chapter-header {
    text-align: center;
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 3rem;
}
.chapter-header__khan {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    color: var(--color-fire-light);
    letter-spacing: 0.25rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--color-fire-light);
    padding: 0.25rem 1rem;
    border-radius: 20px;
}
.chapter-header__title {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: 900;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}
.chapter-header__question {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    font-style: italic;
}

.chapter-section { margin-bottom: 3rem; }
.chapter-section h2 {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    color: var(--color-fire-light);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}
.chapter-section h3 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--color-text);
    margin-bottom: 1rem;
}
.chapter-section p {
    color: var(--color-text-light);
    line-height: var(--leading-loose);
    margin-bottom: 1.25rem;
}
.chapter-section strong { color: var(--color-text); }

/* یادداشت روش */
.method-note {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-right: 4px solid var(--color-fire-light);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
}
.method-note strong { color: var(--color-fire-light); }

/* کارت ویژگی */
.feature-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.feature-card h3 { color: var(--color-fire-light); margin-bottom: 0.75rem; }

/* جدول */
.feature-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-size: var(--text-sm);
}
.feature-table thead { background-color: var(--color-bg-dark); }
.feature-table th {
    padding: 0.75rem 1rem;
    text-align: right;
    color: var(--color-fire-light);
    font-weight: 600;
    border-bottom: 2px solid var(--color-fire);
}
.feature-table td {
    padding: 0.75rem 1rem;
    color: var(--color-text-light);
    border-bottom: 1px solid var(--color-border);
    line-height: var(--leading-relaxed);
}
.feature-table tbody tr:hover { background-color: var(--color-bg-hover); }

/* نقل‌قول پرسش */
.chapter-question {
    background: linear-gradient(135deg, var(--color-bg-card), var(--color-bg-dark));
    border: 1px solid var(--color-border);
    border-right: 4px solid var(--color-fire);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}
.chapter-question p {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--color-text-light);
    line-height: var(--leading-loose);
    margin-bottom: 0;
}

/* جعبهٔ بینش */
.insight-box {
    background: linear-gradient(135deg, var(--color-bg-dark), var(--color-bg-card));
    border: 1px solid var(--color-fire);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}
.insight-box h3 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--color-fire-light);
    margin-bottom: 1rem;
}
.insight-box p {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--color-text-light);
    line-height: var(--leading-loose);
    margin-bottom: 0;
}

/* ========== ناوبری فصل ========== */
.chapter-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
    margin-top: 3rem;
    gap: 1rem;
}
.chapter-nav__empty { flex: 1; }
.chapter-nav__up {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color 0.3s;
}
.chapter-nav__up:hover { color: var(--color-fire-light); }
.chapter-nav__prev {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    padding: 0.75rem 1rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.3s;
}
.chapter-nav__prev:hover {
    border-color: var(--color-fire);
    background-color: var(--color-bg-hover);
}
.chapter-nav__next {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-decoration: none;
    padding: 0.75rem 1rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.3s;
}
.chapter-nav__next:hover {
    border-color: var(--color-fire);
    background-color: var(--color-bg-hover);
}
.chapter-nav__label { font-size: var(--text-xs); color: var(--color-text-muted); }
.chapter-nav__title { font-family: var(--font-heading); font-size: var(--text-base); color: var(--color-text); }
.chapter-nav__arrow { font-size: var(--text-lg); color: var(--color-fire-light); }

/* ========== فصل ۳: لایه‌های درفش ========== */
.layer-card {
    display: flex;
    gap: 1.25rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    align-items: flex-start;
}
.layer-card__number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background-color: var(--color-fire);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.layer-card__content h3 { color: var(--color-fire-light); margin-bottom: 0.75rem; font-size: var(--text-lg); }
.layer-card__content p { color: var(--color-text-light); line-height: var(--leading-relaxed); margin-bottom: 0; }

/* نمودار پل */
.bridge-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem 1rem;
    margin: 2rem 0;
    background-color: var(--color-bg-dark);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    text-align: center;
}
.bridge-diagram__side { flex: 1; }
.bridge-diagram__side strong {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--color-fire-light);
    margin-bottom: 0.5rem;
}
.bridge-diagram__side p { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: 0; }
.bridge-diagram__center {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    background-color: var(--color-bg-card);
    border: 2px solid var(--color-fire);
    border-radius: 12px;
}
.bridge-diagram__icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.bridge-diagram__center strong { display: block; font-family: var(--font-heading); font-size: var(--text-base); color: var(--color-fire-light); margin-bottom: 0.25rem; }
.bridge-diagram__center p { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: 0; }

/* ========== فصل ۴: کارت‌های حق ========== */
.haq-card {
    display: flex;
    gap: 1.5rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}
.haq-card--sky { border-right: 4px solid var(--color-gold); }
.haq-card--earth { border-right: 4px solid var(--color-fire); }
.haq-card--action { border-right: 4px solid var(--color-iron-light); }
.haq-card__icon { flex-shrink: 0; font-size: 2rem; width: 50px; text-align: center; }
.haq-card__content h3 { font-family: var(--font-heading); font-size: var(--text-xl); margin-bottom: 0.75rem; }
.haq-card--sky .haq-card__content h3 { color: var(--color-gold-light); }
.haq-card--earth .haq-card__content h3 { color: var(--color-fire-light); }
.haq-card--action .haq-card__content h3 { color: var(--color-iron-light); }
.haq-card__source, .haq-card__carrier, .haq-card__essence, .haq-card__limit {
    color: var(--color-text-light);
    line-height: var(--leading-relaxed);
    margin-bottom: 0.5rem;
    font-size: var(--text-sm);
}
.haq-card__source { color: var(--color-text-muted); }
.haq-card__carrier { color: var(--color-text-muted); font-style: italic; }
.haq-card__limit {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

/* مدل مثلثی */
.triangle-model {
    text-align: center;
    padding: 2rem;
    margin: 2rem 0;
    background-color: var(--color-bg-dark);
    border: 1px solid var(--color-border);
    border-radius: 12px;
}
.triangle-model__top { margin-bottom: 1.5rem; }
.triangle-model__top strong { display: block; font-size: var(--text-lg); color: var(--color-gold-light); }
.triangle-model__top p { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: 0; }
.triangle-model__bottom { display: flex; justify-content: space-between; gap: 2rem; }
.triangle-model__left strong, .triangle-model__right strong { display: block; font-size: var(--text-lg); margin-bottom: 0.25rem; }
.triangle-model__left strong { color: var(--color-fire-light); }
.triangle-model__right strong { color: var(--color-iron-light); }
.triangle-model__left p, .triangle-model__right p { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: 0; }

/* ========== فصل ۵: نامزدها و جای خالی ========== */
.candidate-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.candidate-card--primary { border-right: 4px solid var(--color-gold); }
.candidate-card--secondary { border-right: 4px solid var(--color-fire); }
.candidate-card--tertiary { border-right: 4px solid var(--color-iron-light); }
.candidate-card--quaternary { border-right: 4px solid var(--color-leather-light); }
.candidate-card__header {
    background: linear-gradient(135deg, var(--color-bg-dark), var(--color-bg-card));
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}
.candidate-card__header h3 { font-family: var(--font-heading); font-size: var(--text-xl); margin-bottom: 0; }
.candidate-card--primary .candidate-card__header h3 { color: var(--color-gold-light); }
.candidate-card--secondary .candidate-card__header h3 { color: var(--color-fire-light); }
.candidate-card--tertiary .candidate-card__header h3 { color: var(--color-iron-light); }
.candidate-card--quaternary .candidate-card__header h3 { color: var(--color-leather-light); }
.candidate-card__body { padding: 1.5rem; }
.candidate-card__body p { color: var(--color-text-light); line-height: var(--leading-relaxed); margin-bottom: 0.75rem; }
.candidate-card__body p:last-child { margin-bottom: 0; }

.void-box {
    background: linear-gradient(135deg, var(--color-bg-dark), var(--color-bg-card));
    border: 2px dashed var(--color-fire);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}
.void-box p { font-family: var(--font-heading); font-size: var(--text-lg); color: var(--color-text-light); line-height: var(--leading-loose); margin-bottom: 0; }
.void-box strong { color: var(--color-fire-light); }

/* ========== فصل ۶: دلیل‌ها و بینش نهایی ========== */
.reason-stack { display: flex; flex-direction: column; gap: 1.25rem; margin: 1.5rem 0; }
.reason-card {
    display: flex;
    gap: 1.25rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    align-items: flex-start;
}
.reason-card__number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background-color: var(--color-fire);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.reason-card__content h3 { font-family: var(--font-heading); font-size: var(--text-lg); color: var(--color-fire-light); margin-bottom: 0.5rem; }
.reason-card__content p { color: var(--color-text-light); line-height: var(--leading-relaxed); margin-bottom: 0; }

.final-insight {
    background: linear-gradient(135deg, var(--color-bg-dark), var(--color-bg-card));
    border: 1px solid var(--color-fire);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}
.final-insight p {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--color-text-light);
    line-height: var(--leading-loose);
    margin-bottom: 1rem;
}
.final-insight p:last-child { margin-bottom: 0; }
.final-insight strong { color: var(--color-fire-light); }
.final-insight em { color: var(--color-gold-light); font-style: italic; }

/* ========== صفحات about و bibliographies ========== */
.claim-box {
    background-color: var(--color-bg-card);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.claim-box--has { border-right: 4px solid var(--color-fire); }
.claim-box--hasnot { border-right: 4px solid var(--color-iron-light); }
.claim-box h3 { font-family: var(--font-heading); font-size: var(--text-lg); margin-bottom: 1rem; }
.claim-box--has h3 { color: var(--color-fire-light); }
.claim-box--hasnot h3 { color: var(--color-iron-light); }
.claim-box ul { list-style: none; padding: 0; }
.claim-box li { color: var(--color-text-light); line-height: var(--leading-loose); padding: 0.3rem 0; }
.claim-box li::before { content: '▹ '; color: var(--color-fire-light); }

.method-layer {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.method-layer h3 { font-family: var(--font-heading); font-size: var(--text-base); color: var(--color-fire-light); margin-bottom: 0.5rem; }
.method-layer p { color: var(--color-text-muted); line-height: var(--leading-relaxed); margin-bottom: 0; }

.biblio-list { list-style: none; padding: 0; }
.biblio-list li {
    color: var(--color-text-light);
    line-height: var(--leading-loose);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}
.biblio-list li:last-child { border-bottom: none; }
.biblio-list strong { color: var(--color-text); }
.biblio-list em { color: var(--color-text-muted); font-style: italic; }

/* ========== لیست نتایج (فصل ۴ و ۵) ========== */
.consequence-list { display: flex; flex-direction: column; gap: 1.25rem; margin: 1.5rem 0; }
.consequence-item { display: flex; gap: 1.25rem; align-items: flex-start; }
.consequence-item__number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background-color: var(--color-fire);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: var(--text-base);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.consequence-item p { color: var(--color-text-light); line-height: var(--leading-relaxed); margin-bottom: 0; }
.consequence-item strong { color: var(--color-fire-light); }

/* ========== فوتر ========== */
.book-footer {
    background-color: var(--color-bg-dark);
    border-top: 2px solid var(--color-fire);
    padding: 2rem 0;
    text-align: center;
}
.book-footer__inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.book-footer__motto { font-family: var(--font-heading); font-size: var(--text-lg); color: var(--color-fire-light); }
.book-footer__parent { font-size: var(--text-sm); color: var(--color-text-muted); }
.book-footer__parent a { color: var(--color-fire-light); text-decoration: none; }
.book-footer__license { font-size: var(--text-xs); color: var(--color-text-muted); }
.book-footer__license a { color: var(--color-text-muted); text-decoration: underline; }

/* ========== واکنش‌گرایی ========== */
@media (max-width: 768px) {
    .book-hero__title { font-size: var(--text-3xl); }
    .book-hero__subtitle { font-size: var(--text-xl); }
    .book-toc__link { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .book-toc__number { text-align: right; }
    .book-header__inner { flex-direction: column; gap: 0.75rem; }
    .bridge-diagram { flex-direction: column; gap: 1.5rem; }
}
@media (max-width: 480px) {
    :root { --container-padding: 1rem; }
    .book-hero { padding: 2rem 0 1.5rem; }
    .book-hero__title { font-size: var(--text-2xl); }
    .triangle-model__bottom { flex-direction: column; gap: 1rem; }
}