/* Audience Venn panel (src/components/AudienceVenn.astro): three equal
   circles in Teal Dark (line + a light fill, so the overlaps darken on their
   own), the Stensul wordmark in the triple overlap, and the labels outside
   the circles, each beside its own circle. Section shell, eyebrow, heading
   and lede come from the global sheets. */

.av {
  --d: 560px;                       /* diagram width */
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--d) minmax(0, 1fr);
  grid-template-areas:
    "leaders diagram martech"
    ".       ops     .";
  column-gap: 40px;
  row-gap: 24px;
  max-width: 1160px;
  margin: var(--l-section-gap, 48px) auto 0;
}

.av-diagram {
  grid-area: diagram;
  position: relative;
  width: var(--d);
  aspect-ratio: 900 / 820;
}
.av-art { display: block; width: 100%; height: 100%; overflow: visible; }

.av-c {
  fill: rgba(13, 40, 40, .06);
  stroke: #0D2828;
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}
/* On an audience's own page its circle keeps the neutral fill: the person
   icon (on, while the other two are off) and the label's Citron underline
   mark it. A Citron tint would hide the icon's Citron fill. */

/* The centre, coloured Citron like a marker: a thick round-capped scribble
   clipped to the triple overlap, opaque over the circles' fill. Without
   JS or with reduced motion it is simply filled; otherwise it is hidden
   (is-ready) and drawn in when the diagram scrolls into view (is-inked).
   The circle outlines are drawn again on top so the ink never covers them. */
.av-ink-stroke { fill: none; stroke: #FFFA66; stroke-width: 64; stroke-linecap: round; stroke-linejoin: round; }
.av-ink.is-ready .av-ink-stroke { stroke-dasharray: 1; stroke-dashoffset: 1; }
.is-inked .av-ink.is-ready .av-ink-stroke { stroke-dashoffset: 0; transition: stroke-dashoffset 1.8s cubic-bezier(.4, .1, .45, 1); }
.av-c-line { fill: none; stroke: #0D2828; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }

/* Triple overlap centre: about (450, 350) in the 900x820 box. */
.av-logo {
  position: absolute;
  left: 50%;
  top: 42.7%;
  width: 20%;
  height: auto;
  translate: -50% -50%;
}

/* Person icons: library marketing icons (<Icon set="marketing">), the
   brand's two-tone style. Lines take currentColor (--ic-line), the accent
   shapes --icon-accent. On: black line, Citron fill. Off: grey line and
   fill, for the other two audiences on an audience page; hovering a label
   turns its icon on. */
.av-ic {
  position: absolute;
  width: 10.5%;                     /* about 95 of the 900 box */
  aspect-ratio: 1;
  translate: -50% -50%;
}
.av-ic .icon {
  display: block;
  width: 100%;
  height: 100%;
  --ic-line: currentColor;
  --icon-accent: #FFFA66;
  color: #201F1D;
  transition: color .2s;
}
.av-ic .icon .f,
.av-ic .icon [style*="--icon-accent"] { transition: fill .2s; }
.av--has-current .av-ic:not(.is-current) .icon {
  --icon-accent: #E4E1DF;
  color: #A8A39F;
}
.av--has-current:has(.av-label--leaders:hover) .av-ic--leaders .icon,
.av--has-current:has(.av-label--martech:hover) .av-ic--martech .icon,
.av--has-current:has(.av-label--ops:hover) .av-ic--ops .icon {
  --icon-accent: #FFFA66;
  color: #201F1D;
}

/* Where two audiences' goals meet, inside each two-circle overlap (desktop). */
.av-meet {
  position: absolute;
  width: 20.5%;                     /* 185 of the 900 box */
  margin: 0;
  translate: -50% -50%;
  text-align: center;
  font-size: var(--type-caption);
  font-weight: var(--type-subhead-weight);
  line-height: 1.3;
  color: #0D2828;
  text-wrap: balance;
}

.av-meet--leaders-martech { width: 23%; line-height: 1.2; }  /* three set lines */

.av-label { min-width: 0; }
.av-label--leaders { grid-area: leaders; text-align: right; }
.av-label--martech { grid-area: martech; text-align: left; }
.av-label--ops     { grid-area: ops; text-align: center; }
/* Line the side labels up with their circles' centres (35% down). */
.av-label--leaders,
.av-label--martech { margin-top: calc(var(--d) * .22); }

.av-label a {
  display: inline-block;
  margin: 0 0 10px;
  color: #201F1D;
  text-decoration: none;
  text-wrap: balance;
  text-underline-offset: 5px;
}
.av-label a:is(:hover, :focus-visible) { text-decoration: underline; }
.av-label.is-current a { text-decoration: underline; text-decoration-color: #FFFA66; text-decoration-thickness: .3em; text-underline-offset: -.05em; text-decoration-skip-ink: none; }

.av-label p {
  margin: 0;
  max-width: 260px;
  display: inline-block;
  font-size: var(--type-body);
  line-height: 1.5;
  color: #6B665E;
  text-wrap: balance;
}

.av-cta-row { margin-top: 16px; }
.av-label a.av-cta { display: inline-flex; margin: 0; color: var(--kit-white); text-decoration: none; text-wrap: nowrap; }
.av-label a.av-cta:is(:hover, :focus-visible) { text-decoration: none; }

.av-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 1023px) {
  .av { --d: 320px; column-gap: 24px; }
  .av-meet { display: none; }
}

/* The person icon inside each label only shows on phones (see below). */
.av-label-ic { display: none; }
/* Ops sits under the wider diagram: keep its summary on its own line. */
@media (min-width: 600px) {
  .av-label--ops p { display: block; margin-inline: auto; }
}

/* Phones: a smaller diagram on top, then the three labels as full-width
   tappable cards (icon, name, summary, chevron). The name's link stretches
   over the whole card, so one tap anywhere goes to that audience's page; the
   separate buttons are dropped. */
@media (max-width: 599px) {
  .av {
    --d: min(240px, 72%);
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "diagram" "leaders" "martech" "ops";
    row-gap: 12px;
  }
  .av-diagram { justify-self: center; margin-bottom: 12px; }
  .av-label,
  .av-label--leaders,
  .av-label--martech,
  .av-label--ops {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 16px;
    grid-template-areas: "ic name chev" "ic sum chev";
    column-gap: 14px;
    row-gap: 2px;
    align-items: center;
    margin: 0;
    padding: 16px;
    text-align: left;
    border-radius: 14px;
    background: var(--kit-white, #fff);
    box-shadow: 0 0 0 1px #E4E1DF, 0 6px 18px rgba(13, 40, 40, .05);
    transition: box-shadow .15s;
  }
  .av-label:active { box-shadow: 0 0 0 2px #0D2828; }
  .av-label-ic { display: block; grid-area: ic; width: 40px; height: 40px; }
  .av-label-ic .icon { display: block; width: 100%; height: 100%; --ic-line: currentColor; --icon-accent: #FFFA66; color: #201F1D; }
  .av--has-current .av-label:not(.is-current) .av-label-ic .icon { --icon-accent: #E4E1DF; color: #A8A39F; }
  .av-label a { grid-area: name; margin: 0; font-size: var(--type-h5); font-weight: 600; line-height: 1.3; }
  .av-label a::before { content: ''; position: absolute; inset: 0; border-radius: 14px; }
  .av-label a:is(:hover, :focus-visible) { text-decoration: none; }
  .av-label a:focus-visible::before { outline: 2px solid #0D2828; outline-offset: 2px; }
  .av-label p { grid-area: sum; display: block; max-width: none; font-size: var(--type-small); line-height: 1.4; text-wrap: pretty; }
  .av-label::after {
    content: '';
    grid-area: chev;
    width: 9px;
    height: 9px;
    border-top: 2px solid #0D2828;
    border-right: 2px solid #0D2828;
    rotate: 45deg;
    translate: -3px 0;
  }
  .av-label.is-current { box-shadow: 0 0 0 2px #FFFA66, 0 6px 18px rgba(13, 40, 40, .05); }
  .av-label.is-current::after { display: none; }
  .av-cta-row { display: none; }
}
