/* ==========================================================================
   Al-Manara site — shared base for every page in web/.
   Tokens, type, header with the animated logo, buttons, toast, footer, reveals.
   Page-specific styles stay in each page.
   ========================================================================== */

/* ---- fonts: IBM Plex Sans Arabic, the team's main face (OFL) --------------- */
@font-face{font-family:"Plex Arabic";src:url(/assets/fonts/plex-arabic-regular.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"Plex Arabic";src:url(/assets/fonts/plex-arabic-medium.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Plex Arabic";src:url(/assets/fonts/plex-arabic-semibold.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"Plex Arabic";src:url(/assets/fonts/plex-arabic-bold.woff2) format("woff2");font-weight:700;font-display:swap}

/* Animatable wipe edge for the slanted reveals */
@property --w{syntax:"<percentage>";inherits:false;initial-value:130%}

:root{
  --brand:#E63411;
  --brand-deep:#c72f13;
  --brand-wash:#fdeee9;
  --ink:#1D1D1B;
  --ink-soft:#3a3a37;
  --muted:#6b6b66;
  --line:#E2E0DB;
  --paper:#F3F2EE;   /* paper ground: easier on the eyes than pure white */
  --surface:#EBE9E4;
  --card:#FFFFFF;    /* cards stay white and lift off the paper */
  --ok:#1e7d4f;
  --ok-wash:#e6f4ec;
  --font:"Plex Arabic","IBM Plex Sans Arabic","Segoe UI",Tahoma,sans-serif;
  /* The spark's inner slanted edge, (297.66,1140.38) → (600.26,362.38) in logo units.
     Every moving thing travels along it; the section cuts use a shallow cut that
     rises the same way (bottom-left → top-right). */
  --cut:clamp(28px,7vw,96px);
  --gutter:clamp(16px,5vw,64px);
  --max:1200px;
  --head-h:64px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--font);font-size:17px;line-height:1.8;overflow-x:hidden}
h1,h2,h3,p{margin:0}
h1,h2,h3{line-height:1.3;text-wrap:balance;font-weight:700}
a{color:inherit}
img{max-width:100%;display:block}
.ltr{direction:ltr;unicode-bidi:isolate;display:inline-block}
.num{font-variant-numeric:tabular-nums}
:focus-visible{outline:2.5px solid var(--brand);outline-offset:3px;border-radius:4px}
.wrap{max-width:var(--max);margin-inline:auto;padding-inline:var(--gutter)}
.eyebrow{display:inline-flex;align-items:center;gap:10px;font-size:14px;font-weight:600;color:var(--brand);letter-spacing:.01em}
.eyebrow::before{content:"";width:22px;height:3px;background:var(--brand);transform:skewX(-21deg)}

/* ---- buttons ---------------------------------------------------------------- */
.btn{display:inline-flex;align-items:center;gap:10px;min-height:48px;padding:10px 22px;border-radius:6px;font:600 16px/1.2 var(--font);text-decoration:none;border:2px solid transparent;cursor:pointer;transition:background-color .15s,color .15s,border-color .15s,transform .15s}
.btn svg{width:18px;height:18px;flex:none}
.btn:active{transform:translateY(1px)}
.btn-sm{min-height:44px;padding:8px 18px;font-size:15px}
/* Buttons charge like the spark: a band sweeps in from the left, its leading edge
   leaning at the spark's angle (21.3° off vertical), moving the way the fist leaves
   the spark. Hover shows a low charge; pressing fills it (site.js adds .charged). */
.btn-primary,.btn-white{position:relative;isolation:isolate;overflow:hidden}
.btn-primary::before,.btn-white::before{content:"";position:absolute;top:0;bottom:0;left:-30%;width:160%;z-index:-1;
  transform:skewX(-21.3deg) translateX(-100%);transition:transform .35s cubic-bezier(.65,0,.35,1)}
@media (hover:hover){.btn-primary:hover::before,.btn-white:hover::before{transform:skewX(-21.3deg) translateX(-80%)}}
.btn-primary.charged::before,.btn-white.charged::before{transform:skewX(-21.3deg) translateX(0)}
.btn-primary{background:var(--brand);color:#fff}
.btn-primary::before{background:var(--charge,var(--ink))}
.btn-white{background:#fff;color:var(--ink);transition:color .2s .1s}
.btn-white::before{background:var(--brand)}
.btn-white.charged{color:#fff}
.btn-white.charged .ico polygon{fill:#fff}
.btn-primary .ico polygon{fill:currentColor}   /* the red spark would vanish on a red button */
.btn-ghost{border-color:var(--ink);color:var(--ink);background:transparent}
.btn-ghost:hover{background:var(--ink);color:#fff}
/* Icon buttons carry the identity: the whole mark, or the spark. The icon stays still. */
.btn-ico .ico{width:auto;height:22px;flex:none;overflow:visible}
/* On dark grounds an ink charge would vanish, so primary buttons charge white there. */
.on-dark .btn-primary{--charge:#fff;transition:color .2s .1s}
.on-dark .btn-primary.charged{color:var(--brand)}
.on-dark .btn-ghost{border-color:#fff;color:#fff}
.on-dark .btn-ghost:hover{background:#fff;color:var(--ink)}
/* Follow buttons wear each app's own colour and icon. */
.btn-social{color:#fff;border:0;padding:0;width:56px;height:56px;justify-content:center;transition:filter .15s,transform .15s}
.btn-social:hover{filter:brightness(1.08)}
.btn-social svg{width:26px;height:26px}
.btn-social.tg{background:#229ED9}
.btn-social.ig{background:linear-gradient(45deg,#F58529 0%,#DD2A7B 45%,#8134AF 75%,#515BD4 100%)}

/* ---- small actions under an event (register · add to calendar · share) ------- */
.acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.act{display:inline-flex;align-items:center;gap:6px;min-height:38px;padding:6px 12px;border:1px solid var(--line);border-radius:6px;background:var(--card);color:var(--ink);font:600 13px/1 var(--font);cursor:pointer;text-decoration:none;transition:border-color .15s,background-color .15s}
.act:hover{border-color:var(--ink)}
.act svg{width:16px;height:16px;flex:none}
.act.act-main{background:var(--brand);border-color:var(--brand);color:#fff;padding-inline:18px}
.act.act-main:hover{background:var(--brand-deep);border-color:var(--brand-deep)}

/* ---- header ----------------------------------------------------------------- */
/* moving between pages: the header stays put and the page underneath cross-fades
   (browsers without view transitions just load the page as before) */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:.2s}
@media (prefers-reduced-motion:reduce){@view-transition{navigation:none}}
.site-head{view-transition-name:site-head}
.site-head{--k:1;position:sticky;top:0;z-index:30;padding-top:env(safe-area-inset-top,0px)}
/* The bar's ground and rule fade in as one layer (opacity only, no blur: a backdrop
   blur repainted on every scroll frame is what stutters on phones). */
.site-head::before{content:"";position:absolute;inset:0;background:var(--paper);border-bottom:1px solid var(--line);opacity:var(--k);z-index:-1}
.head-in{height:var(--head-h);display:flex;align-items:center;justify-content:space-between;gap:16px}
/* The lockup is drawn left-to-right like the artwork: symbol, then the name. At the top
   of the page it is larger, hanging below the bar, and shrinks back as you scroll
   (--k: 0 at the top, 1 after ~140px). The bar keeps its height, so nothing moves. */
.lockup{--h:44px;--big:1.75;display:flex;align-items:flex-start;direction:ltr;text-decoration:none;height:var(--h);width:calc(var(--h) * 1.6496);position:relative;flex:none;
  transform-origin:right top;transform:scale(calc(1 + (var(--big) - 1) * (1 - var(--k))))}   /* no will-change: it froze the logo's raster at the small size, so the big logo at the top came out blurry */
.lockup .mark{width:calc(var(--h) * .5602);height:var(--h);overflow:visible;flex:none}
.lockup .name{position:absolute;left:calc(var(--h) * .614);top:calc(var(--h) * .2765);width:calc(var(--h) * 1.0345);height:calc(var(--h) * .498);
  background:url(/assets/logo-name.svg) no-repeat;background-size:100% 100%}
.nav{display:flex;align-items:center;gap:28px}
.nav a.link{text-decoration:none;font-weight:500;font-size:15px;color:var(--ink-soft);position:relative;padding-block:6px}
.nav a.link::after{content:"";position:absolute;inset-inline:0;bottom:0;height:2px;background:var(--brand);transform:scaleX(0);transform-origin:left;transition:transform .2s}
.nav a.link:hover::after,.nav a.link[aria-current]::after{transform:scaleX(1)}
.nav .btn{min-height:40px;padding:6px 18px;font-size:15px}
.nav .nav-admin{min-height:36px;padding:4px 14px;font-size:14px}
/* phones: the links move into the ☰ sheet; the admin button too */
.menu-btn{display:none;width:44px;height:44px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--ink);cursor:pointer;place-items:center;flex:none}
.menu-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.menu-btn.open{background:var(--ink);border-color:var(--ink);color:#fff}
@media (max-width:820px){
  .nav{gap:10px}
  .nav a.link,.nav .nav-admin,.nav:not([data-nav=own]) > .btn-primary{display:none}
  .menu-btn{display:grid}
}
.menu-sheet{position:fixed;inset:var(--top,64px) 0 0 0;z-index:29}
.menu-open .site-head{--k:1!important}   /* the logo settles to its small size so it doesn't cover the sheet */
.menu-scrim{position:absolute;inset:0;background:rgba(29,29,27,.32)}
.menu-list{position:relative;background:var(--paper);border-bottom:1px solid var(--line);padding:8px var(--gutter) 20px;display:grid;
  box-shadow:0 18px 30px rgba(0,0,0,.08);animation:menu-in .22s ease-out}
.menu-item:last-child{border-bottom:0}
.menu-item{display:flex;align-items:center;min-height:54px;font-size:18px;font-weight:600;color:var(--ink);text-decoration:none;border-bottom:1px solid var(--line)}
.menu-item[aria-current]{color:var(--brand)}
.menu-item[aria-current]::before{content:"";width:16px;height:4px;background:var(--brand);transform:skewX(-21deg);margin-inline-end:10px}
.menu-list:focus{outline:none}
@keyframes menu-in{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.menu-list{animation:none}}
@media (min-width:821px){.lockup{--h:50px}:root{--head-h:76px}}

/* ---- reveals along the slant (only once JS runs; without JS all is visible) -- */
.js .wipe{clip-path:polygon(0 0,calc(var(--w) + 18%) 0,var(--w) 100%,0 100%);--w:-20%;transition:--w .9s cubic-bezier(.65,0,.35,1)}
.js .wipe.in{--w:130%}
.js .rise{opacity:0;transform:translate(calc(var(--d,24px) * -.36),var(--d,24px));transition:opacity .6s ease,transform .7s cubic-bezier(.2,.7,.2,1)}
.js .rise.in{opacity:1;transform:none}

/* ---- toast -------------------------------------------------------------------- */
.toast{position:fixed;z-index:60;left:50%;bottom:calc(24px + env(safe-area-inset-bottom,0px));transform:translate(-50%,16px);opacity:0;pointer-events:none;
  background:var(--ink);color:#fff;font:500 15px/1.4 var(--font);padding:12px 18px;border-radius:8px;max-width:calc(100vw - 32px);transition:opacity .2s,transform .25s}
.toast.show{opacity:1;transform:translate(-50%,0)}

/* ---- footer ------------------------------------------------------------------- */
.foot{background:var(--ink);color:rgba(255,255,255,.55);font-size:13px;padding-block:20px calc(20px + env(safe-area-inset-bottom,0px));border-top:1px solid rgba(255,255,255,.08)}
.foot .wrap{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}

/* ---- review panel for prototypes (not part of the site; ?clean removes it) ---- */
.proto{position:fixed;z-index:120;top:calc(var(--head-h) + 10px + env(safe-area-inset-top,0px));inset-inline-start:10px;font:500 12px var(--font);background:var(--ink);color:#fff;border-radius:6px;padding:6px 10px;display:flex;gap:10px;align-items:center;opacity:.85}
.proto a{color:#fff}
.proto button{all:unset;cursor:pointer;text-decoration:underline}

@media (prefers-reduced-motion:reduce){
  .js .wipe{clip-path:none}
  .js .rise{opacity:1;transform:none}
}
