/* ==========================================================================
   Team & Contact – every member on a microscope slide of liquid glass
   (shortcode [team_section], krebberlab-team.php; behaviour: team.js)

   The slide is a pane of glass (class kl-glass: real refraction at its edge,
   see the plugin "Krebber Lab – Design"): a thick slab with a hard edge, a
   ground-glass label with name, text and contact, and the photo under a square
   cover slip – the lab behind (grey, half transparent) only under the slip, the
   cut-out person on top, never bent by the glass.

   The slides lie straight in a plain grid. Every text is shown whole: a slide is
   as high as its text (or its photo) needs.
   ========================================================================== */

.kl-team { max-width: 1240px; margin-inline: auto !important; }
.is-layout-constrained > .kl-team.alignwide { max-width: 1240px; }   /* wider than the theme's “wide” size */

/* ---------------------------------------------------------------- the slide */
.kl-team .sl {
  --pw: 150px;                                   /* width of the photo */
  box-sizing: border-box;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--pw);
  gap: 18px;
  padding: 16px 18px 16px 16px;
  border-radius: 2px;                            /* a real slide: nearly square corners */
  /* the glass body: its dark, faintly green edge and a sharp contact shadow */
  box-shadow: inset 0 0 0 1px rgba(34, 72, 60, .24), 0 1px 0 rgba(30, 20, 60, .13), 1px 3px 2px rgba(30, 20, 60, .1), 0 10px 24px rgba(48, 22, 92, .08);
  transition: box-shadow .45s var(--kl-ease);
}
.kl-team .sl.kl-glass {
  background: rgba(255, 255, 255, .3);
  -webkit-backdrop-filter: blur(8px) saturate(1.5);
          backdrop-filter: blur(8px) saturate(1.5);
}
@media (min-width: 782px) {
  /* thick slab (krebberlab-design.js, data-edge="slab"): two hard refracting lines
     at the edge, a gloss on the facet (data-fresnel), some body in the middle */
  .kl-team .sl.kl-glass.kl-lensed {
    background: rgba(255, 255, 255, calc(.36 * var(--kl-g-tint)));
    -webkit-backdrop-filter: blur(calc(2px * var(--kl-g-frost))) var(--kl-lens) saturate(calc(1.4 * var(--kl-g-sat)));
            backdrop-filter: blur(calc(2px * var(--kl-g-frost))) var(--kl-lens) saturate(calc(1.4 * var(--kl-g-sat)));
  }
}

/* the label: ground glass */
.kl-team .sl-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 20px 12px;
  border-radius: 3px;
  background-color: rgba(255, 255, 255, .58);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .45 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.kl-team .sl-k { margin: 0 0 4px !important; font: 600 .72rem/1.3 var(--kl-font-display); letter-spacing: .07em; text-transform: uppercase; color: var(--kl-accent); }
.kl-team .sl-name { margin: 0 !important; font: 700 1.12rem/1.25 var(--kl-font-display) !important; color: var(--kl-ink); letter-spacing: -.01em; }
.kl-team .sl-lead { margin: 10px 0 18px !important; font-size: .98rem; line-height: 1.6; color: var(--kl-text); max-width: 36em; }

.kl-team .sl-bio { margin: 8px 0 14px !important; font-size: .88rem; line-height: 1.55; color: var(--kl-text); max-width: 34em; }

/* contact: always at the bottom of the label */
.kl-team .sl-contact { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--kl-rule); display: grid; gap: 2px; }
.kl-team .sl-c { display: flex; align-items: center; gap: 4px; min-width: 0; }
.kl-team .sl-c a {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 3px 6px 3px 4px; margin-left: -4px; border-radius: 6px;
  font: 500 .88rem/1.35 var(--kl-font-display);
  color: var(--kl-text) !important; text-decoration: none !important;
}
.kl-team .sl-c .nw { white-space: nowrap; }       /* an address breaks before the @ only */
.kl-team .sl-c a svg { flex: none; width: 16px; height: 16px; color: var(--kl-accent); }
.kl-team .sl-c a:hover { background: var(--kl-accent-soft); color: var(--kl-accent) !important; }
.kl-team .sl-c a:hover span { text-decoration: underline; text-underline-offset: 2px; }
.kl-team .sl-copy {
  flex: none; display: grid; place-items: center; position: relative;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none;
  color: rgba(72, 38, 128, .55); cursor: pointer;
}
.kl-team .sl-copy svg { width: 15px; height: 15px; }
.kl-team .sl-copy:hover, .kl-team .sl-copy:focus-visible { background: var(--kl-accent-soft); color: var(--kl-accent); }
.kl-team .sl-copy.is-copied { color: #1d7a46; }
.kl-team .sl-copy.is-copied::after {
  content: "Copied"; position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
  padding: 3px 8px; border-radius: 6px; background: var(--kl-ink); color: #fff;
  font: 500 .74rem var(--kl-font-display); white-space: nowrap; z-index: 5; pointer-events: none;
}

/* ---------------------------------------------------------------- the photo
   .sl-fig is the photo (4:5); the square cover slip covers its lower part
   (--q: its width as a share of the photo's). .sl-spec is the part of it that
   counts: from the top of the head (--ht, as a share of the picture's height,
   measured by team.js) to the lower edge of the cover slip. It stands in the
   middle of the slide; the empty top of the picture lies above it. */
.kl-team .sl-spec {
  --ht: .15;
  position: relative; align-self: center; justify-self: center;
  width: var(--pw); height: calc(1.25 * var(--pw) * (1 - var(--ht)));
}
.kl-team .sl-spec--photo { --ht: .2; }          /* the Pods photo: just the square cover slip */
.kl-team .sl-fig { --q: 1; --L: calc((1 - var(--q)) * 50%); position: absolute; left: 0; bottom: 0; width: var(--pw); aspect-ratio: 4 / 5; }
.kl-team .sl-cover,
.kl-team .sl-shadow { position: absolute; bottom: 0; left: var(--L); width: calc(var(--q) * 100%); aspect-ratio: 1; border-radius: 2px; }
.kl-team .sl-shadow { box-shadow: 0 1px 3px rgba(48, 22, 92, .14); }
/* the cover slip's rim bends the lab behind it: the lens as a plain filter on its
   own (still) content – it costs nothing while the page moves (data-alpha) */
.kl-team .sl-cover.kl-glass { overflow: hidden; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Safari leaves the filtered lab out (until the first hover) unless the cover slip has a layer of its own; in Chrome
   that layer would cost a lot while scrolling (its filter run again in every frame inside the slide's glass), so
   only outside Chromium (there <html> has no class kl-refract) */
html:not(.kl-refract) .kl-team .sl-cover.kl-lensed { transform: translateZ(0); }
@media (min-width: 782px) {
  .kl-team .sl-cover.kl-glass.kl-lensed { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; filter: var(--kl-lens); }
}
.kl-team .sl-cover img {
  position: absolute; bottom: 0; display: block;
  left: calc(-50% * (1 - var(--q)) / var(--q)); width: calc(100% / var(--q)); height: calc(125% / var(--q));
}
.kl-team .sl-bg { filter: grayscale(1) contrast(.9) brightness(1.06); opacity: .42; transition: opacity .55s ease; }
.kl-team .sl-bg--c { filter: none; opacity: 0; }
.kl-team .sl-cutw { position: absolute; inset: 0; pointer-events: none; clip-path: inset(-30% var(--L) 0 var(--L)); }
.kl-team .sl-cut { width: 100%; height: 100%; display: block; transform-origin: 50% 100%; transition: transform .55s var(--kl-ease); }
/* hover: the glass runs through a wave (team.js), then the lab gets its colour and the person comes a little closer */
.kl-team .sl:hover .sl-bg, .kl-team .sl:focus-within .sl-bg { opacity: 0; transition-delay: .18s; }
.kl-team .sl:hover .sl-bg--c, .kl-team .sl:focus-within .sl-bg--c { opacity: .72; }
.kl-team .sl:hover .sl-cut, .kl-team .sl:focus-within .sl-cut { transform: scale(1.04); }
/* a member without prepared portraits: the Pods photo, in colour, under the cover slip */
.kl-team .sl-spec--photo .sl-cover img.sl-photo { left: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }

/* ---------------------------------------------------------------- layout */
.kl-team .sl-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 40px; }
.kl-team .sl--hero { --pw: 250px; }
.kl-team .sl--hero .sl-fig { --q: .84; }        /* her cover slip is narrower: the head rises above it */
.kl-team .sl--hero .sl-label { padding: 26px 30px 16px; }
.kl-team .sl--hero .sl-name { font-size: clamp(1.5rem, 2.6vw, 2rem) !important; letter-spacing: -.025em; }
.kl-team .sl-sub { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; }
.kl-team .sl--office { --pw: 150px; }
.kl-team .sl-addr { margin: 0 !important; display: flex; flex-direction: column; justify-content: center; }
.kl-team .sl-addr p { margin: 0 0 6px !important; line-height: 1.5; }

/* the grid: two columns, each slide only as high as it needs; the slides move up
   (masonry): team.js gives each one as many 2px rows as it is high (plus the gap),
   the grid fills each column from the top. Without team.js: plain rows. */
.kl-team .sl-grid {
  --gap: 28px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start;
  gap: var(--gap); margin-top: var(--gap); padding-bottom: 72px;
}
.kl-team .sl-grid.is-masonry { grid-auto-rows: 2px; row-gap: 0; grid-auto-flow: row dense; }
/* (two columns: hidden until team.js has laid the slides out – drawn first as plain rows, they would jump into
   place a moment later; without team.js they show after 1.5 s) */
@media (min-width: 1001px) {
  .kl-team .sl-grid:not(.is-masonry) { visibility: hidden; animation: kl-team-show 0s 1.5s forwards; }
}
@keyframes kl-team-show { to { visibility: visible; } }
.kl-team .sl-grid.is-masonry > .sl { grid-row-end: span var(--span, 1); }
.kl-team .sl-grid > .sl { --pw: 136px; }
.kl-team .sl:hover, .kl-team .sl:focus-within {
  box-shadow: inset 0 0 0 1px rgba(34, 72, 60, .26), 0 1px 0 rgba(30, 20, 60, .12), 1px 4px 4px rgba(30, 20, 60, .1), 0 16px 34px rgba(48, 22, 92, .13);
}

@media (max-width: 1000px) {
  .kl-team .sl-grid, .kl-team .sl-sub { grid-template-columns: minmax(0, 1fr); }
}
/* phones: one column, the photo above the text */
@media (max-width: 640px) {
  .kl-team .sl,
  .kl-team .sl--hero,
  .kl-team .sl--office,
  .kl-team .sl-grid > .sl { --pw: min(260px, 70vw); grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
  .kl-team .sl-spec { order: -1; margin: 14px 0 6px; }
  .kl-team .sl-label, .kl-team .sl--hero .sl-label { padding: 14px 16px 8px; }
  .kl-team .sl-c a { font-size: .84rem; }
  .kl-team .sl-grid { --gap: 20px; margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .kl-team .sl, .kl-team .sl-cut, .kl-team .sl-bg { transition: none; }
}
