/* style.css - עיצוב אתר מעט מן האור */

/* איפוס בסיסי */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Heebo', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #2c2416;
    background-color: #fafaf8;
    direction: rtl;
}

/* מיכל ראשי */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== כותרת מובייל ===== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e8e5df;
    z-index: 1000;
    align-items: center;
    padding: 0 16px;
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: #2c2416;
    position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: #2c2416;
    right: 0;
}

.hamburger-icon::before {
    top: -7px;
}

.hamburger-icon::after {
    top: 7px;
}

.mobile-title {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 18px;
    font-weight: 700;
    color: #8b5e3c;
    margin-right: 12px;
}

/* ===== סרגל צד ===== */
.sidebar {
    width: 300px;
    min-width: 300px;
    background: #fff;
    border-left: 1px solid #e8e5df;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 32px 24px 24px;
    border-bottom: 1px solid #e8e5df;
    text-align: center;
}

.site-title {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 28px;
    font-weight: 700;
    color: #8b5e3c;
    margin-bottom: 4px;
    text-decoration: none;
    cursor: pointer;
}

.site-author {
    font-size: 14px;
    color: #8a7a60;
    font-weight: 300;
}

/* ===== תפריט ===== */
.menu {
    padding: 8px 0;
}

.chapter-list,
.parasha-list,
.article-list {
    list-style: none;
}

/* חומש */
.chapter-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    cursor: pointer;
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 18px;
    font-weight: 700;
    color: #2c2416;
    border-bottom: 1px solid #f0ede8;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.chapter-link:hover {
    background: #faf7f2;
}

.chapter-link.active {
    color: #8b5e3c;
}

/* חץ פתיחה/סגירה */
.toggle-arrow {
    font-size: 10px;
    color: #8a7a60;
    transition: transform 0.2s;
    display: inline-block;
}

.toggle-arrow.open {
    transform: rotate(180deg);
}

.toggle-arrow.small {
    font-size: 8px;
}

/* פרשה */
.parasha-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px 10px 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #2c2416;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.parasha-link:hover {
    background: #faf7f2;
}

.parasha-link.active {
    color: #8b5e3c;
}

/* מאמר */
.article-link {
    display: block;
    padding: 8px 56px 8px 24px;
    cursor: pointer;
    font-size: 14px;
    color: #2c2416;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    text-align: right;
}

.article-link:hover {
    background: #faf7f2;
    color: #8b5e3c;
}

.article-link.active {
    color: #8b5e3c;
    font-weight: 700;
    background: #faf7f2;
    border-right: 3px solid #8b5e3c;
}

.article-link.disabled {
    color: #c4b99a;
    cursor: default;
    pointer-events: none;
}

/* ===== שכבת רקע למובייל ===== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

/* ===== תוכן ראשי ===== */
.main-content {
    flex: 1;
    padding: 40px 60px;
    /*max-width: 800px;*/
    max-width: 980px;
}

/* ===== עמוד הבית ===== */
.home-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.home-content {
    text-align: center;
    max-width: 500px;
}

.home-title {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 42px;
    font-weight: 700;
    color: #8b5e3c;
    margin-bottom: 8px;
}

.home-author {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 22px;
    font-weight: 500;
    color: #2c2416;
    margin-bottom: 24px;
}

.home-description {
    font-size: 16px;
    color: #8a7a60;
    line-height: 1.8;
    margin-bottom: 16px;
}

.home-instruction {
    font-size: 14px;
    color: #b0a48c;
    font-style: italic;
}

/* ===== עמוד מאמר ===== */
.breadcrumb {
    font-size: 14px;
    color: #8a7a60;
    margin-bottom: 24px;
}

.breadcrumb a {
    color: #8b5e3c;
    cursor: pointer;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
}

.article-title {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 32px;
    font-weight: 700;
    color: #2c2416;
    margin-bottom: 32px;
    line-height: 1.4;
}

.article-body {
    margin-bottom: 40px;
}

.article-paragraph {
    font-size: 17px;
    line-height: 1.9;
    color: #2c2416;
    margin-bottom: 16px;
    text-align: justify;
}

.back-btn {
    display: inline-block;
    padding: 10px 28px;
    background: #8b5e3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'Heebo', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.back-btn:hover {
    background: #74502f;
}

/* טעינה ושגיאה */
.loading {
    text-align: center;
    padding: 80px 0;
    color: #8a7a60;
    font-size: 16px;
}

.error-message {
    text-align: center;
    padding: 80px 0;
}

.error-message h2 {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 24px;
    color: #2c2416;
    margin-bottom: 8px;
}

.error-message p {
    color: #8a7a60;
    margin-bottom: 24px;
}

/* ===== רספונסיבי ===== */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .app-container {
        flex-direction: column;
        padding-top: 56px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: -300px;
        height: 100vh;
        z-index: 1001;
        transition: right 0.3s ease;
    }

    .sidebar.sidebar-open {
        right: 0;
    }

    .overlay {
        display: block;
    }

    .main-content {
        padding: 24px 16px;
    }

    .home-title {
        font-size: 32px;
    }

    .home-author {
        font-size: 18px;
    }

    .article-title {
        font-size: 24px;
    }

    .article-paragraph {
        font-size: 16px;
    }

    .back-btn {
        float: left;
    }

}
