/* ==========================================================================
   1. General & Typographic Styles
   ========================================================================== */

   /* --- Make ALL elements non-selectable --- */
* {
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE/Edge */
    user-select: none;         /* Standard */
}

/* --- Base Font and Direction --- */
body, h1, h2, h3, h4, h5 {
    font-family: "Noto Sans Hebrew", sans-serif;
    direction: rtl;
}

body {
    font-size: 16px;
    height: 100%;
    margin: 0; /* Remove default body margin */
}

/* --- Rounded Menu Buttons --- */
.w3-bar-block .w3-button {
    border-radius: 8px;
    margin: 2px 0;
}

.w3-bar-block {
    font-size: medium;
}

/* --- Section Dividers --- */
.section-divider {
    background-color: black;
    width: 50px;
    border: 5px solid black;
}

.w3-text-grey {
    padding-top: 2em;
}

.w3-medium {
    color: gray;
}
.coverintro{
    max-width: 92%;
    margin: auto;
    padding-left: 5%;
}
/* ==========================================================================
   2. Layout Styles
   ========================================================================== */

/* --- Main Content Area --- */
#main-content {
    margin-right: 270px;
    margin-left: 20px;
}

/* --- Right Sidebar for Desktop --- */
#mySidebar {
   right: 0;
    left: auto;
    width: 250px;
    z-index: 3;
    font-weight: bold;
    text-align: right;

    /* --- ADD THESE LINES INSTEAD --- */
    background-color:transparent !important; /* 50% transparent white */
   /* backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);  For Safari compatibility */
}

#sidelogo {
    width: 180px;
    height: auto;
    display: flex;
    justify-content: center;
    margin: 1em 0 1em 1em;

}

/* --- Sidebar Submenus --- */
#mySidebar .sidebar-submenu {
    padding-right: 32px !important;
    font-size: 0.9em;
    font-weight: normal;
    text-align: right;
}
.submenu-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    text-align: right;

}
.submenu-container.visible {
    max-height: 500px; /* A large enough value to show all links */
}
/* Highlight style for the active submenu link */
.sidebar-submenu.active-link {
    color: grey !important; /* !important overrides the default and hover colors */
} 
.subbutton {
    font-size: small;
    font-weight: 400;
    transition: color 0.3s ease-in-out, font-weight 0.3s ease-in-out;
}
.subbutton:hover {
    background-color: #ffffff00 !important; 
    color: black !important;
    font-weight: 600;
}
/* ==========================================================================
   3. Component Styles (Galleries, Video, etc.)
   ========================================================================== */

/* --- Image Placeholder for Lazy Loading --- */
.image-placeholder {
    position: relative;
    display: block;
    width: 100%;
    /* No fixed aspect-ratio here! It will be set by JS. */
    margin-bottom: 0.8em;
}
.image-placeholder img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* object-fit: cover is fine, as the container will have the correct ratio */
    object-fit: cover; 
}

/* --- Gallery Image & Column Adjustments --- */
.w3-row-padding > .w3-half,
.w3-row-padding > .w3-third,
.w3-row-padding > .w3-col {
    padding: 0 8px; 
}

.w3-col img, .w3-half img {
    margin-bottom: 0.4em;
    margin-top: 0.4em;
    opacity: 1;
    cursor: pointer;
}

.gallery-description {
    padding: 0 8px 15px 8px;
    margin: -5px 0 10px 0;
    font-size: 0.9em;
    color: #555;
    line-height: 1.6;
}

/* --- Responsive Video Embed Container --- */
.embed-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    margin: 16px 0;
}
.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
   4. Modal (Lightbox) Styles
   ========================================================================== */

/* --- General Image Modal Background & Centering --- */
#modal01 {
    display: none;
    padding-top: 0 !important;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* --- Modal Content (Image) --- */
#modal01 .w3-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    margin: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    background-color: transparent;
}

/* --- Modal Caption --- */
#caption01 {
    text-align: center;
    color: #444;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    max-width: 80vw;
    box-sizing: border-box;
    font-size: 16px;
    margin-top: 5px;
}

/* --- Modal Close Button --- */
.modal-close-button {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #333;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10;
}
.modal-close-button:hover {
    color: #000;
}

/* --- Workshop Form Modal Specifics --- */
#workshopFormModal .w3-modal-content {
    border-radius: 12px;
    overflow: hidden;
}
#workshopFormModal .w3-button.w3-display-topleft {
    right: auto; /* Reset right position */
    left: 0;    /* Position to the left */
    padding: 8px 16px;
    margin: 4px;
    border-radius: 8px;
    color: white; /* Make the X visible on amber background */
    font-size: 24px;
}
#workshopFormModal .w3-button.w3-display-topleft:hover {
    background-color: rgba(0,0,0,0.2) !important;
}


/* ==========================================================================
   5. Mobile Navigation Styles
   ========================================================================== */

/* --- Mobile Top Header Bar --- */
#mobile-header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #222;
    z-index: 102; /* Above gallery nav */
    display: flex;
    justify-content: flex-start; /* Align logo to the left */
    align-items: center;
    padding: 0 15px;
    height: 50px;
    opacity: 1;
}


.mobile-logo-container img {
    height: 20px;
    display: block;
    margin-left: 15px;
}
.content-card img{
    max-height: 200px;  
    max-width: 400px;

}
/* --- Mobile Gallery Dropdown Menu (in header) --- */
#gallery-nav-container {
    position: fixed;
    top: 50px; /* Position it right below the main header */
    width: 100%;
    background-color: #3a3a3a; /* A slightly different shade */
    z-index: 101; /* Below header, above dropdown panel */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    border-bottom: 1px solid #4f4f4f;
    cursor: pointer; /* Shows hand icon on hover */
    transition: background-color 0.3s ease; /* Smooth hover effect */
}

#gallery-nav-container:hover {
    background-color: #444; 
}

#current-gallery-title {
    color: #fff;
    font-size: 1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    direction: rtl;
    cursor: default; /* No longer a direct button */
    font-weight: bold;
    pointer-events: none; /* Ensures the click passes through to the container */

}

/* New style for the description */
#gallery-nav-container::before {
    content: "לחצו לפתיחה:";
    color: #a0a0a0;
    pointer-events: none; /* Ensures the click passes through to the container */

}

#gallery-toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    padding: 0 8px;
    transition: transform 0.3s ease;
    pointer-events: none; /* Ensures the click passes through to the container */
}
#gallery-toggle-btn.is-open {
    transform: rotate(180deg);
    pointer-events: none; /* Ensures the click passes through to the container */

}

#gallery-links-panel {
    position: fixed;
    top: 80px; /* Position it below the new gallery nav bar (50px header + 45px nav) */
    left: 0;
    right: 0;
    background-color: #333;
    max-height: 0;
    overflow-y: auto;
    transition: max-height 0.3s ease-in-out;
    visibility: hidden; /* Use visibility to prevent interaction when closed */
    z-index: 100; /* Below the gallery nav bar */
}

#gallery-links-panel.is-open {
    max-height: 250px;
    visibility: visible;
}
#gallery-links-panel a {
    display: block;
    color: white;
    padding: 12px 20px;
    text-decoration: none;
    text-align: center;
    font-size: 1em;
    border-bottom: 1px solid #444;
}
#gallery-links-panel a:last-child {
    border-bottom: none;
}
#gallery-links-panel a:hover {
    background-color: #555;
}


/* Add these new rules to make the scrollbar always visible and styled */
#gallery-links-panel::-webkit-scrollbar {
    width: 8px; /* Set the width of the scrollbar */
}

#gallery-links-panel::-webkit-scrollbar-track {
    background: #444; /* Set the background of the track */
}

#gallery-links-panel::-webkit-scrollbar-thumb {
    background-color: #888; /* The color of the scroll handle */
    border-radius: 4px; /* Rounds the corners of the handle */
}
/* --- Mobile Full-Screen Hamburger Menu --- */
.mobile-menu-container {
    /* No special rules needed, flexbox order will handle it */
    position: absolute;
    right: 15px; /* Position it on the right edge */
    top: 50%;
    transform: translateY(-50%);
}

#hamburger-btna {

    font-size: 0.9em;
    font-weight: 700;
    color: gray;
    text-align: left;
    padding-top:5px;
}

#hamburger-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

#mobile-menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 20, 20, 0.95);
    z-index: 102;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
}
#mobile-menu-panel.is-open {
    transform: translateX(0);
}
#mobile-menu-panel .menu-link {
    color: white;
    padding: 20px;
    text-decoration: none;
    font-size: 1.8em;
    text-align: center;
    width: 100%;
}
#mobile-menu-panel .menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
#mobile-menu-panel hr {
    width: 50%;
    max-width: 200px;
    border-color: #555;
}
#close-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 45px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
#menu-overlay {
    display: none !important;
}

/* ==========================================================================
   6. Contact Form Styles
   ========================================================================== */
.contact-form {
    padding: 24px;
    background-color: #fdfdfd;
    border: 1px solid #eee;
    margin-top: 16px;
    margin-bottom: 32px;
}

.contact-form label {
    font-size: 1em;
    font-weight: 500;
    color: #555;
    display: block;
    margin-bottom: 8px;
}

.contact-form .w3-input, .contact-form .w3-select, .contact-form textarea {
    transition: all 0.2s ease-in-out;
    background-color: #fff;
}
.contact-form .w3-input:focus, .contact-form .w3-select:focus, .contact-form textarea:focus {
    border-color: #ffc107 !important; /* amber */
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
    outline: none;
}
.contact-form ::placeholder {
    color: #a0a0a0;
    opacity: 1;
}

#floating-contact-btn {
    position: fixed;
    bottom: 30px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 10px 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
    font-weight: bold;
    color: black !important;
    /*
     * To center the GROUP, we find the total width of the group,
     * and shift the starting point to the left by half of that total width.
     * This is the starting position for the first button.
     */
    left: calc(50% - (var(--contact-btn-width) + var(--button-gap) + var(--whatsapp-btn-width)) / 2);
    color: black !important; 
    /* The left property is removed to allow the flex container to position it */
}

#floating-contact-btn:hover {
    background-color: #ffc107 !important;
    color: black !important;
    /* The transform should only affect the hover animation, not the base position */
    transform: translateY(-3px);
}

#whatsapp-float {
    position: fixed;
    bottom: 30px;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center; /* Center the icon inside */
    width: var(--whatsapp-btn-width);
    height: var(--whatsapp-btn-width);
    /*
     * The second button is positioned at the same starting point as the first,
     * plus the width of the first button, plus the gap.
     */
    left: calc(50% - (var(--contact-btn-width) + var(--button-gap) + var(--whatsapp-btn-width)) / 2 + var(--contact-btn-width) + var(--button-gap));
    width: 42px;
    height: 42px;
    /* The left property is removed to allow the flex container to position it */
    background-color: #20b858;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#whatsapp-float img {
    width: 24px;
    height: 24px;
}

#whatsapp-float:hover {
    background-color: #059546;
    transform: translateY(-2px);
}

@media (min-width: 993px) {
    #floating-contact-btn {
        left: auto; /* Unset the centering 'left' property */
        right: 30px; /* Position 50px from the right edge */
        bottom:100px;
        background-color: white;

    }

    #whatsapp-float {
        left: auto; /* Unset the centering 'left' property */
        /* Position from the right: 50px base + Contact button width + gap */
        right: calc(50px + var(--contact-btn-width) + var(--button-gap));
        bottom: 100px;
    }
     .coverintro {padding-top: 50px;}
    .paddingintro {margin-top: 50px;}
}


/* ==========================================================================
   7. Media Queries for Mobile Responsiveness
   ========================================================================== */

@media (max-width: 992px) {
    /* Adjust main content to clear fixed header and remove desktop sidebar margin */
    #main-content {
        margin-top: 90px; /* Space for 50px header + 45px gallery nav */
        margin-right: 0;
        margin-left: 0;
    }

    /* Push modal close button below the fixed mobile header */
    .modal-close-button {
        top: 60px;
    }

}



/* ==========================================================================
   8. Page Transitions
   ========================================================================== */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background-color: #f1f1f1;
    z-index: 9999;
    transition: left 0.5s cubic-bezier(0.86, 0, 0.07, 1);
}

.page-transition-overlay.is-active {
    left: 0;
}

/* ==========================================================================
   9. Two-Column Cards
   ========================================================================== */

.card {
    background-color: #ffffff;
    border-radius: 16px; /* Nicer, rounder corners */
    box-shadow: 0 5px 20px rgba(0,0,0,0.07); /* Softer drop shadow */
    overflow: hidden; /* Ensures the image corners are clipped */
    margin-bottom: 16px; /* Space between cards when they stack on mobile */
    cursor: pointer; /* Indicate it's clickable */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card-cover-image {
    width: 100%;
    height: auto;
    object-fit: cover; /* Prevents image distortion */
    margin: 0; 
    padding: 0; 
    border-radius: 16px; 
}

.card-content {
    padding: 16px 24px 24px 24px;
    text-align: right;
}

.card-content h3 {
    margin-top: 0;
    font-size: 1.4em;
}

.card-content p {
    font-size: 1em;
    line-height: 1.7;
    color: #444;
}

@media (max-width: 600px) {
    .card-content {
        padding: 16px;
    }
    .card-content h3 {
        font-size: 1.2em;
    }
    .card-content p {
        font-size: 0.95em;
    }
}

/* wave animaiton

 /* Basic CSS reset and styles for the background */
        body, html {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
        }
        /* Style for the canvas to ensure it fills the entire screen */
        #wave-canvas {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1; /* Ensure the canvas is behind other content */
        }


        /* expand div */

.form-expander-toggle {
    width: 100%;
    text-align: right !important;
    position: relative;
    font-weight: bold;
    color: #555;
    margin-top: 16px;
    background-color: #f1f1f1 !important;
}


.form-expander-toggle .arrow {
    float: left;
    transition: transform 0.3s ease;
}

.form-expander-toggle.is-open .arrow {
    transform: rotate(180deg);
}

/* This is the collapsed (default) state */
.form-expander-content {
    max-height: 0;
    overflow: hidden;
    /* Explicitly set all vertical spacing to 0 */
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-top: none;
    /* Define the transition */
    transition: max-height 0.4s ease-out, padding-top 0.4s ease-out, padding-bottom 0.4s ease-out, margin-top 0.4s ease-out;
}

/* This is the expanded state */
.form-expander-content.is-open {
    max-height: 1000px; /* A large enough value to show the content */
    /* Restore the padding that w3-padding used to provide */
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 16px;
    padding-right: 16px;
    /* Add a small margin to separate it from the button */
    margin-top: 8px;
}

/* Define a variable for the gap for easy adjustment */
:root {
    --button-gap: 5px; /* You can change this value to adjust the gap */
    --contact-btn-width: 145px; /* Approximate width of the contact button */
    --whatsapp-btn-width: 42px;
}
