/* ============================
   קובץ עיצוב מרכזי לספר "לב אהרן על התורה"
   ============================ */

/* ============================
   הגדרת פונטים
   ============================ */

@font-face {
    font-family: 'Frank Ruehl CLM';
    src: url('../fonts/FrankRuehlCLM-Medium.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'SBL Hebrew';
    src: url('../fonts/sbl-hebrew.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'TelAviv-EclecticHebrewNo1';
    src: url('../fonts/TelAviv-EclecticHebrewNo1.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Yiddishkeit';
    src: url('../fonts/YiddishkeitAlefAlefAlef-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Fills1';
    src: url('../fonts/FILLS1.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ============================
   עברית - Hebrew Styles
   ============================ */

/* עיצוב כללי למאמרים עבריים */
article[lang="he"],
article:not([lang]) {
    font-family: 'SBL Hebrew', serif;
    direction: rtl;
    text-align: justify; /* יישור משני הצדדים */
    line-height: 1.6; /* רווח בין שורות קטן יותר */
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    color: #222;
}

/* שורה אחרונה בקטע מיושרת לימין */
article[lang="he"] p:last-of-type,
article[lang="he"] div.P2:last-of-type,
article[lang="he"] div.P3:last-of-type,
article:not([lang]) p:last-of-type,
article:not([lang]) div.P2:last-of-type,
article:not([lang]) div.P3:last-of-type {
    text-align-last: right;
}

/* כותרת פרשה/מועד בראש כל מאמר */
.parsha-header {
    font-family: 'Yiddishkeit', serif; /* פונט יידישקייט */
    font-size: 2em; /* אות גדולה */
    font-weight: normal;
    word-spacing: 0.3em; /* רווח בין מילים */
    color: #003366;
    background: #f0f4f8; /* גוון עדין */
    padding: 10px 20px;
    margin-right: 2rem; /* 2rem מגבול ימין */
    margin-bottom: 2rem;
    display: inline-block; /* לא לכל הרוחב */
    width: 25%; /* רבע מרוחב הטור */
    text-align: center;
    border-radius: 0; /* מלבן ללא עיגול */
    box-shadow: none; /* ללא הצללה */
}

/* P1 - כותרת מאמר (@DC) */
.P1 {
    font-family: 'Yiddishkeit', serif; /* פונט יידישקייט */
    font-size: 1.4em; /* אות גדולה יותר */
    font-weight: bold;
    word-spacing: 0.3em; /* רווח בין מילים */
    text-align: center;
    margin: 1.5rem 0;
    color: #003366;
}

/* P2 - פסקה ראשונה / ציטוט רש"י (@A2) */
.P2 {
    font-family: 'SBL Hebrew', serif;
    font-size: 1.1em; /* גדול ב-1 פונקט */
    line-height: 1.6; /* רווח קטן יותר */
    text-indent: 0;
    margin-bottom: 0.8em; /* רווח בין קטעים קטן יותר */
}

/* P3 - פסקה רגילה / גוף המאמר (@A1) */
.P3 {
    font-family: 'SBL Hebrew', serif;
    font-size: 1.1em; /* גדול ב-1 פונקט */
    line-height: 1.6; /* רווח קטן יותר */
    text-indent: 2em;
    margin-bottom: 0.8em; /* רווח בין קטעים קטן יותר */
}

/* P4 - פסוק מקראי (@AI...@AJ) */
.P4 {
    font-family: 'SBL Hebrew', serif; /* פונט SBL */
    font-style: normal; /* לא italic */
    font-size: 1.05em;
    text-align: right;
    margin: 1rem 0 1rem 3rem; /* יותר שמאלה */
    padding: 0.5rem 0;
    background: transparent; /* בלי רקע */
    border-right: none; /* בלי קו מימין */
}

/* P5 - מקור הפסוק (בראשית א, א) - span בתוך P4 */
.P5 {
    font-size: 0.85em; /* אות קטנה יותר */
    color: #666;
}

/* P6 - הדגשה/מודגש (@D7...@D8) */
.P6 {
    font-family: 'SBL Hebrew', serif; /* אותו פונט */
    font-weight: bold; /* מודגש */
    font-style: normal; /* לא italic */
}

/* P7 - סיום מאמר (@D9B) */
.P7 {
    font-family: 'Fills1', sans-serif; /* פונט אורנמנטים */
    text-align: center;
    margin-top: 2em;
    font-size: 1.8em;
    letter-spacing: 0.5em; /* מרווח en-dash בין האותיות */
    color: #666;
}

/* P8 - הערת שוליים (@D3...@D4) */
.P8 {
    vertical-align: super;
    font-size: 0.7em;
    color: #003366;
}

/* P9 - מפריד בין נושאים (@AE–) */
.P9 {
    font-family: 'Fills1', sans-serif; /* פונט אורנמנטים */
    text-align: center;
    font-size: 1.2em; /* קטן יותר מ-P7 */
    margin: 1.5em 0;
    color: #666;
}

/* P10 - ריווח נוסף למעלה (<ALD8>) */
.P10 {
    margin-top: 8pt;
}

/* ============================
   שורת כפתורי ניווט
   ============================ */

.article-nav-inline {
    direction: rtl;
    text-align: right;
    padding: 0.8rem 1rem;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    border-bottom: 2px solid #003366;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    background: #003366;
    color: white;
    text-decoration: none;
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: bold;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: 'Frank Ruehl CLM', serif;
}

.nav-btn:hover {
    background: #004488;
    box-shadow: 0 2px 4px rgba(0,51,102,0.3);
}

.nav-btn:active {
    transform: translateY(1px);
}

.nav-en {
    background: #663399;
    font-family: Arial, sans-serif;
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

.nav-en:hover {
    background: #7744aa;
}

.nav-label {
    display: inline-block;
    padding: 0 0.3rem;
    color: #003366;
    font-size: 0.9rem;
    font-weight: bold;
    font-family: 'Frank Ruehl CLM', serif;
}

.nav-disabled {
    background: #cccccc;
    color: #888888;
    cursor: not-allowed;
    opacity: 0.6;
}

.nav-disabled:hover {
    background: #cccccc;
    box-shadow: none;
    transform: none;
}

.nav-separator {
    width: 1px;
    height: 1.5rem;
    background: #003366;
    opacity: 0.3;
    margin: 0 0.5rem;
}

/* ============================
   אנגלית - English Styles
   ============================ */

/* עיצוב כללי למאמרים אנגליים */
article[lang="en"] {
    font-family: Georgia, 'Times New Roman', serif;
    direction: ltr;
    text-align: justify; /* יישור משני הצדדים */
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    color: #222;
}

/* שורה אחרונה בקטע מיושרת לשמאל */
article[lang="en"] p:last-of-type,
article[lang="en"] div.P2-en:last-of-type,
article[lang="en"] div.P3-en:last-of-type {
    text-align-last: left;
}

/* כותרת פרשה אנגלית */
.parsha-header-en {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2em;
    font-weight: bold;
    color: #003366;
    background: #f0f4f8;
    padding: 10px 20px;
    margin-left: 2rem; /* 2rem מגבול שמאל */
    margin-bottom: 2rem;
    display: inline-block;
    width: 25%;
    text-align: center;
    border-radius: 0; /* מלבן ללא עיגול */
    box-shadow: none; /* ללא הצללה */
}

/* P1-en - כותרת מאמר אנגלית */
.P1-en {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.4em;
    font-weight: bold;
    text-align: center;
    margin: 1.5rem 0;
    color: #003366;
}

/* P2-en - פסקה ראשונה אנגלית */
.P2-en {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1em;
    line-height: 1.6;
    text-indent: 0;
    margin-bottom: 0.8em;
}

/* P3-en - פסקה רגילה אנגלית */
.P3-en {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1em;
    line-height: 1.6;
    text-indent: 2em;
    margin-bottom: 0.8em;
}

/* P4-en - פסוק אנגלי */
.P4-en {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: normal;
    font-size: 1.05em;
    text-align: left;
    margin: 1rem 3rem 1rem 0;
    padding: 0.5rem 0;
    background: transparent;
    border-left: none;
}

/* P5-en - מקור פסוק אנגלי */
.P5-en {
    font-size: 0.85em;
    color: #666;
}

/* P6-en - הדגשה אנגלית */
.P6-en {
    font-weight: bold;
    font-style: normal;
}

/* P7-en - סיום מאמר אנגלי */
.P7-en {
    font-family: 'Fills1', sans-serif;
    text-align: center;
    margin-top: 2em;
    font-size: 1.8em;
    letter-spacing: 0.5em;
    color: #666;
}

/* P8-en - הערת שוליים אנגלית */
.P8-en {
    vertical-align: super;
    font-size: 0.7em;
    color: #003366;
}

/* ============================
   התאמה למסכים קטנים
   ============================ */

@media (max-width: 768px) {
    .parsha-header,
    .parsha-header-en {
        width: 80%;
        margin-right: 1rem;
        margin-left: 1rem;
    }
    
    .article-nav-inline {
        gap: 0.3rem;
        padding: 0.6rem 0.5rem;
    }
    
    .nav-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .nav-label {
        font-size: 0.8rem;
        padding: 0 0.2rem;
    }
    
    .nav-separator {
        margin: 0 0.3rem;
    }
}
