/* General Reset and Base Styles */
html{
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #0a0a0ae0;
    font-family: "Cairo", sans-serif;
    color: antiquewhite;
    overflow-x: hidden; /* Prevents accidental side-scrolling */
}

/* --- Navigation --- */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background-color: #222423;
    padding: 10px 5%;
    position: fixed;
    top: 0;
    z-index: 1000;
    box-sizing: border-box;
}

.name {
    color: antiquewhite;
    font-weight: bolder;
    font-size: 24px;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: 30px;
}

a {
    color: bisque;
    text-decoration: none;
    font-size: 20px;
    transition: 0.3s;
}

a:hover {
    transform: scale(1.1);
    color: rgb(238, 238, 161);
}

/* --- Main Layout Container --- */
.container {
    display: flex;
    flex-direction: row; /* Side by side on desktop */
    align-items: center;
    justify-content: center;
    padding: 120px 5% 50px 5%; /* Top padding accounts for fixed nav */
    gap: 50px;
    min-height: 80vh;
}

/* --- Image Styling --- */
.pict {
    display: inline-block;
    flex: 1;
    padding-right: 15%;
    max-width: 500px;
}

img {
    width: 100%;
    height: auto;
    border-radius: 5%;
    margin-left: 0%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* --- Text Styling --- */
.home {
    flex: 1;
    max-width: 600px;
}

.texts h1 {
    display: block;
    font-weight: bolder;
    font-size: clamp(3rem, 8vw, 6.5rem); /* Fluid typography */
    line-height: 1.2;
    margin: 0 0 20px 0;
}

.line {
    width: 250px;
    height: 5px;
    background-color: #eee;
    margin-bottom: 25px;
    border-radius: 10px;
}

.lorem {
    color: rgb(205, 253, 237);
    font-size: 26px;
    line-height: 1.6;
}

/* --- Responsive Media Queries --- */

/* Mobile Phones and Tablets */
@media (max-width: 900px) {
    .container {
        flex-direction: column; /* Stack image on top of text */
        text-align: center;
        padding-top: 150px;
    }
    
    .nav {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .nav-links {
        gap: 15px;
    }
    
    .line {
        margin: 20px auto; /* Center the line when text is centered */
    }
    
    .pict {
        max-width: 80%; /* Don't let image take full width on tablets */
    }
}

/* Very Small Phones */
@media (max-width: 480px) {
    .name {
        font-size: 18px;
    }
    
    a {
        font-size: 16px;
    }

    .lorem {
        font-size: 18px;
    }
}
/* --- قسم الشهادات المُعدل (كلام شمال وصور يمين) --- */
#certificates {
    padding: 100px 5%;
    background-color: rgba(255, 255, 255, 0.02);
}

.certtt {
    font-weight: bolder;
    font-size: clamp(2.5rem, 6vw, 4rem);
    text-align: center;
    margin-bottom: 50px;
    color: #eee;
}

.certificates-container {
    display: flex;
    flex-direction: row; /* يجعل الكلام يسار والصور يمين */
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.cert-intro {
    flex: 1;
    font-size: 22px;
    line-height: 1.6;
    color: #cdfded;
    text-align: left; /* محاذاة النص لليسار */
    direction: ltr;    /* لضمان تنسيق اللغة الإنجليزية */
}

.certs-gallery {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.certs-gallery img {
    width: 100%;
    max-width: 380px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.5s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.718);
}

.certs-gallery img:hover {
    transform: scale(1.05);
    outline: 2px solid rgb(255, 237, 237);
    /* box-shadow: 0 10px 30px rgba(128, 128, 128, 0.461); */
}

/* --- Responsive للهواتف --- */
@media (max-width: 900px) {
    .certificates-container {
        flex-direction: column; /* ترتيب رأسي في الموبايل */
        text-align: center;
    }

    .cert-intro {
        text-align: center;
        width: 100%;
    }
}

.contact h1{
    font-weight: bolder;
    font-size: clamp(2.5rem, 6vw, 4rem);
    text-align: center;
    margin-bottom: 50px;
    color: #eee;
}