/* BASE FONT SIZE - 1rem = 10px */
html {
    font-size: 62.5%;
    /* 62.5% of 16px = 10px */
}

@font-face {
    font-family: 'ArbelHagilda';
    src: url('../assets/fonts/arbelhagildareg.menukad-webfont.woff') format('woff'),
        url('../assets/fonts/arbelhagildareg.menukad-webfont.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'ArbelHagilda';
    src: url('../assets/fonts/arbelhagildamed.menukad-webfont.woff') format('woff'),
        url('../assets/fonts/arbelhagildamed.menukad-webfont.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'ArbelHagilda';
    src: url('../assets/fonts/arbelhagildabold.menukad-webfont.woff') format('woff'),
        url('../assets/fonts/arbelhagildabold.menukad-webfont.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/*GLOBAL DEV*/
#wpadminbar {
    display: none;
}

/*VARS*/
:root {
    --accent-color: #00aeef;
    --text-color: #2b2b2b;
    --primary-surface: rgba(255, 255, 255, 0.85);
    --secondary-surface: rgba(32, 40, 52, 0.8);
    --main-font: 'ArbelHagilda', sans-serif;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
}

body {
    padding-top: 45px;
    /* Height of the menu bar */
}

body,
button,
input,
select,
optgroup,
textarea {
    color: var(--text-color);
    font-family: var(--main-font);
    font-size: 1.6rem;
    /* 16px - readable base font size */
    line-height: 1.5;
}

h1 {
    font-size: 2.4rem;
    /* 22px */
    margin: 0.8rem 0;
    /* 8px */
}

p {
    font-size: 1.6rem;
    margin-top: 0;
    margin-bottom: 0.8rem;
}

/* Mobile Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
}

/* MENU */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0;
}

.main-navigation {
    width: 100%;
    direction: rtl;
}

.menu-wrapper {
    width: 100%;
}

#primary-menu {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

#primary-menu>li {
    position: relative;
    background-color: var(--accent-color);
    transition: all 0.3s ease;
    flex-grow: 0;
}

#primary-menu>li:hover {
    background-color: var(--secondary-surface);
    box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2)
}

#primary-menu>li>a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #fff;
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    font-size: 1.6rem;
    white-space: nowrap;
}

/* Hamburger Icons */
#primary-menu>li>a {
    position: relative;
}

#primary-menu>li>a::before,
#primary-menu>li>a::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
}

/* Middle line using background on the a tag */
#primary-menu>li>a {
    background-image: linear-gradient(#fff, #fff);
    background-size: 18px 2px;
    background-repeat: no-repeat;
    background-position: 25px center;
}

/* English (Left) */
#primary-menu>li:first-child>a {
    padding-left: 55px;
    padding-top: 1.4rem;
}

#primary-menu>li:first-child>a::before {
    left: 25px;
    margin-top: -6px;
}

#primary-menu>li:first-child>a::after {
    left: 25px;
    margin-top: 4px;
}

/* Hebrew (Right) */
#primary-menu>li:last-child>a {
    padding-right: 55px;
    padding-top: 1.4rem;
    background-position: calc(100% - 25px) center;
}

#primary-menu>li:last-child>a::before {
    right: 25px;
    margin-top: -6px;
}

#primary-menu>li:last-child>a::after {
    right: 25px;
    margin-top: 4px;
}

/* X Animation State */
#primary-menu>li.is-open>a {
    background-image: none;
    /* Hide middle line */
}

#primary-menu>li.is-open>a::before {
    margin-top: -1px;
    transform: rotate(45deg);
}

#primary-menu>li.is-open>a::after {
    margin-top: -1px;
    transform: rotate(-45deg);
}

/* Sub-menu (Expanded State) */
#primary-menu .sub-menu {
    display: none;
    position: absolute;
    top: 0;
    height: 100%;
    background-color: var(--secondary-surface);
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    z-index: 10;
}

#primary-menu>li:hover .sub-menu {
    display: flex;
}

/* English Sub-menu expands to the right */
#primary-menu>li:first-child .sub-menu {
    right: 100%;
    padding-left: 10px;
}

/* Hebrew Sub-menu expands to the left */
#primary-menu>li:last-child .sub-menu {
    left: 100%;
    padding-right: 10px;
    flex-direction: row-reverse;
}

#primary-menu .sub-menu li {
    display: flex;
    align-items: center;
    max-width: 110px;
}

#primary-menu .sub-menu a {
    color: #fff;
    text-align: center;
    text-decoration: none;
    padding: 0 15px;
    font-size: 1.4rem;
    letter-spacing: 1px;
    transition: color 0.2s ease;
}

#primary-menu .sub-menu a:hover {
    color: var(--accent-color);
}

#primary-menu .sub-menu li+li::before {
    content: '/';
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.4rem;
}

.mobile-only-menu-item {
    display: none !important;
}

/* Mobile Design */
@media (max-width: 768px) {
	/* Show mobile home link */
    .mobile-only-menu-item {
        display: flex !important;
        justify-content: center;
        /* Ensure it centers like other items */
    }
	
	#primary-menu>li:first-child>a,
    #primary-menu>li:last-child>a {
        padding-left: 35px;
    }
	
    #primary-menu {
        flex-direction: row;
        flex-wrap: wrap;
    }

    #primary-menu>li {
        flex: 1 1 50%;
        text-align: center;
        transition: none;
        /* Remove transition on mobile to fix delay */
    }

    #primary-menu>li>a {
        justify-content: center;
        border-left: 1px solid #fff;
    }

    #primary-menu>li:last-child>a {
        border-left: none;
    }


    /* Disable hover background on mobile to prevent sticky colors */
    #primary-menu>li:hover {
        background-color: var(--accent-color);
        box-shadow: none;
    }

    /* Hide other items when one is open */
    #primary-menu.has-open-item>li:not(.is-open) {
        display: none;
    }

    #primary-menu.has-open-item>li.is-open {
        flex: 1 1 100%;
        background-color: var(--secondary-surface);
        /* Ensure open item is dark */
    }

    /* Disable hover sub-menu on mobile */
    #primary-menu>li:hover .sub-menu {
        display: none;
    }

    #primary-menu>li.is-open .sub-menu {
        display: flex;
        flex-direction: column;
        position: relative;
        top: 0;
        left: 0 !important;
        right: 0 !important;
        width: 100vw;
        height: auto;
        background-color: var(--secondary-surface);
        padding: 20px 0;
        z-index: 100;
    }

    /* Adjust sub-menu items for column layout */
    #primary-menu>li.is-open .sub-menu li {
        width: 100%;
        max-width: none;
        justify-content: center;
        padding: 10px 0;
    }

    #primary-menu>li.is-open .sub-menu a {
        font-size: 1.6rem;
        padding: 5px 0;
    }

    /* Remove separators on mobile */
    #primary-menu .sub-menu li+li::before {
        display: none;
    }
}

/* Background Hero */
.hero-background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-bg-image.active {
    opacity: 1;
}

/* Page Content Container */
.type-page {
    background-color: var(--primary-surface);
    max-width: 600px;
    margin: 100px auto;
    padding: 40px;
    border-radius: 8px;
    /* Optional: adds a slight softness */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Optional: adds depth */
}

.type-page a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.type-page a:hover {
    text-decoration: underline;
}

/* Ensure text color variable is applied (inherited from body but good to be explicit if needed) */
.type-page {
    color: var(--text-color);
}

@media (max-width: 768px) {
    .type-page {
        margin: 16px;
        padding: 2.4rem;
    }
}

/* Categories List Page */
.categories-container {
    text-align: center;
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.categories-list li {
    margin: 0;
}

.categories-list a {
    font-size: 1.5rem;
    font-weight: var(--font-weight-medium);
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.categories-list a:hover {
    color: var(--text-color);
}

/* Archive / Posts List */
.archive-container .page-header {
    margin-bottom: 18px;
    text-align: center;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.post-item {
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.post-item:last-child {
    border-bottom: none;
}

.post-item .entry-title {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: var(--accent-color);
}

.post-item .entry-title a {
    color: inherit;
    text-decoration: none;
}

.post-item .entry-summary {
    margin-bottom: 15px;
    font-size: 1.6rem;
}

.read-more-link {
    font-weight: var(--font-weight-bold);
    color: var(--accent-color);
    text-decoration: none;
    display: inline-block;
}

.read-more-link:hover {
    text-decoration: underline;
}

/* Single Post */
.single-post-container .entry-title {
    font-size: 2.2rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-color);
}

.single-post-container .entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.single-post-container .entry-content h2 {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
}