/* ------------------------------------------------------------------------------
   «أركان المركز» — the corners of the centre, on the landing page.

   A dark gallery band. The corners stand side by side like volumes on a shelf; each shows
   only its number, its name and how many it holds. One is pulled open at a time: its
   picture widens to fill the room, and its words, subjects and the way in appear over it.
   On a phone the shelf lies down: the same volumes, one above the other, one open.

   The row has a fixed height, so opening a corner never moves the page. Without scripting
   (no `.ark-on`) every corner is simply an open card. assets/js/arkan.js does the rest.

   A corner's one link is the «تصفّح …» line in its body; its ::after is laid over the whole
   corner (the way the site's cards are linked), and the subjects under it sit above that layer.
   -------------------------------------------------------------------------- */
.arkan{
  --ark-ink:#fff8e6;--ark-soft:#d9cdb2;--ark-gold:#e6c477;--ark-gap:12px;
  --ark-col:clamp(66px,7.6vw,96px);       /* a closed corner: its width (its height on a phone) */
  --ark-col-m:66px;--ark-open-h:min(440px,calc(100svh - 150px));
  position:relative;isolation:isolate;
  background:
    radial-gradient(80% 60% at 88% -10%,rgba(230,196,119,.13),transparent 62%),
    radial-gradient(70% 70% at 6% 110%,rgba(61,101,145,.26),transparent 66%),
    linear-gradient(165deg,#0b1722,#132836 62%,#0b1620);
}
.arkan::before,.arkan::after{content:"";position:absolute;inset-inline:0;block-size:1px;z-index:1;
  background:linear-gradient(to right,transparent,rgba(230,196,119,.55),transparent)}
.arkan::before{inset-block-start:0}
.arkan::after{inset-block-end:0}
.arkan .section-title{color:var(--ark-ink)}
.arkan .ark-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:.4rem 2rem}
.arkan .ark-head .eyebrow{flex-basis:100%;margin:0}
.arkan .ark-lede{margin:0;color:var(--ark-soft);font-size:var(--step-0);max-inline-size:44ch;text-wrap:pretty}
.arkan .section-more{justify-content:center}
.arkan .btn-outline{color:var(--ark-ink);border-color:rgba(230,196,119,.5);background:rgba(230,196,119,.06)}
.arkan .btn-outline:hover{background:rgba(230,196,119,.16);border-color:var(--ark-gold)}

/* ---- without scripting: every corner an open card ---- */
.ark-row{list-style:none;margin:0;padding:0;display:grid;gap:14px;
  grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr))}
.ark{position:relative;isolation:isolate;display:flex;flex-direction:column;justify-content:flex-end;
  min-block-size:360px;overflow:hidden;border-radius:var(--r-lg);color:var(--ark-ink);
  background:#0f2030;box-shadow:0 14px 34px rgba(0,0,0,.34),0 0 0 1px rgba(230,196,119,.16)}
.ark-pic{position:absolute;inset:0;z-index:-2;display:block;overflow:hidden}
.ark-pic img{display:block;inline-size:100%;block-size:100%;object-fit:cover;object-position:50% 10%}
.ark[data-shape="video"] .ark-pic img{object-position:50% 50%}
.ark-mono{display:grid;place-items:center;inline-size:100%;block-size:100%;font-family:var(--font-display);
  font-size:6rem;color:rgba(230,196,119,.5)}
.ark-shade{position:absolute;inset:0;z-index:-1;
  background:linear-gradient(to top,rgba(7,16,25,.97) 0%,rgba(7,16,25,.8) 40%,rgba(7,16,25,.2) 72%,rgba(7,16,25,.3) 100%)}
.ark-shade::after{content:"";position:absolute;inset:0;background:rgba(9,20,31,.6);opacity:0}
.ark-spine{display:none}
.ark-body{display:flex;flex-direction:column;align-items:flex-start;gap:.3rem;padding:1.4rem 1.4rem 1.3rem}
.ark-kind{font-family:var(--font-ui);font-size:11px;font-weight:700;letter-spacing:.06em;color:#1a1305;
  background:var(--ark-gold);padding:2px 10px;border-radius:var(--r-pill);margin-block-end:.35rem}
.ark-title{font-family:var(--font-display);font-size:clamp(1.55rem,1.25rem + 1vw,2.1rem);line-height:1.25;color:var(--ark-ink)}
.ark-count{font-family:var(--font-ui);font-size:14px;font-weight:600;color:var(--ark-gold)}
.ark-sum{margin:.25rem 0 0;font-size:.98rem;line-height:1.75;color:var(--ark-soft);max-inline-size:46ch;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.ark-go{margin-block-start:.6rem;font-family:var(--font-ui);font-size:13.5px;font-weight:700;color:var(--ark-gold);
  text-decoration:none;border-block-end:1px solid rgba(230,196,119,.45);padding-block-end:2px;transition:border-color .2s}
.ark-go::after{content:"";position:absolute;inset:0}
.ark-go:hover,.ark-go:focus-visible{border-color:var(--ark-gold)}
.ark-go:focus-visible{outline:none}
.ark:has(.ark-go:focus-visible){outline:2px solid var(--ark-gold);outline-offset:-4px}
.ark-chips{position:relative;z-index:1;display:flex;flex-wrap:wrap;gap:6px;margin-block-start:.8rem}
.ark-chips .chip{background:rgba(230,196,119,.12);color:#f3e4bd;border-color:rgba(230,196,119,.32);
  font-size:12px;padding:4px 11px;transition:background .2s,border-color .2s}
.ark-chips .chip:hover{background:rgba(230,196,119,.26);border-color:var(--ark-gold)}

/* ---- with scripting: the shelf ---- */
.ark-on .ark-row{display:flex;gap:var(--ark-gap);container-type:inline-size;
  block-size:clamp(470px,68vh,590px);
  --ark-open-w:calc(100cqw - (var(--n) - 1) * (var(--ark-col) + var(--ark-gap)))}
.ark-on .ark{flex:0 0 var(--ark-col);min-inline-size:0;min-block-size:0;cursor:pointer;
  transition:flex-grow .8s cubic-bezier(.3,.72,.16,1),opacity .8s ease calc(var(--i) * 80ms),
             transform .9s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 80ms),box-shadow .5s}
.ark-on .ark.is-open{flex-grow:1;cursor:auto;box-shadow:0 22px 50px rgba(0,0,0,.5),0 0 0 1px rgba(230,196,119,.4)}

/* the entrance: the volumes are set on the shelf one after another, the first right away */
.ark-on .ark-row:not(.is-in) .ark{opacity:0;transform:translateY(34px)}
.ark-on .ark-row.is-in .ark{opacity:1;transform:none}

/* the picture keeps the size it has when open and the corner is a window onto it, so
   opening one reveals more of the same picture instead of squeezing it */
.ark-on .ark-pic{inset-inline:auto;inset-inline-start:0;inline-size:var(--ark-open-w,100%);min-inline-size:100%}
.ark-on .ark-pic img{filter:saturate(.55) brightness(.9);transform:scale(1.06);
  transition:filter .8s ease,transform 1.6s cubic-bezier(.2,.7,.2,1)}
.ark-on .ark.is-open .ark-pic img{filter:none;transform:none}
.ark-on .ark-shade::after{opacity:1;transition:opacity .7s ease}
.ark-on .ark.is-open .ark-shade::after{opacity:0}
.ark-on .ark:not(.is-open):hover .ark-shade::after{opacity:.6}

/* a closed corner: its number, its name set sideways like a spine, and its count */
.ark-on .ark-spine{position:absolute;inset:0;z-index:1;display:flex;flex-direction:column;align-items:center;
  justify-content:space-between;padding:1.15rem 0 1.25rem;pointer-events:none;
  transition:opacity .35s ease .15s}
.ark-on .ark.is-open .ark-spine{opacity:0;transition-delay:0s;transition-duration:.2s}
.ark-spine em{font-style:normal;font-family:var(--font-display);font-size:1.05rem;color:var(--ark-gold);
  border-block-end:1px solid rgba(230,196,119,.5);padding-block-end:.4rem;min-inline-size:1.9rem;text-align:center}
.ark-spine b{font-family:var(--font-display);font-size:clamp(1.15rem,1rem + .5vw,1.5rem);font-weight:700;color:var(--ark-ink);
  writing-mode:vertical-rl;white-space:nowrap;text-shadow:0 2px 14px rgba(0,0,0,.6)}
.ark-spine i{font-style:normal;font-family:var(--font-ui);font-size:13px;font-weight:700;color:var(--ark-gold);
  font-variant-numeric:tabular-nums}

/* an open corner: a large ghost numeral, and the words that rise into place. The body keeps
   the open width so its lines never re-wrap while the corner is still opening. */
.ark-on .ark::before{content:attr(data-n);position:absolute;z-index:1;inset-block-start:.6rem;inset-inline-start:1.3rem;
  font-family:var(--font-display);font-size:clamp(4.4rem,3rem + 6vw,8rem);line-height:1;color:var(--ark-gold);opacity:0;
  pointer-events:none;transition:opacity .5s ease}
.ark-on .ark.is-open::before{opacity:.2;transition-delay:.3s}
.ark-on .ark-body{inline-size:var(--ark-open-w,100%);flex:none;padding:1.7rem 1.9rem 1.8rem;
  opacity:0;transform:translateY(16px);pointer-events:none;transition:opacity .3s ease,transform .3s ease}
.ark-on .ark.is-open .ark-body{opacity:1;transform:none;pointer-events:auto;
  transition:opacity .55s ease .3s,transform .75s cubic-bezier(.2,.7,.2,1) .3s}

/* ---- a phone: the volumes lie down, one above another ---- */
@media (max-width:899.98px){
  .arkan .ark-head{display:block}
  .arkan .ark-lede{margin-block-start:.5rem}
  .ark-on .ark-row{flex-direction:column;container-type:normal;
    block-size:calc((var(--n) - 1) * (var(--ark-col-m) + var(--ark-gap)) + var(--ark-open-h))}
  .ark-on .ark{flex-basis:var(--ark-col-m)}
  .ark-on .ark-pic{inline-size:100%;block-size:var(--ark-open-h);inset-block:0 auto;inset-inline:0;min-inline-size:0}
  .ark-on .ark-spine{flex-direction:row;justify-content:flex-start;gap:.9rem;padding:0 1.1rem;align-items:center}
  .ark-spine b{writing-mode:horizontal-tb;font-size:1.3rem}
  .ark-spine i{margin-inline-start:auto}
  .ark-spine em{border-block-end:0;padding:0;min-inline-size:0}
  .ark-on .ark-body{inline-size:100%;padding:1.2rem 1.3rem 1.3rem}
  .ark-on .ark::before{font-size:4.2rem;inset-inline-start:1rem;inset-block-start:.4rem}
  .ark-title{font-size:1.55rem}
  .ark-sum{font-size:.93rem;line-height:1.7}
}

@media (prefers-reduced-motion:reduce){
  .ark-on .ark,.ark-on .ark-pic img,.ark-on .ark-body,.ark-on .ark-spine,.ark-on .ark-shade::after,
  .ark-on .ark::before{transition:none!important}
  .ark-on .ark-row:not(.is-in) .ark{opacity:1;transform:none}
}

/* a corner with no picture wears the centre's logo, not its first letter */
.ark-mono{background:url("../img/logo-full-sm.png") center / min(46%,200px) auto no-repeat;font-size:0;color:transparent}
