/*
  Hero Post Component V2
  ---------- ---------- ---------- ---------- ----------
  Left column + image mode reuse the .hero-post-component styles (main bundle).
  This file adds the platform layers board, ported from the Argonos Platform
  Hero: the visual and the lines share one 1172 × 880 SVG frame, the titles
  are positioned in % of that same box.
*/

.hero-post-v2-component {
  --hpv2-ink: #18211E;                 /* fakeblack */
  --hpv2-line: rgba(24, 33, 30, .45);
  --hpv2-accent: #5D7374;              /* sauge */
  --hpv2-card-hover: #DCEFE3;          /* anande */
  --hpv2-surface: #FFFFFF;
  display: block;
}

.hero-post-v2-component .breadcrumb-container {
  opacity: 0;
  transition: opacity .2s ease-in-out;
}

.hero-post-v2-component .breadcrumb-container.--ready {
  opacity: 1;
}

/* Right column without the featured image background. */
.hero-post-v2-component .hero-post-v2-component__media--plain {
  position: relative;
  background:
    radial-gradient(60% 55% at 70% 75%, rgba(93, 115, 116, .22) 0%, rgba(93, 115, 116, 0) 70%),
    radial-gradient(55% 50% at 25% 20%, rgba(220, 239, 227, .9) 0%, rgba(220, 239, 227, 0) 70%);
}

.hero-post-v2-component.has-platform .hero-post-component__media {
  padding: 48px 24px;
}

/* ---------- Board ---------- */

.hero-post-v2-component__board {
  position: relative;
  z-index: 20;
  width: min(100%, 900px);
  aspect-ratio: 1172 / 880;
  margin-inline: auto;
}

.hero-post-v2-component__diagram {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-post-v2-component__diagram-image {
  pointer-events: none;
}

/* ---------- Lines ---------- */

.hero-post-v2-component__wire {
  pointer-events: none;
}

.hero-post-v2-component__wire-path {
  fill: none;
  stroke: var(--hpv2-line);
  stroke-width: 1.7;
  transition: stroke .22s ease, stroke-width .22s ease;
}

.hero-post-v2-component__wire-ring {
  fill: none;
  stroke: var(--hpv2-ink);
  stroke-width: 1;
  opacity: .25;
}

.hero-post-v2-component__wire-dot {
  fill: var(--hpv2-surface);
  stroke: var(--hpv2-ink);
  stroke-width: 1.5;
  transition: fill .22s ease;
}

.hero-post-v2-component__wire.is-highlighted .hero-post-v2-component__wire-path,
.hero-post-v2-component__wire.is-active .hero-post-v2-component__wire-path {
  stroke: var(--hpv2-ink);
  stroke-width: 2.3;
}

.hero-post-v2-component__wire.is-highlighted .hero-post-v2-component__wire-dot,
.hero-post-v2-component__wire.is-active .hero-post-v2-component__wire-dot {
  fill: var(--hpv2-ink);
}

/* ---------- Layer titles ---------- */

.hero-post-v2-component__layer {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 18%;
  padding: 8px 10px;
  color: var(--hpv2-ink);
  font-family: "Hanken Grotesk", sans-serif;
  font-size: clamp(11px, .9vw, 15px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.02em;
  text-decoration: none;
  /* Frosted glass, blurred over the hero background. */
  background: linear-gradient(155deg, rgba(242, 242, 243, .82) 0%, rgba(255, 255, 255, .64) 55%, rgba(220, 239, 227, .55) 100%);
  border: 1px solid var(--hpv2-ink);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 10px 26px rgba(24, 33, 30, .07);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  translate: 0 -50%;
  transition: background .2s ease, box-shadow .2s ease;
}

.hero-post-v2-component__layer--left {
  left: 0;
}

.hero-post-v2-component__layer--right {
  right: 0;
}

.hero-post-v2-component__layer-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

/* ↗ on the left of the visual, mirrored ↖ on the right. */
.hero-post-v2-component__layer--right .hero-post-v2-component__layer-icon {
  transform: scaleX(-1);
}

a.hero-post-v2-component__layer:hover,
a.hero-post-v2-component__layer:focus-visible,
.hero-post-v2-component__layer.is-highlighted {
  background: var(--hpv2-card-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 12px 30px rgba(24, 33, 30, .1);
}

.hero-post-v2-component__layer--left:hover .hero-post-v2-component__layer-icon {
  transform: translate(2px, -2px);
}

.hero-post-v2-component__layer--right:hover .hero-post-v2-component__layer-icon {
  transform: scaleX(-1) translate(2px, -2px);
}

.hero-post-v2-component__layer:focus-visible {
  outline: 2px solid var(--hpv2-ink);
  outline-offset: 2px;
}

/* Dark mode: titles stay readable cards, lines turn white. */
.dark-mode .hero-post-v2-component {
  --hpv2-line: rgba(255, 255, 255, .55);
}

.dark-mode .hero-post-v2-component__wire-ring,
.dark-mode .hero-post-v2-component__wire-dot {
  stroke: #FFFFFF;
}

/* Small desktop, side by side (lg = 1140px): cards are narrow, the arrow would push the text. */
@media (max-width: 1279px) and (min-width: 1140px) {
  .hero-post-v2-component__layer {
    padding: 6px 5px;
    font-size: 11px;
    line-height: 1.15;
    border-radius: 10px;
  }

  .hero-post-v2-component__layer-icon {
    display: none;
  }
}

/* Mobile / stacked: lines hidden, titles become a two-column list of links. */
@media (max-width: 767px) {
  .hero-post-v2-component.has-platform .hero-post-component__media {
    height: auto;
    padding: 32px 16px;
  }

  .hero-post-v2-component__board {
    width: 100%;
    aspect-ratio: auto;
    overflow-x: clip;
  }

  .hero-post-v2-component__diagram {
    position: relative;
    inset: auto;
    width: 151%;
    max-width: none;
    height: auto;
    margin-left: -25.4%;
    aspect-ratio: 1172 / 880;
  }

  .hero-post-v2-component__wire {
    display: none;
  }

  .hero-post-v2-component__layers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
  }

  .hero-post-v2-component__layer {
    position: relative;
    top: auto !important;
    inset: auto;
    width: auto;
    font-size: clamp(14px, 4vw, 17px);
    translate: none;
  }

  .hero-post-v2-component__layer .hero-post-v2-component__layer-icon,
  .hero-post-v2-component__layer:hover .hero-post-v2-component__layer-icon {
    transform: none;
  }
}

/* Between mobile and lg the column is full width: a bit more room. */
@media (min-width: 768px) and (max-width: 1139px) {
  .hero-post-v2-component.has-platform .hero-post-component__media {
    height: auto;
  }

  .hero-post-v2-component__board {
    width: min(100%, 740px);
  }

  .hero-post-v2-component__layer {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-post-v2-component__wire-path,
  .hero-post-v2-component__wire-dot,
  .hero-post-v2-component__layer,
  .hero-post-v2-component__layer-icon {
    transition: none;
  }
}
