/* ===========================================================================
   AL-SAEED ECONOMIC GROUP  —  pages/p-gallery-album.css
   ---------------------------------------------------------------------------
   Gallery album. The fifteenth 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         vertical bar eyebrow, staggered grid, caption plates
     Project detail   bracketed eyebrow, long-form copy beside a sticky rail
     Global Presence  flanking rules, two-column evidence comparison
     Sustainability   diamond marker, quadrant and an empty report table
     News             highlighter band, front page and a date-first archive
     News detail      corner ticks, no banner, a measured column with breakouts
     Gallery          2x2 dot grid glyph, albums drawn as stacks of prints
     Gallery album    a THREE-SIDED FRAME, open on the leading edge, square
                      cornered - a tab rather than a pill - and a MOSAIC: one
                      tile spanning two columns and two rows with the rest at
                      single size, so the grid is deliberately uneven where
                      every other grid on the site is uniform.

   The album is also the only page with an image LIGHTBOX. The brief's popup
   rules were written for video, and all of them except "stop playback" apply
   to a photograph just as well - so the dialog below is the video modal's
   twin, with previous/next and a counter added because a set needs them.
   See js/lightbox.js.
   =========================================================================== */

.page-gallery-album{
  --eyebrow-fg:var(--teal-dp);
  --page-bg:var(--white);
}

/* The fifteenth eyebrow treatment: a frame missing its leading edge. Logical
   borders, so the open side is the leading one in both directions. */
.page-gallery-album .eyebrow{
  background:none;box-shadow:none;border-radius:0;
  padding-block:.375rem;
  padding-inline:.5rem .75rem;
  border:.0625rem solid var(--gold);
  border-inline-start:0;
  color:var(--eyebrow-fg);
}
.page-gallery-album .eyebrow--onDark{
  color:var(--gold-lt);
  border-color:rgba(201,169,84,.6);
  border-inline-start:0;
}

/* ---------------------------------------------------------------------------
   ALBUM HEAD
   --------------------------------------------------------------------------- */
.album-head{background:var(--white)}
.album-head__text{
  color:var(--ink-2);font-size:var(--fs-lg);
  max-width:min(48rem,100%);margin:var(--s-3) 0 0;
}
.album-head__meta{
  display:flex;flex-wrap:wrap;align-items:center;gap:.75rem var(--s-3);
  margin:var(--s-3) 0 0;
  font-size:var(--fs-sm);color:var(--muted);
}
.album-head__meta b{
  font-family:var(--ff-head, inherit);font-weight:700;color:var(--ink);
  font-variant-numeric:tabular-nums;
}

/* ---------------------------------------------------------------------------
   THE MOSAIC
   ---------------------------------------------------------------------------
   Three columns and a fixed row height, so a tile can span two of each and
   come out roughly square without fighting an aspect-ratio. Six photographs
   fill it exactly: the first takes 2x2, the next two stack beside it, and the
   last three form the bottom row.
   --------------------------------------------------------------------------- */
.mosaic-band{background:var(--cream)}
.mosaic{
  display:grid;gap:var(--gutter);
  grid-template-columns:1fr;
  margin:clamp(2rem,1.5rem + 2.5vw,3.5rem) 0 0;
  padding:0;list-style:none;
}
@media (min-width:36rem){
  .mosaic{
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-auto-rows:clamp(9rem,26vw,14rem);
  }
  /* at two columns the lead tile takes the full width and one row */
  .mosaic > li:first-child{grid-column:span 2}
}
@media (min-width:62rem){
  .mosaic{
    grid-template-columns:repeat(3,minmax(0,1fr));
    grid-auto-rows:clamp(9rem,14vw,15rem);
  }
  .mosaic > li:first-child{grid-column:span 2;grid-row:span 2}
}

/* Each tile is a button, not a link: it opens a dialog on this page rather
   than navigating, and a button is what that is. Reset the control so it
   carries a photograph instead of looking like one. */
.tile{
  display:block;width:100%;height:100%;padding:0;
  border:0;background:none;cursor:zoom-in;
  border-radius:var(--r-md);overflow:hidden;
  position:relative;
  box-shadow:var(--sh-1);
  transition:box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.tile:hover,
.tile:focus-visible{box-shadow:var(--sh-3);transform:translateY(-.1875rem)}
.tile picture{display:block;width:100%;height:100%}
.tile img{
  width:100%;height:100%;object-fit:cover;
  object-position:var(--focus, 50% 50%);
  transition:transform var(--dur-slow) var(--ease);
}
.tile:hover img{transform:scale(1.05)}

/* the caption strip, drawn on the tile and only readable because of the wash
   underneath it */
.tile::after{
  content:"";position:absolute;inset:auto 0 0 0;height:55%;
  background:linear-gradient(to top,rgba(20,17,5,.82),rgba(20,17,5,0));
  pointer-events:none;
  opacity:.9;transition:opacity var(--dur) var(--ease);
}
.tile:hover::after{opacity:1}
.tile__label{
  position:absolute;z-index:1;inset-inline:0;bottom:0;
  padding:var(--s-2) var(--s-3);
  text-align:start;
}
.tile__idx{
  display:block;
  font-size:var(--fs-xs);font-weight:700;letter-spacing:.1em;
  color:var(--gold-lt);font-variant-numeric:tabular-nums;
}
.tile__name{
  display:block;margin-top:.1875rem;
  font-family:var(--ff-head, inherit);font-weight:700;
  font-size:var(--fs-body);line-height:1.25;color:var(--white);
}
/* the magnifier hint, so it is obvious the tile opens rather than navigates */
.tile__zoom{
  position:absolute;z-index:1;
  top:var(--s-2);inset-inline-end:var(--s-2);
  width:2.25rem;height:2.25rem;border-radius:50%;
  display:grid;place-items:center;
  background:rgba(20,17,5,.6);
  box-shadow:inset 0 0 0 .0625rem rgba(255,255,255,.28);
  opacity:0;transform:scale(.86);
  transition:opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.tile:hover .tile__zoom,
.tile:focus-visible .tile__zoom{opacity:1;transform:none}
.tile__zoom svg{
  width:1.125rem;height:1.125rem;
  fill:none;stroke:var(--white);stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
}

/* ---------------------------------------------------------------------------
   THE LIGHTBOX
   ---------------------------------------------------------------------------
   Deliberately the same construction as .v-modal in core.css - same backdrop
   opacity, same blur, same scale-in, same close button - so a visitor who has
   opened the hero video already knows how this behaves.
   --------------------------------------------------------------------------- */
.lb{
  position:fixed;inset:0;z-index:1080;
  display:grid;place-items:center;padding:var(--gutter);
  background:rgba(10,8,2,.9);
  -webkit-backdrop-filter:blur(.375rem);backdrop-filter:blur(.375rem);
  opacity:0;visibility:hidden;
  transition:opacity var(--dur) var(--ease), visibility var(--dur);
}
.lb.is-open{opacity:1;visibility:visible}

.lb__dialog{
  position:relative;
  width:min(80rem,100%);
  transform:scale(.94) translateY(1rem);
  transition:transform var(--dur-slow) var(--ease-out);
}
.lb.is-open .lb__dialog{transform:none}

.lb__img{
  display:grid;place-items:center;
  background:#000;
  border-radius:var(--r-md);overflow:hidden;
  box-shadow:var(--sh-3);
  /* a ceiling rather than an aspect ratio: the six photographs run from 0.78
     to 2.19, and forcing one frame on all of them would letterbox some and
     crop others. The dialog takes whatever shape the picture is, up to the
     height the viewport can spare. */
  max-height:min(78vh,52rem);
}
.lb__img picture{display:block;max-width:100%;max-height:min(78vh,52rem)}
.lb__img img{
  display:block;max-width:100%;max-height:min(78vh,52rem);
  width:auto;height:auto;object-fit:contain;
}

.lb__meta{
  display:flex;flex-wrap:wrap;align-items:baseline;
  gap:.5rem var(--s-2);
  margin-top:var(--s-2);
  color:rgba(255,255,255,.82);
}
.lb__counter{
  font-family:var(--ff-head, inherit);font-weight:700;
  font-size:var(--fs-sm);color:var(--gold-lt);
  font-variant-numeric:tabular-nums;
  direction:ltr;unicode-bidi:isolate;
}
.lb__caption{margin:0;font-size:var(--fs-sm)}

/* close, and the two steppers. All three share one look; the steppers sit on
   the picture's outer edges and mirror with the direction because their
   insets are logical. */
.lb__close,
.lb__nav{
  position:absolute;z-index:2;
  width:2.75rem;height:2.75rem;border-radius:50%;
  display:grid;place-items:center;
  background:rgba(20,17,5,.66);color:var(--white);
  box-shadow:inset 0 0 0 .0625rem rgba(255,255,255,.28);
  transition:background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.lb__close{top:.75rem;inset-inline-end:.75rem}
.lb__close:hover{background:var(--gold-btn);transform:rotate(90deg)}
.lb__close svg{
  width:1.125rem;height:1.125rem;fill:none;stroke:currentColor;
  stroke-width:2.25;stroke-linecap:round;
}

.lb__nav{top:50%;transform:translateY(-50%)}
.lb__nav--prev{inset-inline-start:.75rem}
.lb__nav--next{inset-inline-end:.75rem}
.lb__nav:hover{background:var(--gold-btn);transform:translateY(-50%) scale(1.08)}
.lb__nav svg{
  width:1.25rem;height:1.25rem;fill:none;stroke:currentColor;
  stroke-width:2.25;stroke-linecap:round;stroke-linejoin:round;
}
/* The sprite carries a left chevron and a right one, so each control gets the
   glyph it needs rather than one glyph rotated. In RTL both controls swap
   sides - their insets are logical - so both glyphs have to point the other
   way, which is one mirror applied to the pair. */
[dir="rtl"] .lb__nav svg{transform:scaleX(-1)}

/* ---------------------------------------------------------------------------
   OTHER ALBUMS
   --------------------------------------------------------------------------- */
.siblings{background:var(--white)}
.siblings__list{
  display:grid;gap:var(--gutter);
  grid-template-columns:1fr;
  margin:clamp(1.75rem,1.25rem + 2vw,2.5rem) 0 0;
  padding:0;list-style:none;
}
@media (min-width:36rem){ .siblings__list{grid-template-columns:repeat(2,minmax(0,1fr))} }

.sibling{
  display:flex;align-items:center;justify-content:space-between;
  gap:var(--s-2);
  padding:var(--s-3);
  background:var(--cream);
  border-radius:var(--r-md);
  border-inline-start:.25rem solid var(--teal);
  transition:background var(--dur-fast) var(--ease),
             border-color var(--dur-fast) var(--ease);
}
.sibling:hover{background:var(--gold-tint);border-inline-start-color:var(--gold)}
.sibling__name{
  margin:0;font-size:var(--fs-h4);line-height:1.25;color:var(--ink);
}
.sibling__count{
  display:block;margin-top:.25rem;
  font-size:var(--fs-xs);font-weight:600;
  letter-spacing:.06em;text-transform:uppercase;color:var(--teal-dp);
}
.sibling svg{
  width:1.25rem;height:1.25rem;flex:0 0 auto;
  fill:none;stroke:var(--gold-btn);stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
}

/* ---------------------------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion:reduce){
  .tile,.tile img,.tile::after,.tile__zoom,
  .lb,.lb__dialog,.lb__close,.lb__nav,.sibling{transition:none}
  .tile:hover,.tile:focus-visible{transform:none}
  .tile:hover img{transform:none}
  .lb__dialog,.lb.is-open .lb__dialog{transform:none}
  .lb__nav{transform:translateY(-50%)}
  .lb__nav:hover{transform:translateY(-50%)}
  .lb__close:hover{transform:none}
}
