/* public/assets/css/common.css */

/* =========================================
   1. הגדרות גלובליות (Base)
   ========================================= */
html, body {
    width: 100%; 
    max-width: 100%; 
    overflow-x: hidden !important; 
    margin: 0; 
    padding: 0; 
    font-family: var(--font-main, 'Rubik', sans-serif);
    scroll-behavior: smooth; 
    color: var(--dark-color, #444); 
    /* Direction now comes from the dir attribute that the templates put on
       <html>, derived from the site's language. text-align:start resolves to
       right under rtl and left under ltr, so one rule covers both.
       The :not([dir]) rule below keeps any page that somehow renders without
       the attribute behaving exactly as it did before. */
    text-align: start; 
}

html:not([dir]),
html:not([dir]) body {
    direction: rtl;
    text-align: right;
}

/* לוגו בהדר – במצב עריכה לחיצה פותחת החלפת לוגו (תבנית Modern וכו') */
a.navbar-logo-link-editable {
    cursor: pointer;
    pointer-events: auto !important;
}
a.navbar-logo-link-editable img {
    pointer-events: auto !important;
}

/* =========================================
   2. טיפוגרפיה (Typography)
   ========================================= */
h1, h2, h3, h4, h5 {
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

/* =========================================
   3. טפסים וקלט (Forms)
   ========================================= */
input, textarea, select, .form-control {
    text-align: start;
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    border-radius: 12px !important;
    background: #ffffff;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02) inset;
}

/* RTL is the default above, but it is only a DEFAULT: it must not be !important,
   or it silently overrides the inline "direction: ltr" that fields holding code,
   URLs, domains and phone numbers set on themselves. That is what made the
   global HEAD/BODY code boxes render Google tags backwards.
   dir="ltr" is additionally honoured with !important so an explicit opt-in in
   the markup always wins, whatever a later stylesheet does. */
input[dir="ltr"], textarea[dir="ltr"], select[dir="ltr"], .form-control[dir="ltr"] {
    direction: ltr !important;
    text-align: left !important;
}

input:focus, textarea:focus, select:focus, .form-control:focus {
    background: #fff;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color, #3b82f6), transparent 80%) !important;
    outline: none;
}

::placeholder {
    text-align: start !important;
    opacity: 0.6;
}

/* =========================================
   4. כפתורים (Buttons)
   ========================================= */
.btn-primary { 
    background: var(--primary-color, #3b82f6) !important; 
    border: none !important;
    color: white !important;
    padding: 12px 35px !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
    letter-spacing: 0.5px;
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary:hover { 
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    filter: brightness(1.1);
}

/* =========================================
   5. כרטיסים ורקעים (Cards & Backgrounds)
   ========================================= */
.card, .p-4.bg-white, .accordion-item {
    border: 1px solid rgba(0,0,0,0.05) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03) !important;
    transition: all 0.3s ease !important;
}

.card:hover, .p-4.bg-white:hover {
    transform: translateY(-5px) !important;
    border-color: var(--primary-color, #3b82f6) !important;
    box-shadow: 0 15px 30px -10px rgba(0,0,0,0.1) !important;
}

.bg-light-custom { 
    background-color: #f8f9fa !important;
    background-image: radial-gradient(#cbd5e0 1.5px, transparent 1.5px) !important;
    background-size: 24px 24px !important;
}

.bg-dark-custom { 
    background: #111 !important; 
    background: radial-gradient(circle at center, #222 0%, #000 100%) !important;
    color: white !important; 
}
.bg-dark-custom h2, .bg-dark-custom p, .bg-dark-custom i { color: white !important; }


/* --- הוסף את זה בסוף הקובץ public/assets/css/common.css --- */

/* =========================================
   6. Hero Section (עיצוב בסיסי לכולם)
   ========================================= */
.hero-section, .video-hero-section {
    position: relative;
    padding: 180px 0 100px 0;
    text-align: center;
    background-size: cover;
    background-position: center;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* מסכה כהה על הרקע כדי שהטקסט יבלוט */
.hero-section::before, .video-hero-section::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%);
    z-index: 1; pointer-events: none;
}

.hero-section .container, .video-hero-section .container {
    position: relative; z-index: 1;
}

.hero-section .hero-center-content {
    position: relative;
    z-index: 2;
}

.hero-section h1, .video-hero-section h1 {
    color: #ffffff !important;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    font-weight: 800;
    margin-bottom: 25px;
}

.hero-section p, .video-hero-section p {
    color: rgba(255,255,255,0.9) !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    font-size: 1.25rem;
}

/* =========================================
   7. כפתורים צפים (WhatsApp + נגישות)
   ========================================= */
.access-widget-btn, .whatsapp-float {
    position: fixed; 
    bottom: 30px; 
    width: 50px; height: 50px; 
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2); 
    cursor: pointer; 
    transition: transform 0.2s; 
    border: 3px solid white;
    z-index: var(--z-max); /* משתמש במשתנה שהגדרנו */
}

.access-widget-btn { 
    left: 20px; 
    background: #0056b3; 
    color: white; 
    font-size: 24px; 
}

.whatsapp-float { 
    right: 20px; 
    background: #25d366; 
    color: white; 
    font-size: 28px; 
    text-decoration: none; 
}

.access-widget-btn:hover, .whatsapp-float:hover { 
    transform: scale(1.1); 
}

/* התאמה למובייל - הרמה מעל הסרגל התחתון */
@media (max-width: 992px) {
    .access-widget-btn, .whatsapp-float { bottom: 90px !important; }
}

/* תפריט הנגישות עצמו */
.access-menu {
    position: fixed; bottom: 100px; left: 20px; 
    width: 300px; max-width: 90vw;
    background: #ffffff; border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); 
    border: 1px solid rgba(0,0,0,0.1);
    display: none; flex-direction: column; overflow: hidden;
    z-index: var(--z-modal);
}
.access-menu.open { display: flex; }

/* =========================================
   Text+Video section: prevent RTL text overflow (wrap instead of cut off)
   ========================================= */
.content-fix {
    min-width: 0 !important;
    max-width: 100%;
}
.content-fix .lead,
.content-fix [data-field="text"] {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

/* Mobile: force text column to full width and wrap (fix RTL cutoff) */
@media (max-width: 991px) {
    .content-fix {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding-left: var(--bs-gutter-x, 12px) !important;
        padding-right: var(--bs-gutter-x, 12px) !important;
    }
    .content-fix .lead,
    .content-fix [data-field="text"],
    .content-fix .lead p,
    .content-fix [data-field="text"] p {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }
    .section-wrapper .container .row {
        min-width: 0 !important;
    }
}

/* Text+Video section: mobile – row inside container, no overflow (RTL wrap fix) */
@media (max-width: 991px) {
    .section-text-video {
        overflow-x: hidden !important;
    }
    .section-text-video .container {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    .section-text-video .text-video-row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }
    .section-text-video .content-fix {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .section-text-video .text-video-body,
    .section-text-video .text-video-body p {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
    }
}

.access-header { background: #f8f9fa; padding: 15px; font-weight: bold; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.access-body { padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 400px; overflow-y: auto; }
.access-footer { padding: 10px; background: #f8f9fa; border-top: 1px solid #eee; }

/* פריטי תפריט הנגישות */
.access-item { 
    background: #fff; border: 1px solid #eee; border-radius: 8px; 
    padding: 10px; text-align: center; cursor: pointer; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; height: 80px; 
}
.access-item:hover { border-color: var(--primary-color, #3b82f6); color: var(--primary-color, #3b82f6); }
.access-item.active { background: var(--primary-color, #3b82f6); color: white; }

.skip-link {
    position: absolute;
    top: -100px; /* מסיט את האלמנט מחוץ למסך */
    right: 10px;
    background: #000;
    color: #fff !important;
    padding: 10px 20px;
    z-index: 100000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0; /* מציג אותו רק כשלוחצים Tab והוא מקבל פוקוס */
}

/* --- תיקון רספונסיביות ל-Hero --- */
@media (max-width: 768px) {
   
}

/* --- לוגו: הגדלה ויזואלית (ללא שינוי זרימה) --- */
.logo-boost {
    transform: scale(1.2);
}

/* --- Prevent unbroken strings (like URLs) from breaking layouts --- */
.text-break {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}
[contenteditable="true"] {
    overflow-wrap: break-word;
}

/* =========================================
   Site search overlay (full-screen)
   ========================================= */
.search-overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-overlay-container.active {
    display: block !important;
    opacity: 1;
}

.search-close-btn {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 40px;
    height: 40px;
    z-index: 100001;
    cursor: pointer;
    background-size: 1.5em;
    opacity: 0.8;
}

.search-close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    transition: 0.2s;
}

.search-massive-input {
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 0 !important;
    color: white !important;
    font-size: 2.5rem !important;
    padding: 15px 0 !important;
    box-shadow: none !important;
    text-align: center !important;
}

.search-massive-input:focus {
    border-bottom-color: var(--primary-color, #3b82f6) !important;
}

.search-massive-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

@media (max-width: 991.98px) {
    .nav-item-search {
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }
}

.search-nav-trigger {
    border: none !important;
    font-weight: 600;
}

.search-nav-trigger:hover,
.search-nav-trigger:focus-visible {
    color: var(--primary-color, #3b82f6) !important;
}

.search-nav-trigger:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary-color, #3b82f6), transparent 50%);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Marketing Popup (Centered, Squarish, Non-blocking) */
.marketing-popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 420px;
    max-width: 90vw;
    min-height: 420px; /* Makes it squarish */
    background: #ffffff;
    z-index: 999999;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}
.marketing-popup-container.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}
.popup-close-btn {
    position: absolute;
    top: 15px;
    right: 15px; /* Right side in RTL */
    z-index: 10;
    background-color: rgba(255,255,255,0.9);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
}
.popup-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}