/* assets/css/rtl.css */

/* General RTL adjustments */
body {
    direction: rtl;
    text-align: right;
}

/* Typography adjustments */
h1, h2, h3, h4, h5, h6, p, .section-description, .tagline {
    text-align: right;
}

.text-left { text-align: right; } /* Override default for specific elements if needed */
.text-right { text-align: left; } /* Override default for specific elements if needed */

/* Header */
.header .container {
    flex-direction: row-reverse; /* Swap logo and nav/lang switcher positions */
}

.main-nav {
    justify-content: flex-start; /* Push nav to left in RTL */
}

.nav-list {
    flex-direction: row-reverse; /* Navigation items order */
}

.nav-link::after {
    right: 0; /* Underline starts from right */
    left: auto;
}

.language-switcher {
    margin-left: 0;
    margin-right: var(--spacing-md); /* Adjust margin for RTL */
}

/* Hamburger menu for RTL */
.hamburger-menu {
    order: 1; /* Position before logo in RTL for consistent hamburger-right */
    margin-left: var(--spacing-md);
    margin-right: 0;
}

.main-nav.open .hamburger-menu .bar:nth-child(1) {
    transform: translateY(8px) rotate(-45deg); /* Adjust rotation */
}

.main-nav.open .hamburger-menu .bar:nth-child(3) {
    transform: translateY(-8px) rotate(45deg); /* Adjust rotation */
}

.main-nav.open .nav-list {
    transform: translateY(0%);
    right: 0; /* For mobile nav, slide from right */
    left: auto;
    text-align: right;
}

/* Hero Section */
.hero-content {
    text-align: right;
}

.hero-ctas {
    flex-direction: row-reverse; /* Reverse order of CTA buttons */
    justify-content: flex-end; /* Align to right */
}

@media (max-width: 768px) {
    .hero-ctas {
        flex-direction: column; /* Still column on very small screens */
        align-items: flex-end; /* Align items to the right */
    }
}

/* Grid layouts */
.grid-2-cols {
    grid-template-areas: "image text"; /* Swap columns */
}

.grid-2-cols > *:nth-child(1) { /* First item (text-content) */
    grid-area: text;
}
.grid-2-cols > *:nth-child(2) { /* Second item (image-content) */
    grid-area: image;
}

/* About Us Intro Section */
.about-us-intro .text-content {
    text-align: right;
}
.about-us-intro .image-content {
    text-align: center; /* Image should remain centered */
}

/* Specializations */
.specialization-item {
    text-align: right;
}

/* Project Cards */
.project-card h3, .project-card p {
    text-align: right;
}

/* Footer */
.footer-content {
    flex-direction: row-reverse; /* Reverse order of footer columns */
}

.footer-brand, .footer-nav, .footer-contact {
    text-align: right;
}

.footer-brand img {
    margin-left: auto; /* Push logo to right */
    margin-right: 0;
}

.footer-nav ul {
    padding-right: 0; /* Remove default padding */
}

.footer-bottom {
    text-align: right;
}

.social-links {
    justify-content: flex-end; /* Align social links to right */
}

/* Form elements */
.form-group label {
    text-align: right;
}

/* Benefits list */
.benefits-list li {
    flex-direction: row-reverse; /* Checkmark on the right */
    text-align: right;
}

.benefits-list li::before {
    margin-left: var(--spacing-sm); /* Space after checkmark */
    margin-right: 0;
}

.benefits-list li h4 {
    text-align: right;
}

.benefits-list li p {
    margin-top: var(--spacing-xs);
    margin-bottom: 0;
    font-size: 0.95rem;
    text-align: justify;
}

.vision-mission-item {
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure they take full height of grid cell */
}
.vision-mission-item p {
    flex-grow: 1; /* Allow paragraph to grow and push footer down */
}

/* Mobile specific RTL adjustments */
@media (max-width: 768px) {
    .main-nav {
        order: 3; /* Keep nav below, but ensure content aligns right */
        align-items: flex-end;
    }
    .nav-list {
        top: var(--header-height);
        right: 0;
        left: auto;
        transform: translateX(150%); /* Slide from right */
    }
    .main-nav.open .nav-list {
        transform: translateX(0%);
    }

    .hamburger-menu {
        order: 2; /* Still after logo */
        margin-left: 0;
        margin-right: var(--spacing-md);
    }
    .language-switcher {
        order: 1; /* Before hamburger */
        margin-left: 0;
        margin-right: auto;
    }

    .about-us-intro .image-content {
        order: 1; /* Keep image on top */
        margin-bottom: var(--spacing-md);
    }
    .about-us-intro .text-content {
        order: 2;
    }

    .footer-content {
        flex-direction: column; /* Still column, but internal text aligns right */
        text-align: right;
    }
    .footer-brand img {
        margin-left: auto;
        margin-right: auto; /* Center logo on mobile */
    }
    .social-links {
        justify-content: center; /* Center social links on mobile */
    }
}

@media (min-width: 768px) {
    .grid-2-cols {
        grid-template-areas: unset; /* Reset for desktop, allowing normal flow if not explicitly ordered */
    }
    .grid-2-cols > *:nth-child(1), .grid-2-cols > *:nth-child(2) {
        grid-area: unset;
    }

    /* Reverse the columns if the image is on the left in LTR, now it should be on the right */
    .about-us-intro .image-content {
        grid-column: 2; /* Image on the right */
        grid-row: 1;
    }
    .about-us-intro .text-content {
        grid-column: 1; /* Text on the left */
        grid-row: 1;
    }
}