/* ===================================================================
   SPEAKERS — the dark gallery
   -------------------------------------------------------------------
   Four portraits to a row on a near-black ground, greyed back. Click
   one and it comes up in colour, lifts off the grid, and a band opens
   directly beneath that row with the name, the practice and the way
   through to the biography.

   Its own stylesheet, and its own script — index.php is not touched by
   either. The panel and the arrows are moved into the grid by the
   script, which is why they carry grid-column rules here.

   The accent is the green out of the Navayan leaf rather than a colour
   invented for the occasion.
   =================================================================== */

.spk-dark{
  --ink:#0E0D0C;          /* the ground */
  --acc:#C3DE93;          /* the leaf, lifted for a dark background */
  --acc-ink:#1A1D16;      /* what sits legibly on the leaf */
  --pale:#F4F1EA;
  --dim:#9A978F;
  --hair:rgba(244,241,234,.14);

  background:var(--ink);
  color:var(--pale);
  padding:clamp(72px,8vw,124px) 0;
}

/* the heading block, which comes from landing.css and is built for a pale
   ground — only the colours need turning over */
.spk-dark .sec-head{border-color:var(--hair)}
.spk-dark .eyebrow{color:var(--acc)}
.spk-dark .display{color:var(--pale)}
.spk-dark .display em{color:var(--acc)}
.spk-dark .sec-note{color:var(--dim)}

/* ------------------------------------------------------------- the grid -- */
/* Four to a row. The element is still called the rail, because the markup it
   came from called it that and renaming it would mean touching index.php. */
.spk-rail{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:clamp(10px,1.1vw,18px);
  margin:clamp(26px,3vw,44px) 0 0;
  padding:0;
  overflow:visible;
}

.spk-card{
  position:relative;
  aspect-ratio:3/4;
  background:#1A1917;
  border:1px solid rgba(244,241,234,.1);
  cursor:pointer;
  overflow:hidden;
  transition:border-color .35s ease,transform .45s cubic-bezier(.22,1,.36,1),
             box-shadow .45s ease,z-index 0s;
}
.spk-card:focus-visible{outline:2px solid var(--acc);outline-offset:3px}

/* The one in focus: in colour, and lifted off the grid. The rest stay as they
   were. A transform rather than a bigger cell, so the four-up rhythm holds
   and nothing below it jumps about. */
.spk-card.on{
  border-color:var(--acc);
  transform:scale(1.045);
  z-index:3;
  box-shadow:0 26px 60px -24px rgba(0,0,0,.85);
}

.spk-shot{position:absolute;inset:0}
.spk-shot img{
  width:100%;height:100%;object-fit:cover;object-position:center 22%;display:block;
  filter:grayscale(1) contrast(1.05) brightness(.74);
  transition:filter .45s ease,transform .7s cubic-bezier(.22,1,.36,1);
}
.spk-card:hover .spk-shot img{filter:grayscale(1) contrast(1.05) brightness(.92)}
/* the colour photograph, which is the whole point of choosing one */
.spk-card.on .spk-shot img{filter:none;transform:scale(1.02)}

.spk-shot:after{
  content:'';position:absolute;inset:0;
  background:linear-gradient(transparent 34%,rgba(8,8,7,.52) 62%,rgba(8,8,7,.93));
}

/* No photograph yet. Rather than a dark hole in the row, the card carries the
   initials large on a ruled ground, so a speaker whose portrait has not
   arrived still looks like a card somebody made on purpose. */
.spk-shot.nophoto{
  background:
    repeating-linear-gradient(135deg,rgba(195,222,147,.05) 0 1px,transparent 1px 11px),
    radial-gradient(ellipse at 50% 34%,rgba(195,222,147,.1),transparent 62%),
    linear-gradient(165deg,#272622,#121110);
}
.spk-ini{
  position:absolute;inset:0;display:grid;place-items:center;
  padding-bottom:16%;
  font:italic 400 clamp(54px,5.4vw,86px)/1 var(--serif,'Instrument Serif',Georgia,serif);
  color:rgba(244,241,234,.3);
  transition:color .4s ease;
}
.spk-shot:not(.nophoto) .spk-ini{display:none}
.spk-card.on .spk-ini{color:rgba(195,222,147,.5)}

.spk-cap{
  position:absolute;left:0;right:0;bottom:0;z-index:2;
  padding:0 clamp(14px,1.2vw,20px) clamp(14px,1.3vw,20px);
}
.spk-cap h4{
  margin:0 0 5px;
  font:600 clamp(15px,1.25vw,19px)/1.25 var(--display,'Instrument Serif',Georgia,serif);
  letter-spacing:-.02em;color:#fff;
}
.spk-cap p{
  margin:0;font:400 12px/1.5 var(--sans,'DM Sans',Arial,sans-serif);
  color:rgba(244,241,234,.74);
}

.spk-no{
  position:absolute;right:clamp(12px,1.1vw,18px);bottom:clamp(12px,1.1vw,18px);z-index:3;
  display:none;align-items:center;gap:9px;
  font:600 12px/1 var(--sans,'DM Sans',Arial,sans-serif);letter-spacing:.1em;
  color:var(--acc);
}
.spk-card.on .spk-no{display:flex}
.spk-card.on .spk-cap{padding-bottom:clamp(34px,3vw,46px)}
.spk-no i{font-style:normal;font-size:15px;line-height:1}

/* ------------------------------- the details, beneath the chosen one's row -- */
/* The script moves this into the grid so it falls under the right row. Until
   it does, it sits under the whole grid and still reads correctly. */
.spk-panel{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(0,1fr) minmax(0,1.1fr);
  gap:clamp(20px,3vw,46px);
  align-items:start;
  margin-top:clamp(18px,2vw,28px);
  padding-top:clamp(20px,2.2vw,30px);
  border-top:1px solid var(--hair);
}
/* opened in place, so the row above it does not appear to jump */
.spk-panel.moved{animation:spk-open .45s cubic-bezier(.22,1,.36,1) both}
@keyframes spk-open{
  from{opacity:0;transform:translateY(-8px)}
  to  {opacity:1;transform:none}
}

.spk-big{
  margin:0;
  font:500 clamp(28px,3.2vw,48px)/1.04 var(--display,'Instrument Serif',Georgia,serif);
  letter-spacing:-.045em;color:var(--pale);
}
.spk-facts{
  padding-left:clamp(20px,2.4vw,40px);
  border-left:1px solid var(--hair);
}
.spk-facts p{margin:0 0 4px;font:400 15px/1.55 var(--sans,'DM Sans',Arial,sans-serif)}
.spk-facts p:last-child{margin-bottom:0}
.spk-post{color:var(--dim)}
.spk-prac{color:#fff;font-weight:600}
.spk-place{color:var(--dim)}

.spk-act{
  padding-left:clamp(20px,2.4vw,40px);
  border-left:1px solid var(--hair);
}
.spk-invite{
  margin:0 0 16px;font:400 15px/1.6 var(--sans,'DM Sans',Arial,sans-serif);color:var(--pale);
}
.spk-read{
  display:inline-flex;align-items:center;gap:10px;
  padding:13px 22px;border:0;cursor:pointer;
  background:var(--acc);color:var(--acc-ink);
  font:600 13.5px/1 var(--sans,'DM Sans',Arial,sans-serif);
  transition:background .25s ease,transform .25s ease;
}
.spk-read:hover{background:#D3E8AA;transform:translateY(-1px)}
.spk-read:focus-visible{outline:2px solid var(--pale);outline-offset:3px}
.spk-read i{font-style:normal;font-size:15px}
.spk-read[hidden]{display:none}

/* ---------------------------------------- stepping from one to the next -- */
/* Moved into the grid by the script, directly under the panel. */
.spk-ui{
  grid-column:1 / -1;
  display:flex;align-items:center;gap:clamp(14px,1.6vw,24px);
  margin-top:clamp(18px,2vw,26px);
}
.spk-arrow{
  flex:0 0 auto;width:44px;height:44px;border-radius:50%;
  background:transparent;border:1px solid var(--hair);color:var(--pale);
  display:grid;place-items:center;cursor:pointer;
  transition:border-color .25s ease,color .25s ease;
}
.spk-arrow svg{width:18px;height:18px}
.spk-arrow:hover:not(:disabled){border-color:var(--acc);color:var(--acc)}
.spk-arrow:disabled{opacity:.3;cursor:default}
.spk-arrow:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
.spk-track{flex:1;height:1px;background:var(--hair);position:relative}
.spk-track i{
  position:absolute;left:0;top:-1px;height:3px;width:0;
  background:var(--acc);transition:width .45s cubic-bezier(.22,1,.36,1);
}
/* the counter the script adds; no markup change needed for it */
.spk-count{
  flex:0 0 auto;font:600 12px/1 var(--sans,'DM Sans',Arial,sans-serif);
  letter-spacing:.14em;color:var(--dim);
}
.spk-count b{color:var(--acc);font-weight:600}

/* The hidden controls that carry data-spk through to the photograph viewer.
   Out of the layout, out of the tab order, still clickable from script. */
.spk-dark .spk-proxies{display:none}

/* ---------------------------------------------------------- responsive -- */
@media(max-width:1100px){
  .spk-rail{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:900px){
  .spk-panel{grid-template-columns:1fr;gap:16px}
  .spk-facts,.spk-act{padding-left:0;border-left:0;padding-top:16px;border-top:1px solid var(--hair)}
}
@media(max-width:700px){
  .spk-rail{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .spk-cap h4{font-size:14px}
  .spk-cap p{font-size:11px}
  /* a lifted card would run off the edge of a two-up grid */
  .spk-card.on{transform:none}
  .spk-ui{gap:12px}
  .spk-arrow{width:40px;height:40px}
}

@media(prefers-reduced-motion:reduce){
  .spk-card,.spk-read,.spk-track i,.spk-arrow,.spk-shot img{transition:none}
  .spk-panel.moved{animation:none}
}
