/* ===========================================================================
   AL-SAEED ECONOMIC GROUP  —  pages/p-projects.css
   ---------------------------------------------------------------------------
   Projects. The eighth distinct visual key:
     Home            teal filled eyebrow, expanding six-panel strip
     About           gold filled eyebrow, timeline on one rule
     Chairman        gold-on-dark eyebrow, letter on the dark ground
     Leadership      outlined eyebrow, portrait grid with no card boxes
     Sectors         rule-and-label eyebrow, alternating full-width rows
     Sector detail   dark filled eyebrow pill, one page as a tab set
     Companies       underlined eyebrow, filterable directory of crest cards
     Projects        a VERTICAL gold bar to the leading side of the label -
                     no box, no fill, no underline, no horizontal rule - and
                     a STAGGERED two-column grid where each photograph carries
                     a white caption plate overlapping its lower corner.

   The stagger and the overlapping plate are the new spatial devices: every
   earlier page keeps its cards on a shared baseline inside the container,
   and this one deliberately does not. Five works, so the columns end uneven -
   which the stagger turns into rhythm rather than a gap.
   Direction-agnostic: logical properties and a mirrored transform-origin.
   =========================================================================== */

.page-projects{
  --eyebrow-fg:var(--teal-dp);
  --page-bg:var(--white);
  /* how far the second column drops below the first */
  --stagger:clamp(2rem, 1rem + 4vw, 5rem);
  /* how far the caption plate hangs over the photograph's lower edge */
  --plate-rise:clamp(1.75rem, 1.25rem + 2vw, 3rem);
}

/* The eighth eyebrow treatment: a vertical bar on the leading side. Logical
   border and padding, so it moves to the right-hand side in Arabic and
   Kurdish without a second rule. */
.page-projects .eyebrow{
  background:none;box-shadow:none;border:0;border-radius:0;
  padding-block:.125rem;
  padding-inline:var(--s-2) 0;
  border-inline-start:.1875rem solid var(--gold);
  color:var(--eyebrow-fg);
}
.page-projects .eyebrow--onDark{
  color:var(--gold-lt);
  border-inline-start-color:var(--gold-lt);
}

/* ---------------------------------------------------------------------------
   BRIEF
   --------------------------------------------------------------------------- */
.brief{background:var(--white)}
.brief__text{
  color:var(--ink-2);font-size:var(--fs-lg);
  max-width:min(48rem,100%);margin:var(--s-3) 0 0;
}

/* The locations the reference actually names, as a row of chips. Deliberately
   not the numeric tally the Companies page uses - these are place names, and
   a figure would have to be invented to turn them into one. */
.places{
  display:flex;flex-wrap:wrap;gap:.5rem;
  margin:clamp(1.75rem,1.25rem + 2vw,2.5rem) 0 0;
  padding:0;list-style:none;
}
.places li{
  display:inline-flex;align-items:center;gap:.5rem;
  padding:.5rem 1rem;
  font-size:var(--fs-sm);font-weight:600;color:var(--ink-2);
  background:var(--cream);
  border-radius:var(--r-pill);
  box-shadow:inset 0 0 0 .0625rem var(--line);
}
.places li::before{
  content:"";flex:0 0 auto;
  width:.375rem;height:.375rem;border-radius:50%;
  background:var(--teal);
}

/* ---------------------------------------------------------------------------
   THE WORKS
   --------------------------------------------------------------------------- */
/* `clip` on the inline axis: the photographs scale on hover and the plates sit
   proud of their column, so without this a hover could widen the document. */
.works-band{background:var(--cream);overflow-x:clip}

.works{
  display:grid;gap:calc(var(--gutter) + var(--plate-rise)) var(--gutter);
  grid-template-columns:1fr;
  margin:clamp(2rem,1.5rem + 2vw,3rem) 0 0;
  padding:0;list-style:none;
}
@media (min-width:62rem){
  .works{grid-template-columns:repeat(2,minmax(0,1fr))}
  /* The stagger. Second-column items drop, which is the whole point of the
     layout; it also means the five works do not leave a bare square at the
     end of an even grid. */
  .work:nth-child(even){margin-block-start:var(--stagger)}
}

.work{position:relative;display:flex;flex-direction:column}

.work__media{
  margin:0;position:relative;
  border-radius:var(--r-md);overflow:hidden;
  box-shadow:var(--sh-1);
}
/* 4/3 for all five. They were rebuilt from the originals inside the reference
   PDF and run from 0.78 to 1.82, so no single frame fits them all; 4/3 is the
   middle of that spread and each work carries its own --focus for the rest.
   See tools/optimize-images.sh for where the files come from. */
.work__media picture{display:block;width:100%;aspect-ratio:4/3}
.work__media img{
  width:100%;height:100%;object-fit:cover;
  object-position:var(--focus, 50% 50%);
  transition:transform var(--dur-slow) var(--ease);
}
.work:hover .work__media img,
.work:focus-within .work__media img{transform:scale(1.04)}

/* a wash at the foot of the photograph, so the plate has something to sit
   against rather than a hard edge */
.work__media::after{
  content:"";position:absolute;inset:auto 0 0 0;height:45%;
  background:linear-gradient(to top,rgba(20,17,5,.42),rgba(20,17,5,0));
  pointer-events:none;
}

/* The caption plate. It overlaps the photograph's lower corner: pulled up by
   --plate-rise and inset from the leading edge, which is why the grid's row
   gap adds that same value back. */
.work__plate{
  position:relative;z-index:1;
  margin-block-start:calc(var(--plate-rise) * -1);
  margin-inline:var(--s-3) var(--s-5);
  padding:var(--s-3);
  background:var(--white);
  border-radius:var(--r-md);
  box-shadow:var(--sh-2);
  transition:transform var(--dur) var(--ease),
             box-shadow var(--dur) var(--ease);
}
.work:hover .work__plate,
.work:focus-within .work__plate{transform:translateY(-.25rem);box-shadow:var(--sh-3)}

.work__meta{
  display:flex;align-items:center;gap:.625rem;
  margin:0 0 .5rem;
}
.work__idx{
  font-size:var(--fs-xs);font-weight:700;
  color:var(--gold-dk);letter-spacing:.12em;
  font-variant-numeric:tabular-nums;
}
.work__place{
  display:inline-flex;align-items:center;gap:.625rem;
  font-size:var(--fs-xs);font-weight:600;
  color:var(--teal-dp);letter-spacing:.08em;text-transform:uppercase;
}
/* the hairline between the index and the place name. On the place name rather
   than on the row, because a pseudo-element on a flex container is laid out
   after all of its children - it would have landed at the end of the row. */
.work__place::before{
  content:"";flex:0 0 auto;
  width:1rem;height:.0625rem;background:var(--line);
}

.work__name{
  margin:0;font-size:var(--fs-h4);line-height:1.25;color:var(--ink);
}
/* the gold rule that draws under the name on hover, from the leading edge */
.work__name::after{
  content:"";display:block;
  height:.125rem;background:var(--gold);
  margin-top:.5rem;
  transform:scaleX(0);transform-origin:left;
  transition:transform var(--dur) var(--ease);
}
[dir="rtl"] .work__name::after{transform-origin:right}
.work:hover .work__name::after,
.work:focus-within .work__name::after{transform:scaleX(1)}

.work__text{
  margin:.625rem 0 0;font-size:var(--fs-sm);color:var(--muted);
}
.work__more{
  display:inline-flex;align-items:center;gap:.5rem;
  margin-top:var(--s-2);
  font-family:var(--ff-head, inherit);
  font-size:var(--fs-sm);font-weight:600;color:var(--ink);
}
.work__more svg{
  width:1rem;height:1rem;flex:0 0 auto;
  fill:none;stroke:var(--gold-btn);stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
  transition:transform var(--dur-fast) var(--ease);
}
.work__more:hover{color:var(--gold-dk)}
/* transforms have no logical axis, so forward is named per direction */
.work__more:hover svg{transform:translateX(.1875rem)}
[dir="rtl"] .work__more:hover svg{transform:translateX(-.1875rem)}

/* ---------------------------------------------------------------------------
   WHICH SECTOR THESE WORKS BELONG TO
   ---------------------------------------------------------------------------
   A light band rather than another dark one - the Companies page already
   closes on dark before the call to action, and two dark bands in a row read
   as one long footer.
   --------------------------------------------------------------------------- */
.tie{background:var(--white)}
.tie__inner{
  display:grid;gap:var(--s-3) var(--gutter);
  grid-template-columns:1fr;align-items:center;
  padding:clamp(1.75rem,1.25rem + 2vw,2.5rem);
  background:var(--cream);
  border-radius:var(--r-lg);
  border-inline-start:.25rem solid var(--teal);
}
@media (min-width:62rem){
  .tie__inner{grid-template-columns:minmax(0,1fr) auto}
}
.tie__title{margin:0;font-size:var(--fs-h4);color:var(--ink)}
.tie__text{margin:.5rem 0 0;color:var(--muted);max-width:62ch}

/* ---------------------------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion:reduce){
  .work__media img,
  .work__plate,
  .work__name::after,
  .work__more svg{transition:none}
  .work:hover .work__plate,
  .work:focus-within .work__plate{transform:none}
  .work:hover .work__media img,
  .work:focus-within .work__media img{transform:none}
}
