﻿/* ═══════════════════════════════════════════════════════════
   مستجاب — Layout Layer (v3)
   Grid, sections, bento, responsive containers
   ═══════════════════════════════════════════════════════════ */

:root {
    --section-y: clamp(48px, 8vw, 96px);
    --gutter: clamp(16px, 4vw, 24px);
    --font-display: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
}

html:has(.page-home),
html:has(.page-service) {
    scroll-behavior: smooth;
}

body.page-home,
body.page-service,
body[class^="page-"] {
    scroll-padding-top: var(--site-chrome, calc(var(--strip-h, 38px) + var(--header-h, 76px)));
}

body.page-home,
body.page-service,
body[class^="page-"] {
    padding-bottom: calc(var(--mobile-bar-h, 0px) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
    body.page-home,
    body.page-service,
    body[class^="page-"] {
        padding-bottom: 0;
    }
}

@media (max-width: 767px) {
    :root {
        --mobile-bar-h: 76px;
    }
}

/* ── Container ── */
.container {
    max-width: var(--container-max, 1200px);
    padding-inline: var(--gutter);
}

.container--narrow {
    max-width: 720px;
}

.container--wide {
    max-width: 1400px;
}

/* ── Section spacing ── */
.section {
    padding-block: var(--section-y);
}

.section--compact {
    padding-block: clamp(32px, 5vw, 56px);
}

.section--hero-gap {
    padding-top: calc(var(--site-chrome, calc(var(--strip-h, 38px) + var(--header-h, 76px))) + 24px);
}

/* ── Bento grid (asymmetric — anti 3-col slop) ── */
.bento-grid {
    display: grid;
    gap: clamp(16px, 2.5vw, 24px);
    grid-template-columns: repeat(12, 1fr);
}

.bento-grid > .bento-span-6 { grid-column: span 6; }
.bento-grid > .bento-span-4 { grid-column: span 4; }
.bento-grid > .bento-span-8 { grid-column: span 8; }
.bento-grid > .bento-span-12 { grid-column: span 12; }

.bento-grid > .bento-tall { grid-row: span 2; }

@media (max-width: 1023px) {
    .bento-grid > .bento-span-6,
    .bento-grid > .bento-span-4,
    .bento-grid > .bento-span-8 {
        grid-column: span 6;
    }
}

@media (max-width: 767px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-grid > * {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }
}

/* ── Service grid ── */
.services-grid,
.features-grid,
.steps-grid {
    display: grid;
    gap: clamp(16px, 2.5vw, 24px);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

/* ── Two-column split (RTL hero / content) ── */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
}

.split-layout--reverse {
    direction: ltr;
}

.split-layout--reverse > * {
    direction: rtl;
}

@media (max-width: 1023px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* ── Horizontal scroll rail (mobile services) ── */
.scroll-rail {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.scroll-rail::-webkit-scrollbar {
    display: none;
}

.scroll-rail > * {
    flex: 0 0 min(85vw, 320px);
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .scroll-rail--desktop-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        overflow: visible;
    }

    .scroll-rail--desktop-grid > * {
        flex: unset;
    }
}

/* ── CTA banner full bleed glass ── */
.cta-banner {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.97) 0%, rgba(6, 10, 18, 0.99) 100%);
    backdrop-filter: blur(20px);
    border-block: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 80% at 20% 50%, rgba(220, 38, 38, 0.15) 0%, transparent 55%);
    pointer-events: none;
}

.cta-banner .container {
    position: relative;
    z-index: 1;
}

/* ── Prose / article layout ── */
.prose-layout {
    max-width: 46rem;
    margin-inline: auto;
    line-height: 1.85;
}

.prose-layout h2 {
    font-family: var(--font-display);
    margin-top: 2.5rem;
}

/* ── Utility visibility ── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Standard breakpoints reference ── */
/* sm: 480px | md: 768px | lg: 1024px | xl: 1280px */

@media (max-width: 479px) {
    .hide-xs { display: none !important; }
}

@media (min-width: 480px) and (max-width: 767px) {
    .hide-sm { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hide-md { display: none !important; }
}

@media (min-width: 1024px) {
    .hide-lg-up { display: none !important; }
}
