@import url("fontawesome-all.min.css");
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300italic,400,600");

/*
    amdsleem Core Stylesheet v1.0
    Technical Architecture by Ahmad Sleem
    Structured for stability, clarity, and scalable multi‑page design
*/
html, body {
    height: 100%;
}

html, div, span, applet, object,
iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
pre, a, abbr, acronym, address, big, cite,
code, del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var, b,
u, i, center, dl, dt, dd, ol, ul, li, fieldset,
form, label, legend, table, caption, tbody,
tfoot, thead, tr, th, td, article, aside,
canvas, details, embed, figure, figcaption,
footer, header, hgroup, menu, nav, output, ruby,
section, summary, time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;}

article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;}

ol, ul {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

    blockquote:before, blockquote:after, q:before, q:after {
        content: '';
        content: none;
    }

table {
    border-collapse: collapse;
    border-spacing: 0;
}

mark {
    background-color: transparent;
    color: inherit;
}

input::-moz-focus-inner {
    border: 0;
    padding: 0;
}

input, select, textarea {
    -moz-appearance: none;
    -webkit-appearance: none;
    -ms-appearance: none;
    appearance: none;
}
/* Basic — Sleem Core Layout */

/* Box Sizing */
html {
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* ===========================
   BODY — Global Styling
   =========================== */

body {
    /* دفع الفوتر لتحت */
    display: flex;
    flex-direction: column;
    
    /* Reset fixes */
    -webkit-text-size-adjust: none;

    /* Typography */
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 25px; /* تم تعديل pt → px */
    font-weight: 300;
    line-height: 1.75em;
    color: #5bddd2;

    /* Background (هنا هتحط الخلفية الموحدة لكل الصفحات) */
    background-image: url('../../images/third_bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Disable animations during preload */
body.is-preload *,
body.is-preload *::before,
body.is-preload *::after {
    animation: none !important;
    transition: none !important;
}

/* Inputs inherit typography */
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    color: #32854b;
    line-height: 1.4em;
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    color: inherit;
    text-decoration: none;
}

h1 a strong, h2 a strong, h3 a strong,
h4 a strong, h5 a strong, h6 a strong {
    color: #0e5a25;
}

h2 {
    font-size: 2em;
    letter-spacing: -0.5px;
}

h2.alt {
    color: #777;
}

h2.alt strong {
    color: #555;
}

h3 {
    font-size: 1.45em;
}

/* Header & Footer spacing */
header {
    margin: 0 0 1.8em 0;
}

header > p {
    margin: 1em 0 0 0;
}

footer {
    margin: 2em 0 0 0;
}

/* Text elements */
strong, b {
    font-weight: 400;
    color: #444;
}

em, i {
    font-style: italic;
}

/* Links */
a {
    text-decoration: none;
    color: inherit;
    border-bottom: dotted 1px rgba(128, 128, 128, 0.4);
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
    outline: 0;
}

a:hover {
    color: #8feb97;
    border-bottom-color: transparent;
}

/* Sub/Sup */
sub {
    position: relative;
    top: 0.5em;
    font-size: 0.8em;
}

sup {
    position: relative;
    top: -0.5em;
    font-size: 0.8em;
}

/* HR */
hr {
    border: 0;
    border-top: solid 1px #ddd;
}

/* Blockquote */
blockquote {
    border-left: solid 0.4em #ddd;
    padding: 1em 0 1em 1.5em;
    font-style: italic;
}

/* Spacing */
p, ul, ol, dl, table {
    margin-bottom: 1.8em;
}

br.clear {
    clear: both;
}

/* Container — Desktop Base */
.container {
    margin: 0 auto;
    width: 100%;
    max-width: 1400px;
    padding: 0 20px;
}

/* Large screens */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
}

/* Medium screens */
@media (min-width: 961px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
}

/* Tablets */
@media (max-width: 960px) {
    .container {
        max-width: 100%;
    }
}

/* Row System — Sleem Minimal Grid */

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 40px; /* المسافة بين الأعمدة */
    align-items: stretch;
}

/* عمود عام */
.col {
    flex: 1;
    min-width: 0;
}

/* أحجام جاهزة */
.col-12 { flex: 0 0 100%; }
.col-6  { flex: 0 0 calc(50% - 40px); }
.col-4  {
    flex: none !important;
    width: auto !important;
    min-height: auto !important;
    height: auto !important;
}
.col-3  { flex: 0 0 calc(25% - 40px); }
.col-8 {
    flex: 0 0 calc(76.666% - 60px);
}

/* محاذاة */
.row.aln-left   { justify-content: flex-start; }
.row.aln-center { justify-content: center; }
.row.aln-right  { justify-content: flex-end; }

.row.aln-top    { align-items: flex-start; }
.row.aln-middle { align-items: center; }
.row.aln-bottom { align-items: flex-end; }

/* موبايل */
@media (max-width: 736px) {
    .row {
        gap: 20px;
    }

    .col-6,
    .col-4,
    .col-3 {
        flex: 0 0 100%;
    }
}

/* Sections & Articles — Sleem Layout */

section,
article {
    margin-bottom: 2.5em;
}

/* إزالة المسافة لو آخر عنصر */
section > :last-child,
article > :last-child {
    margin-bottom: 0;
}

/* منع المسافة داخل الـ row */
.row > section,
.row > article {
    margin-bottom: 0;
}



/* Sidebar — Sleem Core Layout (Glassmorphism Version) */

#header {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100vh;

    /* خلفية زجاجية شفافة */
    background: rgba(34, 38, 41, 0.55); /* نفس اللون القديم لكن بشفافية */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    color: #fff;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

     padding: 2em 1.5em 0 1.5em;

    /* ظل بسيط ناعم */
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);

    /* لو المحتوى طويل */
    overflow-y: auto;

    /* علشان يفضل فوق كل العناصر */
    z-index: 1000;
}

/* Top section */
#header .top {
    flex-grow: 1;
}

/* Bottom section */
#header .bottom {
    margin-top: auto;
    display: flex;
    justify-content: center;
    width: 100%;
    position: relative;
}

/* Logo */
#logo {
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 2em;
}

#logo h1 {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

#logo p {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5em;
}

/* Navigation */
#nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#nav ul li {
    margin-bottom: 0.5em;
}

#nav ul li a {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.75em 1em;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
    border-radius: 0.4em;
    transition: background 0.25s ease, color 0.25s ease;
}

/* Icon inside nav */
#nav ul li a span:before {
    width: 1.25em;
    text-align: center;
    color: #41484c;
}

/* Hover */
#nav ul li a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* Active */
#nav ul li a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

#nav ul li a.active span:before {
    color: #8feb97;
}

/* Icons section */
#header .icons {
    margin-bottom: 0;
    font-size: 1.5em;
}

/* Footer — Sleem Core Layout */

#footer {
    margin-left: 320px; /* عرض الـ sidebar الجديد */
    background: rgba(0, 0, 0, 0.35); /* درجة الشفافية */
    padding: 40px;
    border-radius: 10px; /* اختياري */
    text-align: center;
    /*padding: 2.5em 0 3em 0;*/
    font-size: 1em;
    color: #2ba347;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* Copyright list */
#footer .copyright {
    margin: 0;
    padding: 0;
    list-style: none;
}

#footer .copyright li {
    display: inline-block;
    padding-left: 0.75em;
    margin-left: 0.75em;
    border-left: 1px solid rgba(128, 128, 128, 0.35);
    line-height: 1em;
}

/* أول عنصر */
#footer .copyright li:first-child {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
}

/* Main — Sleem Core Layout */

#main {
    margin-left: 320px; /* عرض الـ sidebar الجديد */
    padding: 2.5em 0;
    flex: 1; /* عشان الـ main ياخد المساحه الفاضيه كلها */
}

/* Sections داخل الـ main */
#main > section {
    margin: 0;
    padding: 3em 0;
    text-align: center;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* Dark section */
#main > section.dark {
    background: #222629;
    color: rgba(255, 255, 255, 0.85);
}

#main > section.dark h2,
#main > section.dark h3,
#main > section.dark h4,
#main > section.dark h5,
#main > section.dark h6 {
    color: inherit;
}

#main > section.dark strong {
    color: #fff;
}

#main > section.dark a {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

#main > section.dark a:hover {
    border-bottom-color: transparent;
}

/* Cover section */
#main > section.cover {
    padding: 8em 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ألوان sections لو محتاجها */
#main > section.bg-light {
    background: rgba(0, 0, 0, 0.35); /* درجة الشفافية */
    padding: 40px;
    border-radius: 10px; /* اختياري */
    margin-bottom: 90px;
}

#main > section.bg-soft {
    background: #ecf1f1;
}

#main > section.bg-muted {
    background: rgba(0, 0, 0, 0.35); /* درجة الشفافية */
    padding: 40px;
    border-radius: 10px; /* اختياري */
}

/* فاصل رفيع */
.section-tight {
    margin-top: 4px;
    padding-top: 4px;
}

/* شاشة المقالات */
#article-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.article-box {
    width: min(900px, 90vw);
    max-height: 85vh;
    overflow-y: auto;
    background: rgba(18,18,22,0.96);
    border-radius: 16px;
    padding: 2.2em;
    box-shadow: 0 0 40px rgba(0,0,0,0.45);
}

.article-close {
    position: sticky;
    top: 0;
    float: right;
    border: none;
    background: transparent;
    color: #ccc;
    font-size: 1.6em;
    cursor: pointer;
    margin-bottom: 0.5em;
}

.article-container {
    width: 100%;
    color: #e6e6e6;
    line-height: 1.8;
}

.article-title {
    font-size: 1.9em;
    margin-bottom: 1em;
    color: #fff;
}

.article-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1.5em;
    box-shadow: 0 0 20px rgba(0,0,0,0.35);
}

.article-text {
    margin-bottom: 1.2em;
    font-size: 1.03em;
}

/* مقاسات الكروت */
/* Grid */
.posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

/* Card */
.blog-box {
    width: 100%;
    background: #fff;
    border-radius: 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: visible; /* مهم جداً */
    justify-content: space-between;
    min-height: 420px;
}

/* Title */
.blog-box header {
    padding: 1em;
}

/* Text */
.blog-box p {
    padding: 0 1em;
    margin-bottom: 1em;
    min-height: 70px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    flex-grow: 1; /* يملأ المساحة */
}

/* تثبيت الهيدر */
.blog-box header {
    margin: 0 !important;
    padding: 1em;
}

.blog-box header h3 {
    min-height: 48px; /* سطرين */
    overflow: hidden;
}

/* Actions */
.blog-box .actions {
    margin-top: auto;
    padding: 1em;
}

.blog-box .actions a {
    position: relative;
    z-index: 10; /* يمنع القص */
}

/* منع item من التأثير على blog-box */
.item.blog-box {
    padding: 0 !important;
    margin-bottom: 0 !important;
}

.item {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
}

/* PROJECTS GRID */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.project-box {
    display: flex;
    flex-direction: column;
    height: 420px;
}

.project-box p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-box .actions {
    margin-top: auto;
}

/* التعريب */
html[lang="ar"] #header {
    right: 0;
    left: auto;
}

html[lang="ar"] #main {
    margin-right: 320px;
    margin-left: 0;
}

html[lang="ar"] body {
    direction: rtl;
}