/* --- Color Palette from Logo --- */
:root {
    /* Using colors sampled from the logo image */
    --color-primary-blue: #2d5a7b; /* Deep blue/teal - from bowl/minaret */
    --color-secondary-beige: #d4c1a0; /* Sandy/beige - from building/bread */
    --color-dark-text: #333333; /* Dark text color */
    --color-light-bg: #e8e8e8; /* Light gray background color */
    --color-green-leaves: #5a8d38; /* Example green - from leaves (adjusted slightly for visibility) */

    /* Lighter/Darker variations for accents */
    --color-primary-blue-light: #4f7a99; /* Lighter blue */
    --color-secondary-beige-dark: #bda88d; /* Darker beige */
}


body {
    /* Apply Google Fonts - Prioritize Noto Sans for Latin, Tajawal for Arabic */
    font-family: 'Noto Sans', 'Tajawal', sans-serif;
    line-height: 1.6;
    margin: 0;
    background-color: var(--color-light-bg);
    color: var(--color-dark-text);
    padding-bottom: 20px;
}

.container {
    background-color: #fff; /* Container background is white */
    padding: 20px;
    border-radius: 8px;
    /* Add a subtle colored shadow */
    box-shadow: 0 0 10px rgba(45, 90, 123, 0.15); /* Using a translucent primary blue */
    max-width: 600px;
    margin: 20px auto;
    margin-bottom: 20px;
    /* Add a subtle border */
    border: 1px solid var(--color-secondary-beige-dark);
}

/* --- Header Logo Styles --- */
#site-header.container {
    text-align: center;
    margin-top: 0;
    padding: 10px 20px;
    border-radius: 0 0 8px 8px;
     margin-bottom: 0;
}

/* Style the logo link */
#site-header a {
    display: inline-block; /* Allows margin auto for centering */
    text-decoration: none; /* Remove default underline */
    color: inherit; /* Inherit color, though the image is the main content */
}

#site-header img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto; /* Center the image within the link */
}


h1, h2, h3 {
    color: var(--color-primary-blue);
}

/* --- Menu List Styles (Dual Language) --- */
#menu-list h2 { /* Style for category headings */
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--color-primary-blue);
    border-bottom: 2px solid var(--color-primary-blue-light);
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

#menu-list h2 span {
     padding: 0 5px;
     min-width: 0;
     overflow: hidden;
     text-overflow: ellipsis;
}

#menu-list h2 span:first-child {
    text-align: left;
    flex-grow: 1;
    flex-shrink: 1;
}

#menu-list h2 span:last-child {
    text-align: right;
    margin-left: 10px;
     font-weight: bold;
    flex-shrink: 1;
     flex-grow: 1;
}


#menu-list ul {
     list-style: none;
     padding: 0;
     margin-bottom: 20px;
}

#menu-list li {
    margin-bottom: 8px;
}

#menu-list li a {
    text-decoration: none;
    color: var(--color-dark-text);
    font-weight: normal;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px dotted var(--color-secondary-beige-dark);
     flex-wrap: nowrap;
     transition: background-color 0.2s ease;
}

#menu-list li a:hover {
    color: var(--color-primary-blue);
    border-bottom-color: var(--color-primary-blue);
    background-color: rgba(212, 193, 160, 0.1);
}

#menu-list li a span {
    padding: 0 5px;
     min-width: 0;
     overflow: hidden;
     text-overflow: ellipsis;
}

#menu-list li a span:first-child {
    text-align: left;
    flex-grow: 1;
    flex-shrink: 1;
}

#menu-list li a span:last-child {
    text-align: right;
    flex-shrink: 1;
    margin-left: 10px;
    font-weight: bold;
     flex-grow: 1;
}


/* --- Item Details Styles --- */
#item-title {
    margin-bottom: 20px;
}

#item-title h1 { /* English Item Title */
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.8em;
    color: var(--color-primary-blue);
}

#item-title h2 { /* Arabic Item Title */
    margin-top: 5px;
    margin-bottom: 0;
    font-size: 1.4em;
    color: var(--color-dark-text);
    text-align: right;
    font-weight: bold;
}

/* --- Dual Language Heading/Link Styles (e.g., Ingredients, Back Link) --- */
/* Style the flex container */
.dual-language-heading,
.dual-language-link {
    display: flex;
    justify-content: space-between; /* Side-by-side */
    align-items: center;
    flex-wrap: nowrap; /* Prevent wrapping */
    width: 100%; /* Take available width */
    box-sizing: border-box;
}

/* Style the spans inside */
.dual-language-heading span,
.dual-language-link span {
     padding: 0 5px; /* Padding inside spans */
     min-width: 0; /* Allow shrinking */
     overflow: hidden;
     text-overflow: ellipsis; /* Truncate overflow */
     flex-shrink: 1; /* Allow shrinking */
}

.dual-language-heading span:first-child,
.dual-language-link span:first-child {
    text-align: left;
    flex-grow: 1; /* Allow English side to take space */
}

.dual-language-heading span:last-child,
.dual-language-link span:last-child {
    text-align: right;
    flex-grow: 1; /* Allow Arabic side to take space */
    margin-left: 10px; /* Space between languages */
}


/* Specific adjustments for the Ingredients Heading */
#ingredients-heading {
     margin-top: 20px;
     margin-bottom: 10px;
     color: var(--color-primary-blue);
     border-bottom: 2px solid var(--color-secondary-beige); /* Use beige for this separator */
     padding-bottom: 5px;
}

/* Specific adjustments for the Back to Menu link */
#back-link {
     color: var(--color-primary-blue); /* Link color */
     text-decoration: underline; /* Underline */
     margin-top: 20px;
     margin-bottom: 0; /* Remove default paragraph margin */
     display: inline-flex; /* Use inline-flex for the link container */
     font-weight: bold; /* Bold text */
}

#back-link span:last-child {
    /* Adjust margin for stacked view later */
}


#item-ingredients {
    list-style: disc;
    padding-left: 20px;
}

html[dir="rtl"] #item-ingredients {
     padding-left: 0;
     padding-right: 20px;
     text-align: right;
}

#item-ingredients li {
     margin-bottom: 8px;
     list-style-position: outside;
     display: flex;
     flex-direction: column;
     align-items: flex-start;
     border-bottom: 1px dotted var(--color-secondary-beige);
     padding-bottom: 5px;
}

html[dir="rtl"] #item-ingredients li {
    align-items: flex-end;
}

#item-ingredients li span {
     width: 100%;
     box-sizing: border-box;
}

#item-ingredients li .en-ingredient-text {
    font-weight: bold;
    color: var(--color-dark-text);
    text-align: left;
}

#item-ingredients li .ar-ingredient-text {
     font-size: 0.9em;
     color: #555;
     text-align: right;
     margin-top: 3px;
}


/* --- Mobile Responsiveness --- */
@media (max-width: 480px) {
    .container {
        padding: 15px;
         margin: 10px auto;
         margin-bottom: 10px;
    }

    #site-header.container {
         padding: 10px 15px;
    }

    #site-header img {
        max-width: 150px;
    }

    /* MENU LIST - Keep on one line, reduce font */
    #menu-list li a span {
         font-size: 0.9em;
         padding: 0 3px;
    }

    #menu-list h2 span {
         font-size: 1em;
         padding: 0 3px;
    }

    #menu-list li a span:first-child {
        text-align: left;
    }
     #menu-list li a span:last-child {
        text-align: right;
         margin-left: 5px;
     }

    /* DUAL LANGUAGE HEADINGS/LINKS - Stack on mobile */
    .dual-language-heading,
    .dual-language-link {
        flex-direction: column; /* Stack children vertically */
        align-items: flex-start; /* Align children to the start (left/right based on dir) */
        /* Adjust text-align for spans within stacked containers */
    }

    .dual-language-heading span,
    .dual-language-link span {
         width: 100%; /* Spans take full width when stacked */
         padding: 0; /* Remove horizontal padding when stacked */
         text-align: left; /* Default alignment for stacked spans */
    }

     /* Explicitly align the Arabic span to the right when stacked */
     .dual-language-heading span:last-child,
     .dual-language-link span:last-child {
         text-align: right; /* Arabic aligns right */
         margin-top: 2px; /* Small space between stacked languages */
         margin-left: 0; /* Remove left margin */
     }

     /* Item Details - Stacked layout remains, font sizes might be adjusted */
    #item-title h1 {
         font-size: 1.5em;
    }
     #item-title h2 {
         font-size: 1.2em;
     }

     #item-ingredients {
         padding-left: 15px;
     }
      html[dir="rtl"] #item-ingredients {
         padding-left: 0;
         padding-right: 15px;
      }

       #item-ingredients li {
            align-items: flex-start;
            padding-bottom: 3px;
       }
       html[dir="rtl"] #item-ingredients li {
             align-items: flex-end;
       }

       #item-ingredients li .ar-ingredient-text {
            margin-top: 2px;
       }
}