/*
 * About Us (template-about.php, template-parts/about/*) and team bios (template-bio.php,
 * template-parts/bio/*). Ported from the approved mock docs/design/site-direction/
 * index.html, view #about (.s-ab-hero, .s-ab-cols, .s-cl-top, .s-team, .s-divider); the
 * bio pages follow the same system. The mock column is 1120px and the site 1280px, so
 * fixed columns are scaled by 8/7. Tokens only. Rules sit under .gp-team so they outrank
 * the Elementor kit (.elementor-kit-N a, h2) while Elementor stays active.
 */

.gp-team {
  font-size: var(--gp-fs-body);
  line-height: var(--gp-lh-body);
  color: var(--gp-text);
  background: var(--gp-white);
}
.gp-team p { margin: 0; }
.gp-team img { display: block; max-width: 100%; height: auto; }
.gp-team .gp-h-xl, .gp-team .gp-h-l, .gp-team .gp-h-m { font-family: var(--gp-font); color: var(--gp-navy); }
.gp-team .gp-tlink { color: var(--gp-navy); text-decoration: none; }

/* ---------- Hero (About Us and bios): Dark Blue with the dot grid of the service hero ---------- */

.gp-team .ab-hero {
  position: relative;
  overflow: hidden;
  background: var(--gp-cover);
  color: var(--gp-text-dk);
}
.gp-team .ab-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--gp-dots-dk) 1px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, black 100%);
  mask-image: linear-gradient(90deg, transparent 30%, black 100%);
  pointer-events: none;
}
.gp-team .ab-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 72px;
  align-items: center;
  padding-top: 112px;
  padding-bottom: 112px;
}
.gp-team .ab-hero__title { color: var(--gp-white); }
.gp-team .ab-hero__title .gp-lt { color: var(--gp-head-dk); }
.gp-team .ab-hero__title .gp-bd { color: var(--gp-white); }
.gp-team .ab-hero__lead { max-width: 700px; margin-top: 56px; color: var(--gp-head-dk); line-height: 1.7; }

/* Headline lines rise into place once, as on the home page. */
.gp-team .ab-mask { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.gp-team .ab-mask > span { display: block; }
.gp-js .gp-team .ab-mask > span { animation: gp-ab-rise .7s var(--gp-ease) both; }
.gp-js .gp-team .ab-mask:nth-child(2) > span { animation-delay: .09s; }
@keyframes gp-ab-rise { from { transform: translateY(102%); } to { transform: none; } }

/*
 * The shield line work: the logo's sub-paths as Light Blue hairlines, drawn in sequence
 * once on load (outer shield, then the G and the P), about 2.5s in all; then one short
 * orange stroke travels slowly once round the outer contour and stops. Nothing moves
 * after that. Without scripts or with reduced motion it is shown drawn and still.
 * pathLength="1" on each path makes the dash values fractions of the path.
 */
.gp-team .ab-hero__fx { line-height: 0; pointer-events: none; }
.gp-team .ab-shield { display: block; width: auto; height: 460px; max-width: none; overflow: visible; }
.gp-team .ab-shield__line {
  fill: none;
  stroke: var(--gp-light-blue);
  stroke-opacity: .4;
  stroke-width: .7;
  stroke-linejoin: round;
}
.gp-team .ab-shield__run {
  fill: none;
  stroke: var(--gp-accent);
  stroke-width: 1.1;
  stroke-linecap: square;
  stroke-dasharray: .07 1.2;
  stroke-dashoffset: 0;
  opacity: 0;
}
/* Still picture (reduced motion or no script): one short stroke at rest on the outer line. */
.gp-team .ab-shield__run:first-child { opacity: 1; stroke-dashoffset: -.9; }
@media (prefers-reduced-motion: no-preference) {
  .gp-js .gp-team .ab-shield__line {
    stroke-dasharray: 1 2;
    stroke-dashoffset: 1.01;
    animation: gp-ab-draw 1.1s cubic-bezier(.45, 0, .2, 1) forwards;
    animation-delay: calc(.15s + var(--i, 0) * .2s);
  }
  /* After the lines have drawn, one stroke travels round each line in turn, without
     stopping: 4.5s per line, then on to the next. */
  .gp-js .gp-team .ab-shield__runs { opacity: 0; animation: gp-ab-run-in .8s ease-out 2.6s forwards; }
  .gp-js .gp-team .ab-shield__run,
  .gp-js .gp-team .ab-shield__run:first-child {
    opacity: 0;
    stroke-dashoffset: .07;
    animation: gp-ab-run calc(var(--of, 7) * 4.5s) linear calc((var(--n, 0) - var(--of, 7)) * 4.5s) infinite;
  }
}
@keyframes gp-ab-draw { to { stroke-dashoffset: 0; } }
@keyframes gp-ab-run-in { to { opacity: 1; } }
@keyframes gp-ab-run {
  0% { stroke-dashoffset: .07; opacity: 1; }
  14.2% { stroke-dashoffset: -1; opacity: 1; }
  14.28%, 100% { stroke-dashoffset: -1; opacity: 0; }
}

/* ---------- Mission: three columns under a thin Dark Blue rule ---------- */

.gp-team .ab-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px; }
.gp-team .ab-cols p { padding-top: 22px; border-top: 1px solid var(--gp-navy); font-size: 16px; }

/* ---------- Meet the Team ---------- */

.gp-team .ab-team__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 594px;
  gap: 82px;
  align-items: end;
  margin-bottom: 78px;
}
.gp-team .ab-team__top p { font-size: 16px; }
.gp-team .ab-people { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 56px 46px; }
.gp-team .ab-people--partners { margin-top: 64px; padding-top: 64px; border-top: 1px solid var(--gp-rule-lt); }
.gp-team #team, .gp-team #partners { scroll-margin-top: calc(var(--gp-header-h) + 24px); }

/* ---------- Bio hero ---------- */

.gp-team .bio-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 72px;
  align-items: end;
  padding-top: 128px;
  padding-bottom: 112px;
}
.gp-team .bio-hero--solo .bio-hero__inner { grid-template-columns: minmax(0, 1fr); }
.gp-team .bio-hero__name {
  margin: 0;
  font-family: var(--gp-font);
  font-size: 88px;
  line-height: .98;
  letter-spacing: -.03em;
  color: var(--gp-white);
}
.gp-team .bio-hero__name .gp-lt { color: var(--gp-head-dk); }
.gp-team .bio-hero__name .gp-bd { color: var(--gp-white); }
.gp-team .bio-hero__role {
  max-width: 46em;
  margin-top: 30px;
  color: var(--gp-head-dk);
  font-weight: 500;
  font-size: var(--gp-fs-label);
  line-height: 1.7;
  letter-spacing: var(--gp-track-label);
  text-transform: uppercase;
}
.gp-team .bio-hero__links { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 44px; }
.gp-team .bio-hero .gp-tlink { color: var(--gp-white); border-color: var(--gp-rule-dk); }
.gp-team .bio-hero .gp-tlink:hover { border-color: var(--gp-accent); }
.gp-team .bio-hero__back { margin-left: 28px; }
.gp-team .bio-hero__specs { margin: 0; padding: 22px 0 0; border-top: 1px solid var(--gp-rule-dk); }
.gp-team .bio-hero__specs li { margin-bottom: 12px; color: var(--gp-text-dk); font-size: 16px; }
.gp-team .bio-hero__specs li:last-child { margin-bottom: 0; }
.gp-team .bio-hero__specs li::before { top: 11px; }

/* ---------- Bio story: portrait beside a reading column ---------- */

.gp-team .bio-story__grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0 96px; align-items: start; }
.gp-team .bio-story__grid--solo { grid-template-columns: minmax(0, 1fr); }
.gp-team .bio-story__figure { margin: 0; aspect-ratio: 1; overflow: hidden; background: var(--gp-surface-lt); }
.gp-team .bio-story__figure img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.gp-team .bio-story__title { margin-bottom: 36px; }
.gp-team .bio-rich { max-width: 66ch; }
.gp-team .bio-rich p,
.gp-team .bio-rich ul,
.gp-team .bio-rich ol { margin: 0 0 20px; font-size: 17px; line-height: 1.75; }
.gp-team .bio-rich > :last-child { margin-bottom: 0; }
.gp-team .bio-rich strong { color: var(--gp-navy); font-weight: 600; }
.gp-team .bio-rich a { color: var(--gp-navy); font-weight: 600; text-decoration: underline; text-decoration-color: var(--gp-rule-lt); text-underline-offset: 4px; }
.gp-team .bio-rich a:hover { text-decoration-color: var(--gp-accent); }

/* ---------- Bio: the rest of the team ---------- */

.gp-team .bio-team__top { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 48px; }
.gp-team .bio-team__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 46px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gp-team .bio-team__link {
  display: block;
  height: 100%;
  padding: 18px 0 22px;
  border-top: 1px solid var(--gp-rule-lt);
  text-decoration: none;
  transition: border-color var(--gp-dur-fast) ease-out;
}
.gp-team .bio-team__link:hover { border-top-color: var(--gp-accent); }
.gp-team .bio-team__name { display: block; margin-bottom: 4px; color: var(--gp-navy); font-weight: 600; font-size: 17px; line-height: 1.4; }
.gp-team .bio-team__role {
  display: block;
  color: var(--gp-text);
  font-weight: 500;
  font-size: var(--gp-fs-label-xs);
  line-height: 1.6;
  letter-spacing: .15em;
  text-transform: uppercase;
}

/* ---------- Narrower screens: stack, never scroll sideways (phone pass is a later task) ---------- */

@media (max-width: 1100px) {
  .gp-team .ab-hero__inner { grid-template-columns: minmax(0, 1fr) auto; gap: 48px; }
  .gp-team .ab-shield { height: 340px; }
  .gp-team .ab-team__top { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .gp-team .ab-people,
  .gp-team .bio-team__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gp-team .bio-hero__inner { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .gp-team .bio-story__grid { grid-template-columns: 260px minmax(0, 1fr); gap: 0 56px; }
}
@media (max-width: 860px) {
  .gp-team .ab-hero__inner { grid-template-columns: minmax(0, 1fr); }
  .gp-team .ab-hero__fx { justify-self: end; }
  .gp-team .ab-shield { height: 260px; }
  .gp-team .ab-cols { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .gp-team .ab-people,
  .gp-team .bio-team__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gp-team .bio-story__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .gp-team .bio-story__figure { max-width: 340px; }
}
@media (max-width: 720px) {
  .gp-team .bio-hero__name { font-size: 52px; }
  .gp-team .bio-hero__back { margin-left: 0; }
}
@media (max-width: 520px) {
  .gp-team .ab-people,
  .gp-team .bio-team__list { grid-template-columns: minmax(0, 1fr); }
}

/* Desktop: the Our Mission hero fills the window, like the home page hero. On a short
   laptop window the heading, spacing and shield tighten so everything fits. */
@media (min-width: 961px) {
  .gp-team .ab-hero__inner {
    min-height: max(520px, calc(100vh - var(--gp-header-h)));
    min-height: max(520px, calc(100svh - var(--gp-header-h)));
    padding-top: clamp(32px, 8vh, 112px);
    padding-bottom: clamp(32px, 8vh, 112px);
    align-items: center;
  }
  .gp-team .ab-hero__title { font-size: clamp(60px, 11vh, var(--gp-fs-xl)); }
  .gp-team .ab-hero__lead { margin-top: clamp(24px, 5vh, 56px); }
  .gp-team .ab-hero__fx svg { width: auto; height: clamp(300px, 56vh, 560px); }
}

/* Our Mission hero, framing: text in the left half, the shield centred in the right half
   (not pushed to the edge), and the pair sitting slightly above the middle of the window. */
@media (min-width: 961px) {
  .gp-team .ab-hero__inner {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: clamp(40px, 5vw, 96px);
    padding-top: clamp(28px, 6vh, 96px);
    padding-bottom: clamp(48px, 12vh, 160px);
  }
  .gp-team .ab-hero__fx { justify-self: center; }
  .gp-team .ab-hero__fx svg { height: clamp(300px, 60vh, 600px); }
  .gp-team .ab-hero__lead { max-width: 620px; }
}

/* "Our Mission" on one line: "Our" in the regular weight, "Mission" in the heavier one. */
.gp-team .ab-hero__title { white-space: nowrap; }
.gp-team .ab-hero__title .ab-mask { display: inline-block; vertical-align: bottom; }
.gp-team .ab-hero__title .ab-mask + .ab-mask { margin-left: .08em; }
.gp-team .ab-hero__title .gp-lt,
.gp-team .ab-hero__title .gp-bd { display: inline-block; }

/* Mission paragraphs: no rules above the columns and less space above the band, so the
   three paragraphs follow on from the hero instead of standing apart. */
.gp-team .ab-mission { padding-block: clamp(48px, 8vh, 88px); }
.gp-team .ab-cols p { padding-top: 0; border-top: 0; font-size: 17px; line-height: 1.7; }

/* Thin vertical dividers between the three mission paragraphs (side by side only). */
@media (min-width: 1101px) {
  .gp-team .ab-cols { gap: 0; }
  .gp-team .ab-cols p { padding-inline: clamp(28px, 3vw, 48px); border-left: 1px solid var(--gp-rule-lt); }
  .gp-team .ab-cols p:first-child { padding-left: 0; border-left: 0; }
  .gp-team .ab-cols p:last-child { padding-right: 0; }
}

/* Bio: the portrait sits in the hero, above the specialism lines; the story then runs the
   full width beneath its heading, in two columns on wide screens. */
.gp-team .bio-hero__inner { grid-template-columns: minmax(0, 1fr) 320px; align-items: center; padding-top: clamp(56px, 10vh, 112px); padding-bottom: clamp(56px, 10vh, 104px); }
.gp-team .bio-hero__photo { margin: 0 0 28px; aspect-ratio: 4 / 5; overflow: hidden; background: var(--gp-surface-dk); }
.gp-team .bio-hero__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.gp-team .bio-story__grid,
.gp-team .bio-story__grid--solo { grid-template-columns: minmax(0, 1fr); }
.gp-team .bio-rich { max-width: none; }
.gp-team .bio-rich p,
.gp-team .bio-rich ul,
.gp-team .bio-rich ol { max-width: 72ch; }
@media (min-width: 1101px) {
  .gp-team .bio-rich { columns: 2; column-gap: clamp(56px, 6vw, 104px); }
  .gp-team .bio-rich p,
  .gp-team .bio-rich ul,
  .gp-team .bio-rich ol { max-width: none; }
  .gp-team .bio-rich p,
  .gp-team .bio-rich li,
  .gp-team .bio-rich h3,
  .gp-team .bio-rich h4 { break-inside: avoid; }
  /* A one-paragraph story is not split mid-sentence: its heading sits to the left and
     the paragraph runs as one comfortable column beside it. */
  .gp-team .bio-story__col:has(.bio-rich > p:only-child) { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0 96px; align-items: start; }
  .gp-team .bio-rich:has(> p:only-child) { columns: 1; max-width: 72ch; }
}
@media (max-width: 1100px) {
  .gp-team .bio-hero__inner { grid-template-columns: minmax(0, 1fr); }
  .gp-team .bio-hero__photo { width: min(100%, 260px); }
}

/* Bio hero, framing: portrait and specialism lines on the left, the name, role and links
   immediately beside them, so the two halves sit together with no empty middle. */
@media (min-width: 1101px) {
  .gp-team .bio-hero__inner { grid-template-columns: 340px minmax(0, 1fr); gap: clamp(56px, 6vw, 104px); align-items: center; }
  .gp-team .bio-hero__side { order: -1; }
  .gp-team .bio-hero--solo .bio-hero__inner { grid-template-columns: minmax(0, 1fr); }
  .gp-team .bio-hero__name { font-size: clamp(64px, 7vw, 104px); }
}
@media (min-width: 1101px) {
  /* On a short laptop window the portrait scales down so the hero fits the first screen. */
  .gp-team .bio-hero__inner { grid-template-columns: clamp(220px, 38vh, 340px) minmax(0, 1fr); padding-top: clamp(32px, 6vh, 104px); padding-bottom: clamp(32px, 6vh, 104px); }
  .gp-team .bio-hero__photo { margin-bottom: clamp(16px, 3vh, 28px); }
  .gp-team .bio-hero__specs { padding-top: clamp(12px, 2.4vh, 22px); }
  .gp-team .bio-hero__specs li { margin-bottom: clamp(6px, 1.3vh, 12px); font-size: clamp(14px, 2.1vh, 16px); }
}

/* ==========================================================================
   Phone and tablet pass (below 1101px only; desktop above is untouched).
   ========================================================================== */

/* ---------- About Us hero: heading and paragraph first; the shield smaller beneath ---------- */

@media (max-width: 860px) {
  .gp-team .ab-hero__inner { gap: 8px; padding-top: 56px; padding-bottom: 48px; }
  .gp-team .ab-hero__lead { margin-top: 28px; }
  .gp-team .ab-shield { height: 200px; }
}
@media (max-width: 480px) {
  .gp-team .ab-hero__lead { font-size: 17px; line-height: 1.7; }
  .gp-team .ab-shield { height: 168px; }
}

/* ---------- Mission and Meet the Team ---------- */

@media (max-width: 720px) {
  .gp-team .ab-cols { gap: 20px; }
  .gp-team .ab-cols p { font-size: 16px; }
  .gp-team .ab-team__top { gap: 20px; margin-bottom: 40px; }
  .gp-team .ab-people { gap: 40px; }
  .gp-team .ab-people--partners { margin-top: 40px; padding-top: 40px; }
}

/* ---------- Bio hero: portrait, name, role, links, then the specialism lines ---------- */

@media (max-width: 1100px) {
  .gp-team .bio-hero__side { display: contents; }
  .gp-team .bio-hero__photo { order: -1; margin: 0; }
  .gp-team .bio-hero__specs { order: 1; }
  .gp-team .bio-hero__inner { gap: 32px; align-items: start; }
  /* Links: 44px targets without moving their underlines. */
  .gp-team .bio-hero__links { gap: 24px 32px; margin-top: 32px; }
  .gp-team .bio-hero .gp-tlink { position: relative; font-size: 11px; }
  .gp-team .bio-hero .gp-tlink::after { content: ''; position: absolute; inset: -12px -10px; }
  .gp-team .bio-hero__back { margin-left: 0; }
}
@media (max-width: 720px) {
  .gp-team .bio-hero__inner { gap: 28px; padding-top: 40px; padding-bottom: 48px; }
  .gp-team .bio-hero__photo { width: min(100%, 220px); }
  .gp-team .bio-hero__name { font-size: 44px; text-wrap: balance; }
  .gp-team .bio-hero__role { margin-top: 18px; }
  .gp-team .bio-hero__specs li { font-size: 15px; }
  .gp-team .bio-story__title { margin-bottom: 24px; }
  .gp-team .bio-rich p,
  .gp-team .bio-rich ul,
  .gp-team .bio-rich ol { font-size: 16px; line-height: 1.7; }
  .gp-team .bio-rich { overflow-wrap: break-word; }
  .gp-team .bio-team__top { flex-wrap: wrap; margin-bottom: 32px; }
}
@media (max-width: 374px) {
  .gp-team .bio-hero__name { font-size: 38px; }
}
