/*
 Theme Name:  Blocksy Child
 Template:    blocksy
 Description: Child theme for Blocksy customizations.
 Version:     1.0.0
*/

/* Optional: your custom CSS here. */

:root {
    --our-background: #166c49;
    --our-foreground: #ffffff;
    --highlight-yellow: #FFFF00;
    --highlight-other: #05FFFF;
    --highlight-green: #00FF00;
    --serif-english: 'EB Garamond', serif;
    --serif-hebrew: 'David Libre', 'Times New Roman', serif;
    --sans-english: Montserrat, Arial, Helvetica, sans-serif;
    --sans-hebrew: "Noto Sans Hebrew", Arial, Helvetica, sans-serif;
    --site-title-family: Inter, Arial, sans-serif;
    --logo-image-dim: 0;
    --logo-text-width: 270px;
    --logo-width: calc(var(--logo-image-dim) + var(--logo-text-width));
    --logo-height: 140px;
    --logo-pad: calc(var(--logo-width) + 30px);
    --logo-background: var(--our-background);
    --logo-color: var(--our-foreground);
 }

/*
 *================================================
 * Fighting sticky header layout shifts!
 *================================================
 */
html {
    overflow-y: scroll !important;
}

.ct-sticky-container {
    height: 72px !important;
}

/*
 *========================
 * Overall Fonts
 *========================
 */
:lang(he-IL), .lang-he, .lang-he-il {
    font-family: var(--sans-hebrew);
}
.lang-he h1, .lang-he h2, .lang-he h3, .lang-he h4 {
    font-family: var(--sans-hebrew);
}
:lang(en-US),
html.lang-en,
html.lang-en-gb {
    font-family: var(--sans-english) !important;
}
.lang-en h1, .lang-en h2, .lang-en h3, .lang-en h4 {
    font-family: var(--sans-english);
    font-size: 0.9rem; /* Adjust this number as needed */
}

/*
 *========================  
 * Main menu override
 *========================
 */
:lang(he-IL) [data-header*="type-1"] .ct-header [data-id="menu"] > ul > li > a {
    font-family: var(--sans-hebrew);
}

:lang(en-US) [data-header*="type-1"] .ct-header [data-id="menu"] > ul > li > a,
html.lang-en [data-header*="type-1"] .ct-header [data-id="menu"] > ul > li > a,
html.lang-en-gb [data-header*="type-1"] .ct-header [data-id="menu"] > ul > li > a {
    font-family: var(--sans-english);
}

/*
 *=========================
 * Site Title font override
 *=========================
 */
.site-title, 
.site-title a {
    font-family: var(--site-title-family) !important;
}

/* Might be needed for sticky header */
.ct-site-text-logo {
    font-family: var(--site-title-family) !important;
}


/*
 * ========================================
 * Protocol search results page font size
 * ========================================
 */
.ct-container .protocol-archive-list li {
    font-size: 12pt;
}

/*
 * ========================================
 * Control of embedded YouTube video
 * ========================================
 */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 60%;
    margin: 0 auto;
}

@media (max-width: 768px) {
  .video-wrapper {
    max-width: 100%;
  }
}

/*
 * ========================================
 * Customize Contact Form 7 (CF7) form
 * ========================================
.wpcf7 label {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
}
 */

.wpcf7-form {
    max-width: 600px;
    margin: 0 auto;
    label span.he {
        font-family: var(--sans-hebrew) !important;
        font-weight: 400;
        color: black;
    }
    label span.en {
        font-family: var(--sans-english) !important;
        font-weight: 400;
        font-size: 90%;
        color: black;
    }
}

.wpcf7 label:not(.wpcf7-form-control-wrap) {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

:lang(he) .wpcf7 label .he { order: 2; }
:lang(he) .wpcf7 label .en { order: 1; }

:lang(en) .wpcf7 label .en { order: 1; }
:lang(en) .wpcf7 label .he { order: 2; }

.wpcf7 label:not(.wpcf7-form-control-wrap) {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0 10px;
    direction: ltr;
}

.wpcf7 label .he,
.wpcf7 label .en {
    flex: 0 0 auto;
}

.wpcf7 label .wpcf7-form-control-wrap {
    flex: 0 0 100%;
}

.wpcf7 label br {
    display: none;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
    border-color: #555555;
}

.wpcf7 input[type="email"] {
    direction: ltr;
    text-align: left;
}


:lang(he) .wpcf7 input[type="text"],
:lang(he) .wpcf7 textarea {
    direction: rtl;
    text-align: right;
}

:lang(en) .wpcf7 input[type="text"],
:lang(en) .wpcf7 textarea {
    direction: ltr;
    text-align: left;
}

.wpcf7 .wpcf7-submit {
    font-family: var(--sans-english) !important;
    font-weight: 600;
}

.contact-intro-table {
    max-width: 600px;
    margin: 0 auto;
    direction: ltr;
}

.contact-intro-table table {
    border-collapse: collapse;
    border: none;
    color: black;
    direction: ltr;

    tr, td, th {
        border: none;
    }

    td {
        width: 50%;
        padding: 10px;
        vertical-align: top;
    }

    td:first-child {
        text-align: left;
        font-family: var(--sans-english) !important;
        font-size: 90%;
    }

    td:last-child {
        text-align: right;
        direction: rtl;
        font-family: var(--sans-hebrew) !important;
    }
}

/*
 * =========================
 * Language Switcher Hacking
 *
 * Using a menu item seems to get the built-in language switcher for the Blocksy
 * theme. That language switcher by default shows the current language with a dropdown
 * for other languages. Here we supress the ".ct-active-language" and use all manner of
 * !important specifiers for the dropdown to make it behave as we want.
 * =========================
 */
.ct-language-switcher .ct-active-language {
    display: none !important;
}

.ct-language-switcher[data-type="dropdown"] > ul {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: auto !important;
}

.ct-language-switcher > ul::before { /* Probably harmless */
    display: none;
}

/* Very specific to beat out theme rule */
.ct-language-switcher[data-type=dropdown] ul > li a[data-label=right] {
    padding: 0 15px;
}

.ct-language-switcher li > a,
.ct-language-switcher li > a .ct-label {
    background-color: white;
    color: black;
}

.ct-language-switcher li > a:hover,
.ct-language-switcher li > a .ct-label:hover {
    background-color: blue;
    color: white;
}


/*
 * ================================
 * Hamburger menu colors
 * ================================
 */
/*
.ct-sticky-container .ct-container .ct-header-trigger .ct-icon:hover {
    box-shadow: 0 0 16px rgba(256, 256, 256, 1.0);
}
*/

.ct-header-trigger {
    position: relative;  /* needed so ::after positions relative to it */
}

.ct-header-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;   /* adjust to taste */
    height: 40px;  /* adjust to taste */
    background-color: white;
    border-radius: 50%;  /* makes it a circle — remove for a square */
    opacity: 0;
    transition: opacity 0.2s ease;  /* smooth fade in */
    z-index: -1;  /* keeps it behind the icon */
}

.ct-header-trigger:hover::after {
    opacity: 1;
}

.ct-header-trigger:hover svg {
    color: green;  /* change icon color on hover */
    fill: green;
}

/*
 * ================================
 * Fix the color of the close
 * button on the off-canvas area.
 * ================================
 */
#offcanvas .ct-toggle-close svg {
    color: #333333;  /* change to your preferred color */
    fill: #333333;
}

/*
 *========================
 * Bilingual Logo
 *========================
 */
.custom-logo-container {
    width: var(--logo-width);
}

.custom-logo-container .logo-en,
.custom-logo-container .logo-he {
    display: none !important;
    width: 100%;
}
html[lang|="en"] .custom-logo-container .logo-en {
    display: block !important;
}
html[lang|="he-IL"] .custom-logo-container .logo-he {
    display: block !important;
}

.logo-cont-he {
    background-color: inherit;
    color: black;
    padding: 10px 10px 10px 10px;
    display: flex;
    flex-direction: column;

    .logo-he-line1 {
        .logo-he-text1 {
            font-family: var(--site-title-family) !important;
            font-size: 18pt;
            font-weight: bold;
            white-space: nowrap; /* Keeps the name on one line */
        }
    }

    .logo-he-line2 {
        display: flex;
        flex-direction: row;
        gap: 1em;
        font-family: var(--site-title-family) !important;
        font-size: 12pt;
        font-weight: bold;
        white-space: nowrap; /* Keeps the name on one line */
    }

    @media (max-width: 768px) {
        .logo-he-line2 {
            display: flex;
            flex-direction: column;
            gap: 0;
            font-family: var(--site-title-family) !important;
            font-size: 10pt;
            font-weight: bold;
            white-space: normal; /* Keeps the name on one line */
        }

    }
}

.logo-cont-en {
    .logo-en-line1 {
        .logo-en-text1 {
            font-family: var(--site-title-family) !important;
            font-size: 16pt;
            font-weight: bold;
            white-space: nowrap; /* Keeps the name on one line */
        }
    }
    .logo-en-line2 {
        display: flex;
        flex-direction: row;
        gap: 1em;
        font-family: var(--site-title-family) !important;
        font-size: 10pt;
        font-weight: bold;
        white-space: nowrap; /* Keeps the name on one line */
    }

    @media (max-width: 768px) {
        .logo-en-line2 {
            display: flex;
            flex-direction: column;
            gap: 0;
            font-family: var(--site-title-family) !important;
            font-size: 9pt;
            font-weight: bold;
            white-space: normal; /* Keeps the name on one line */
        }
    }

}


/*
 * ================================
 * Highlighting
 * ================================
 */
.marked {
    background-color: var(--highlight-other);
}

.marked.marked-yellow {
    background-color: var(--highlight-yellow);
}

.marked.marked-green {
    background-color: var(--highlight-green);
}

mark                     { padding: 0 2px; }
mark.highlight-yellow    { background-color: #ffff00; }
mark.highlight-cyan      { background-color: #00ffff; }
mark.highlight-green     { background-color: #00ff00; }
mark.highlight-magenta   { background-color: #ff00ff; }
mark.highlight-red       { background-color: #ff0000; color: #fff; }
mark.highlight-blue      { background-color: #0000ff; color: #fff; }
mark.highlight-darkblue  { background-color: #00008b; color: #fff; }
mark.highlight-darkcyan  { background-color: #008b8b; }
mark.highlight-darkgreen { background-color: #006400; color: #fff; }
mark.highlight-darkred   { background-color: #8b0000; color: #fff; }
mark.highlight-darkyellow{ background-color: #9b870c; }
mark.highlight-darkgray  { background-color: #a9a9a9; }
mark.highlight-lightgray { background-color: #d3d3d3; }
u           { text-decoration: underline; }

/*
 * ============================
 * Custom Search Box
 * Works on Blocksy Pro 2.1.38
 * ============================
 */
.ct-container {
    .custom-search-box {

        display: flex !important;
        justify-content: center !important;
        align-items: center !important;


        .custom-search-form {
            display: flex;
            align-items: center;
            position: relative;
            flex-direction: row-reverse;

            .custom-search-input {
                transform-origin: center !important;
                transition: width 0.3s ease !important;
            }

            .custom-search-input {
                width: 0;
                padding: 0;
                margin-inline-start: 0;
                opacity: 0;
                border: none;
                outline: none;
                background: transparent;
                transition: width 0.6s ease, opacity 0.6s ease, padding 0.6s ease, margin 0.6s ease;
                overflow: hidden;
                font-size: 14px;
            }

            .custom-search-button {
                background: none;
                border: none;
                cursor: pointer;
                padding: 0;
                display: flex;
                align-items: center;
                justify-content: center;
                color: inherit;
            }
            .custom-search-button:hover {
                opacity: 0.7;
            }
            .custom-search-icon {
                display: block;
                fill: currentColor;
            }

        }
        &.is-open .custom-search-input {
            width: 200px;
            padding: 4px 10px;
            opacity: 1;
            border: 1px solid currentColor;
            margin-inline-start: 12px;
        }
    }
}

/*
 * =================================
 * Grid spacing on top row of header
 * =================================
 */
[data-device="desktop"] [data-row="top"] .ct-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
}

[data-device="desktop"] [data-row="top"] [data-column="start"],
[data-device="desktop"] [data-row="top"] [data-column="middle"],
[data-device="desktop"] [data-row="top"] [data-column="end"] {
    display: contents !important;
}
nav#header-menu-1 {
    align-items: flex-start !important;
}


/*
 * ========================================
 * Control of embedded YouTube video
 * ========================================
 */
.our-video-wrapper {
    text-align: center;
}

.video-wrapper {
    /*
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 0 auto;
    max-width: 400px;
    */
}

@media (max-width: 768px) {
  .video-wrapper {
    max-width: 100%;
  }
}

/*
 * ================================================================
 * Latest Medaon button
 * ================================================================
 */
.ct-header-cta .ct-button {
    background-color: var(--our-background) /* #D92B2B */;
    color: var(--our-foreground);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: none;
    padding: 0.3em 1.8em;
    border-radius: 50px;
    border: none;
    /* box-shadow: 0 4px 18px rgba(217,43,43,0.35); */
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
