/* =============================================================
   service-detail.css — editorial template for /services/<slug>.
   Discipline: Montserrat-only, no gradients on big type, no blobs,
   asymmetric grid, numbered poster rows. Companion to /services hub.
   ============================================================= */

:root {
    --ink: #0a0a0a;
    --paper: #ffffff;
    --rule: rgba(0, 0, 0, 0.12);
    --o: #ff9201;
    --b: #00b1e1;
}
body.dark-mode {
    --ink: #f1f1f1;
    --paper: #0c0c0c;
    --rule: rgba(255, 255, 255, 0.12);
}
body.sd-body {
    font-family: 'Montserrat', sans-serif;
    background: var(--paper);
    color: var(--ink);
    overflow-x: clip;
    line-height: 1.6;
}

/* Reading progress hairline */
.sd-prog {
    position: fixed; top: 0; left: 0; right: 0;
    height: 2px; z-index: 50; pointer-events: none;
}
.sd-prog i {
    display: block; height: 100%; width: 0;
    background: var(--o); transition: width 80ms linear;
}

/* ----------- 1. Intro / hero — asymmetric editorial ----------- */
.sd-intro {
    min-height: 92vh;
    padding: 9rem 5vw 5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr auto;
    gap: 4rem 4vw;
    align-items: end;
    position: relative;
    max-width: 1480px;
    margin: 0 auto;
}
.sd-intro::before {
    content: ""; position: absolute;
    top: 9rem; left: 5vw; right: 5vw;
    height: 1px; background: var(--rule); opacity: 0.6;
}
.sd-intro-mast {
    grid-column: 1 / -1; grid-row: 1 / 2;
    align-self: start;
    display: flex; justify-content: space-between;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem; letter-spacing: 0.3em;
    text-transform: uppercase; font-weight: 600;
    opacity: 0.55;
}
.sd-intro-mast a { color: inherit; text-decoration: none; opacity: 0.7; }
.sd-intro-mast a:hover { color: var(--o); opacity: 1; }
.sd-intro-mast span + span { text-align: right; }
.sd-intro-head { grid-column: 1 / 2; grid-row: 2 / 3; max-width: 22ch; }
.sd-intro-head h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: clamp(2.8rem, 10vw, 10rem);
    line-height: 0.86;
    letter-spacing: -0.05em;
    margin: 0;
    color: var(--ink);
}
.sd-intro-head h1 em {
    font-style: italic; font-weight: 200;
    color: var(--o); letter-spacing: -0.03em;
}
.sd-intro-head h1 .thin { font-weight: 200; opacity: 0.6; }
.sd-intro-sub {
    display: block;
    margin-top: 2rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.35vw, 1.18rem);
    line-height: 1.55;
    max-width: 36ch;
    color: var(--ink); opacity: 0.7;
}
.sd-intro-aside {
    grid-column: 2 / 3; grid-row: 2 / 3;
    justify-self: end; text-align: right;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 0.85rem; line-height: 1.55;
    opacity: 0.7;
    max-width: 22ch;
    border-right: 1px solid var(--o);
    padding-right: 1.25rem;
}
.sd-intro-aside strong {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 2.2rem; line-height: 1;
    letter-spacing: -0.03em;
    color: var(--ink); opacity: 1;
    margin-bottom: 0.4rem;
}
.sd-intro-cue {
    position: absolute; bottom: 2.5rem; left: 5vw;
    font-size: 0.7rem; letter-spacing: 0.28em;
    text-transform: uppercase; font-weight: 600;
    opacity: 0.55;
    display: inline-flex; align-items: center; gap: 0.85rem;
}
.sd-intro-cue span {
    display: inline-block; font-size: 1.1rem; line-height: 1;
    animation: sdBob 1.8s ease-in-out infinite;
}
@keyframes sdBob {
    0%, 100% { transform: translateY(0); opacity: 0.55; }
    50%      { transform: translateY(6px); opacity: 1; }
}

/* ----------- Section frame ----------- */
.sd-section {
    max-width: 1480px;
    margin: 0 auto;
    padding: 7rem 5vw 5rem;
}
.sd-chapter {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0.5;
    margin-bottom: 1.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-variant-numeric: tabular-nums;
}
.sd-chapter::before {
    content: ""; display: inline-block;
    width: 36px; height: 1px;
    background: var(--o);
}

/* ----------- 2. Brief / context — two-column editorial w/ dropcap ----------- */
.sd-brief {
    display: grid;
    grid-template-columns: 0.7fr 1.4fr;
    gap: 5vw;
    align-items: start;
}
.sd-brief-meta {
    font-family: 'Montserrat', sans-serif;
    border-top: 1px solid var(--rule);
}
.sd-brief-meta dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.1rem 1.5rem;
    padding: 1.5rem 0 0;
}
.sd-brief-meta dt {
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.55;
    padding-top: 4px;
}
.sd-brief-meta dd {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--ink);
}
.sd-brief-meta dd em {
    font-style: italic; font-weight: 400;
    color: var(--o);
}
.sd-brief-body h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 3.6vw, 3.4rem);
    line-height: 1;
    letter-spacing: -0.035em;
    margin: 0 0 2rem;
    max-width: 18ch;
    color: var(--ink);
}
.sd-brief-body h2 em {
    font-style: italic; font-weight: 300;
    color: var(--o); letter-spacing: -0.01em;
}
.sd-brief-body p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.3vw, 1.2rem);
    line-height: 1.65;
    color: var(--ink);
    opacity: 0.85;
    margin: 0 0 1.25rem;
    max-width: 60ch;
}
.sd-brief-body p:first-of-type::first-letter {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    float: left;
    font-size: 4em;
    line-height: 0.82;
    margin: 0.15em 0.18em -0.05em 0;
    color: var(--ink);
}

/* ----------- 3. Deliverables / What's included — poster rows ----------- */
.sd-rows {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    border-top: 2px solid var(--ink);
}
.sd-row {
    display: grid;
    grid-template-columns: minmax(180px, 22%) 1fr minmax(140px, 16%);
    column-gap: 4vw;
    row-gap: 1.5rem;
    align-items: end;
    padding: 3rem 0 2.75rem;
    border-bottom: 1px solid var(--rule);
    position: relative;
    transition: background 0.4s ease;
}
.sd-row:hover { background: rgba(255, 146, 1, 0.04); }
.dark-mode .sd-row:hover { background: rgba(255, 146, 1, 0.05); }
.sd-row::after {
    content: ""; position: absolute;
    left: 0; top: 0;
    width: 0; height: 2px;
    background: var(--o);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.sd-row:hover::after { width: 56px; }
.sd-row-n {
    font-family: 'Montserrat', sans-serif;
    font-weight: 100;
    font-size: clamp(2.6rem, 5vw, 4.6rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: var(--ink);
    opacity: 0.28;
    font-variant-numeric: tabular-nums;
    align-self: end;
}
.sd-row-body { align-self: end; display: flex; flex-direction: column; gap: 0.55rem; }
.sd-row-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: clamp(1.5rem, 2.6vw, 2.4rem);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin: 0;
}
.sd-row-name em {
    font-style: italic; font-weight: 200;
    color: var(--o); letter-spacing: -0.02em;
}
.sd-row-d {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: clamp(0.96rem, 1.05vw, 1.05rem);
    line-height: 1.65;
    color: var(--ink); opacity: 0.8;
    max-width: 56ch;
    margin: 0;
}
.sd-row-tag {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--b);
    align-self: end;
    text-align: right;
}

/* ----------- 4. Process — 4-step numbered ----------- */
.sd-process {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem 4vw;
    margin-top: 2rem;
}
.sd-step { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.sd-step:nth-child(2) { border-top-color: var(--o); }
.sd-step:nth-child(3) { border-top-color: var(--b); }
.sd-step-n {
    font-family: 'Montserrat', sans-serif;
    font-weight: 200;
    font-size: 2.6rem;
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: var(--ink); opacity: 0.32;
    font-variant-numeric: tabular-nums;
    display: block;
    margin-bottom: 0.5rem;
}
.sd-step h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 0.65rem;
    color: var(--ink);
}
.sd-step p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    color: var(--ink); opacity: 0.78;
}

/* ----------- 5. FAQ — editorial accordion ----------- */
.sd-faq { margin-top: 1.5rem; border-top: 2px solid var(--ink); }
.sd-faq details {
    border-bottom: 1px solid var(--rule);
    padding: 1.75rem 0;
    cursor: pointer;
}
.sd-faq summary {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: clamp(1.05rem, 1.35vw, 1.25rem);
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--ink);
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
    transition: color 0.3s ease;
}
.sd-faq summary::-webkit-details-marker { display: none; }
.sd-faq summary::after {
    content: "+";
    font-family: 'Montserrat', sans-serif;
    font-weight: 200;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--o);
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
    flex-shrink: 0;
}
.sd-faq details[open] summary::after { transform: rotate(45deg); }
.sd-faq details:hover summary { color: var(--o); }
.sd-faq details p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: clamp(0.98rem, 1.1vw, 1.08rem);
    line-height: 1.7;
    color: var(--ink); opacity: 0.82;
    margin: 1rem 0 0;
    max-width: 72ch;
}

/* ----------- 6. Closing dark CTA band ----------- */
.sd-close {
    background: #0a0a0a;
    color: #fff;
    border-top: 1px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    margin-top: 5rem;
}
.sd-close::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 60% 80% at 88% 50%, rgba(255,146,1,0.18), transparent 65%);
    pointer-events: none;
    opacity: 0.85;
    z-index: 0;
}
.sd-close-inner {
    position: relative; z-index: 1;
    max-width: 1480px;
    margin: 0 auto;
    padding: 7rem 5vw 6rem;
    display: grid;
    grid-template-columns: 1.4fr auto;
    gap: 3rem 4vw;
    align-items: end;
}
.sd-close h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: clamp(2.4rem, 6vw, 5.6rem);
    line-height: 0.92;
    letter-spacing: -0.045em;
    margin: 0;
    color: #fff;
    max-width: 16ch;
}
.sd-close h2 em {
    font-style: italic; font-weight: 200;
    color: var(--o); letter-spacing: -0.02em;
}
.sd-close h2 .thin { font-weight: 100; opacity: 0.55; }
.sd-close p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #fff;
    opacity: 0.72;
    max-width: 54ch;
    margin: 1rem 0 0;
}
.sd-close-cta {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.7rem;
    border: 1px solid rgba(255,255,255,0.4);
    transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease, gap 0.35s ease;
    white-space: nowrap;
    align-self: end;
}
.sd-close-cta i {
    font-style: normal; font-size: 1.05em;
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.sd-close-cta:hover {
    background: var(--o);
    color: #0a0a0a;
    border-color: var(--o);
    gap: 1.1rem;
}
.sd-close-cta:hover i { transform: translate(4px, -4px); }
.sd-close-cta:focus-visible { outline: 2px solid var(--o); outline-offset: 4px; }

/* ----------- 7. Related — editorial outro row ----------- */
.sd-outro {
    padding: 4rem 5vw 6rem;
    max-width: 1480px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--rule);
}
.sd-outro-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    opacity: 0.55;
}
.sd-outro-links {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}
.sd-outro-links a {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink);
    text-decoration: none;
    opacity: 0.85;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
    transition: opacity 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.sd-outro-links a:hover { opacity: 1; color: var(--o); border-bottom-color: var(--o); }

/* Breadcrumb bar — sits above the intro, matches editorial typography */
.sd-crumbs {
    max-width: 1480px;
    margin: 0 auto;
    padding: 5.5rem 5vw 0;
}
.sd-crumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ink);
    opacity: 0.6;
}
.sd-crumbs li { display: inline-flex; align-items: center; gap: 0.75rem; }
.sd-crumbs li + li::before {
    content: "/";
    color: var(--o);
    opacity: 0.7;
    margin-right: 0.25rem;
}
.sd-crumbs a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease;
}
.sd-crumbs a:hover { color: var(--o); }
.sd-crumbs li[aria-current="page"] { color: var(--o); opacity: 1; }
@media (max-width: 700px) {
    .sd-crumbs { padding: 5rem 1.25rem 0; }
    .sd-crumbs ol { font-size: 0.65rem; letter-spacing: 0.22em; gap: 0.4rem 0.55rem; }
}
/* RTL: breadcrumb separator flips */
body.rtl .sd-crumbs li + li::before { margin-right: 0; margin-left: 0.25rem; }

/* Inline links inside body copy */
.sd-brief-body a,
.sd-row-d a,
.sd-close p a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--o);
    padding-bottom: 1px;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.sd-brief-body a:hover,
.sd-row-d a:hover,
.sd-close p a:hover {
    color: var(--o);
}

/* ----------- Responsive ----------- */
@media (max-width: 1024px) {
    .sd-intro {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        min-height: auto;
        gap: 2.5rem 4vw;
        padding-bottom: 3rem;
    }
    .sd-intro-mast  { grid-column: 1; grid-row: 1; }
    .sd-intro-head  { grid-column: 1; grid-row: 2; max-width: none; }
    .sd-intro-aside {
        grid-column: 1; grid-row: 3;
        max-width: none;
        justify-self: start; text-align: left;
        border-right: 0; border-left: 1px solid var(--o);
        padding-left: 1.25rem; padding-right: 0;
    }
    .sd-intro-cue {
        position: static;
        grid-column: 1; grid-row: 4;
        margin-top: 1rem;
    }
    .sd-brief { grid-template-columns: 1fr; gap: 2.5rem; }
    .sd-process { grid-template-columns: 1fr 1fr; }
    .sd-close-inner { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .sd-section { padding: 4rem 1.25rem 3rem; }
    .sd-intro { padding: 6rem 1.25rem 2.5rem; gap: 2.5rem; }
    .sd-intro::before { left: 1.25rem; right: 1.25rem; }
    .sd-intro-cue { position: static; margin-top: 1rem; }
    .sd-row { grid-template-columns: 60px 1fr; column-gap: 1rem; padding: 2rem 0 2.25rem; }
    .sd-row-n { font-size: 2.2rem; }
    .sd-row-tag { grid-column: 1 / -1; text-align: left; }
    .sd-process { grid-template-columns: 1fr; }
    .sd-close-inner { padding: 4.5rem 1.25rem 4rem; }
    .sd-outro { padding: 2.5rem 1.25rem 4rem; }
    .sd-faq summary { gap: 1rem; }
}
/* Small mobile — 320px → 480px */
@media (max-width: 480px) {
    .sd-section { padding: 3rem 1rem 2.5rem; }
    .sd-intro { padding: 5.5rem 1rem 2rem; gap: 2rem; min-height: auto; }
    .sd-intro::before { left: 1rem; right: 1rem; }
    .sd-intro-mast { flex-direction: column; align-items: flex-start; gap: 0.65rem; }
    .sd-intro-mast span + span { text-align: left; }
    .sd-row { padding: 1.75rem 0 2rem; column-gap: 0.85rem; grid-template-columns: 48px 1fr; }
    .sd-row-n { font-size: 1.9rem; }
    .sd-row-body { gap: 0.4rem; }
    .sd-faq details { padding: 1.25rem 0; }
    .sd-faq summary { font-size: 1rem; gap: 0.85rem; }
    .sd-faq summary::after { font-size: 1.4rem; }
    .sd-brief-meta dl { grid-template-columns: 1fr; gap: 0.25rem 0; }
    .sd-brief-meta dt { padding-top: 0.85rem; }
    .sd-close-inner { padding: 3.5rem 1rem 3rem; gap: 1.5rem; }
    .sd-close-cta { padding: 0.85rem 1.3rem; font-size: 0.72rem; }
    .sd-outro { padding: 2rem 1rem 3rem; gap: 1rem; }
    .sd-outro-links { gap: 1.25rem 1.5rem; }
    .sd-outro-links a { font-size: 0.8rem; }
}
/* Large desktop — 1440px+ — constrain max-width to keep line lengths readable */
@media (min-width: 1680px) {
    .sd-section, .sd-close-inner, .sd-outro, .sd-intro { max-width: 1480px; }
}

/* Arabic typography overrides */
body.rtl.sd-body { font-family: 'Tajawal','Cairo','Montserrat',sans-serif; }
body.rtl .sd-intro-head h1, body.rtl .sd-brief-body h2, body.rtl .sd-row-name, body.rtl .sd-close h2 {
    font-family: 'Tajawal','Cairo','Montserrat',sans-serif;
    letter-spacing: -0.01em;
    line-height: 1.1;
}
body.rtl .sd-intro-head h1 em, body.rtl .sd-brief-body h2 em, body.rtl .sd-row-name em, body.rtl .sd-close h2 em {
    font-family: 'Tajawal','Cairo',sans-serif;
    font-style: normal;
}
body.rtl .sd-brief-body p:first-of-type::first-letter {
    float: right; margin: 0.15em 0 -0.05em 0.18em;
}
body.rtl .sd-intro-aside {
    border-right: 0; border-left: 1px solid var(--o);
    padding-right: 0; padding-left: 1.25rem;
}
/* RTL responsive — fix text-align that the LTR mobile rules force to "left" */
@media (max-width: 1024px) {
    body.rtl .sd-intro-aside { justify-self: start; text-align: right; }
}
@media (max-width: 700px) {
    body.rtl .sd-row-tag { text-align: right; }
    body.rtl .sd-intro-mast span + span { text-align: right; }
}
@media (max-width: 480px) {
    body.rtl .sd-intro-mast span + span { text-align: right; }
}
/* Tabular numbers stay LTR even in RTL flow */
body.rtl .sd-row-n,
body.rtl .sd-step-n,
body.rtl .sd-intro-aside strong { direction: ltr; unicode-bidi: isolate; }
