/* Home — "فلسفتنا في التطوير" section (3 tinted photo cards). Mostafa Fawzi add this. */
.sd-phil{position:relative;margin:0 !important;padding:clamp(80px,9vw,128px) clamp(20px,5vw,72px) !important; /* !important: Kadence zeroes side padding on full-width blocks */
  background:#fff}
/* Classic themes wrap group content in an extra div — let its children act as direct children */
.sd-phil .wp-block-group__inner-container{display:contents}
.sd-phil p,.sd-phil h2,.sd-phil h3,.sd-phil figure,.sd-phil .wp-block-group{margin:0 !important} /* spacing comes from gap below */
.sd-phil .sd-wrap{max-width:1296px;margin:0 auto !important;display:flex;flex-direction:column;gap:clamp(40px,5vw,64px)}

/* Head: eyebrow + title on one side, short line on the other */
.sd-phil .sd-ph-hd{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:24px 48px}
.sd-phil .sd-ph-t{display:flex;flex-direction:column;gap:20px;max-width:720px}
.sd-phil .sd-eb{align-self:flex-start;display:inline-flex;align-items:center;gap:12px;font-size:14px;color:#96857c}
.sd-phil .sd-eb::before{content:"";width:32px;height:1px;background:#c19773}
.sd-phil h2{font-family:var(--sd-font-serif);font-weight:700;font-size:clamp(34px,4.6vw,64px);line-height:1.2;color:#012f66}
.sd-phil .sd-ph-lead{max-width:460px;text-wrap:pretty;font-size:17px;line-height:1.9;color:#3e5475}

/* Cards */
.sd-phil .sd-ph-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.sd-phil .sd-pc{position:relative;isolation:isolate;overflow:hidden;border-radius:20px;min-height:380px;padding:32px;
  display:flex;flex-direction:column;justify-content:space-between;gap:32px;
  transform-origin:right center;animation:sdPhDoor 1.2s cubic-bezier(.22,1,.36,1) backwards;
  transition:transform .9s cubic-bezier(.22,1,.36,1),box-shadow .9s cubic-bezier(.22,1,.36,1)}
.sd-phil .sd-pc:nth-child(2){animation-delay:.15s}
.sd-phil .sd-pc:nth-child(3){animation-delay:.3s}
/* Photo + color tint (duotone). If the photo is removed, the card keeps its solid color. */
.sd-phil .sd-pc-bg{position:absolute !important;inset:0;z-index:-2}
.sd-phil .sd-pc-bg img{width:100%;height:100%;object-fit:cover;display:block;transition:transform 1.4s cubic-bezier(.22,1,.36,1)}
.sd-phil .sd-pc::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none}
.sd-phil .sd-pc-top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.sd-phil .sd-pc-num{display:inline-block;font-family:var(--sd-font-serif);font-weight:700;font-size:72px;line-height:1;
  transition:transform .9s cubic-bezier(.22,1,.36,1)}
.sd-phil .sd-ic{flex:none;width:32px;height:32px}
.sd-phil .sd-pc-txt{display:flex;flex-direction:column;gap:12px}
.sd-phil .sd-pc h3{font-family:var(--sd-font-serif);font-weight:700;font-size:30px;line-height:1.3}
.sd-phil .sd-pc p:not(.sd-pc-num){font-size:16px;line-height:1.9}
/* Deep brand colors over the photo. --t1 top / --t2 bottom = how much color covers the photo (0 = photo only, 1 = solid color). */
.sd-phil .sd-pc{--t1:.86;--t2:.95;color:#fef3ef}
/* 1 · navy */
.sd-phil .c1{background:#012f66}
.sd-phil .c1::before{background:linear-gradient(rgba(1,47,102,var(--t1)),rgba(1,47,102,var(--t2)))}
/* 2 · bronze (deep sand) */
.sd-phil .c2{background:#7d5a3c}
.sd-phil .c2::before{background:linear-gradient(rgba(125,90,60,var(--t1)),rgba(125,90,60,var(--t2)))}
/* 3 · deep taupe */
.sd-phil .c3{background:#3e342f}
.sd-phil .c3::before{background:linear-gradient(rgba(62,52,47,var(--t1)),rgba(62,52,47,var(--t2)))}
/* Text: cream titles, soft body, sand numerals + icons */
.sd-phil .sd-pc h3{color:#fef3ef}
.sd-phil .sd-pc p:not(.sd-pc-num){color:#e9ddd5}
.sd-phil .sd-pc-num,.sd-phil .sd-ic{color:#c19773}
.sd-phil .c2 .sd-pc-num,.sd-phil .c2 .sd-ic{color:#f3dcc6}

/* Hover: 3D tilt + numeral pops + photo zoom — only for real mouse users on wide screens */
@media (hover:hover) and (min-width:1025px){
  .sd-phil .sd-pc:hover{transform:perspective(1000px) rotateX(5deg) rotateY(-7deg) translateY(-8px);box-shadow:0 40px 60px -40px rgba(1,47,102,.55)}
  .sd-phil .sd-pc:hover .sd-pc-num{transform:translateY(-6px) scale(1.18)}
  .sd-phil .sd-pc:hover .sd-pc-bg img{transform:scale(1.06)}
}

/* Animations wait until the section scrolls into view (sd-reveal.js adds .is-in) */
.sd-js .sd-reveal:not(.is-in) .sd-pc{animation-play-state:paused}
@keyframes sdPhDoor{from{opacity:0;transform:perspective(1200px) rotateY(-75deg)}}
@keyframes sdPhUp{from{opacity:0;transform:translateY(28px)}}

/* Desktop entrance (plays once, when the section scrolls into view):
   the 3 cards come up to different heights (1 highest, 3 lowest), then slide into one row, each at its own speed.
   Uses "translate", so the hover tilt (transform) still works. Mobile/tablet keep the simple rise below. */
@media (min-width:1025px){
  .sd-phil .sd-pc{animation:sdPhPar var(--pd,1.8s) cubic-bezier(.22,1,.36,1) backwards} /* delays: .15s / .3s from the nth-child rules above */
  .sd-phil .c1{--py:60px;--pd:1.7s}
  .sd-phil .c2{--py:170px;--pd:2s}
  .sd-phil .c3{--py:280px;--pd:2.3s}
}
@keyframes sdPhPar{0%{translate:0 calc(var(--py,0px) + 80px);opacity:0}35%{translate:0 var(--py,0px);opacity:1}55%{translate:0 var(--py,0px)}100%{translate:0 0;opacity:1}}

/* Tablet: 3 columns stay, a bit tighter */
@media (max-width:1024px){
  .sd-phil .sd-ph-grid{gap:12px}
  .sd-phil .sd-pc{min-height:340px;padding:26px;gap:24px}
  .sd-phil .sd-pc-num{font-size:60px}
  .sd-phil .sd-pc h3{font-size:24px}
  .sd-phil .sd-pc p:not(.sd-pc-num){font-size:15px}
}
/* Mobile: one card per row, simple rise instead of the 3D door */
@media (max-width:767px){
  .sd-phil .sd-ph-hd{gap:16px}
  .sd-phil .sd-ph-lead{font-size:16px}
  .sd-phil .sd-ph-grid{grid-template-columns:1fr}
  .sd-phil .sd-pc{min-height:260px;padding:24px;animation-name:sdPhUp;animation-duration:.9s}
  .sd-phil .sd-pc:nth-child(2){animation-delay:.1s}
  .sd-phil .sd-pc:nth-child(3){animation-delay:.2s}
  .sd-phil .sd-pc-num{font-size:56px}
  .sd-phil .sd-pc h3{font-size:24px}
}
@media (prefers-reduced-motion:reduce){.sd-phil *,.sd-phil .sd-pc{animation:none !important;transition:none !important}}

/* English (LTR) mirror — Mostafa Fawzi add this. */
html[dir=ltr] .sd-phil .sd-pc{transform-origin:left center;animation-name:sdPhDoorL}
@keyframes sdPhDoorL{from{opacity:0;transform:perspective(1200px) rotateY(75deg)}}
@media (hover:hover) and (min-width:1025px){
  html[dir=ltr] .sd-phil .sd-pc:hover{transform:perspective(1000px) rotateX(5deg) rotateY(7deg) translateY(-8px)}
}
