/* --- 1. הגדרות בסיס ומשתנים --- */
:root {
    --primary: #054c78; 
    --accent: #d1e6f3;  
    --text: #2d2d2d;
    --bg: #f5f8fa;      
    --max-width: 1100px;
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0; width: 100%; overflow-x: hidden; 
}

body {
    font-family: 'Alef', Arial, sans-serif;
    line-height: 1.7;
    background-color: var(--bg);
    direction: rtl;
    color: var(--text);
}

/* --- 2. נגישות ולוגו --- */
.skip-link { 
    position: absolute; top: -100px; right: 50%; transform: translateX(50%); 
    background: #ffeb3b; padding: 10px 20px; z-index: 3000; transition: top 0.3s; 
    font-weight: bold; text-decoration: none; border-radius: 0 0 8px 8px;
}
.skip-link:focus { top: 0; }

.logo-area { text-align: center; padding: 0 10px 10px 10px; }
.logo-area h1 { margin: 0; font-size: 2.0rem; }
.logo-area h1 a { color: #07639d; text-decoration: none; }

/* --- 3. בועות קישורים (Top Bar) --- */
.top-bar { padding: 10px 20px 0 20px; }
.top-links { 
    max-width: var(--max-width); margin: 0 auto; 
    display: flex; gap: 8px; justify-content: flex-end; 
    list-style: none; padding: 0; flex-wrap: wrap;
}

.top-links a { 
    color: var(--primary); text-decoration: none; font-size: 0.9rem; font-weight: bold; 
    padding: 6px 15px; border-radius: 20px; background: #fff; 
    border: 1px solid #adc9dd; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease; 
    display: inline-block;
    white-space: nowrap;
}

@media (max-width: 900px) { 
    .top-links { justify-content: center; gap: 5px; } 
    .top-links a { padding: 4px 10px; font-size: 0.85rem; }
}

/* --- 4. תפריט ניווט --- */
.main-nav { background: var(--primary); position: sticky; top: 0; z-index: 2000; width: 100%; }
.menu-toggle { display: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.main-nav li { position: relative; }
.main-nav a { color: #fff; text-decoration: none; padding: 15px 20px; display: block; font-weight: 500; }
.main-nav a:hover { background: rgba(255, 255, 255, 0.15); }

.main-nav .dropdown {
    display: none; position: absolute; top: 100%; right: 0;
    background: var(--primary); min-width: 220px; z-index: 2100; padding: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
@media (min-width: 901px) { .main-nav li:hover > .dropdown { display: block; } }

/* --- 5. מבנה העמוד והסיידבר --- */
.main-wrapper { 
    max-width: var(--max-width); margin: 15px auto; 
    display: flex; gap: 30px; padding: 0 20px; align-items: flex-start; 
}
.content-area { flex: 1; min-width: 0; }
.sidebar { flex: 0 0 320px; width: 320px; }

article { 
    background: #fff; padding: 15px 25px 30px 25px; 
    border-radius: var(--radius); border: 1px solid #e0e8f0; 
    box-shadow: var(--shadow); 
}

article h2:first-child, article h3:first-child { margin-top: 0; padding-top: 0; }

/* --- 6. ווידג'טים בסיידבר --- */
.sidebar .widget { 
    padding: 18px; margin-bottom: 20px; border-radius: var(--radius); 
    border-right: 5px solid var(--primary); background: #fff; 
    box-shadow: var(--shadow); transition: all 0.3s ease;
}

.sidebar .widget h2, .sidebar .widget h3 {
    margin: 0 0 12px 0 !important; padding: 0 !important;
    font-size: 1.15rem; line-height: 1.2;
}

.sidebar .widget:nth-child(1) { background-color: #f4f9ff; border-right-color: #a5c8ff; }
.sidebar .widget:nth-child(2) { background-color: #f6fdf9; border-right-color: #b2dfdb; }
.sidebar .widget:nth-child(3) { background-color: #fffdf5; border-right-color: #ffe0b2; }
.sidebar .widget:nth-child(4) { background-color: #fdf9ff; border-right-color: #e1bee7; }

.sidebar .widget:has(.fb-container) { padding: 0 !important; overflow: hidden; }
.fb-container { width: 100%; height: 450px; display: flex; justify-content: center; }
.fb-container iframe { width: 100% !important; height: 450px !important; }

/* תיקון פריצת תמונה בסיידבר */
#imageContainer {
    width: 100%;       /* תופס את כל רוחב הווידג'ט */
    overflow: hidden;  /* ליתר ביטחון, שלא יבלוט כלום */
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

#randomImage {
    max-width: 100%;   /* המפתח: התמונה לעולם לא תהיה רחבה מהמיכל שלה */
    height: auto;      /* שמירה על פרופורציות הציור */
    display: block;
    border-radius: 8px; /* אופציונלי: התאמה לעיצוב הכללי */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#imageTitle {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary);
    text-align: center;
    margin-top: 5px;
}

/* --- 7. תמונות ופרסומות --- */
article img.img_he {
    display: inline-block !important; float: right !important;
    width: 200px !important; max-width: 200px !important; height: auto !important;
    margin-left: 20px !important; margin-bottom: 15px !important;
    border-radius: 12px !important; box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

#dynamic-footer, #dynamic-header { max-width: var(--max-width); margin: 0 auto; text-align: center; clear: both; }

.ad-bottom-wrapper {
    display: block !important; width: 100% !important; max-width: var(--max-width);
    margin: 30px auto !important; text-align: center !important; clear: both; min-height: 90px;
}
.ad-bottom-wrapper ins.adsbygoogle { display: block !important; margin: 0 auto !important; text-align: center !important; }

/* --- 8. תיקון היזח שורות ברשימות (יישור פלס לימין) --- */
article ul, article ol, .sidebar ul, .sidebar ol, #main-content ul, #main-content ol {
    list-style-position: outside !important;
    margin-right: 0 !important;
    padding-right: 1.5rem !important;
    text-align: right !important;
}

article li, .sidebar li { margin-bottom: 8px; line-height: 1.6; }

/* --- 9. תקצירי מאמרים (Article Summaries - look_card) --- */
.look_card {
    padding: 25px; margin-bottom: 25px; border-radius: var(--radius);
    background: #fff; border-right: 6px solid var(--primary);
    box-shadow: var(--shadow); display: flow-root; line-height: 1.8;
}

.look_yellow { background-color: #fefce8; border-right-color: #fef08a; }
.look_green  { background-color: #f0fdf4; border-right-color: #bbf7d0; }
.look_blue   { background-color: #f0f9ff; border-right-color: #bae6fd; }
.look_orange { background-color: #fff7ed; border-right-color: #ffdbbb; }
.look_purple { background-color: #f5f3ff; border-right-color: #ddd6fe; }

.look_card img {
    border-radius: 8px; margin-left: 15px; width: 120px;
    height: auto; float: right; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.look_card h2, .look_card h3 { 
    margin-top: 0; margin-bottom: 12px; 
    font-size: 1.3rem; color: var(--primary); 
}

/* --- 10. רספונסיביות מובייל --- */
@media (max-width: 900px) {
    .main-wrapper { flex-direction: column; padding: 0 10px; }
    .sidebar, .content-area { width: 100%; flex: none; }
    
    .menu-toggle { 
        display: block; width: 100%; background: var(--primary); 
        color: #fff; border: none; padding: 15px; text-align: right; cursor: pointer;
    }
    .main-nav ul#nav-list { display: none; flex-direction: column; }
    .main-nav ul#nav-list.active { display: flex; }
    .main-nav .dropdown { position: static; background: rgba(0,0,0,0.1); padding-right: 15px; }
    .main-nav li.open > .dropdown { display: block; }

    article img.img_he {
        float: none !important; display: block !important;
        margin: 0 auto 15px auto !important; max-width: 100% !important; width: auto !important;
    }

    article ul, article ol, .sidebar ul, .sidebar ol { padding-right: 1.2rem !important; }

    .look_card img {
        float: none !important; display: block !important;
        margin: 0 auto 15px auto !important; max-width: 100% !important;
    }
    .look_card { padding: 20px; }
    .look_card h2, .look_card h3 { text-align: center; }
}

/* וידוא הצגת מודעות בכל האתר */
ins.adsbygoogle {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* מניעת התנגשות עם אלמנטים צפים (כמו תמונות המאמר) */
.adsbygoogle {
    clear: both !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
}

/* הסרת רקע צהוב שחלק מהדפדפנים מוסיפים למודעות ריקות */
ins { background: transparent !important; text-decoration: none; }

/* homepage css */
       .home-page #main-content article {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            padding: 0 !important;
        }

        .main-card {
            padding: 25px;
            margin-bottom: 25px;
            border-radius: 12px;
            background: #fff;
            border-right: 6px solid #054c78;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
            display: flow-root; 
            line-height: 1.8;
        }

        .card-yellow { background-color: #fefce8; border-right-color: #fef08a; }
        .card-green  { background-color: #f0fdf4; border-right-color: #bbf7d0; }
        .card-blue   { background-color: #f0f9ff; border-right-color: #bae6fd; }
        .card-orange { background-color: #fff7ed; border-right-color: #ffdbbb; }
        .card-purple { background-color: #f5f3ff; border-right-color: #ddd6fe; }

        .main-card img {
            border-radius: 5px;
            margin-left: 15px;
            width: 100px;
            height: auto;
            float: right;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        .main-card h2 { margin-top: 0; margin-bottom: 15px; font-size: 1.3rem; }

        @media (max-width: 900px) {
            .main-card img {
                float: none !important;
                display: block;
                margin: 0 auto 15px auto !important;
                max-width: 100% !important;
            }
            .main-card h2 { text-align: center; }
            .main-card { padding: 20px; }
        }
        
        /* מרכוז ה-Header וה-Footer */
#dynamic-header, #dynamic-footer {
    display: block;
    width: 100%;
    max-width: 1200px; /* או הרוחב המקסימלי שמוגדר ב-main-wrapper שלך */
    margin: 0 auto;
    text-align: center;
}

/* במידה והפוטר מכיל קישורים או רשימות, נמרכז גם אותם */
#dynamic-footer ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
}
.qa-widget {
        /* מבטיח שהרוחב יתפרס על כל המקום הפנוי */
        width: 100%; 
        /* גורם ל-padding לא להוסיף על הרוחב הכולל */
        box-sizing: border-box; 
        
        padding: 25px;
        margin: 0 0 25px 0;
        border-radius: 12px;
        background-color: #f0f9ff; /* card-blue */
        border-right: 6px solid #054c78;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        display: flow-root; 
        line-height: 1.8;
        text-align: right;
        direction: rtl;
        font-family: inherit;
    }

    /* תיקון למובייל - לוודא שלא "בורח" מהצדדים */
    @media (max-width: 900px) {
        .qa-widget {
            width: 100%;
            padding: 20px;
            margin-bottom: 20px;
        }
    }
/* אין צורך להגדיר את .qa-widget מחדש כי השתמשנו ב-main-card */

    .qa-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 15px;
        border-bottom: 1px solid rgba(5, 76, 120, 0.1);
        padding-bottom: 10px;
    }
    
    .qa-icon {
        background: #054c78;
        color: white;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 5px;
        font-weight: bold;
        flex-shrink: 0; /* מונע מהאייקון להתכווץ */
    }
    
    .qa-header h4 {
        margin: 0 !important; /* ביטול מרווחים של תגיות H */
        color: #054c78;
        font-size: 1.1rem;
        font-weight: 700;
    }
    
    .qa-question {
        font-size: 1.3rem;
        font-weight: 600;
        color: #333;
        margin-bottom: 15px;
        line-height: 1.4;
    }
    
    .qa-answer-hidden {
        display: none;
        border-top: 1px dashed rgba(5, 76, 120, 0.2);
        padding-top: 15px;
        margin-top: 15px;
    }
    
    .qa-answer {
        color: #444;
        line-height: 1.8;
        margin-bottom: 10px;
    }
    
    .qa-more-link {
        display: inline-block;
        color: #054c78;
        text-decoration: none;
        font-weight: 600;
        font-size: 0.9rem;
    }
    
    .qa-more-link:hover { text-decoration: underline; }
    
    #qa-toggle-btn {
        background: #054c78;
        color: white;
        border: none;
        padding: 8px 22px;
        border-radius: 20px;
        cursor: pointer;
        font-size: 0.9rem;
        font-family: inherit;
        transition: background 0.3s;
    }
    
    #qa-toggle-btn:hover { background: #0866a1; }


    /* עיצוב מיכל התגובות שייראה כמו כרטיס באתר */
    .disqus-card-wrapper {
        background-color: #ffffff; /* רקע לבן */
        padding: 30px; /* ריווח פנימי נדיב */
        margin-top: 40px; /* רווח מהתוכן שמעליו */
        margin-bottom: 25px; /* רווח מהאלמנט שמתחתיו */
        border-radius: 12px; /* פינות מעוגלות */
        border: 1px solid #e0e8f0; /* גבול עדין */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); /* צל עדין */
        
        /* הקו הימני העבה המאפיין את antro.co.il */
        border-right: 6px solid #054c78; /* צבע כחול ראשי */
        
        /* מבטיח כיוון עברית ויישור לימין */
        direction: rtl; 
        text-align: right;
        
        /* תיקון לפריצה במובייל */
        box-sizing: border-box;
        width: 100%;
    }

    /* עיצוב הכותרת מעל התגובות */
    .disqus-card-wrapper h3.comments-title {
        font-family: 'Alef', Arial, sans-serif; /* גופן האתר */
        color: #054c78; /* צבע כחול ראשי */
        margin-top: 0;
        margin-bottom: 20px;
        font-size: 1.4rem;
        font-weight: 700;
        border-bottom: 2px solid #d1e6f3; /* קו תחתי עדין */
        padding-bottom: 10px;
    }

    /* התאמות למובייל */
    @media (max-width: 900px) {
        .disqus-card-wrapper {
            padding: 20px;
            margin-top: 30px;
        }
        
        .disqus-card-wrapper h3.comments-title {
            text-align: center; /* מרכוז כותרת במובייל */
        }
    }


    /* עיצוב רספונסיבי מודרני ללא div כפולים */
    .container_video {
        position: relative;
        width: 100%;
        max-width: 560px; /* רוחב מקסימלי לסרטון */
        aspect-ratio: 16 / 9; /* שומר על יחס וידאו תקין 16:9 */
        margin-bottom: 25px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        background-color: #000; /* צבע רקע שחור בזמן טעינה */
    }
    .container_video iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }


