/* עיצוב בלוק Post Hero Banner */

/* סגנונות בסיסיים לבלוק */
.post-hero-banner {
    position: relative;
    width: 100vw;
    margin-right: calc(-50vw + 50%);
    margin-left: calc(-50vw + 50%);
    margin-top: 0;
    margin-bottom: 0;
    overflow: visible; /* שינוי מ-hidden ל-visible כדי לאפשר גלישת כותרת */
    padding-bottom: 50px; /* רווח לגלישת כותרת למטה */
}

/* בעורך - שמור על רוחב רגיל */
.post-hero-banner-editor {
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

/* Wrapper for the banner */
.post-hero-banner-wrapper {
    position: relative;
    width: 100%;
}

/* תמונת רקע - יחס 19:6 */
.post-hero-banner-image-wrapper {
    position: relative;
    width: 100%;
    overflow: visible; /* שינוי מ-hidden ל-visible - מאפשר לכותרת לגלוש */
    background: #f0f0f0;
}

.post-hero-banner-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Placeholder כשאין תמונה */
.post-hero-banner-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-hero-banner-placeholder .placeholder-message {
    color: white;
    font-size: 18px;
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

/* מיכל התוכן - ממורכז עם רוחב קבוע */
.post-hero-banner-content {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    z-index: 10;
    pointer-events: none;
}

.post-hero-banner-inner {
    background: #f9f9f9; /* התאמה מדויקת לרקע העמוד */
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: none; /* ללא צל כדי להתמזג עם הרקע */
    max-height: none; /* מאפשר גובה חופשי */
    overflow: visible; /* מאפשר גלישת תוכן */
}

/* תגית קטגוריה */
.post-hero-banner-category {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #1a1a1a;
    border-radius: 20px;
    background: transparent;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 12px;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

/* כותרת ראשית */
.post-hero-banner-title {
    margin: 0 0 15px 0;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    color: #1a1a1a; /* טקסט כהה על רקע לבן */
    letter-spacing: -0.5px;
}

/* כותרת משנה */
.post-hero-banner-subtitle {
    margin: 0;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    color: #555; /* אפור כהה על רקע לבן */
}

/* עיצובים למסכים קטנים */
@media (max-width: 1024px) {
    .post-hero-banner-content {
        max-width: 90%;
        width: calc(100% - 40px);
    }
    
    .post-hero-banner-inner {
        padding: 25px 30px;
    }
    
    .post-hero-banner-title {
        font-size: 36px;
    }
    
    .post-hero-banner-subtitle {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .post-hero-banner-content {
        top: 65%;
        max-width: 95%;
        width: calc(100% - 20px);
    }
    
    .post-hero-banner-inner {
        padding: 20px;
    }
    
    .post-hero-banner-title {
        font-size: 28px;
    }
    
    .post-hero-banner-subtitle {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .post-hero-banner-title {
        font-size: 24px;
    }
    
    .post-hero-banner-subtitle {
        font-size: 14px;
    }
    
    .post-hero-banner-inner {
        padding: 15px;
    }
}

/* תמיכה ב-align wide ו-full */
.post-hero-banner.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.post-hero-banner.alignfull {
    max-width: 100%;
    width: 100%;
}

/* עיצובים לעורך גוטנברג */
.post-hero-banner-editor .post-hero-banner-title[contenteditable="true"]:empty:before {
    content: attr(aria-placeholder);
    opacity: 0.62;
    pointer-events: none;
}

.post-hero-banner-editor .post-hero-banner-subtitle[contenteditable="true"]:empty:before {
    content: attr(aria-placeholder);
    opacity: 0.62;
    pointer-events: none;
}

.post-hero-banner-editor .post-hero-banner-inner {
    pointer-events: all;
}

/* הודעת placeholder בעורך */
.post-hero-banner-placeholder-message {
    padding: 20px;
    background: #f8f8f8;
    border: 2px dashed #ddd;
    text-align: center;
    color: #666;
    margin: 20px 0;
    border-radius: 4px;
}

/* ================================
   שיפורים לתצוגה המקדימה בעורך
   ================================ */

/* וידוא שהתוכן נראה בעורך בסגנון Hero */
.post-hero-banner-editor.banner-style-hero {
    position: relative !important;
    overflow: visible !important;
    min-height: 300px;
}

.post-hero-banner-editor.banner-style-hero .post-hero-banner-wrapper {
    position: relative !important;
    overflow: visible !important;
    width: 100% !important;
}

/* תיקון: הסרת overflow hidden מה-image-wrapper כדי שהתוכן יוכל לצאת החוצה */
.post-hero-banner-editor.banner-style-hero .post-hero-banner-image-wrapper {
    overflow: visible !important;
    position: relative !important;
}

/* אבל השארת התמונה עצמה בתוך הגבולות */
.post-hero-banner-editor.banner-style-hero .post-hero-banner-image-wrapper .post-hero-banner-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.post-hero-banner-editor.banner-style-hero .post-hero-banner-content {
    position: absolute !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    display: block !important;
    z-index: 100 !important; /* הגדלת z-index כדי לוודא שהתוכן מעל */
}

/* וידוא שה-inner content נראה */
.post-hero-banner-editor.banner-style-hero .post-hero-banner-inner {
    visibility: visible !important;
    opacity: 1 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    display: block !important;
}

/* וידוא שגוטנברג לא חותך את התוכן */
.block-editor-block-list__layout .wp-block-ttfchild-post-hero-banner {
    overflow: visible !important;
}

.block-editor-block-list__block .wp-block-ttfchild-post-hero-banner {
    overflow: visible !important;
}

/* למנוע חיתוך מכל אלמנט הורה אפשרי בעורך */
.wp-block-ttfchild-post-hero-banner,
.wp-block-ttfchild-post-hero-banner > *,
.post-hero-banner-editor,
.post-hero-banner-editor > * {
    overflow: visible !important;
    clip: unset !important;
    clip-path: none !important;
}

/* התאמות למסכים שונים בעורך */
@media (min-width: 1025px) {
    .post-hero-banner-editor.banner-style-hero .post-hero-banner-content {
        top: calc(100% - min(12.63vw, 170px)) !important;
    }
}

@media (min-width: 1400px) {
    .post-hero-banner-editor.banner-style-hero .post-hero-banner-content {
        top: calc(100% - 170px) !important;
    }
}

@media (max-width: 768px) {
    .post-hero-banner-editor.banner-style-hero .post-hero-banner-content {
        top: calc(100% - 10vw) !important;
        max-width: 90% !important;
        width: calc(100% - 30px) !important;
    }
}

@media (max-width: 480px) {
    .post-hero-banner-editor.banner-style-hero .post-hero-banner-content {
        top: calc(100% - 8vw) !important;
        max-width: 95% !important;
        width: calc(100% - 20px) !important;
    }
}
