:root {
    --navy: #05103A;
    --ink: #0d1b2a;
    --muted: #5b6b82;
    --accent: #ffb367;
    --paper: #ffffff;
    --sheet: #f7f8fb;
    --line: #e6e9f0;
    --shadow: 0 12px 28px rgba(5, 16, 58, .06);
    /* ارتفاع الصورة في الصف الأول */
    --row1-min-h: clamp(320px, 34vw, 460px);
}

.sd-hero {
    position: relative;
    min-height: 360px;
    color: #fff;
    background-image: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .6)), var(--sd-hero, url('/assets/images/hero-fallback.jpg'));
    /* فالباك اختياري */
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    display: grid;
    place-items: center;
    text-align: center;
}


/* ===== HERO ===== */

.sd-hero-inner {
    position: relative;
    z-index: 2;
    width: min(1200px, 92%);
    padding: 42px 0;
}

.sd-breadcrumb {
    display: flex;
    gap: 8px;
    justify-content: center;
    opacity: .9;
    font-size: 14px;
    margin-bottom: 6px;
}

.sd-breadcrumb a {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.sd-breadcrumb a:hover {
    border-color: #fff;
}

.sd-title {
    margin: 8px 0 6px;
    font-size: clamp(28px, 4.8vw, 46px);
    font-weight: 900;
    letter-spacing: .02em;
}

.sd-lead {
    margin: 0 auto 14px;
    font-size: clamp(14px, 2.2vw, 18px);
    max-width: 820px;
    opacity: .95;
}

.sd-badges {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.sd-badge {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    gap: 8px;
    align-items: center;
}


/* ===== PAGE WRAP ===== */

.sd-wrap {
    background: var(--sheet);
    padding: clamp(28px, 5vw, 60px) 0;
}


/* ===== MASTER GRID ===== */

.sd-matrix {
    width: min(1200px, 92%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.25fr 1fr 0.95fr;
    gap: clamp(14px, 2.2vw, 22px);
    /* الوضع الافتراضي: الوصف بجانب الصورة (إن أردته لاحقًا) */
    grid-template-areas: "media text aside" "why   why  aside" "cta   cta  related";
    align-items: start;
}


/* وضع: الوصف تحت الصورة */

.sd-matrix.layout-text-below {
    grid-template-areas: "media media aside" "text  text  aside" "why   why   aside" "cta   cta   related";
}


/* موبايل */

@media (max-width:1060px) {
    .sd-matrix,
    .sd-matrix.layout-text-below {
        grid-template-columns: 1fr;
        grid-template-areas: "media" "text" "aside" "why" "related" "cta";
    }
}


/* ربط العناصر بالمناطق */

.sd-media {
    grid-area: media;
}

.sd-text-card {
    grid-area: text;
}

.sd-aside {
    grid-area: aside;
}

.sd-why {
    grid-area: why;
}

.sd-related {
    grid-area: related;
}

.sd-cta {
    grid-area: cta;
}


/* ===== الصورة ===== */

.sd-media {
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #eef1f6;
    box-shadow: var(--shadow);
    height: var(--row1-min-h);
    min-height: var(--row1-min-h);
}

.sd-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sd-media-fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #94a3b8;
    font-size: 48px;
}


/* عند اختيار "الكتابة تحت الصورة" خلي الوصف بطول تلقائي */

.sd-matrix.layout-text-below .sd-text-card {
    height: auto;
    min-height: auto;
}


/* ===== بطاقة النص ===== */

.sd-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.sd-card h2,
.sd-card h3 {
    margin: 0 0 12px;
    color: var(--navy);
    font-weight: 900;
    font-size: clamp(18px, 2vw, 20px);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sd-card h3 i,
.sd-card h2 i {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #0d1b2a;
    color: #fff;
    font-size: 14px;
}

.sd-text-card {
    background: linear-gradient(90deg, rgba(255, 179, 103, .25), rgba(255, 179, 103, 0)) 0 0/6px 100% no-repeat, var(--paper);
    border-left: 6px solid rgba(255, 179, 103, .3);
    display: flex;
    align-items: center;
    /* يتوسّط عموديًا إذا قصير */
}

[dir="rtl"] .sd-text-card {
    background: linear-gradient(-90deg, rgba(255, 179, 103, .25), rgba(255, 179, 103, 0)) 100% 0/6px 100% no-repeat, var(--paper);
    border-left: 1px solid var(--line);
    border-right: 6px solid rgba(255, 179, 103, .3);
}

.sd-text-card .sd-intro {
    color: #334155;
    font-size: 16px;
    line-height: 1.8;
    margin: 2px 0;
}


/* موبايل: طول تلقائي دائمًا */

@media (max-width:1060px) {
    .sd-media {
        height: auto;
        min-height: auto;
        aspect-ratio: 16/10;
    }
    .sd-media img {
        height: auto;
    }
    .sd-text-card {
        align-items: flex-start;
    }
}


/* ===== العمود الجانبي ===== */

.sd-aside {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 18px;
}

.sd-btn {
    display: block;
    text-decoration: none;
    background: #0d1b2a;
    color: #fff;
    padding: 11px 12px;
    border-radius: 12px;
    margin-top: 8px;
    transition: transform .15s ease, filter .15s ease;
}

.sd-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.sd-btn.outline {
    background: transparent;
    color: #0d1b2a;
    border: 1px solid var(--line);
}

.sd-social {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.sd-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #0d1b2a;
    color: #fff;
    border: 1px solid var(--line);
    transition: transform .15s ease, filter .15s ease;
}

.sd-social a:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.sd-social .fa-whatsapp {
    color: #25D366
}

.sd-social .fa-facebook {
    color: #1778f2
}

.sd-social .fa-x-twitter {
    color: #fff
}

.sd-social .fa-instagram {
    color: #ff5aa5
}

.sd-social .fa-linkedin {
    color: #0a66c2
}


/* ===== الخطوات ===== */

.sd-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.sd-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fbff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
}

.sd-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #05103A;
    font-weight: 900;
}


/* ===== لماذا تختارنا ===== */

.sd-h2 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 900;
    color: var(--navy);
}

.sd-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.sd-list-why {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 920px) {
    .sd-list-why {
        grid-template-columns: 1fr;
    }
}

.sd-list-why li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}

.sd-list-why i {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-top: 2px;
    background: #e7fbf3;
    color: #10b981;
}

.sd-why-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sd-why-item strong {
    font-weight: 900;
    color: var(--navy);
}

.sd-why-item span {
    color: #334155;
    line-height: 1.6;
}


/* ===== Related Services ===== */

.sd-links {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.sd-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-decoration: none;
    color: #0f3a7a;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}

.sd-links a::after {
    content: "›";
    font-size: 18px;
    line-height: 1;
    color: #0f3a7a;
    opacity: .75;
}

.sd-links a:hover {
    transform: translateX(2px);
    background: #f9fbff;
    border-color: #cfd6e4;
}

[dir="rtl"] .sd-links a::after {
    content: "‹";
}


/* ===== CTA ===== */

.sd-cta {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #05103A, #0d1b2a);
    color: #fff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.sd-cta h3 {
    margin: 0 0 4px;
    font-size: 22px;
}

.sd-cta p {
    margin: 0;
    opacity: .95;
}

.sd-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: #05103A;
    border-radius: 999px;
    padding: 12px 18px;
    text-decoration: none;
    border: 1px solid var(--accent);
    font-weight: 900;
    transition: transform .15s ease, filter .15s ease;
}

.sd-cta-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}


/* ===== RTL ===== */

[dir="rtl"] .sd-breadcrumb {
    direction: rtl;
}